Skip to content

Commit

Permalink
Merge pull request #227 from genomic-medicine-sweden/226-fix-file-con…
Browse files Browse the repository at this point in the history
…tention-issue

Fix #226: Avoid some warnings from the JVM in picard by turning off performance files
  • Loading branch information
sylvinite authored Nov 30, 2023
2 parents 4a7dda0 + 2050873 commit d1c7c5e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bin/postaln_qc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
my $REF_FA = ( $ARGV[5] or 0 );
my $PAIRED = is_PE( $BAM );

# Needed to avoid a certain warning message messing up JSON output:
# https://github.com/genomic-medicine-sweden/JASEN/issues/226
my $JVM_OPTS = "-XX:-UsePerfData";


if( $BAITS and $REF_FA ) {
print STDERR "Calculating HS-metrics...\n";
Expand All @@ -37,9 +41,9 @@
$DICT =~ s/\.(fa|fasta)$/\.dict/;
die "Could not find dict file for reference fasta" unless ( -s $DICT );
}
system_p( "picard BedToIntervalList -I $BED -O $BED.interval_list -SD $DICT" ) unless -s "$BED.interval_list";
system_p( "picard BedToIntervalList -I $BAITS -O $BAITS.interval_list -SD $DICT" ) unless -s "$BAITS.interval_list";
system_p( "picard CollectHsMetrics -I $BAM -O $BAM.hsmetrics -R $REF_FA -BAIT_INTERVALS $BAITS.interval_list -TARGET_INTERVALS $BED.interval_list" );
system_p( "picard $JVM_OPTS BedToIntervalList -I $BED -O $BED.interval_list -SD $DICT" ) unless -s "$BED.interval_list";
system_p( "picard $JVM_OPTS BedToIntervalList -I $BAITS -O $BAITS.interval_list -SD $DICT" ) unless -s "$BAITS.interval_list";
system_p( "picard $JVM_OPTS CollectHsMetrics -I $BAM -O $BAM.hsmetrics -R $REF_FA -BAIT_INTERVALS $BAITS.interval_list -TARGET_INTERVALS $BED.interval_list" );

open( HS, "$BAM.hsmetrics" );
while( <HS> ) {
Expand All @@ -66,7 +70,7 @@

if( $PAIRED ) {
print STDERR "Collect insert sizes...\n";
system_p( "picard CollectInsertSizeMetrics -I $BAM -O $BAM.inssize -H $BAM.ins.pdf -STOP_AFTER 1000000");
system_p( "picard $JVM_OPTS CollectInsertSizeMetrics -I $BAM -O $BAM.inssize -H $BAM.ins.pdf -STOP_AFTER 1000000");
open( INS, "$BAM.inssize" );
while( <INS> ) {
if( /^\#\# METRICS CLASS/ ) {
Expand Down

0 comments on commit d1c7c5e

Please sign in to comment.