From: martinahansen Date: Thu, 1 Sep 2011 14:29:29 +0000 (+0000) Subject: fixed bug in find_SNPs X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b0bc22d4936b121c63a1abb5a9e2c02912cee700;p=biopieces.git fixed bug in find_SNPs git-svn-id: http://biopieces.googlecode.com/svn/trunk@1511 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/bp_bin/find_SNPs b/bp_bin/find_SNPs index 6671144..2b40f32 100755 --- a/bp_bin/find_SNPs +++ b/bp_bin/find_SNPs @@ -48,9 +48,9 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output| record[:ALIGN].split(',').each do |snp| pos, event = snp.split(':') - pos += record[:S_BEG] + pos = pos.to_i + record[:S_BEG].to_i - snp_hash[record[:S_ID].to_sym][pos.to_sym][event.to_sym] += 1 + snp_hash[record[:S_ID].to_sym][pos][event.to_sym] += 1 end end end diff --git a/bp_test/out/find_SNPs.out.1 b/bp_test/out/find_SNPs.out.1 index f92cd4f..2338ec0 100644 --- a/bp_test/out/find_SNPs.out.1 +++ b/bp_test/out/find_SNPs.out.1 @@ -60,21 +60,21 @@ CIGAR: 61M1D39M --- REC_TYPE: SNP S_ID: gi|48994873|gb|U00096.2| -POS: 632937 +POS: 3000 EVENT: ->A SNP_COUNT: 1 TYPE: INSERTION --- REC_TYPE: SNP S_ID: gi|48994873|gb|U00096.2| -POS: 8993 +POS: 1001 EVENT: G>C SNP_COUNT: 2 TYPE: MISMATCH --- REC_TYPE: SNP S_ID: gi|48994873|gb|U00096.2| -POS: 615440 +POS: 5501 EVENT: G>- SNP_COUNT: 3 TYPE: DELETION