Skip to content

Commit

Permalink
Issue #10 - out by 1 error :-(
Browse files Browse the repository at this point in the history
  • Loading branch information
tseemann committed Mar 3, 2020
1 parent 3e4451f commit 20a3ca7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions samclip
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@ use Getopt::Long;
use File::Basename;
use Data::Dumper;

#----------------------------------------------------------------------
# the sitch
# 1 6 11 16 21 26 30
# contig: NNNNN NNNNN NNNNN NNNNN NNNNN NNNNN
#
# 11,20,+ 10M xxxxx xxxxx
# 11,20,+ 6M4S xxxxx x----
# 11,20,+ 4S6M ----x xxxxx
# 11,20,+ 3S5M2S ---xx xxx--

#----------------------------------------------------------------------
# globals

my $EXE = basename($0);
my $VERSION = "0.2";
my $VERSION = "0.3.0";
my $AUTHOR = 'Torsten Seemann (@torstenseemann)';
my $HOMEPAGE = "https://github.com/tseemann/samclip";

Expand Down Expand Up @@ -114,7 +124,7 @@ while (my $line = <ARGV>) {
my $end = $start + length($sam[SAM_SEQ]) - 1;
my $contiglen = $len->{$sam[SAM_RNAME]} or err("Reference", $sam[SAM_RNAME], "not in '$ref'");
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;
unless ($start == 0 or $end >= $contiglen) {
unless ($start <= 1 or $end >= $contiglen) {
if ($HL+$SL > $max or $HR+$SR > $max) {
$removed++;
next;
Expand Down

0 comments on commit 20a3ca7

Please sign in to comment.