Skip to content

Commit

Permalink
skip and log files with no id_run or position metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcam committed May 17, 2019
1 parent 720456a commit bf58970
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bin/npg_add_illumina_composition_metadata.pl
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ sub _create_irods_composition_file {
my $num_skipped = 0;
my $num_mismatches = 0;
my $num_created = 0;
my $num_missing_attrs = 0;
my $report_fh;

if ($report_path) {
Expand Down Expand Up @@ -275,8 +276,11 @@ sub _create_irods_composition_file {
my $subset = q[];
my $subset_mismatch = 0;

($attrs{'id_run'} && $attrs{'position'}) or $logger->logcroak(
"Either id_run or position is not defined for $path");
if (not ($attrs{'id_run'} and $attrs{'position'})) {
$logger->error("Either id_run or position is not defined for $path");
$num_missing_attrs++;
next;
}

$composition = npg_tracking::glossary::composition->new(
components => [
Expand Down Expand Up @@ -359,7 +363,8 @@ sub _create_irods_composition_file {
'Failed to close a file handle to ', $report_path, q[: ], $OS_ERROR);
}

$logger->info("Skipps summary: $num_skipped");
$logger->info("Skips summary: $num_skipped");
$logger->info("Skips due to missing attrs summary: $num_missing_attrs");
$logger->info("Mismatches summary: $num_mismatches");
$logger->info("Updates summary: $num_updated");
$logger->info("Creates summary: $num_created");
Expand Down

0 comments on commit bf58970

Please sign in to comment.