Skip to content

Commit ddd2f6f

Browse files
Jonathan Kansgouriano
Jonathan Kans
authored andcommitted
JIRA:RW-2494 Use sequence length instead of RNA feature length in WGS cleanup -thanks to Justin for catching it
git-svn-id: https://anonsvn.ncbi.nlm.nih.gov/repos/v1/trunk/c++@104470 78c7ea69-d796-4a43-9a09-de51944f1b03
1 parent 3cde700 commit ddd2f6f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/objtools/cleanup/cleanup.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2821,21 +2821,22 @@ bool CCleanup::WGSCleanup(CSeq_entry_Handle entry, bool instantiate_missing_prot
28212821
new_rrna->Assign(*(rna_it->GetSeq_feat()));
28222822

28232823
const CSeq_loc& loc = rna_feat.GetLocation();
2824-
if (loc.IsSetStrand() && loc.GetStrand() == eNa_strand_minus) {
2825-
if (loc.GetStart(eExtreme_Biological) >= sequence::GetLength(rna_feat.GetLocation(), &entry.GetScope())) {
2824+
CBioseq_Handle r = entry.GetScope().GetBioseqHandle(loc);
2825+
if (r && loc.IsSetStrand() && loc.GetStrand() == eNa_strand_minus) {
2826+
if (loc.GetStart(eExtreme_Biological) >= r.GetBioseqLength()) {
28262827
new_rrna->SetLocation().SetPartialStart(true, eExtreme_Biological);
28272828
change_this_rrna = true;
28282829
}
28292830
if (loc.GetStop(eExtreme_Biological) < 1) {
28302831
new_rrna->SetLocation().SetPartialStop(true, eExtreme_Biological);
28312832
change_this_rrna = true;
28322833
}
2833-
} else {
2834+
} else if (r) {
28342835
if (loc.GetStart(eExtreme_Biological) < 1) {
28352836
new_rrna->SetLocation().SetPartialStart(true, eExtreme_Biological);
28362837
change_this_rrna = true;
28372838
}
2838-
if (loc.GetStop(eExtreme_Biological) >= sequence::GetLength(rna_feat.GetLocation(), &entry.GetScope())) {
2839+
if (loc.GetStop(eExtreme_Biological) >= r.GetBioseqLength()) {
28392840
new_rrna->SetLocation().SetPartialStop(true, eExtreme_Biological);
28402841
change_this_rrna = true;
28412842
}
@@ -2846,7 +2847,7 @@ bool CCleanup::WGSCleanup(CSeq_entry_Handle entry, bool instantiate_missing_prot
28462847
rrna_h.Replace(*new_rrna);
28472848
any_changes = true;
28482849
}
2849-
}
2850+
}
28502851
}
28512852

28522853
for (CFeat_CI gene_it(entry, SAnnotSelector(CSeqFeatData::e_Gene)); gene_it; ++gene_it) {

0 commit comments

Comments
 (0)