Skip to content

assign.ensembleTax - agreeing taxonomy is set to NA when higher rank is NA #4

Description

@naurasd

Hi,

I have encountered a somewhat weird behavior when running assign.ensembleTax. I am using v1.2.2.

I have performed all the required previous steps of your pipeline, i.e. mapping taxonomies onto each other.

Subsequently, I am using pr2.txt and silva.txt as input for assign.ensembleTax. The files are attached for you to reproduce the issue. I am running the function with count.na=FALSE.

library(ensembleTax)

pr2<-read.table("pr2.txt",sep="\t",header=T)

silva<-read.table("silva.txt",sep="\t",header=T)

tax_list <- list(pr2, silva)
names(tax_list) <- c("pr2", "silva")
ensemble <- assign.ensembleTax(tax_list, 
                               tablenames = names(tax_list), 
                               ranknames = colnames(pr2[,3:12]),
                               tiebreakz = NULL, 
                               count.na=FALSE, 
                               assign.threshold = 0, 
                               weights=c(1,1))

Unfortunately, in some cases, in the output ensemble, some ranks are set to NA, even though both taxonomies agree at this rank.

Below, I show row 11 of ensemble, pr2 and silva.

row11<-rbind(ensemble[11,],pr2[11,],silva[11,])
rownames(row11)<-c("ensemble","pr2","silva")
row11[,-2]

              svN    Domain Supergroup Division Subdivision              Phylum        Class_X Class_Order_Family Order_Family_X Genus Species
ensemble ASV10006 Eukaryota       TSAR Rhizaria    Cercozoa Filosa-Sarcomonadea Glissomonadida               <NA>           <NA>  <NA>    <NA>
pr2      ASV10006 Eukaryota       TSAR Rhizaria    Cercozoa Filosa-Sarcomonadea Glissomonadida               <NA>     Heteromita  <NA>    <NA>
silva    ASV10006 Eukaryota       TSAR Rhizaria    Cercozoa Filosa-Sarcomonadea Glissomonadida               <NA>     Heteromita  <NA>    <NA>

As you can see, for the rank Order_Family_X, both pr2 and silva agree, but the assignment is set to NA in ensemble. Why? This ASV is just one example, there are more cases like this.

My first guess is that this rank is set to NA due to a default behavior, which potentially sets all ranks to NA once a higher rank is NA? Is this the case? This behavior is a bit inconvenient. Eukaryotic taxonomies in some customized Silva and PR2 reference sets can be weird and it may happen that a higher rank is NA even though a lower rank is not.

Thanks for your feedback

Nauras

pr2.txt
silva.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions