joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
581 stars 187 forks source link

error: NA values in taxonomyTable object #220

Closed zeleniy closed 11 years ago

zeleniy commented 11 years ago

Imagine you did some importing of data prior to this command...

q
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 34634 taxa and 6 samples ]
sample_data() Sample Data:       [ 6 samples by 6 sample variables ]
tax_table()   Taxonomy Table:    [ 34634 taxa by 8 taxonomic ranks ]
phy_tree()    Phylogenetic Tree: [ 34634 tips and 34632 internal nodes ]
p = prune_species(taxa_sums(q) >= 1000, q)
p
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 23 taxa and 6 samples ]
sample_data() Sample Data:       [ 6 samples by 6 sample variables ]
tax_table()   Taxonomy Table:    [ 23 taxa by 8 taxonomic ranks ]
phy_tree()    Phylogenetic Tree: [ 23 tips and 22 internal nodes ]
plot_bar(p)
Error in validObject(.Object) : invalid class “taxonomyTable” object: 
 All values in Taxonomy Table are NA.
 Must have at least one informative value.
tax_table(p)
Taxonomy Table:     [23 taxa by 8 taxonomic ranks]:
      Kingdom    Phylum           Class                   Order               
6140  "Bacteria" "Actinobacteria" "Actinobacteria"        "Actinomycetales"   
25560 "Bacteria" "Firmicutes"     "Clostridia"            "Clostridiales"     
31119 "Bacteria" "Proteobacteria" "Betaproteobacteria"    "Burkholderiales"   
18740 "Bacteria" "Proteobacteria" "Betaproteobacteria"    "Burkholderiales"   
6258  "Bacteria" "Proteobacteria" "Betaproteobacteria"    "Burkholderiales"   
30592 "Bacteria" "Proteobacteria" "Gammaproteobacteria"   NA                  
31390 "Bacteria" "Cyanobacteria"  "Synechococcophycideae" "Pseudanabaenales"  
24389 "Bacteria" "Cyanobacteria"  "Synechococcophycideae" "Pseudanabaenales"  
2265  "Bacteria" "Cyanobacteria"  "Synechococcophycideae" "Pseudanabaenales"  
5622  "Bacteria" "Cyanobacteria"  "Synechococcophycideae" "Pseudanabaenales"  
6213  "Bacteria" "Cyanobacteria"  "Synechococcophycideae" "Pseudanabaenales"  
5604  "Bacteria" "Cyanobacteria"  "Synechococcophycideae" "Pseudanabaenales"  
6349  "Bacteria" "Cyanobacteria"  "Synechococcophycideae" "Pseudanabaenales"  
11803 "Bacteria" "Proteobacteria" "Gammaproteobacteria"   "Enterobacteriales" 
16374 "Bacteria" "Proteobacteria" "Betaproteobacteria"    "Burkholderiales"   
32774 "Bacteria" "Proteobacteria" "Alphaproteobacteria"   "Rhodospirillales"  
7654  "Bacteria" "Bacteroidetes"  "Flavobacteriia"        "Flavobacteriales"  
23656 "Bacteria" "Bacteroidetes"  "Flavobacteriia"        "Flavobacteriales"  
35904 "Bacteria" "Bacteroidetes"  "Sphingobacteriia"      "Sphingobacteriales"
26562 "Bacteria" "Bacteroidetes"  "Sphingobacteriia"      "Sphingobacteriales"
28005 "Bacteria" "Bacteroidetes"  "Sphingobacteriia"      "Sphingobacteriales"
3429  "Bacteria" "Chloroflexi"    "Anaerolineae"          "SJA-15"            
22213 "Bacteria" "Planctomycetes" "Planctomycetia"        "Gemmatales"        
      Family               Genus              Species Rank1
6140  "Micrococcaceae"     NA                 NA      NA   
25560 "Clostridiaceae"     "Clostridium"      NA      NA   
31119 "Oxalobacteraceae"   NA                 NA      NA   
18740 "Oxalobacteraceae"   NA                 NA      NA   
6258  "Oxalobacteraceae"   NA                 NA      NA   
30592 NA                   NA                 NA      NA   
31390 "Pseudanabaenaceae"  NA                 NA      NA   
24389 "Pseudanabaenaceae"  "Arthronema"       NA      NA   
2265  "Pseudanabaenaceae"  "Arthronema"       NA      NA   
5622  "Pseudanabaenaceae"  "Arthronema"       NA      NA   
6213  "Pseudanabaenaceae"  "Arthronema"       NA      NA   
5604  "Pseudanabaenaceae"  "Arthronema"       NA      NA   
6349  "Pseudanabaenaceae"  "Arthronema"       NA      NA   
11803 "Enterobacteriaceae" "Erwinia"          NA      NA   
16374 "Comamonadaceae"     NA                 NA      NA   
32774 "Rhodospirillaceae"  "Azospirillum"     NA      NA   
7654  "Flavobacteriaceae"  "Chryseobacterium" NA      NA   
23656 "Flavobacteriaceae"  "Chryseobacterium" NA      NA   
35904 "Flexibacteraceae"   "Emticicia"        NA      NA   
26562 "Flexibacteraceae"   "Spirosoma"        NA      NA   
28005 "Flexibacteraceae"   "Flectobacillus"   NA      NA   
3429  NA                   NA                 NA      NA   
22213 "Gemmataceae"        NA                 NA      NA
joey711 commented 11 years ago

@zeleniy

Thanks for the feedback. This problem looks identical to the last closed issue. In both cases, the solution is already available in the latest version of phyloseq on GitHub, and most-likely the devel release of Bioconductor. Please update your version from the Bioconductor release (1.4.x) to the latest (1.5.19+ or so).

In the future, please provide your version of phyloseq, operating system, and a reproducible example (e.g. calling example code, or minimal fake data) so that it is easier to diagnose your problem. In this case, I'm taking an educated guess about the solution because I just closed an issue with the exact same error message, and had already fixed the bug and provided the solution in example code.

In most cases your operating system won't matter, but the version of phyloseq you are using definitely does. The default installation through Bioconductor is only updated at 6-month intervals. This means small bugs like this can linger in the release version. When in doubt, try the GitHub or Bioconductor devel versions.

Thanks again for your feedback, and please don't hesitate to make further comments if updating your phyloseq version does not fix this issue... at which point I will re-open it.

joey

joey711 commented 11 years ago

Here is the link for the phyloseq installation instructions