Open grossebusedu38 opened 4 years ago
subset_metabarlist <- function(metabarlist, table, indices)
would become
subset_metabarlist <- function(metabarlist, table, indices, simplify=TRUE)
=================
when simplify=FALSE, do not remove any columns in the reads table:
reads <- reads[, colSums(reads) > 0, drop = F]
reads <- reads[, (colSums(reads) > 0) & simplify, drop = F]
usefull when you want to compare the reads table of two subseted metabarlist that were originally the same:
Example:
soil_euk2 <- soil_euk soil_euk2$reads <- corrected
metabaR::ggpcrtag(soil_euk2) metabaR::ggpcrtag(soil_euk)
s1<- subset_metabarlist(soil_euk, 'pcrs', {v <- soil_euk$pcrs$control_type=="sequencing";v[is.na(v)]<-F;v}) s2 <- subset_metabarlist(soil_euk2, 'pcrs', {v <- soil_euk$pcrs$control_type=="sequencing";v[is.na(v)]<-F;v})
subset_metabarlist <- function(metabarlist, table, indices)
would become
subset_metabarlist <- function(metabarlist, table, indices, simplify=TRUE)
=================
when simplify=FALSE, do not remove any columns in the reads table:
reads <- reads[, colSums(reads) > 0, drop = F]
would become
reads <- reads[, (colSums(reads) > 0) & simplify, drop = F]
=================
usefull when you want to compare the reads table of two subseted metabarlist that were originally the same:
Example:
soil_euk2 <- soil_euk soil_euk2$reads <- corrected
metabaR::ggpcrtag(soil_euk2) metabaR::ggpcrtag(soil_euk)
s1<- subset_metabarlist(soil_euk, 'pcrs', {v <- soil_euk$pcrs$control_type=="sequencing";v[is.na(v)]<-F;v}) s2 <- subset_metabarlist(soil_euk2, 'pcrs', {v <- soil_euk$pcrs$control_type=="sequencing";v[is.na(v)]<-F;v})
s(1|2)$reads and s(1|2)$motus tables are not easily comparable