From addbac0f68ab8f8c0953c30d6a69d335723eebe7 Mon Sep 17 00:00:00 2001 From: Tiago Grego Date: Fri, 6 Oct 2023 10:08:48 +0100 Subject: [PATCH] allow issues with soure data, process descriptions properly --- .../support-mini-x86-32/bin/pirsr/0.1/PIRSR.pm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/jms-implementation/support-mini-x86-32/bin/pirsr/0.1/PIRSR.pm b/core/jms-implementation/support-mini-x86-32/bin/pirsr/0.1/PIRSR.pm index 3bfc656054..9c15e6ad79 100644 --- a/core/jms-implementation/support-mini-x86-32/bin/pirsr/0.1/PIRSR.pm +++ b/core/jms-implementation/support-mini-x86-32/bin/pirsr/0.1/PIRSR.pm @@ -123,7 +123,7 @@ sub process_templates { } else { - die "Failed to parse fasta block: \"$block\"\n"; + warn ("Failed to parse fasta block: \"$block\"\n"); } } @@ -263,7 +263,9 @@ sub _parse_rules { $group->{'label'} = $1; $group->{'start'} = $2; $group->{'end'} = $3; - $group->{'desc'} = $5; + my $desc = $5 // ''; + $desc =~ s/^\s+|\s+$//g; + $group->{'desc'} = $desc; } elsif ($line =~ /\AFT\s+Group\:\s+(\d+)\;\s+Condition\:\s+(.*)\z/) { @@ -274,7 +276,9 @@ sub _parse_rules { } elsif ($line =~ /\AFT\s+(.*)\z/) { - $group->{'desc'} .= " $1"; + my $desc = $1 // ''; + $desc =~ s/^\s+|\s+$//g; + $group->{'desc'} .= " $desc"; } else { die "Failed to parse Group line: \"$line\"\n"; @@ -307,6 +311,12 @@ sub align_template { my $prot_id = $rule->{'Feature'}->{'from'}; + if (!$prot_id) { + warn ("No from template available for rule $rule->{AC}.") if ($self->verbose); + $rule->{'ignore'} = 1; + return $rule; + } + my $fasta_file = "$self->{data_folder}/sr_tp/${prot_id}.fa"; open (my $in, '<', "$fasta_file") or die "Failed top open $fasta_file file: $!\n";