Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

picante error in ses.comdistnt2 #1

Open
karoraw1 opened this issue Jun 6, 2019 · 1 comment
Open

picante error in ses.comdistnt2 #1

karoraw1 opened this issue Jun 6, 2019 · 1 comment
Labels

Comments

@karoraw1
Copy link

karoraw1 commented Jun 6, 2019

i've attached my distance matrix, strata vector, and phylogenetic distance matrix.

I use the following code to load and run them:

library(ape)
library(picante)
library(MicEco)
library(doSNOW)

tsv.data <- read.delim("../otu_data/clustered_sequences/test_abundances.txt", row.names=1)
phydf <- read.delim("../otu_data/clustered_sequences/test_distmat.txt", row.names=1)
strata_df <- read.delim("../otu_data/clustered_sequences/test_strata.txt", row.names=1)
strat_vec <- unname(unlist(strata_df[,'CollectionAgency']))
strata_ <- as.integer(as.factor(strat_vec)[drop = TRUE])
phydist = as.matrix(phydf)
mntd_scores <- ses.comdistnt2(tsv.data, phydist, method = "quasiswap", strata =strata_ , abundance.weighted = TRUE, runs = 5, cores=1)

The error I get is:

Error in match.comm.dist(comm, dis) : 
  Community data set lacks taxa (column) names, these are required to match distance matrix and community data

I do not get this error when strata = NULL

test_abundances.txt
test_distmat.txt
test_strata.txt

@Russel88
Copy link
Owner

Russel88 commented Jun 7, 2019

Apparently the permatfull/permatswap function removes row- and colnames when there is a strata argument.

I don't have time at the moment to fix this, so if you want this functionality you have to change the code such that permutations are run first, row- and colnames are fixed, and then comdistnt.par is run on the permuted matrices.

@Russel88 Russel88 added the bug label Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants