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

Segfault running snp2h5 #13

Closed
ngcrawford opened this issue May 4, 2015 · 4 comments
Closed

Segfault running snp2h5 #13

ngcrawford opened this issue May 4, 2015 · 4 comments

Comments

@ngcrawford
Copy link

Hi,
I'm getting a segfault and a core dump when I run snp2h5. It looks to me like there may be a bug with how the pairs of hap andimpute2 files are associated. The first chromosome that is parsed runs correctly (e.g., chr10), but the second produces an error. I think snp2h5 is not updating to the correct hap file when it cycles to the next chromosome...

Let me know if there is anything I can do to help.

-- Nick

~/data/external_datasets/cbrown_impute2$ ~/source/WASP/snp2h5/bin/./snp2h5 --chrom /home/ngcrawford/data/genomes/chrmInfo.trunc.txt --format impute --geno_prob geno_probs.h5 --snp_index snp_index.h5 --snp_tab snp_tab.h5 --haplotype haps.h5 5M.hg19.RNAseq.d3_unrelated.filtered.o.chr_.impute2.gz 5M.hg19.RNAseq.d3_unrelated.filtered.o.chr_.impute2_haps.gz
writing genotype probabilities to: geno_probs.h5
writing haplotypes to: haps.h5
writing SNP index to: snp_index.h5
writing SNP table to: snp_tab.h5
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr10.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr11.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr12.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr13.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr14.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr15.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr16.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr17.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr18.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr19.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr1.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr20.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr21.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr22.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr2.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr3.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr4.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr5.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr6.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr7.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr8.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr9.impute2.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr10.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr11.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr12.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr13.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr14.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr15.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr16.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr17.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr18.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr19.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr1.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr20.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr21.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr22.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr2.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr3.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr4.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr5.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr6.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr7.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr8.impute2_haps.gz'
'5M.hg19.RNAseq.d3_unrelated.filtered.o.chr9.impute2_haps.gz'
chromosome: chr10, length: 135534747bp
reading from file 5M.hg19.RNAseq.d3_unrelated.filtered.o.chr10.impute2.gz
counting lines in file
total lines: 1461156
number of samples: 162
initializing HDF5 matrix with dimension: (1461156, 486)
parsing file and writing to HDF5 files
.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
initializing HDF5 matrix with dimension: (1461156, 324)
reading from file 5M.hg19.RNAseq.d3_unrelated.filtered.o.chr10.impute2_haps.gz
parsing file and writing to HDF5 files
.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
chromosome: chr11, length: 135006516bp
reading from file 5M.hg19.RNAseq.d3_unrelated.filtered.o.chr11.impute2.gz
counting lines in file
total lines: 1640404
number of samples: 162
initializing HDF5 matrix with dimension: (1640404, 486)
parsing file and writing to HDF5 files
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
initializing HDF5 matrix with dimension: (1640404, 324)
reading from file 5M.hg19.RNAseq.d3_unrelated.filtered.o.chr10.impute2_haps.gz
parsing file and writing to HDF5 files
WARNING: snp2h5.c:775: snp at position 20000105 present in impute2_haps file but not in impute2 file
WARNING: snp2h5.c:775: snp at position 20000144 present in impute2_haps file but not in impute2 file
WARNING: snp2h5.c:775: snp at position 20000279 present in impute2_haps file but not in impute2 file

[... A LARGE NUMBER OF LINES ...]

WARNING: snp2h5.c:775: snp at position 135006472 present in impute2_haps file but not in impute2 file
ERROR: Segmentation fault (core dumped)

@gmcvicker
Copy link
Collaborator

Hi Nick. Thanks for letting us know about this problem. Recently I have been testing using just one input file so I didn't notice the problem. I have committed some changes that should fix the issue. Please pull the changes and give it a try again.

@ngcrawford
Copy link
Author

Looks like the new code fixed the bug! Thanks. I'll let you know if I find any more. ;)

@ghost
Copy link

ghost commented Jul 10, 2017

Hi,
I'm use snp2h5 to convert vcf to h5. I find there is an problem in the latest version.
I use version (v 0.2 & v 0.2.1). The error happened.
...................................................................................................................
long alleles will be truncated to 100bp
writing SNP index to: snp_index.h5
chromosome: C2, length: 52886895bp
reading from file chr_vcf/C2.vcf
counting lines in file
total lines: 0
reading VCF header
ERROR: expected last line in header to start with #CHROM
....................................................................................................................

I check the vcf file, and
....................................................................................................................
grep "#CHR" chr_vcf/C2.vcf
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT SRR3203096
.....................................................................................................................
However, I use the old version (v 01 ), it is fine.

@gmcvicker
Copy link
Collaborator

Hi ZhengYaa

I believe that this issue was fixed on the master branch after version 0.2.1. Can you try to checkout the master rather than v0.2.1? (I should make a version 0.2.2 that includes the latest changes).

You might also try adding sample names to your header line if you have more than one sample in the VCF, since it looks like you only have one 'SRR3203096'.

Hope this helps,

Graham

gmcvicker pushed a commit to gmcvicker/WASP that referenced this issue May 23, 2019
update local fork with new WASP changes
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