@@ -2821,21 +2821,22 @@ bool CCleanup::WGSCleanup(CSeq_entry_Handle entry, bool instantiate_missing_prot
2821
2821
new_rrna->Assign (*(rna_it->GetSeq_feat ()));
2822
2822
2823
2823
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 ()) {
2826
2827
new_rrna->SetLocation ().SetPartialStart (true , eExtreme_Biological);
2827
2828
change_this_rrna = true ;
2828
2829
}
2829
2830
if (loc.GetStop (eExtreme_Biological) < 1 ) {
2830
2831
new_rrna->SetLocation ().SetPartialStop (true , eExtreme_Biological);
2831
2832
change_this_rrna = true ;
2832
2833
}
2833
- } else {
2834
+ } else if (r) {
2834
2835
if (loc.GetStart (eExtreme_Biological) < 1 ) {
2835
2836
new_rrna->SetLocation ().SetPartialStart (true , eExtreme_Biological);
2836
2837
change_this_rrna = true ;
2837
2838
}
2838
- if (loc.GetStop (eExtreme_Biological) >= sequence::GetLength (rna_feat. GetLocation (), &entry. GetScope () )) {
2839
+ if (loc.GetStop (eExtreme_Biological) >= r. GetBioseqLength ( )) {
2839
2840
new_rrna->SetLocation ().SetPartialStop (true , eExtreme_Biological);
2840
2841
change_this_rrna = true ;
2841
2842
}
@@ -2846,7 +2847,7 @@ bool CCleanup::WGSCleanup(CSeq_entry_Handle entry, bool instantiate_missing_prot
2846
2847
rrna_h.Replace (*new_rrna);
2847
2848
any_changes = true ;
2848
2849
}
2849
- }
2850
+ }
2850
2851
}
2851
2852
2852
2853
for (CFeat_CI gene_it (entry, SAnnotSelector (CSeqFeatData::e_Gene)); gene_it; ++gene_it) {
0 commit comments