Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix yaml parse RG ID bug #69

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/PCAP/Bwa/Meta.pm
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ sub _validate_yaml {
my $yaml_obj = LoadFile( $meta_yaml );
# if all ID's aren't unique we generate time based UUID and take the first section as the new ID
# this will not prevent universal clash but will within a BAM file.
my %ids;
for my $rg_key(keys %{$yaml_obj->{'READGRPS'}}) {
my $rg_rec = $yaml_obj->{'READGRPS'}->{$rg_key};

Expand All @@ -224,10 +223,9 @@ sub _validate_yaml {
$rg_rec->{'PL'} = uc $rg_rec->{'PL'};
}

if(! exists $rg_rec->{'ID'} || exists $ids{$rg_rec->{'ID'}} ) {
if(! exists $rg_rec->{'ID'}) {
$rg_rec->{'ID'} = _getuuid_for_rg();
}
$ids{$rg_rec->{'ID'}} = 1;
}
return $yaml_obj;
}
Expand Down