phyloseq is an R package with functions and tools to handle and analyze high-throughput microbiome census data
Questions tagged [phyloseq]
141 questions
0
votes
1 answer
Looking for code in R to summarize by ____H or ____D?
I have a chart with ASV's per sample, the samples are sorted by number (sample) and a letter which corresponds to human or dog. I am trying to see which ASV's are in only humans, or only dogs. My thought for how to do this is sum all rows by dog or…
0
votes
1 answer
Trying to subset a large table using counts of all row values in a single column
Working in R on genomic data.
I'm trying to subset a very large melted phyloseq table, which includes a column of phylum IDs, in order to remove rows containing phyla that occur less than 100000 times in the table. I might have missed an "easy" way…

carrollk2015
- 3
- 2
0
votes
1 answer
Compute and plot bootstrap values with ggtree
I have a file with the phylogenetic tree that is the output of doing RAxML.
I want to plot this tree with the R package ggtree and show the bootstrap values and the internal numbers of the nodes.
The actual code plots the tree with the node numbers,…

Marta N
- 1
- 1
0
votes
1 answer
Normalization method
I am a PhD student working on microbiome 16S rRNA sequence data. I have this code for phyloseq normalization from a previous student and wanted to ask if someone could help explain exactly what it is doing:
ps_norm <- transform_sample_counts(ps,…

MAlvarez
- 31
- 5
0
votes
2 answers
Order x-axis categorical variable using another categorical variable
I have a dataframe like follows:
Class ID Stage Abundance Substrat
OTUA rep1 A-X1 123 G
OTUA rep2 A-X1 234 PC
OTUA rep3 A-X1 [numerical values] [only two categorical…
0
votes
1 answer
How do I generate scatterplots for abundance and a numerical variable with a phyloseq object?
I have a phyloseq object in R, and I would like to generate scatterplots to show associations between individual taxa and a numeric variable that's in my sample data (i.e. my variable on x axis, abundance of particular taxa on y axis).
I guess I…

Kate
- 1
0
votes
1 answer
Calculate top taxa per sample in a phyloseq object
I need to calculate the top 6 taxa in each individual sample of my phyloseq object. It seems like it should be a simple request...but I have not been able to find a way to do this!
Thank you

MAlvarez
- 31
- 5
0
votes
1 answer
Stacked bar chart with OTUs identified to different taxonomic levels
I have microbiome data with OTUs identified to the lowest taxonomic level possible. Some of the OTUs are identified to genus, others to family, order, etc. I need to create a stacked bar chart.
My problem:
If I choose "genus" for my bar chart,…

MAlvarez
- 31
- 5
0
votes
1 answer
phyloseq: Discrepancies in otu counts before and after using tax_glom
Maybe I missed something in how tax_glom works but as I did not find any info here nor elsewhere on the web, maybe someone here can help.
I do not provide data but I can on request. Here is the code highlighting the issue I…

GTC
- 1
- 2
0
votes
1 answer
Fail to plot by group on a phyloseq object generated by R package Divnet
I intend to plot an alpha diversity plot of my samples, which consist of three groups.
Alpha diversity is calculated by R package Divnet. It involve using phyloseq as a dependency.
The group of each sample is specified in a sam_data, column "type"…

ivanllam
- 3
- 2
0
votes
0 answers
How to subset (or filter?) taxa in a phyloseq object, within a grouping?
I am attempting to subset (or filter?) taxa that have relative abundance >= 35%,and belong in >= 70% of samples within a grouping (in my case it is the number of 'clusters' in my data).
Is there a simple line of code on how to do this? I have…

Dominika Boron
- 11
- 1
- 1
- 5
0
votes
0 answers
How to attach metadata to a phylo4d tree
I am working to attach metadata to a phylo4d tree. I will start by saying I can attach my objects as a dropbox file, but if I am just misunderstanding the logic I'll save myself and everyone's time.
I start with a phyloseq object then extract the…

Geomicro
- 303
- 3
- 13
0
votes
1 answer
Trying to change colour of one variable in ggplot geom_bar dependent on the string
I have a for loop to run through a tonne of microbiome data (using phyloseq) and generate plots for multiple experiments.
ggplot(data_M1, aes(x = Sample, y = Abundance, fill = get(i))) +
geom_bar(stat = "identity")+
facet_wrap(vars(Status,…

DS14
- 133
- 9
0
votes
1 answer
Phylo tree has no branch lengths using phylosig () R
I am having a hard time understanding why my phylo tree (imported as a phyloseq object from QIIME2) appears to have no branch lengths when used in phylosig(). I am trying to compute the phylogenetic signal of my 16S dataset compared to a single…

Geomicro
- 303
- 3
- 13
0
votes
2 answers
Editing tables with R studio
Phylum
Abundance
Bacteroidetes
12
Firmicutes
4
Proteobacteria
3
Firmicutes
21
Firmicutes
9
Bacteroidetes
15
Proteobacteria
3
Bacteroidetes
8
Verrucomicrobia
2
Bacteroidetes
5
My question is I have a table like above in…