Open vadimverenich opened 3 years ago
Hi vadiverenich, Have you solved the issue? I get the same error. Please let me know if you have a solution for this.
I think the issue here is that y
in the svm formula is character type. The formula is defined by svm.mod <- as.formula(paste0("Population~", paste0("PC", 1:numpc, collapse = "+")))
and used in the following two lines:
https://github.com/chenlab-uva/AncestryInference_KING/blob/279b3327e729ef1d13fc482d811ae4f56155b053/Ancestry_Inference.R#L32
and
Thus, I suspect the problem can be partially resolved by set Population
as a factor/numeric in dat
before the svm
step.
However, as I did so, the results of a largely European group now has largely AMR inferences, so I suspect there are some factor levels issue as the inference results are converted back to the population group. In any case, I will contact the project lead regarding this, and the script I have edited is https://gist.github.com/liutiming/8723973ecd0ef2d8fc9245e10fee5324
Thanks to @pontikos for helping with the debugging.
Thank you @liutiming. I am using your edited script. It works well, but I am getting a lot of AFR inferences. Did you find out why that is happening?
Thanks!
Hi,
Thanks for correcting the script. were any of you able to determine why AFR inferences are showing up at high levels? My SNP dataset are supposed to be south east Asians mostly but AFR shows up in a high %. Any idea? Thanks
Hello,
I had the same problem when running on R 4.2. It worked on R version 3.6.
Hi, Just confirm that R 3.6 works well, I have to install the old R 3.6 on windows. VasiliosRaptis, thank you!
I have recently discovered problem running Ancestry_Inference R code
Rscript Ancestry_Inference.R input/examplepc.txt input/example_popref.txt prefix Error in { : task 1 failed - "Need numeric dependent variable for regression." Calls: %dopar% ->
Execution halted