Open MatiasPezoa21 opened 4 years ago
Error in validObject(.Object) : invalid class “phyloseq” object: Component sample names do not match. Try sample_names()
Yup.. Me, too, getting the same error message.
The error occurs because the sample names of the OTU table and those of the sample data do not match. You can check this using sample_names() on your OTU table and sample data.
For an example on how to solve this: https://github.com/joey711/phyloseq/issues/1315
Hi everyone, I'm Matias. I have the following problem and I don't know how to solve it, please if someone can help me.
This is the script
taxTabExtra <- addSpecies(taxTab, "~/Resultados secuencias matias/silva_species_assignment_v132.fa", verbose=TRUE) unname(head(taxTab)) -> tabla colnames(tabla) <- c("Kingdom", "Phylum", "Order", "Class", "Family", "Genus")
seqs <- getSequences(seqtab.nochim)
names(seqs) <- seqs alignment <- AlignSeqs(DNAStringSet(seqs), anchor=NA,verbose=FALSE)
phangAlign <- phyDat(as(alignment, "matrix"), type="DNA") dm <- dist.ml(phangAlign) treeNJ <- NJ(dm) fit = pml(treeNJ, data=phangAlign) fitGTR <- update(fit, k=4, inv=0.2) fitGTR <- optim.pml(fitGTR, model="GTR", optInv=TRUE, optGamma=TRUE, rearrangement = "stochastic", control = pml.control(trace = 0),multithread=20)
samdf <- read.csv("~/Resultados secuencias matias/Liquen/Metadatos liquen.csv", header=FALSE, row.names = 1) rownames(seqtab.nochim) %in% rownames(samdf) all(rownames(seqtab) %in% samdf$run)
ps <- phyloseq(otu_table(seqtab.nochim, taxa_are_rows=FALSE), sample_data(samdf), tax_table(taxTab), phy_tree(fitGTR$tree))
And the problem occurs at the end