Closed pyspider closed 3 years ago
@pyspider it is mainly because your data table only has two samples. I did not expect this before. It is fixed in the latest version of iCAMP (version >= 1.4.3, can be download from /RPackage/AllVersion). Please try. However, I would not suggest applying iCAMP to a dataset with only two samples, since the null model results would not be quite reliable when sample number is too low.
Another issue in your data: phydist.csv is not a square matrix. Some taxa may be lost when you preparing the data file.
Besides, the taxa IDs are too complicated and may cause unexpected error in R.
Please see the following code.
comf="OTU.location.csv" pdf="phydist.csv"
library(iCAMP) com=read.csv(comf,row.names = 1) dim(com)
pd=read.csv(pdf,row.names = 1) dim(pd) # your phydist is not a square matrix.
sampc=match.name(cn.list=list(com=com),both.list = list(pd=pd)) com=sampc$com pd=sampc$pd
oldid=colnames(com) colnames(com)=paste0("Taxon",1:ncol(com)) rownames(pd)<-colnames(pd)<-colnames(com) write.csv(data.frame(OldID=oldid,NewID=colnames(com)),file = "IDchange.csv")
bnti=iCAMP::bNTIn.p(comm = com,dis = pd,nworker = 2,weighted = TRUE, exclude.consp = FALSE, rand = 4, output.bMNTD = FALSE, sig.index = 'SES', unit.sum = NULL, correct.special = FALSE, detail.null=FALSE)
bnti2=bNTIn.p(comm = com,dis = pd,nworker = 2,weighted = TRUE, exclude.consp = FALSE, rand = 4, output.bMNTD = FALSE, sig.index = 'SES', unit.sum = NULL, correct.special = FALSE, detail.null=TRUE)
qpout=qpen(comm = com, pd = pd, rand.time = 4, ab.weight = TRUE)
Many thanks for you help! Sorry. I uploaded a not square dissimilarity matrix here because I exported this file is incomplete. But this matrix is square in the previous analysis.
It is fixed in the latest version of iCAMP (version >= 1.4.3, can be download from /RPackage/AllVersion). Please try.
Yes. I repeated all analysis by iCAMP (version 1.4.3). The results are the same. Sure, a comparison of only two smaples can be allowed using iCAMP (version 1.4.3). But this caused some errors on iCAMP (version 1.3.4).
However, I would not suggest applying iCAMP to a dataset with only two samples, since the null model results would not be quite reliable when sample number is too low.
Thanks for your suggestion. Yes. Two samples are not quite reliable. Actually, they are pooled assemblages here. I did same analysis for many subgroupings too. But this error is caused by only two sample.
Has the problem been solved? I am confused when you said 'the results are the same.' Do you mean you still get any error with version 1.4.3?
Yes. This problem has been solved on iCAMP version 1.4.3... The results for only two samples are the same in comparison with the results from iCAMP version 1.3.4 (using bNTIn.p under detail.null=FALSE). Sorry for this confusion. Many thanks for your help again.
Thank you for letting me know the issue. Feel free to contact me if any other issue shows up.
When I set detail.null= TRUE using bNTIn.p. I encountered this error: Error in 1:ncol(bMNTD.randm) : argument of length 0. But if I set detail.null= FALSE (default) using bNTIn.p, It's working smothly. And I can get the beltaNTI value. I am not sure whether I may use this result. Qpen also have same error. Here is the dataset I used. comm_and_phydist.zip
.