Question: error with metagenomeSeq newMRexperiment
0
gravatar for noelle.noyes
4.8 years ago by
noelle.noyes30
United States
noelle.noyes30 wrote:

I am receiving an error message with metagenomeSeq that I simply can't figure out:

Error in validObject(.Object) : 

  invalid class “MRexperiment” object: featureNames differ between assayData and featureData

I believe this refers to the features not matching between the count matrix and the taxonomy.  However, I have triple-checked the files, and they do have the same features names, in the same order.  I did some googling, and perhaps came up with a clue, but I am not a savvy R user at all.  The user forum I found indicated that this error message has something to do with using make.names for assayData, but not feature data:

https://stat.ethz.ch/pipermail/bioconductor/2013-November/056100.html

 Here is the code I am using (adapted from the user manual), and I have attached all relevant files:

counts = load_meta("counts.txt", sep = "\t")

pheno = load_phenoData("pheno.txt", sep = "\t", tran=TRUE)

ord = match(colnames(counts$counts), rownames(pheno))

pheno = pheno[ord, ]

head(phono)

taxa = read.delim("taxa.txt", sep = "\t", stringsAsFactors=FALSE)

phenotypeData = AnnotatedDataFrame(pheno)

taxaData = AnnotatedDataFrame(taxa)

AMR = newMRexperiment(counts$counts,phenoData=phenotypeData, featureData=taxaData)

Data from counts.txt:

  Samp1 Samp2 Samp3 Samp4 Samp5 Samp6 Samp7 Samp8 Samp9
(AGly)Aac)-IVa:X01385:244-1029:786 0 0 0 0 0 0 0 0 0
(AGly)AadA1-pm:JQ690540:7968-8798:831 0 0 0 0 0 70 70 0 0
(AGly)AadA1:M95287:3320-4111:792 0 0 0 0 0 0 27 0 0
(AGly)AadA11:AJ567827:1-792:792 0 0 0 0 0 0 0 0 0

 

Data from taxa.txt:

Gene Class Mechanism
(AGly)Aac)-IVa:X01385:244-1029:786 Aminoglycosides Aminoglycoside acetyltransferases
(AGly)AadA1-pm:JQ690540:7968-8798:831 Aminoglycosides Aminoglycoside nucleotidyltransferases
(AGly)AadA1:M95287:3320-4111:792 Aminoglycosides Aminoglycoside nucleotidyltransferases

Hopefully I am not making a very obvious mistake and thus wasting anyone's time with this error! Thank you in advance for your time.

metagenomeseq error • 1.4k views
ADD COMMENTlink modified 4.8 years ago by Joseph Nathaniel Paulson270 • written 4.8 years ago by noelle.noyes30
Answer: error with metagenomeSeq newMRexperiment
1
gravatar for Joseph Nathaniel Paulson
4.8 years ago by
United States
Joseph Nathaniel Paulson270 wrote:

Hi Noelle,

Thank you for the informative post! Looking at the line reading in the taxa, your taxa data rownames will be 1,2,3,4,..., etc.

Unfortunately, that's not how the count table row names are encoded. If you change reading your taxa in to:

taxa = read.delim("taxa.txt", sep = "\t", stringsAsFactors=FALSE,row.names=1)

it should work. Also, I should mention we support biom-format.

ADD COMMENTlink written 4.8 years ago by Joseph Nathaniel Paulson270
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 194 users visited in the last hour