]> git.donarmstrong.com Git - biopieces.git/commitdiff
fixed bug in find_SNPs
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 1 Sep 2011 14:29:29 +0000 (14:29 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 1 Sep 2011 14:29:29 +0000 (14:29 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1511 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/find_SNPs
bp_test/out/find_SNPs.out.1

index 6671144cc3a70066e0a221f66e4a08ff9e638a54..2b40f32d408d55abcea7b436015ec9b5c2ec6e9c 100755 (executable)
@@ -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
index f92cd4f25ecf616dc5066f66d1359084561f68e3..2338ec0b8b1c1c843ca1b979e8b0d376e6ec2846 100644 (file)
@@ -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