Questions tagged [phyloseq]

phyloseq is an R package with functions and tools to handle and analyze high-throughput microbiome census data

141 questions
0
votes
0 answers

How to filter data in R object so it only shows certain species?

Here is the code I am currently using after importing my OTU table, metadata, taxonomy and tree into R as one object. The issue I have is in the last line, I keep getting the error "Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to…
0
votes
2 answers

OTU table from phyloseq object can't be coerced into a data frame

I need to convert my OTU table from my phyloseq object into a data frame so that I can use it to run PICRUSt2, but as.data.frame(physeq@otu_table) won't make it a data frame. I tried pie<-as.matrix(physeq@otu_table) and when I say is.matrix(pie) #it…
brynaR
  • 11
  • 5
0
votes
2 answers

Error code for tool subset_taxa; Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to array extent

I load .biom data into R using library phyloseq. Data2020 <- import_biom("XXX") mapfile2020 <- import_qiime_sample_data("XXX") tree <- read_tree("XXX") mydata <- merge_phyloseq(Data2020, mapfile2020, tree) colnames(tax_table(mydata)) <-…
0
votes
1 answer

Constructing a simple dataframe (DADA2 Pipeline transition to Phyloseq)

I successfully completed the DADA2 Pipeline Tutorial (https://benjjneb.github.io/dada2/tutorial.html) using my own data but have gotten stuck with the transition to Phyloseq. I need to construct a simple data.frame from the information encoded in…
0
votes
1 answer

Phyloseq code modification for relative aboundance plot

I am following this pipeline (https://www.nicholas-ollberding.com/post/introduction-to-the-statistical-analysis-of-microbiome-data-in-r/) for relative abundance in box plot image like this…
Shaminur
  • 51
  • 6
0
votes
0 answers

How to assign one specific color to a specific taxa in a phyloseq object after using colorRampPalette

I have difficulties on R for creating the color palette i'd like to get... I simply want to plot distributions of the different phyla of my phyloseq object (called physeq) in barplots. In order to assign a color to each phylum (so the color doesn't…
GwenP29
  • 1
  • 1
0
votes
0 answers

Phyloseq sample_data() and sample_names() not working to incorporate samples into phyloseq object

My question relates to using phyloseq() to build a phyloseq object. I've followed https://joey711.github.io/phyloseq/import-data.html & https://vaulot.github.io/tutorials/Phyloseq_tutorial.html and the code has worked before. Specifically, why is…
dowds05
  • 1
  • 1
0
votes
1 answer

Removing the original color outline in R when using a new pallette in a barplot

I am using plot_bar function in R to illustrate some data from a phyloseq class. I want to add some different colors to my plot, here the pallette Paired from the RColorBrewer package. For some reasons the bars end up still having the default color…
Flora
  • 3
  • 3
0
votes
0 answers

error while plotting beta diversity with ggplot from phyloseq object

I am getting an error while plotting the beta diversity from phyloseq object with ggplot2, could you please suggest how I can resolve this issue? R code phyloseq_prop = transform_sample_counts(physeq, function(x) 1E6 * x/sum(x)) expt1.ord <-…
bioinfonext
  • 119
  • 7
0
votes
0 answers

stacked barplot with samples in x-axis arranged according to "early" and "late" groups

Hi friends I'm working with Phyloseq package to analyse 16S metagenomic data. I want to make a stacked barplot with abundance in y-axis and samples in x-axis. I have 10 samples with 4 early and 6 late. How can I arrange in the barplot. I mean first…
CHANDA7
  • 11
  • 3
0
votes
1 answer

How to load data.frame made by phyloseq::psmelt from disc?

Melting phyloseq data for easier plotting takes long time with df = psmelt(pseq) so I want to save the created df data.frame to disc for faster recovering in case of any crash. Using save(df,file="filename.Rda") creates file which is supposed to be…
mschmidt
  • 89
  • 7
0
votes
1 answer

How to subdivide prevalence groups into gender on R - microbiome

I'm new to R. I'm working with a script that splits the atlas1006 microbiome data into 3 groups of disease prevalence (low, medium, high) based on country. I want to subdivide each group: low, medium, high, into male and female for each group, i.e.…
0
votes
1 answer

How to display a dataframe with factors in R data viewer?

I have a class that contains a dataframe where the columns are factors (from package phyloseq). It looks like that: > str(a) 'data.frame': 124 obs. of 21 variables: Formal class 'sample_data' [package "phyloseq"] with 4 slots ..@ .Data :List…
0
votes
1 answer

R phyloseq tax_glom used in a function give a error

I'm trying to make a function to obtain a table in a relative abundance of any given taxrank with PHYLOSEQ, something like: Relative_Table <- function (PhyloObj, TRank) { GROUP <- tax_glom(PhyloObj, taxrank="TRank") Percent <-…
abraham
  • 661
  • 8
  • 14
0
votes
1 answer

Problem in importing .biom file from the Earth Microbiome Project (release1) in R

I want to import a .biom file in R that I've dowloaded from the ftp server - the Earth Microbiome Project (release 1). The file comes from the following link: ftp://ftp.microbio.me/emp/release1/otu_tables/closed_ref_silva/ I tried with several of…
C.Bru026
  • 1
  • 2