Skip to content

Commit

Permalink
Hidden side effects, this is least disruptive
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranmraine committed Jun 26, 2020
1 parent 31886fb commit 7d47fb0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions perl/bin/brassI_prep_bam.pl
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,12 @@ sub process_header {
next;
}

chomp $row;

# process the @RG line
# order of lines in header MUST NOT CHANGE IN ANY WAY
$count_in_bam++;
my $rg_id = 0;
$rg_id = $1 if($row =~ /\tID:([^\t]+)/);
chomp $rg_id;

# die horribly if RG ids don't match
unless (defined $bas_ob->get($rg_id, 'readgroup')) { die "Readgroup $rg_id in bam file but not in bas file $!"; }
Expand Down Expand Up @@ -181,7 +180,7 @@ sub process_header {
$row =~ s/(\tID:)([^\t]+)/${1}${p}${2}/;
}

$new_header .= $row."\n";
$new_header .= $row;
}

# die horribly if number of RGs in bas and bam don't match
Expand Down

0 comments on commit 7d47fb0

Please sign in to comment.