Problem with creating an MRexperiment with metagenomeseq - invalid class “MRexperiment” object: 1: feature numbers differ between assayData and featureData
0
0
Entering edit mode
Laura • 0
@Laura-24738
Last seen 3.8 years 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

setwd("/home/laura/Desktop/Thesis/fasta-qual-mapping-files-NOTRIM")

install packages

BiocManager::install("metagenomeSeq")

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: https://pastebin.com/zbxB5RR5

and my taxonomy: https://pastebin.com/VtykYigR

MRexperiment metagenomes metagenomeSeq • 935 views
ADD COMMENT

Login before adding your answer.

Traffic: 667 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