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

change.sigindex error!! #68

Open
minzooey opened this issue Nov 26, 2024 · 3 comments
Open

change.sigindex error!! #68

minzooey opened this issue Nov 26, 2024 · 3 comments

Comments

@minzooey
Copy link

I am getting an error when I perform "change.sigindex" using the following code.
Could you tell me exactly which data in detail is not numeric and thus the error is occurring?

icres3=iCAMP::change.sigindex(icamp.output = icres2, sig.index = "Confidence", detail.save = TRUE, detail.null = FALSE, conf.cut = 0.975)
Now re-calculate i=1 in 2, bMPDi. Tue Nov 26 16:14:05 2024
Error in matrix(obsa[, i], nrow = nrow(randar), ncol = ncol(randar)) :
non-numeric matrix extent

@DaliangNing
Copy link
Owner

DaliangNing commented Nov 26, 2024

you may save the 'icres2' as rda file and send me ([email protected]) to debug.

save(icres2, file="icres2.rda")

@DaliangNing
Copy link
Owner

The error is because some bins have too few taxa where the number of all possible randomizations is less than 1000, then the randomization times for different bins are different in our icamp output (some are 1000, some are 720). The newest version of iCAMP (version 1.6.7) has solved this problem, which allow the icamp.output has different randomziation times in different bins. You can go through change.sigindex now. The latest version can be downloaded from https://github.com/DaliangNing/iCAMP1/tree/master/RPackage/AllVersions.

However, for a real microbiome dataset, I strongly recommend using bin.size.limit >= 12 to ensure enough statistical power. The bin.size.limit had better be determined by phylogenetic signal test, as showed in Step 7 and 8 in the example R code (https://github.com/DaliangNing/iCAMP1/blob/master/Examples/SimpleOTU/icamp.test.r)

@DaliangNing
Copy link
Owner

I also received your query on iCAMP for relative aubndance data.
"I encountered an issue while performing the iCAMP analysis using relative abundance data. I followed the exact code as below:"

# 9.5 # input community matrix as relative abundances (values < 1) rather than counts  
comra = comm / rowSums(comm)  
prefixra = paste0(prefix, "RA")  
bin.size.limit = 24 # For real data, usually use a proper number according to phylogenetic signal test or try some settings then choose the reasonable stochasticity level. our experience is 12, or 24, or 48. but for this example dataset which is too small, have to use 5.  
icres6 = iCAMP::icamp.big(comm = comra, tree = tree, pd.desc = pd.big$pd.file, pd.spname = pd.big$tip.label, pd.wd = pd.big$pd.wd,  
                          rand = rand.time, prefix = prefixra, ds = 0.2, pd.cut = NA, sp.check = TRUE,  
                          phylo.rand.scale = "within.bin", taxa.rand.scale = "across.all",  
                          phylo.metric = "bMPD", sig.index = "Confidence",  
                          bin.size.limit = bin.size.limit, nworker = nworker, memory.G = memory.G,  
                          rtree.save = FALSE, detail.save = TRUE, qp.save = FALSE, detail.null = FALSE,  
                          ignore.zero = TRUE, output.wd = save.wd, correct.special = TRUE, unit.sum = rowSums(comra),  
                          special.method = "depend", ses.cut = 1.96, rc.cut = 0.95, conf.cut = 0.975,  
                          omit.option = "no", meta.ab = NULL, taxo.metric = "bray", transform.method = NULL,  
                          logbase = 2, dirichlet = TRUE)  

Despite using the code as is, the analysis did not proceed and resulted in the following error message:

The names are re-ranked.  
----------Now binning-----------------Wed Nov 27 10:45:27 2024  
Now computing path. begin at Wed Nov 27 10:45:28 2024. Please wait...  
Now computing path. begin at Wed Nov 27 10:45:31 2024. Please wait...  
Now computing dist to root. begin at Wed Nov 27 10:45:32 2024. Please wait...  
----------Now binning com and sp without omitting small bins-----------------Wed Nov 27 10:45:33 2024  
----bMPD bin i=1 in 10 ---- Wed Nov 27 10:45:33 2024  
Now calculating observed betaMPD. Begin at Wed Nov 27 10:45:33 2024. Please wait...  
Now randomizing by parallel computing. Begin at Wed Nov 27 10:45:34 2024. Please wait...  
Now fixing special cases. Begin at Wed Nov 27 10:45:53 2024. Please wait...  
All match very well.  
Now calculating observed MPD. Begin at Wed Nov 27 10:45:54 2024. Please wait...  
Now randomizing by parallel computing. Begin at Wed Nov 27 10:45:54 2024. Please wait...  
Error in checkForRemoteErrors(val) :   
  4 nodes produced errors; first error: missing values are not allowed with argument 'na.rm = FALSE'  

First, use this option (step 9.5 in the example R code) only when you have to use 'relative abundances' (all values are lower than 1).
To debug, I need all the input files and R code you used. You may send to me via email ([email protected]) or attach files here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants