Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • sarah_27_m
    Junior Member
    • Jan 2017
    • 4

    Using DeSeq2 in R or Qiime to examine taxonomic rank other than OTU level

    Hello,

    I am trying to follow the example given here https://github.com/joey711/phyloseq/issues/683, using DeSeq2 to examine differential abundance at Genus rather than OTU level, however When I import my data into R studio doing the following I only have one taxonomic rank (Kingdom).

    map<-import_qiime_sample_data(file.choose())
    tree<-read_tree(file.choose())
    biomfile<-import_biom(file.choose(),parseFunction=parse_taxonomy_greengenes)
    physeq<-merge_phyloseq(biomfile,tree,map)

    physeq
    phyloseq-class experiment-level object
    otu_table() OTU Table: [ 2206 taxa and 66 samples ]
    sample_data() Sample Data: [ 66 samples by 11 sample variables ]
    tax_table() Taxonomy Table: [ 2206 taxa by 1 taxonomic ranks ]
    phy_tree() Phylogenetic Tree: [ 2206 tips and 2204 internal nodes ]

    Previously I had imported my data using the following code and I see 7 taxonomic ranks, however when I try to use this data with the code supplied by joey711 (link above) I get the error below

    otufile=("otu_table_m1000_minus_cyano_chloro_json_w_consensuslineage.txt")
    mapfile=("Mapping_file_LS.txt")
    trefile=("rep_set_tree.tre")
    qiimedata = import_qiime(otufile, mapfile, trefile)
    qiimedata

    phyloseq-class experiment-level object
    otu_table() OTU Table: [ 2206 taxa and 66 samples ]
    sample_data() Sample Data: [ 66 samples by 11 sample variables ]
    tax_table() Taxonomy Table: [ 2206 taxa by 7 taxonomic ranks ]
    phy_tree() Phylogenetic Tree: [ 2206 tips and 2204 internal nodes ]

    GenusFiltered <- subset_taxa(qiimedata, Genus != "NA" & Species == "NA")

    Error in rownames<-(*tmp*, value = c("sp1", "sp0")) :
    length of 'dimnames' [1] not equal to array extent

    The package version of phyloseq that I am using in R studio is 1.19.1
    Any help to fix this would be much appreciated

    Secondly does anyone know if there is way to use the DeSeq2 function in Qiime to compare higher taxonomic ranks, eg Genus? I am aware that I would have to take the results with a pinch of salt.

    If there isnt a way is there a way in which I can use Qiime to do permutation based tests, other than at OTU level?
    Cheers,
    Sarah
  • sarah_27_m
    Junior Member
    • Jan 2017
    • 4

    #2
    Just in case anyone else has this problem, there is a pretty simple fix that worked for me (took me a while to find!!!!)

    You can agglomerate taxa of the same type, so for me I did this:

    (x1 <- tax_glom(qiimedata, taxrank="Family"))

    ntaxa(qiimedata); ntaxa(x1)

    qiimedata is my data matrix and then I can simply choose which rank to agglomerate to, then I run my DeSeq2 analysis as usual.

    Comment

    Latest Articles

    Collapse

    • GATTACAT
      Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
      by GATTACAT
      Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
      07-01-2026, 11:43 AM
    • SEQadmin2
      Nine Things a Sample Prep Scientist Thinks About Before Sequencing
      by SEQadmin2


      I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

      Here are nine questions we think about, in roughly the order they matter, before...
      06-18-2026, 07:11 AM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by SEQadmin2, 07-02-2026, 11:08 AM
    0 responses
    22 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 06-30-2026, 05:37 AM
    0 responses
    23 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 06-26-2026, 11:10 AM
    0 responses
    22 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 06-17-2026, 06:09 AM
    0 responses
    55 views
    0 reactions
    Last Post SEQadmin2  
    Working...