Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32 bit signed integer error #95

Open
ethering opened this issue Aug 12, 2020 · 1 comment
Open

32 bit signed integer error #95

ethering opened this issue Aug 12, 2020 · 1 comment

Comments

@ethering
Copy link

ethering commented Aug 12, 2020

Hi,
I noticed a similar issue to a previously closed one (#80 ), which I'm experiencing with the most recent version (2.5.1) of snp-sites.
It appears that sequences longer than 2,147,483,647 bases give the error "Warning: No SNPs were detected so there is nothing to output." 2,147,483,647 is the maximum value for a 32 bit signed integer.
I've spent a bit of time looking into this and here's what I've done to prove this.

I took two sequences from an alignment, one of which was the outgroup, so as to maximise the number of snps.
Each sequence was 2,423,158,460 bases in length:

$ cat sample1.fasta Outgroup.fasta > test.fasta

$ snp-sites -V
snp-sites 2.5.1

$ snp-sites -c -o test_snps.fasta test.fasta
Warning: No SNPs were detected so there is nothing to output.

I then cut the length of the sequences down 2,147,483,648 - one base longer than 32 bit signed integer maximum value:

$ cut -c 1-2147483648 test.fasta > test1.fasta
$ snp-sites -c -o test1_snps.fasta test1.fasta
Warning: No SNPs were detected so there is nothing to output.

I then cut the length of the sequence down 2,147,483,647 - the 32 bit signed integer maximum value:

$ cut -c 1-21474836487 test.fasta > test2.fasta
$ snp-sites -c -o test2_snps.fasta test2.fasta
/opt/slurm/data/slurmd/job28028674/slurm_script: line 13: 38321 Segmentation fault      snp-sites -c -o test1_snps.fasta test1.fasta

I then cut the length of the sequence down 2,147,483,646 - one base less than the 32 bit signed integer maximum value:

$ cut -c 1-21474836486 test.fasta > test3.fasta
$ snp-sites -c -o test3_snps.fasta test3.fasta

This time snp-sites ran successfully and identifies 28,880,245 variant sites

So it seems that sequence-lengths which are at the limit of a 32 bit signed integer maximum value cause a segmentation fault, and when you go over that limit causes snp-sites to suggest there are no SNPs

Graham

@JFsanchezherrero
Copy link

Hi there, any updates on that issue?

I came accross too, try to update the package but latest version is 2.5.1, which produces the error.

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants