Phyloseq prune_samples function not working?

Hi everyone,

I'm using the package "phyloseq" to analyze some sequence data and would like to remove samples with the prune_samples function but for some reason the function removes some of the samples but then leaves some of them within the data frame. The samples that I would like to remove that are still present are:
TP1
TP2
TP7
TP16.
Here is the code I use to remove those samples and create a new object called "New.rarefaction": New.rarefaction<- prune_samples(sample_names(ps)!= "TP10" & sample_names(ps)!= "TP15" & sample_names(ps)!= "TP16" & sample_names(ps)!= "TP2" & sample_names(ps)!= "TP6" & sample_names(ps)!= "TP1" & sample_names(ps)!= "TP7" & sample_names(ps)!= "TP11" & sample_names(ps)!= "TP22" & sample_names(ps)!= "TP190727MSE" & sample_names(ps)!= "TP190728TSE" & sample_names(ps)!= "TP190730PSE" & sample_names(ps)!= "TP190730TSE" & sample_names(ps)!= "TP190730WS" & sample_names(ps)!= "TP190731KSE" & sample_names(ps)!= "TP190731SSE" & sample_names(ps)!= "TP190801NSE" & sample_names(ps)!= "TP190802RSE", ps)

But, when I check the new data frame for the sample IDs they are still there:
ps@sam_data[["SampleID"]]
[1] "TP13" "TP14" "TP16" "TP17" "TP18" "TP19" "TP1" "TP23" "TP24" "TP25" "TP2"
[12] "TP3" "TP4" "TP5" "TP7" "TP8" "TP9" .

Any suggestions?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.