popgenDK / SATC

Sex assignment through coverage
17 stars 10 forks source link

'x' must be an array of at least two dimensions #3

Open fuesseler opened 2 years ago

fuesseler commented 2 years ago

Hello! I am trying to use your package, which looks very promising! The examples you provided work perfectly fine for me, but when I try to run it for my own idxstats files R gives the following error:

Error in rowMeans(mat[, g == 1]) : 'x' must be an array of at least two dimensions

the above is when I try to use it in R, it happens when I try to run the sexDetermine function. I also tried doing it in shiny, but get the same error message as above.

I suspect it must be something wrong with my idxstats input files (i have six). Here is an example how the head of these files look like. First column is the name of the scaffold, then length, then number of mapped and unmapped reads.

0 91818038 6538851 936 1 108327730 7688399 1165 2 99174761 7077374 973 3 92607911 6538700 834

Do you have any idea what might be causing the error and how to make it work?

casia16 commented 2 years ago

Hi, The idxstat looks fine. It is possible that our default filtering threshold, filter out all the scaffolds you have. Can you play around with setting a lower threshold of minLength? and if you run it in R, you may also check the dim(idx[[1]]) compared with dim(rFilt[[1]]), that will give you number of scaffolds before and after filtering.