What are the input files for lwaldron / metaphlanToPhyloseq.R ?
2
0
Entering edit mode
3.7 years ago
c.e.chong ▴ 60

Hi,

Has anyone used lwaldron/metaphlanToPhyloseq.R (

I'm unsure of what the input files should be and there is no help information on GitHub. I'm wanting to use it to input my metaphlan3 merged abundance table into phyloseq.

Thanks in advance!

r metagenomics metaphlan • 2.1k views
ADD COMMENT
0
Entering edit mode
3.7 years ago
zorbax ▴ 610

You need the output of metaphlan folder and one metadata file with the same samples ids. input is the metaphlan2 output folder and meta_input is the metadata file.

metaphlanToPhyloseq(input, meta_input, simplenames = TRUE, 
                                     roundtointeger = FALSE)
ADD COMMENT
0
Entering edit mode

Thank you for getting back to me. I've tried this and get this error:

metaphlan <- read.csv("statemerged_abundance_table_reformatted.csv", header = TRUE) 
metadata <- read.delim("metadata.txt", header = FALSE, sep = "\t")
metaphlanToPhyloseq(metaphlandir = metaphlan, metadat = metadata, simplify = TRUE)

Error in list.files(metaphlandir) : invalid 'path' argument

This is the metaphlan csv :

clade_name  healthy_mphlan  dandruff_mphlan dandruffhealthy_mphlan
k__Bacteria 91.40268    71.86512    89.7509
k__Bacteria|p__Actinobacteria   86.36566    49.51296    77.30806
k__Bacteria|p__Actinobacteria|c__Actinobacteria 86.36566    49.51296    77.30806
k__Bacteria|p__Actinobacteria|c__Actinobacteria|o__Actinomycetales  0.1044  0.11737 0.62909
k__Bacteria|p__Actinobacteria|c__Actinobacteria|o__Actinomycetales|f__Actinomycetaceae  0.1044  0.11737 0.62909
k__Bacteria|p__Actinobacteria|c__Actinobacteria|o__Actinomycetales|f__Actinomycetaceae|g__Actinobaculum 0.01359 0.03944 0.09785
ADD REPLY
0
Entering edit mode

I think my comment was of a previous version, I corrected the answer. In this function you will need more functions from curatedMetagenomicData regarding the tree.

ADD REPLY
0
Entering edit mode

Ok, so I should run through the ‘curatedMetagenomicData’ pipeline with my data?

ADD REPLY
0
Entering edit mode

Just load before curatedMetagenomicData with library(curatedMetagenomicData) before run the function metaphlanToPhyloseq() with your folder and metadata files.

ADD REPLY
0
Entering edit mode

Thank you so much for your help!

I'm still getting an error.

I have a directory called metaphlan_profiling and it contains 22 .txt outputs from metaphlan

mtph_subDir <- "metaphlan_profiling/"

I read in the metadata information (I'm not sure if this should be a data frame)

metadata <- read.delim("metaphlan_profiling/metadata.txt", header=FALSE, sep = "\t") 
head(metadata)
V1 V2
1 DD_S10_mphlan  1
2 DD_S12_mphlan  1
3 DD_S14_mphlan  1
4 DD_S16_mphlan  1
5  DD_S6_mphlan  1
6  DD_S8_mphlan  1

I think run the function

phyloseq <- metaphlanToPhyloseq1(metaphlandir = mtph_subDir , metadat = metadata, simplify = TRUE)

I get this error :

Error during wrapup: more columns than column names
Error: no more error handlers available (recursive errors?); invoking 'abort' restart
ADD REPLY
0
Entering edit mode
2.9 years ago
serene.s • 0

Hi I am not able to use this function, kindly tell me how to use it and what are files that I need and where should I place them? What changes I should make to make it work? Please make a tutorial for it with a proper explanation. I do not understand why HuttenHower lab has not made a tutorial for importing the metaphlan3 output to phyloseq when mostly everyone who gets the results want to analyze with phyloseq package? How should the Metadata.txt file look like?

Thanks Saraswati Awasthi

ADD COMMENT

Login before adding your answer.

Traffic: 2220 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6