91 list<CConstRef<CSeq_align> > align_list;
97 align_product_idh = canonical;
99 if(feat_idh.
MatchesTo(align_product_idh)) {
103 if(align_list.size() > 1) {
115 const string& annot_name)
118 if(!annot_name.empty()) {
120 if(annot_name ==
"Unnamed") {
140 const string& annot_name,
147 feature::CFeatTree feat_tree;
156 feat_tree.AddFeatures(feat_it);
178 "Unable to get alignment for mRNA.");
188 "Unable to get mRNA sequence.");
191 for(
CFeat_CI prod_feat_it(mrna_bsh, mrna_sel); prod_feat_it; ++prod_feat_it) {
197 "Multiple cdregion features found on mRNA.");
199 prod_cd_feat = *prod_feat_it;
220 *projected_mrna_loc);
233 changes[mrna_eh] = new_mrna_feat;
239 changes[cds_eh] = new_cds_feat;
241 for (
auto mit = changes.
begin(); mit != changes.
end(); mit++) {
242 mit->first.Replace(*mit->second);
ESeqLocExtremes
Used to determine the meaning of a location's Start/Stop positions.
@ eExtreme_Biological
5' and 3'
static void CreateMicroIntrons(objects::CScope &scope, objects::CBioseq_Handle bsh, const string &annot_name="", TSeqRange *range=NULL, bool ignore_errors=false)
static CRef< objects::CSeq_loc > s_ProjectCDS(const objects::CSeq_align &spliced_aln, const objects::CSeq_loc &product_cds_loc, bool convert_overlaps=true)
Similar to s_ProjectRNA(...) Postcondition: seq-vector of the returned loc is of exact same length an...
static CRef< objects::CSeq_loc > s_ProjectRNA(const objects::CSeq_align &spliced_aln, CConstRef< objects::CSeq_loc > product_cds_loc=CConstRef< objects::CSeq_loc >(NULL), size_t unaligned_ends_partialness_thr=kDefaultAllowedUnaligned)
Project RNA, preserving discontinuities in the CDS.
static void x_SetAnnotName(objects::SAnnotSelector &sel, const string &annot_name)
const CSeq_id & GetSeq_id(TDim row) const
Get seq-id (the first one if segments have different ids).
namespace ncbi::objects::
const_iterator begin() const
const_iterator end() const
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
bool MatchesTo(const CSeq_id_Handle &h) const
True if *this matches to h.
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
string AsString(void) const
void SetTruncatedStart(bool val, ESeqLocExtremes ext)
set / remove e_Lim fuzz on start or stop (tl/tr - indicating removed parts of the seq-loc)
bool IsPartialStart(ESeqLocExtremes ext) const
check start or stop of location for e_Lim fuzz
ENa_strand GetStrand(void) const
Get the location's strand.
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
bool IsTruncatedStop(ESeqLocExtremes ext) const
bool IsTruncatedStart(ESeqLocExtremes ext) const
check if parts of the seq-loc are missing
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
void SetPartialStart(bool val, ESeqLocExtremes ext)
set / remove e_Lim fuzz on start or stop (lt/gt - indicating partial interval)
void SetPartialStop(bool val, ESeqLocExtremes ext)
bool IsPartialStop(ESeqLocExtremes ext) const
void SetTruncatedStop(bool val, ESeqLocExtremes ext)
TSeqPos GetStop(ESeqLocExtremes ext) const
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
CBioseq_EditHandle GetEditHandle(const CBioseq_Handle &seq)
Get editable Biosec handle by regular one.
const CSeq_annot_Handle & GetAnnot(void) const
Get handle to seq-annot for this feature.
CConstRef< CSeq_feat > GetOriginalSeq_feat(void) const
virtual CSeq_id_Handle GetProductId(void) const
CSeq_id_Handle GetProductId(void) const
SAnnotSelector & SetResolveAll(void)
SetResolveAll() is equivalent to SetResolveMethod(eResolve_All).
const CSeq_loc & GetLocation(void) const
SAnnotSelector & ResetAnnotsNames(void)
Select annotations from all Seq-annots.
SAnnotSelector & SetAdaptiveDepth(bool value=true)
SetAdaptiveDepth() requests to restrict subsegment resolution depending on annotations found on lower...
SAnnotSelector & IncludeNamedAnnotAccession(const string &acc, int zoom_level=0)
SAnnotSelector & IncludeFeatType(TFeatType type)
Include feature type in the search.
SAnnotSelector & AddNamedAnnots(const CAnnotName &name)
Add named annot to set of annots names to look for.
SAnnotSelector & ExcludeUnnamedAnnots(void)
Add unnamed annots to set of annots names to exclude.
SAnnotSelector & AddUnnamedAnnots(void)
Add unnamed annots to set of annots names to look for.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
void SetLocation(TLocation &value)
Assign a value to Location data member.
const TLocation & GetLocation(void) const
Get the Location member data.
static void InheritPartialness(const CSeq_loc &src, CSeq_loc &dest)
CConstRef< CSeq_align > GetAlignmentForRna(const CMappedFeat &a_feat, CScope &a_scope, bool ignore_errors)
range(_Ty, _Ty) -> range< _Ty >