Skip to content

Commit

Permalink
Improvement v2 to taxonomy parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jbisanz committed Oct 19, 2018
1 parent 337067a commit 195b4c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/qza_to_phyloseq.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ qza_to_phyloseq<-function(features,tree,taxonomy,metadata, tmp){
taxt<-strsplit(as.character(taxonomy$Taxon),"\\; ")
taxt<-lapply(taxt, function(x){length(x)=7;return(x)})
taxt<-do.call(rbind, taxt)
taxt<-apply(taxt,2, function(x) replace(x, grepl("^[kpcofgs]__$", x), "Not_Assigned"))
taxt<-apply(taxt,2, function(x) replace(x, grepl("^[kpcofgs]__$", x), NA))
rownames(taxt)<-taxonomy$Feature.ID
colnames(taxt)<-c("Kingdom","Phylum","Class","Order","Family","Genus","Species")
argstring<-paste(argstring, "tax_table(taxt),")
Expand Down

0 comments on commit 195b4c0

Please sign in to comment.