szpiech / selscan

Haplotype based scans for selection
GNU General Public License v3.0
109 stars 33 forks source link

Issue with --trunc-ok #21

Closed plxsas closed 7 years ago

plxsas commented 8 years ago

Dear zachary,

Sorry to bother you again but I am really experience problem with running selscan on my data.

This is my command options:

./selscan --ihs --vcf gHaplotypeCaller_bialllelicfinalSNPs.Autosome.chr1.phased_biallelic_ch1_AF_0.05_snp_195275175.vcf.recode.vcf --map gHaplotypeCaller_bialllelicfinalSNPs.Autosome.chr1.phased_biallelic_AF_0.05.map --max-gap 230000 --cutoff 0.9 --trunc-ok --out test

But, no success yet, this is what I see in the log file. These snp are on both ends of the chromosome 1 and it seems that (--trunc-ok) is not doing its job and disregarding these snp from calculation. Please see the following example of the output:

WARNING: Reached chromosome edge before EHH decayed below 0.9. Skipping calculation at C1P402 WARNING: Reached chromosome edge before EHH decayed below 0.9. Skipping calculation at C1P436 WARNING: Reached chromosome edge before EHH decayed below 0.9. Skipping calculation at C1P442 WARNING: Reached chromosome edge before EHH decayed below 0.9. Skipping calculation at C1P520 WARNING: Reached chromosome edge before EHH decayed below 0.9. Skipping calculation at C1P603 WARNING: Reached chromosome edge before EHH decayed below 0.9. Skipping calculation at C1P696 WARNING: Reached chromosome edge before EHH decayed below 0.9. Skipping calculation at C1P195275687 WARNING: Reached chromosome edge before EHH decayed below 0.9. Skipping calculation at C1P195275689 WARNING: Reached chromosome edge before EHH decayed below 0.9. Skipping calculation at C1P195275713 WARNING: Reached chromosome edge before EHH decayed below 0.9. Skipping calculation at C1P195275864 WARNING: Reached chromosome edge before EHH decayed below 0.9. Skipping calculation at C1P195275865

I would appreciate if you would advise me regarding this matter?

I am looking forward to hearing from you.

Thanks

szpiech commented 8 years ago

When you say no success, do you mean that you aren't getting any results at all, or just not getting results for the two snps on the end of your chromosome?

Also, this might seem like a silly question, but do you have non-zero increasing genetic distances in your map file?

rwaples commented 7 years ago

I think I'm running into the same issue. I'm trying to get selscan to run on the example data provided with the nSL program. I've converted the input haplotypes provided there (8 haplotypes x 18 sites) into the selscan format and run selscan with the command line:

!/home/ryan/programs/selscan/bin/linux/selscan --nsl --keep-low-freq \ --trunc-ok \ --hap ''/home/ryan/temp/test_nSL/nSL_example_for_selscan.txt'' \ --map '/home/ryan/temp/test_nSL/nSL_example_for_selscan.map' \ --out /home/ryan/temp/test_nSL/nSL_example_selscan

But I also get the error: "WARNING: Reached chromosome edge before EHH decayed below 0. Skipping calculation at rs7" for each snp.

How can I get selscan to work on this data? I've tried other command line flags as well, to no avail.

gist of the input and resulting log here

Thanks!

rwaples commented 7 years ago

Oops, the log file has the error messages, but the results file is populated

With the above command I'm getting these results:

rs1 100000 0.625 0.44 1.16667 -0.975131 rs2 200000 0.375 1.16667 0.72 0.482655 rs3 300000 0.625 0.71 2.43333 -1.23175 rs4 400000 0.125 0.2 0.761905 -1.3375 rs5 500000 0.625 0.81 2.43333 -1.09998 rs6 600000 0.5 0.883333 1.31667 -0.399156 rs7 700000 0.75 0.84 0.2 1.43508 rs8 800000 0.625 1.05 0.7 0.405465 rs9 900000 0.25 0.2 0.92 -1.52606 rs10 1000000 0.75 0.96 0.6 0.470004 rs11 1100000 0.625 0.53 2.43333 -1.52414 rs12 1200000 0.25 0.6 0.84 -0.336472 rs13 1300000 0.5 1.48333 0.816667 0.596816 rs14 1400000 0.5 0.583333 0.816667 -0.336472 rs15 1500000 0.5 0.9 0.666667 0.300105 rs16 1600000 0.5 0.5 0.616667 -0.209721 rs17 1700000 0.375 0.833333 0.4 0.733969 rs18 1800000 0.5 0.266667 0.466667 -0.559616

szpiech commented 7 years ago

I had intended to output those warnings even when --trunc-ok was set so that a user could identify which sites would have been filtered, but it seems I failed to remove the "Skipping calculation at..." part under such circumstances. Sorry for the misleading warning message, but it seems the calculations are running as expected.

rwaples commented 7 years ago

Yep, Thanks!