Problem with creating an MRexperiment with metagenomeseq - invalid class “MRexperiment” object: 1: feature numbers differ between assayData and featureData
Entering edit mode
Laura • 0
Last seen 8 weeks ago

So I'm running into an issue with putting in my taxonomy data, for some reason it woun't pick up the names or counts and this makes making an MRexperiment impossible

My code:

```# clear all rm(list = ls())

set working directory to fasta-qual-mapping-files-NOTRIM on my desktop


install packages


load packages

library(vegan) library(biomformat) library(BiocManager) library(metagenomeSeq)

loading count data

dataDirectory <- system.file("extdata", package = "metagenomeSeq") table.euks.alpha <- loadMeta("./biom-111920EFNillcus515F/feature-table.txt", sep = "\t") table.bact.alpha <- loadMeta("./biom-111920EFNeuk1391F/feature-table.txt", sep = "\t") dim(table.euks.alpha$counts) dim(table.bact.alpha$counts)

loading taxonomy

taxabact = read.delim("./taxonomy-exported-111920EFNillcus515F/taxonomy.tsv", sep = "\t", stringsAsFactors = FALSE) taxaeuk = read.delim("./taxpnpmy-silva-exported-11920EFNeuk1391F/taxonomy.tsv", sep = "\t", stringsAsFactors = FALSE)

creating MRexperiment object

sampledatabacttaxa = AnnotatedDataFrame(taxabact) sampledataeuktaxa = AnnotatedDataFrame(taxaeuk) sampledatabacttaxa sampledataeuktaxa obj = newMRexperiment(table.bact.alpha$counts, featureData = sampledatabacttaxa)


Here's the MRexperiment error: Error in validObject(.Object) : invalid class “MRexperiment” object: 1: feature numbers differ between assayData and featureData invalid class “MRexperiment” object: 2: featureNames differ between assayData and featureData

and when I use taxabactnames It returns NULL, same with taxaeuknames

Here is a pastebin of my eukaryotic OTU counts for an example of formatting:

and my taxonomy:

MRexperiment metagenomes metagenomeSeq • 46 views

Login before adding your answer.

Traffic: 383 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6