Open lauraDRH opened 1 year ago
The following might do what you want. It will prune all taxa which occur no more than once in each of the samples.
subsets <- @._data$sample), function(x) @._data$sample %in% x, df)) # split phyloseq taxa <- unique(unlist(lapply(subsets, function(x) @.**@.!=0)>1))))) # check if taxa_are_rows==FALSE else rowSums df.subset <- prune_taxa(taxa, merge_samples(x = df, group = "sample", fun = sum))
Message ID: @.***>
hi @cresil!
I think something happened with your code but it looks like it is what I am looking for!
I am studying the microbiome of an organism and I have sequenced 3 PCR replicates for each sample.
I want to merge my ESVs reads, but only when they appear in two out of three replicates and I have no idea how to do it. In I way, I would like to se the function _mergesamples() to merge all the replicates, but adding the condition of 2/3 replicates
The df looks something like this:
is there any way to do this? thanks so much!
p.s. thanks for the phyloseq package, it's great!