129 string locationId(
"unknown");
140 auto ids = bsh.
GetId();
142 auto id = ids.front();
148 string seqStart =
"1";
152 locationId += seqStart;
154 locationId += seqStop;
182 id += rnaId.substr(4) +
suffix;
196 const string commonPrefix(
"gene-");
201 return (commonPrefix + stem);
214 const string commonPrefix(
"rna-");
218 if (!farAccession.empty()) {
219 return (commonPrefix + farAccession);
223 auto origTranscriptId = mf.
GetNamedQual(
"orig_transcript_id");
224 if (!origTranscriptId.empty()) {
225 return (commonPrefix + origTranscriptId);
239 return (commonPrefix + stem);
252 const string commonPrefix(
"cds-");
256 if (!farAccession.empty()) {
257 return (commonPrefix + farAccession);
261 auto origTranscriptId = mf.
GetNamedQual(
"orig_protein_id");
262 if (!origTranscriptId.empty()) {
263 return (commonPrefix + origTranscriptId);
270 return (commonPrefix + stem);
283 const string commonPrefix(
"id-");
289 rawId = commonPrefix + stem;
300 if (!exonNumber.empty()) {
301 rawId +=
string(
"-") + exonNumber;
314 for (
const auto& ref: dbxrefs) {
315 if (ref->GetDb() ==
"GeneID") {
318 ref->GetTag().AsString(ostr);
341 const auto& geneRef = gene.GetData().GetGene();
342 if (geneRef.IsSetLocus_tag()) {
343 return geneRef.GetLocus_tag();
345 if (geneRef.IsSetLocus()) {
346 return geneRef.GetLocus();
359 locationId =
"unknown";
363 auto bsh =
fc.BioseqHandle();
364 if (bsh && bsh.CanGetInst_Length()) {
368 locationId +=
":whole";
374 locationId += inPoint;
376 locationId += outPoint;
386 if (!productIdHandle) {
394 return bestIdHandle.GetSeqId()->GetSeqIdString(
true);
399 const string& baseId)
410 return disambiguated;
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
static CGenbankIdResolve & Get()
bool GetBestId(CSeq_id_Handle, CScope &, string &)
std::string xGetGenericSuffix(const CMappedFeat &, CGffFeatureContext &)
std::string xDisambiguate(const std::string &)
std::string xGetGenericId(const CMappedFeat &, CGffFeatureContext &)
std::string xGetIdForGene(const CMappedFeat &, CGffFeatureContext &)
std::string xExtractFeatureLocation(const CMappedFeat &, CGffFeatureContext &)
std::string GetGffSourceId(CBioseq_Handle)
std::map< std::string, int > mLastUsedExonIds
std::set< std::string > mExistingIds
std::string xExtractGeneLocusTagOrLocus(const CMappedFeat &)
std::string xGetIdForRna(const CMappedFeat &, CGffFeatureContext &)
std::string xExtractFarAccession(const CMappedFeat &)
unsigned int mLastTrulyGenericSuffix
std::string xGetIdForCds(const CMappedFeat &, CGffFeatureContext &)
std::string GetNextGffExonId(const std::string &)
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
CMappedFeat GetBestGeneForMrna(const CMappedFeat &mrna_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0, CFeatTree::EBestGeneType lookup_type=CFeatTree::eBestGene_TreeOnly)
CMappedFeat GetBestGeneForCds(const CMappedFeat &cds_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0, CFeatTree::EBestGeneType lookup_type=CFeatTree::eBestGene_TreeOnly)
CMappedFeat GetBestGeneForFeat(const CMappedFeat &feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0, CFeatTree::EBestGeneType lookup_type=CFeatTree::eBestGene_TreeOnly)
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,...
@ eGetId_ForceAcc
return only an accession based seq-id
const string & GetNamedQual(const CTempString &qual_name) const
Return a named qualifier.
TSeqPos GetBioseqLength(void) const
CConstRef< CSeq_id > GetNonLocalIdOrNull(void) const
Find a non-local ID if present, consulting assembly details if all IDs for the overall sequence are l...
CScope & GetScope(void) const
Get scope this handle belongs to.
CScope & GetScope(void) const
Get scope this handle belongs to.
const CSeq_feat::TDbxref & GetDbxref(void) const
CSeqFeatData::ESubtype GetFeatSubtype(void) const
CSeqFeatData::E_Choice GetFeatType(void) const
const TId & GetId(void) const
TRange GetLocationTotalRange(void) const
CSeq_id_Handle GetProductId(void) const
const CSeq_loc & GetLocation(void) const
#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.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
E_Choice Which(void) const
Which variant is currently selected.
constexpr bool empty(list< Ts... >) noexcept
static const char * suffix[]
CConstRef< CSeq_id > GetBestId(const CBioseq &bioseq)