This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DESeq2 error :Error in cleanContrast

I'm trying to extract results from DESeq2 anlysis using contrast function, my code is :

zyres_BFvsBS <- results(zinbde_sub, contrast = c("Group.Sub.Group", "BF", " BS"))

But I got this error:

Error in cleanContrast(object, contrast, expanded = isExpanded, listValues = listValues, : BF and BS should be levels of Group.Sub.Group such that Group.Sub.Group_BF_vs_A and Group.Sub.Group_.BS_vs_A are contained in 'resultsNames(object)'

I tried this code:

zinbde_sub$Group.Sub.Group <- factor(zinbde_sub$Group.Sub.Group, levels =c("A","BF","BS","CF","CS"))

But it's not working.

Do you have any suggestions? Thank you very much!

deseq2

Can you post the results of levels(zinbde_sub$Group.Sub.Group)? Also please format your code properly.

Please hughlight code/errors with markdown: enter image description here

1 answer

Looks like you have a typo - the error message says the BS is .BS. I'd check your samplesheet or wherever you're defining that group, or try .BS in your results call.

Log in to answer this question.