I have worked on that for over a week now and it is not working still. I am using the package ''RAM'' in r and more specifically the OTU.diversity function:
*Summarize Diversity Indices for OTU Tables
Description
These functions calculate diversity indices for all samples and append outputs as new columns to metadata table.
Usage
OTU.diversity(data, meta) Arguments data a list of OTU tables. meta the metadata to append the outputs.
Details
This function summarize the following diversity indices: specnumber, shannon, simpson, invsimpson, true diversity, evenness, chao and ACE indices, for a given otu table.
Value
This function return vectors of diversity indices for each sample, which are appended to a given metadata table.*
My command line is:
tabletemp <- read.table(paste(pathDataAn, "ITS.table.tsv", sep = ""),
sep = "\t", header = TRUE, dec = ".", comment.char = "", quote = "", stringsAsFactors = TRUE,
as.is = TRUE, check.names = FALSE, colClasses=c("row.names"="character", "taxonomy"="character"))
tabletemp$row.names <- NULL
metatemp <- read.table(paste(pathDataAn, "ITS.meta.tsv", sep = ""),
sep = "\t", header = TRUE, dec = ".", comment.char = "", quote = "", stringsAsFactors = TRUE,
as.is = TRUE)
temp2 <- OTU.diversity(list(data=tabletemp), metatemp)
and the output says this:
Error in .valid.meta(otu, meta = meta) : Sample names for otu1 and meta differ. They may be out of order. In otu1, not in meta: EM13S01RV EM13S02RV EM13S03FW EM13S03RV...(lists of all my samples) In meta, not in otu1:
1, 2, 3, ...
I have verified that each header is the same and in the exact same order. They all are correctly arranged. Please help me, I do not understand why it does not seem to read these tables properly.