Skip to content

Commit 20a3ca7

Browse files
committed
Issue #10 - out by 1 error :-(
1 parent 3e4451f commit 20a3ca7

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

samclip

+12-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,21 @@ use Getopt::Long;
66
use File::Basename;
77
use Data::Dumper;
88

9+
#----------------------------------------------------------------------
10+
# the sitch
11+
# 1 6 11 16 21 26 30
12+
# contig: NNNNN NNNNN NNNNN NNNNN NNNNN NNNNN
13+
#
14+
# 11,20,+ 10M xxxxx xxxxx
15+
# 11,20,+ 6M4S xxxxx x----
16+
# 11,20,+ 4S6M ----x xxxxx
17+
# 11,20,+ 3S5M2S ---xx xxx--
18+
919
#----------------------------------------------------------------------
1020
# globals
1121

1222
my $EXE = basename($0);
13-
my $VERSION = "0.2";
23+
my $VERSION = "0.3.0";
1424
my $AUTHOR = 'Torsten Seemann (@torstenseemann)';
1525
my $HOMEPAGE = "https://github.com/tseemann/samclip";
1626

@@ -114,7 +124,7 @@ while (my $line = <ARGV>) {
114124
my $end = $start + length($sam[SAM_SEQ]) - 1;
115125
my $contiglen = $len->{$sam[SAM_RNAME]} or err("Reference", $sam[SAM_RNAME], "not in '$ref'");
116126
msg("CHROM=$sam[SAM_RNAME]:1-$contiglen POS=$start..$end CIGAR=$sam[SAM_CIGAR] HL=$HL SL=$SL SR=$SR HR=$HR max=$max)") if $debug;
117-
unless ($start == 0 or $end >= $contiglen) {
127+
unless ($start <= 1 or $end >= $contiglen) {
118128
if ($HL+$SL > $max or $HR+$SR > $max) {
119129
$removed++;
120130
next;

0 commit comments

Comments
 (0)