popgenDK / SATC

Sex assignment through coverage
17 stars 10 forks source link

Error in svd(t(mat * w)) : a dimension is zero #13

Open jcaccavo opened 1 year ago

jcaccavo commented 1 year ago

Hi there,

When I try to run SATC on idxstats files I created from my .bam files, I consistently get the following error:

Error in svd(t(mat * w)) : a dimension is zero
Calls: satc -> sexDetermine -> svd
In addition: Warning message:
In filterScaffold(dat = r, minLength = minLength, M = M, normScaffolds = normScaffolds,  :
  large difference in covarage of the scaffolds used for normalization. Consider using the median instead (--useMedian TRUE) or manually choose scaffolds (--normScaffolds)
Execution halted

Here are my idxstats files, which do not differ from the example idxstats files (e.g. leopard), other than that the scaffolds are not in descending order.

To create the idxstats files, I used the following code:

for bam in *.bam;do
        file=$(basename $bam | sed 's/.bam//')
        samtools idxstats $file.bam > ${file}.idxstats
done

To run SATC, I'm using the following code: Rscript --vanilla satc.R -i dmawsoni_idxstats_path.txt -o dmawsoni2021 #--useMedian TRUE Note - I tried using the parameter --useMedian TRUE, as suggested in the error output, but this did not eliminate the error.

I am working with 48 .bam/.idxstats files.

I am happy to provide further information as needed.

Thanks so much in advance for your help!