Rosemeis / pcangsd

Framework for analyzing low depth NGS data in heterogeneous populations using PCA.
GNU General Public License v3.0
46 stars 11 forks source link

-sites_save returning only 0s #84

Closed nickylustenhouwer closed 9 months ago

nickylustenhouwer commented 9 months ago

I am running pcangsd on a subset of individuals, so when applying the mafs filter, some sites are filtered out. I would like to know which sites were kept, so I can identify them in the final output (for example, label them on a Manhattan plot or compare them between different subsets of the data). I tried doing this using -sites_save: pcangsd -b call_all_chr1to12_subsampled.beagle.gz --filter samples_Nor.txt -o call_all_chr1to12_subsampled_Nor_pcangsd --threads 5 --iter 300 --pcadapt --snp_weights --admix --admix_iter 300 --sites_save

The output looks normal, and it retained a subset of sites: Loaded 491259 sites and 334 individuals. Number of sites after MAF filtering (0.05): 383045 I get all of the right output files including call_all_chr1to12_subsampled_Nor_pcangsd.sites Everything else works (covariance matrix, zscores, SNP weights) but the sites file contains only 0s! It has the correct number of lines - 491259 - but every single line has a 0, so there is no way for me to know which sites were kept and which sites weren't. All of the other output files contain the filtered number of sites (383045).

What could I be doing wrong? I tried running pcangsd without -filter, or without -admix or -pcadapt but no matter what I do -sites_save only returns zeros. Many thanks for your help!

Rosemeis commented 9 months ago

Hi, thank you for reaching out!

I think it is me that have a bug somewhere, and will look at it asap. :-)

Best, Jonas

Rosemeis commented 9 months ago

I have now pushed an update that should fix the problem (v1.21)! :-)

Best, Jonas

nickylustenhouwer commented 9 months ago

Hi Jonas,

Thank you so much for taking the time to look into this, I am happy to report that your update has fixed the problem! I now get a sites file of the correct length with 1s and 0s. Many thanks again,

Nicky