#parse remarks to check syntax for location of edits
while(my($attrib,$remarks)=each%$remarks){
foreachmy$text(@{$remarks}){
if(($attribeq'remark')&&($text=~/^$alabel(.*)/)){
#$support->log_warning("seleno remark for $tsi stored as Annotation_remark not hidden remark) [$mod_date]\n");
$log_object->_save_log('log_warning','',$gsi,'',$tsi,'VQCT_wrong_selC_coord',"seleno remark for $tsi stored as Annotation_remark not hidden remark) [$mod_date]");
$annot_stops=$1;
}
elsif($text=~/^$alabel2(.*)/){
$annot_stops=$1;
}
}
foreachmy$text(@{$remarks}){
if(($attribeq'remark')&&($text=~/^$alabel(.*)/)){
#$support->log_warning("seleno remark for $tsi stored as Annotation_remark not hidden remark) [$mod_date]\n");
$log_object->_save_log('log_warning','',$gsi,'',$tsi,'VQCT_wrong_selC_coord',"seleno remark for $tsi stored as Annotation_remark not hidden remark) [$mod_date]");
$annot_stops=$1;
}
elsif($text=~/^$alabel2(.*)/){
$annot_stops=$1;
}
}
}
#check the location of the annotated edits matches actual stops in the sequence
#$support->log_warning("DNA: Annotated stop for transcript tsi ($tname) is in DNA not peptide coordinates) [$mod_date]\n");
$log_object->_save_log('log_warning','',$gsi,'DNA',$tsi,'VQCT_wrong_selC_coord',"DNA: Annotated stop for transcript tsi ($tname) is in DNA not peptide coordinates) [$mod_date]");
#$support->log_warning("PEPTIDE: Annotated stop for transcript $tsi ($tname) is out by one) [$mod_date]\n");
$log_object->_save_log('log_warning','',$gsi,'PEPTIDE',$tsi,'VQCT_wrong_selC_coord',"PEPTIDE: Annotated stop for transcript $tsi ($tname) is out by one) [$mod_date]");
}
elsif($defined_offset){
#$support->log_warning("Annotated stop for transcript $tsi ($tname) does not match a TGA codon) [$mod_date]\n");
$log_object->_save_log('log_warning','',$gsi,'TRANSCRIPT',$tsi,'VQCT_wrong_selC_coord',"Annotated stop for transcript $tsi ($tname) does not match a TGA codon) [$mod_date]");
$log_object->_save_log('log_warning','',$gene->stable_id,'DNA',$tsi,'VQCT_wrong_selC_coord',"DNA: Annotated stop for transcript tsi ($tname) is in DNA not peptide coordinates) [$mod_date]");
$log_object->_save_log('log_warning','',$gene->stable_id,'PEPTIDE',$tsi,'VQCT_wrong_selC_coord',"PEPTIDE: Annotated stop for transcript $tsi ($tname) is out by one) [$mod_date]");
}
elsif(defined($offset)&&($offset=~/^\d+$/)){
$log_object->_save_log('log_warning','',$gene->stable_id,'TRANSCRIPT',$tsi,'VQCT_wrong_selC_coord',"Annotated stop for transcript $tsi ($tname) does not match a TGA codon) [$mod_date]");
push@annotated_stops,$offset;
}
$i++;
}
}
#check location of found stops matches annotated ones - any new ones are reported
#$support->log_verbose("Transcript $tsi ($tname) has potential selenocysteines but has been discounted by annotators:\n".$seen_transcripts->{$tsi}.") [$mod_date]\n");
$log_object->_save_log('log_verbose','',$gsi,'',$tsi,'VQCT_pot_selC',"Transcript $tsi ($tname) has potential selenocysteines but has been discounted by annotators: ".$seen_transcripts->{$tsi}.") [$mod_date]");
}
else{
#$support->log("POTENTIAL SELENO ($seq) in $tsi ($tname, gene $gname) found at $pos [$mod_date]\n");
$log_object->_save_log('log','',$gsi,'',$tsi,'VQCT_pot_selC',"POTENTIAL SELENO ($seq) in $tsi ($tname, gene $gname) found at $pos [$mod_date]");
}
}
my$pos=$stop->[1];
my$seq=$stop->[0];
unless(grep{$pos==$_}@annotated_stops){
if($seen_transcripts->{$tsi}){
#$support->log_verbose("Transcript $tsi ($tname) has potential selenocysteines but has been discounted by annotators:\n\t".$seen_transcripts->{$tsi}.") [$mod_date]\n");
$log_object->_save_log('log_verbose','',$gene->stable_id,'',$tsi,'VQCT_pot_selC',"Transcript $tsi ($tname) has potential selenocysteines but has been discounted by annotators: ".$seen_transcripts->{$tsi}.") [$mod_date]");
}
else{
#$support->log("POTENTIAL SELENO ($seq) in $tsi ($tname, gene $gname) found at $pos [$mod_date]\n");
$log_object->_save_log('log','',$gene->stable_id,'',$tsi,'VQCT_pot_selC',"POTENTIAL SELENO ($seq) in $tsi ($tname, gene $gname) found at $pos [$mod_date]");