pProduct->
SetId(*pId);
91 if(
prot.IsSetName() &&
prot.GetName().size() > 0) {
92productName =
prot.GetName().front();
103 if(
prot.IsSetName() &&
prot.GetName().size() > 0) {
104productName =
prot.GetName().front();
116 const string& locusTagPrefix,
117 unsigned intlocusTagNumber,
118 unsigned intstartingFeatId,
123mpMessageListener(pMessageListener),
124mLocusTagPrefix(locusTagPrefix),
125mLocusTagNumber(locusTagNumber),
126mNextFeatId(startingFeatId)
139 unsigned intsequenceSize,
140 const string& locusTagPrefix,
141 unsigned intlocusTagNumber,
142 unsigned intstartingFeatId,
146mSequenceSize(sequenceSize),
147mpMessageListener(pMessageListener),
148mLocusTagPrefix(locusTagPrefix),
149mLocusTagNumber(locusTagNumber),
150mNextFeatId(startingFeatId)
197 if(pOverlappingRna) {
209pRna->
SetData().SetRna().SetExt().SetName(
214pRna->
SetId().SetLocal().SetStr(rnaId);
224pRnaXref->SetId(*pFeatId);
225pRna->
SetXref().push_back(pRnaXref);
237pRnaXref->SetId(*pGeneId);
238pRna->
SetXref().push_back(pRnaXref);
271 boolinfered(
false);
272edit::CLocationEditPolicy editPolicy(
273edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd,
274edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd,
277edit::CLocationEditPolicy::eMergePolicy_NoChange);
285pEditedCds->
Assign(cds);
286infered = editPolicy.ApplyPolicyToFeature(*pEditedCds, *
mpScope);
314geneEh.
Replace(*pEditedGene);
336 if(!product.empty()) {
341feh.
Replace(*pEditedFeature);
351vector<string> specialQuals{
352 "Protein",
"protein",
353 "go_function",
"go_component",
"go_process"};
359(it)->GetOriginalFeature()));
360 constQUALS& quals = (*it).GetQual();
361vector<string> badQuals;
362 for(QUALS::const_iterator qual = quals.begin(); qual != quals.end();
364 stringqualKey = (*qual)->GetQual();
365 if(std::find(specialQuals.begin(), specialQuals.end(), qualKey)
366!= specialQuals.end()) {
371 if(qualKey ==
"protein_id"|| qualKey ==
"transcript_id") {
374 if(qualKey ==
"orig_protein_id"|| qualKey ==
"orig_transcript_id") {
380badQuals.push_back(qualKey);
387badQuals.push_back(qualKey);
389 for(vector<string>::const_iterator badIt = badQuals.begin();
390badIt != badQuals.end(); ++badIt) {
401{
'A', list<char>({
'A'})},
402{
'G', list<char>({
'G'})},
403{
'C', list<char>({
'C'})},
404{
'T', list<char>({
'T'})},
405{
'U', list<char>({
'U'})},
406{
'M', list<char>({
'A',
'C'})},
407{
'R', list<char>({
'A',
'G'})},
408{
'W', list<char>({
'A',
'T'})},
409{
'S', list<char>({
'C',
'G'})},
410{
'Y', list<char>({
'C',
'T'})},
411{
'K', list<char>({
'G',
'T'})},
412{
'V', list<char>({
'A',
'C',
'G'})},
413{
'H', list<char>({
'A',
'C',
'T'})},
414{
'D', list<char>({
'A',
'G',
'T'})},
415{
'B', list<char>({
'C',
'G',
'T'})},
416{
'N', list<char>({
'A',
'C',
'G',
'T'})}
424 autocodonRecognized = mf.
GetNamedQual(
"codon_recognized");
425 if(codonRecognized.empty()) {
428 if(codonRecognized.size() != 3) {
437pEditedFeat->
Assign(origFeat);
442 for(
charchar1 : sIUPACmap.at(codonRecognized[0])) {
443 for(
charchar2 : sIUPACmap.at(codonRecognized[1])) {
444 for(
charchar3 : sIUPACmap.at(codonRecognized[2])) {
446 codons.insert(codonIndex);
456 for(
const autocodonIndex :
codons) {
457extTrna.SetCodon().push_back(codonIndex);
505 stringtranscript_id = mrna.
GetNamedQual(
"transcript_id");
510 returntranscript_id;
531 if(noProteinIdQual) {
542 stringtranscriptId = cds.
GetNamedQual(
"transcript_id");
543 const boolnoTranscriptIdQual =
NStr::IsBlank(transcriptId);
544 if(noTranscriptIdQual && mrna) {
548 const boolisGenbankTranscript =
s_IsGenbankId(transcriptId);
555 if(noProteinIdQual) {
561 if(noTranscriptIdQual) {
574 if(hasProteinId && hasTranscriptId) {
575 if(!isGenbankProtein && (transcriptId == proteinId)) {
576proteinId =
"cds."+ proteinId;
580 if(hasProteinId && !isGenbankProtein) {
581transcriptId =
"mrna."+ proteinId;
582hasTranscriptId =
true;
584 else if(hasTranscriptId && !isGenbankTranscript) {
585proteinId =
"cds."+ transcriptId;
586hasProteinId =
true;
590 if(!hasTranscriptId && mrna) {
610 const string& cds_transcript_id,
611 const string& cds_protein_id,
619 booluse_local_ids =
false;
621 stringtranscript_id = mrna.
GetNamedQual(
"transcript_id");
623transcript_id = cds_transcript_id;
626use_local_ids =
true;
629 stringprotein_id = mrna.
GetNamedQual(
"protein_id");
631protein_id = cds_protein_id;
634 if((protein_id == transcript_id) && !
NStr::StartsWith(protein_id,
"gb|")) {
635protein_id =
"cds."+ protein_id;
637use_local_ids =
true;
645 if(transcript_id != cds_transcript_id) {
649 if(protein_id != cds_protein_id) {
669 stringtranscriptId = mrna.
GetNamedQual(
"transcript_id");
671 if(noTranscriptIdQual) {
674 const boolisGenbankTranscript =
s_IsGenbankId(transcriptId);
681 if(noTranscriptIdQual) {
689 if((transcriptId == proteinId) &&
690!isGenbankTranscript) {
691proteinId =
"cds."+ proteinId;
696transcriptId =
"mrna."+ proteinId;
698 else if(!isGenbankTranscript && !
NStr::IsBlank(transcriptId)) {
699proteinId =
"cds."+ transcriptId;
720 string& transcript_id,
726 stringlocus_tag_prefix;
727 if(update_protein_id || update_transcript_id) {
730 if(update_protein_id) {
731protein_id =
"gnl|"+ locus_tag_prefix +
"|"+ protein_id;
734 if(update_transcript_id) {
735transcript_id =
"gnl|"+ locus_tag_prefix +
"|"+ transcript_id;
742 if(update_protein_id) {
743protein_id =
"gnl|"+ seq_label +
"|"+ protein_id;
746 if(update_transcript_id) {
747transcript_id =
"gnl|"+ seq_label +
"|"+ transcript_id;
857geneEH.
Replace(*pEditedGene);
868 if(sequenceSize == 0) {
877pGene->
SetId().SetLocal().SetStr(geneId);
885pGeneXref->SetId(*pFeatId);
886pGene->
SetXref().push_back(pGeneXref);
905 if(!orig_tid.empty()) {
942 if(!orig_pid.empty()) {
959 if(!
id.
empty()) {
968 automRnaTid = parent.
GetNamedQual(
"transcript_id");
969 if(tid == mRnaTid) {
970tid =
string(
"cds.") + tid;
1028 autoorig_tid = mf.
GetNamedQual(
"orig_transcript_id");
1029 if(!orig_tid.empty()) {
1050 if(!
id.
empty()) {
1075 autoorig_tid = mf.
GetNamedQual(
"orig_transcript_id");
1076 if(!orig_tid.empty()) {
1138 const string& rawId)
1142 if(string::npos != rawId.find(
"|")) {
1145 " does not have a usable transcript_ or protein_id.");
1151 if(locusTagPrefix.empty()) {
1153 "Cannot generate transcript_/protein_id for feature "+
xGetIdStr(mf) +
1154 " without a locus tag.");
1159 if(!rawId.empty()) {
1160 return string(
"gnl|") + locusTagPrefix +
"|"+ rawId;
1167 if(
id.
empty()) {
1170 if(
id.
empty()) {
1175 if(!
id.
empty()) {
1176 return string(
"gnl|") + locusTagPrefix +
"|mrna."+ id;
1183 if(
id.
empty()) {
1186 if(!
id.
empty()) {
1187 return string(
"gnl|") + locusTagPrefix +
"|cds."+ id;
1198 "Cannot generate transcript_/protein_id for feature "+
xGetIdStr(mf) +
1199 " - insufficient context.");
1257feh.
AddQualifier(
"orig_transcript_id", transcriptId);
1275 stringtranscriptId =
rna.GetNamedQual(
"transcript_id");
1276feh.
AddQualifier(
"orig_transcript_id", transcriptId);
1277 stringproteinId =
rna.GetNamedQual(
"protein_id");
1304 stringtranscriptId = mf.
GetNamedQual(
"transcript_id");
1305 if(transcriptId.empty()) {
1309 if(proteinId.empty()) {
1315 stringtranscriptId = mf.
GetNamedQual(
"transcript_id");
1316 if(transcriptId.empty()) {
1339 for(; itGenes; ++itGenes) {
1358vector<CSeq_id_Handle> annotIds;
1362 for(; itGenes; ++itGenes) {
1365vector<CSeq_id_Handle>::const_iterator compIt;
1366 for(compIt = annotIds.begin();
1367compIt != annotIds.end();
1369 if(*compIt == idh) {
1373 if(compIt == annotIds.end()) {
1374annotIds.push_back(idh);
1379 for(vector<CSeq_id_Handle>::const_iterator idIt = annotIds.begin();
1380idIt != annotIds.end();
1389 for(; itGenes; ++itGenes) {
1413 for(; itOther; ++itOther) {
1415(itOther)->GetOriginalFeature()));
1446 if(
autoparent =
mTree.GetParent(*it); parent) {
1447 autosubtype = parent.GetOriginalFeature().GetData().GetSubtype();
1485 const string& qualKey,
1486 const string& qualVal)
1498 const string& qualKey)
1509 const string& qualKey,
1510 const string& qualVal)
1514 if(!existing.empty()) {
1523 const string& proteinIdStr)
1532pEditedFeat->
Assign(origFeat);
1533pEditedFeat->
SetProduct().SetWhole(*pProteinId);
1542 const intWIDTH = 6;
1545 if(suffix.size() < WIDTH) {
1546suffix =
padding.substr(0, WIDTH - suffix.size()) + suffix;
1548 stringnextTag(
"auto");
1549 returnnextTag + suffix;
1556 const intWIDTH = 6;
1559 if(suffix.size() < WIDTH) {
1560suffix =
padding.substr(0, WIDTH - suffix.size()) + suffix;
1571 const stringdbPrefix(
"gnl|");
1592 if(locusTag.empty() &&
1598 stringprefix, suffix;
1611 const stringdbPrefix(
"gnl|");
1631 if(locusTag.empty() &&
1638 stringprefix, suffix;
1644 returntranscriptId;
1657 auto& baseId = *baseLoc.
GetId();
1659 if(sequenceSize == 0 || baseStart <= baseStop) {
1661pEnvelope->
SetId(baseId);
1662pEnvelope->
SetInt().SetFrom(baseStart);
1663pEnvelope->
SetInt().SetTo(baseStop);
1669pTop->
SetId().Assign(baseId);
1671pTop->
SetTo(sequenceSize-1);
1675pBottom->
SetId().Assign(baseId);
1677pBottom->
SetTo(baseStop);
1684pBottom->
SetId().Assign(baseId);
1686pBottom->
SetTo(baseStop);
1690pTop->
SetId().Assign(baseId);
1692pTop->
SetTo(sequenceSize-1);
1727 const string& message)
1756 stringmessage = subName +
" feature is missing locus tag.";
1777 stringmessage = subName +
" feature is missing transcript ID.";
1784 const stringcodonRecognized)
1790 stringmessage =
"tRNA with bad codon recognized attribute \""+
1791codonRecognized +
"\".";
1812 stringmessage = subName +
" feature is missing protein ID.";
1830 xPutError(
"Protein ID on mRNA feature differs from protein ID on child CDS.");
1846 xPutError(
"Transcript ID on mRNA feature differs from transcript ID on child CDS.");
1856stringstream strstr;
1857 auto&
id= mf.
GetId();
1858 switch(
id.Which()) {
1860 return "\"UNKNOWN ID\"";
1862 id.GetLocal().AsString(strstr);
1863 returnstrstr.str();
1884 if(geneRef.IsSetLocus_tag()) {
1886 stringprefix, suffix;
1890 autolocusTagFromQualifier = geneFeature.
GetNamedQual(
"locus_tag");
1891 if(!locusTagFromQualifier.empty()) {
1892 stringprefix, suffix;
1902 if(feature.
Empty())
1923 autoappend_nonduplicated_item = [](list<string>& current_list,
1924 constlist<string>& other_list)
1926unordered_set<string> current_set;
1927 for(
const auto& item : current_list) {
1928current_set.insert(item);
1931 for(
const auto& item : other_list) {
1932 if(current_set.find(item) == current_set.end()) {
1933current_list.push_back(item);
1939append_nonduplicated_item(current_ref.
SetName(),
1948append_nonduplicated_item(current_ref.
SetEc(),
1949other_ref.
GetEc());
1953append_nonduplicated_item(current_ref.
SetActivity(),
1958 for(
const auto& pDBtag : other_ref.
GetDb()) {
1959current_ref.
SetDb().push_back(pDBtag);
1982 const string& product_name = cds.
GetNamedQual(
"product");
1984prot_ref.
SetName().push_back(product_name);
1988 if(pMrna.
Empty()) {
1993 for(
auto& prot_name : prot_ref.
SetName()) {
2011feature.
SetId().SetLocal().SetId(
id++);
2020 if(feat.NotEmpty() && feat->IsSetData() && feat->GetData().IsCdregion())
2043 boolwas_extended =
false;
2044 if(replacement.
Empty())
2050 if(protein.
Empty())
2060protein_entry->
SetSeq(*protein);
2080 if(protein->
GetId().empty())
2082 const string* protein_ids = 0;
2084qual_to_remove =
"protein_id";
2085protein_ids = &cd_feature.
GetNamedQual(qual_to_remove);
2087 if(protein_ids->empty())
2089qual_to_remove =
"orig_protein_id";
2090protein_ids = &cd_feature.
GetNamedQual(qual_to_remove);
2093 if(protein_ids->empty())
2099 if(protein_ids->empty())
2101protein_ids = &cd_feature.
GetNamedQual(
"product_id");
2104 if(!protein_ids->empty())
2109MergeSeqIds(*protein, new_ids);
2118 if(protein->
GetId().empty())
2120 if(base_name.empty() && !bioseq.GetId().empty())
2125newid = GetNewProteinId(*m_scope, base_name);
2126protein->
SetId().push_back(newid);
2132 CSeq_feat& prot_feat = CreateOrSetFTable(*protein);
2142prot_ref.
SetName().push_back(
"hypothetical protein");
2144cd_feature.
SetProtXref().SetName().push_back(
"hypothetical protein");
2152prot_feat.
SetLocation().SetInt().SetId().Assign(*GetAccessionId(protein->
GetId()));
2156cd_feature.
SetProduct().SetWhole().Assign(*GetAccessionId(protein->
GetId()));
2162cd_feature.
SetXref().clear();
2181 auto& ext = mrna_feature.
SetData().SetRna().SetExt();
2183(ext.IsName() && ext.SetName().empty()))
2184ext.SetName() = prot_ref.
GetName().front();
2208 returnprotein_entry;
2217 if(objectId.
IsStr()) {
2218 returnobjectId.
GetStr();
2232 for(
autopThisFeat: thisFeatures) {
2234 if(!pThisFeat->IsSetId() || !pThisFeat->GetId().IsLocal()) {
2237 const auto& this_oid = pThisFeat->GetId().GetLocal();
2240 for(
autopOtherFeat: otherFeatures) {
2241 if(!pOtherFeat->IsSetId() || !pOtherFeat->GetId().IsLocal()) {
2242thisFeatures.push_back(pOtherFeat);
2245 const auto& other_oid = pOtherFeat->GetId().GetLocal();
2247thisFeatures.push_back(pOtherFeat);
2251thisFeatures.push_back(pOtherFeat);
2264 if(lhs.
IsStr()) {
2277 stringoldFeatIdAsStr;
2278 if(oldFeatId.
IsStr()) {
2279oldFeatIdAsStr = oldFeatId.
GetStr();
2285 stringnewFeatIdAsStr = oldFeatIdAsStr +
"x";
2287pNewFeatId->
SetStr(oldFeatIdAsStr +
"x");
2289pNewFeatId->
SetStr() +=
"x";
2293pBaseFeat->SetId().SetLocal(*pNewFeatId);
2297 for(
autoit = featMap.
begin(); it != featMap.
end(); ++it) {
2298 autopFeat = it->second;
2299 for(
auto& pXref: pFeat->SetXref()) {
2300 if(!pXref->IsSetId() || !pXref->GetId().IsLocal()) {
2304pXref->SetId().SetLocal(*pNewFeatId);
User-defined methods of the data storage class.
@ eExtreme_Positional
numerical value
User-defined methods of the data storage class.
User-defined methods of the data storage class.
string GetIdHashOrValue(const string &base, int offset)
CSeqdesc & Set(bool skip_lookup=false)
static bool ExtendToStopIfShortAndNotPartial(CSeq_feat &f, CBioseq_Handle bsh, bool check_for_stop=true)
Extends a coding region up to 50 nt.
static bool ExtendStopPosition(CSeq_feat &f, const CSeq_feat *cdregion, size_t extension=0)
static bool LocationMayBeExtendedToMatch(const CSeq_loc &orig, const CSeq_loc &improved)
Checks whether it is possible to extend the original location up to improved one.
void InstantiateProducts()
void xFeatureSetQualifier(CMappedFeat, const std::string &, const std::string &)
unsigned int mSequenceSize
CConstRef< CSeq_feat > xGetLinkedFeature(const CSeq_feat &cd_feature, bool gene)
void GenerateMissingGeneForMrna()
void GenerateMissingGeneForCds()
void xFeatureAddTranscriptIdMrna(CMappedFeat)
IObjtoolsListener * mpMessageListener
set< CMappedFeat > mProcessedMrnas
bool xAdjustExistingParentGene(CMappedFeat)
void xGenerateMissingMrnaForCds(const CMappedFeat &cds)
void xGenerateLocusIdsRegenerate()
void xFeatureRemoveQualifier(CMappedFeat, const std::string &)
CRef< CSeq_loc > xGetGeneLocation(const CSeq_loc &, TSeqPos)
unsigned int mLocusTagNumber
void xPutError(const string &message)
void ProcessCodonRecognized()
void xFeatureAddTranscriptIdCds(CMappedFeat)
void xGenerateMissingGeneForChoice(CSeqFeatData::E_Choice, const CGff3LocationMerger *=nullptr)
static std::string xGetIdStr(CMappedFeat)
CSeq_annot_EditHandle mEditHandle
void xPutErrorMissingLocustag(CMappedFeat)
void GenerateProteinAndTranscriptIds()
CRef< CSeq_feat > xMakeGeneForFeature(const CMappedFeat &, TSeqPos)
void GenerateMissingParentFeaturesForProkaryote(const objects::CGff3LocationMerger *=nullptr)
bool AnnotHasAllLocusTags() const
void xFeatureAddProteinIdCds(CMappedFeat)
void xAddTranscriptAndProteinIdsToUnmatchedMrna(CMappedFeat &mrna)
std::string xGetCurrentLocusTagPrefix(CMappedFeat)
void GenerateMissingParentFeaturesForEukaryote(const objects::CGff3LocationMerger *=nullptr)
void xConvertToGeneralIds(const CMappedFeat &mf, string &transcript_id, string &protein_id)
void xFeatureAddTranscriptIdDefault(CMappedFeat)
CSeq_annot_Handle mHandle
void xGenerateLocusIdsUseExisting()
void xFeatureAddQualifier(CMappedFeat, const std::string &, const std::string &)
string xNextTranscriptId(const CMappedFeat &)
void xPutErrorBadCodonRecognized(const string codonRecognized)
bool m_use_hypothetic_protein
void xGenerateMissingGeneForFeats(const SAnnotSelector &sel, const CGff3LocationMerger *=nullptr)
void xPutErrorMissingProteinId(CMappedFeat)
string xNextProteinId(const CMappedFeat &)
void xGenerateMissingGeneForFeat(const CMappedFeat &feat)
void xPutErrorMissingTranscriptId(CMappedFeat)
void xGenerateMissingGeneForSubtype(CSeqFeatData::ESubtype, const CGff3LocationMerger *=nullptr)
void GenerateMissingParentFeatures(bool forEukaryote, const objects::CGff3LocationMerger *=nullptr)
void xFeatureAddProteinIdDefault(CMappedFeat)
void xFeatureSetProduct(CMappedFeat, const string &)
map< string, int > mMapProtIdCounts
bool xCreateMissingParentGene(CMappedFeat, TSeqPos)
void MergeFeatures(const CSeq_annot::TData::TFtable &other)
std::string xGenerateTranscriptOrProteinId(CMappedFeat, const std::string &)
void GenerateMissingMrnaForCds()
void xAddTranscriptAndProteinIdsToCdsAndParentMrna(CMappedFeat &cds)
void EliminateBadQualifiers()
void xGenerate_mRNA_Product(CSeq_feat &cd_feature)
void InstantiateProductsNames()
void xAddTranscriptAndProteinIdsToMrna(const string &cds_transcript_id, const string &cds_protein_id, CMappedFeat &mrna)
void xPutErrorDifferingTranscriptIds(const CMappedFeat &mrna)
CFeatTableEdit(CSeq_annot &, const string &="", unsigned int=1, unsigned int=1, IObjtoolsListener *=nullptr)
void xFeatureAddProteinIdMrna(CMappedFeat)
void xPutErrorDifferingProteinIds(const CMappedFeat &mrna)
void xRenameFeatureId(const CObject_id &, FeatMap &)
static int CodonToIndex(char base1, char base2, char base3)
TSeqPos GetSequenceSize(const string &) const
bool IsLegalQualifier(EQualifier qual) const
Test wheather a certain qualifier is legal for the feature.
EQualifier
List of available qualifiers for feature keys.
ESubtype GetSubtype(void) const
static EQualifier GetQualifierType(CTempString qual)
convert qual string to enumerated value
static CTempString SubtypeValueToName(ESubtype eSubtype)
Turns a ESubtype into its string value which is NOT necessarily related to the identifier of the enum...
CSeq_feat_EditHandle â.
namespace ncbi::objects::
const CProt_ref * GetProtXref(void) const
get protein (if present) from Seq-feat.xref list
const string & GetNamedQual(const CTempString &qual_name) const
Return a named qualifier.
void AddQualifier(const string &qual_name, const string &qual_val)
Add a qualifier to this feature.
void RemoveQualifier(const string &qual_name)
Remove all qualifiers with the given name; do nothing if no such qualifier exists.
bool AddSeqFeatXref(const CSeqFeatXref::TId &id)
void SetProtXref(CProt_ref &value)
static bool GetOrgName(string &name, const objects::CSeq_entry &entry)
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
const_iterator begin() const
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
CRef< CSeq_loc > sProductFromString(const string str)
static string s_GetTranscriptIdFromMrna(const CMappedFeat &mrna)
static void s_SetProtRef(const CSeq_feat &cds, CConstRef< CSeq_feat > pMrna, CProt_ref &prot_ref)
static bool s_IsGenbankId(const string &id)
static bool AssignLocalIdIfEmpty(CSeq_feat &feature, unsigned &id)
static void s_AppendProtRefInfo(CProt_ref ¤t_ref, const CProt_ref &other_ref)
static bool s_ShouldConvertToGeneral(const string &id)
string sGetCdsProductName(const CSeq_feat &cds, CScope &scope)
bool idAlpha(const CSeq_id_Handle &idh1, const CSeq_id_Handle idh2)
bool OjectIdsAreEqual(const CObject_id &lhs, const CObject_id &rhs)
string sGetFeatMapKey(const CObject_id &objectId)
static bool s_IsGeneralId(const string &id)
static const char * str(char *buf, int n)
const TResidue codons[4][4]
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
@ eDiag_Error
Error message.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
static SIZE_TYPE ParseIDs(CBioseq::TId &ids, const CTempString &s, TParseFlags flags=fParse_Default)
Parse a string representing one or more Seq-ids, appending the results to IDS.
void GetLabel(string *label, ELabelType type=eDefault, TLabelFlags flags=fLabel_Default) const
Append a label for this Seq-id to the supplied string.
string AsString(void) const
@ fParse_PartialOK
Warn rather than throwing an exception when a FASTA-style ID set contains unparsable portions,...
@ fParse_ValidLocal
Treat otherwise unidentified strings as raw accessions, provided that they pass rudimentary validatio...
@ eContent
Untagged human-readable accession or the like.
void SetPacked_int(TPacked_int &v)
ENa_strand GetStrand(void) const
Get the location's strand.
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
TSeqPos GetStop(ESeqLocExtremes ext) const
CMappedFeat GetBestMrnaForCds(const CMappedFeat &cds_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0)
bool CopyFeaturePartials(CSeq_feat &dst, const CSeq_feat &src)
CopyFeaturePartials A function to copy the start and end partialness from one feature to another.
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)
CMappedFeat GetBestOverlappingFeat(const CMappedFeat &feat, CSeqFeatData::ESubtype need_subtype, sequence::EOverlapType overlap_type, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0)
bool AdjustProteinMolInfoToMatchCDS(CMolInfo &molinfo, const CSeq_feat &cds)
AdjustProteinMolInfoToMatchCDS A function to change an existing MolInfo to match a coding region.
CMappedFeat GetBestCdsForMrna(const CMappedFeat &mrna_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0)
@ eOverlap_CheckIntRev
1st is a subset of 2nd with matching boundaries
bool IsPseudo(const CSeq_feat &feat, CScope &scope)
Determines whether given feature is pseudo, using gene associated with feature if necessary Checks to...
CBioseq_Handle GetBioseqFromSeqLoc(const CSeq_loc &loc, CScope &scope, CScope::EGetBioseqFlag flag=CScope::eGetBioseq_Loaded)
Retrieve the Bioseq Handle from a location.
static CRef< CBioseq > TranslateToProtein(const CSeq_feat &cds, CScope &scope)
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
CBioseq_EditHandle GetEditHandle(const CBioseq_Handle &seq)
Get editable Biosec handle by regular one.
CSeq_annot_Handle AddSeq_annot(CSeq_annot &annot, TPriority pri=kPriority_Default, EExist action=eExist_Throw)
Add Seq-annot, return its CSeq_annot_Handle.
CBioseq_Handle GetObjectHandle(const CBioseq &bioseq, EMissing action=eMissing_Default)
const string & GetNamedQual(const CTempString &qual_name) const
Return a named qualifier.
void AddQualifier(const string &qual_name, const string &qual_val)
Add a qualifier to this feature.
virtual CSeq_id_Handle GetLocationId(void) const
const CFeat_id & GetId(void) const
const CSeq_annot_Handle & GetAnnot(void) const
Get handle to seq-annot for this feature.
const CSeqFeatData & GetData(void) const
CSeq_feat_EditHandle AddFeat(const CSeq_feat &new_obj) const
bool IsSetProduct(void) const
void RemoveQualifier(const string &qual_name)
Remove all qualifiers with the given name on this feature.
CSeqFeatData::ESubtype GetFeatSubtype(void) const
void Replace(const CSeq_feat &new_feat) const
Replace the feature with new Seq-feat object.
SAnnotSelector & IncludeFeatSubtype(TFeatSubtype subtype)
Include feature subtype in the search.
SAnnotSelector & ExcludeFeatSubtype(TFeatSubtype subtype)
Exclude feature subtype from the search.
bool IsSetPartial(void) const
const CSeq_loc & GetLocation(void) const
bool GetPartial(void) const
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
SAnnotSelector & IncludeFeatType(TFeatType type)
Include feature type in the search.
SAnnotSelector & SetSortOrder(ESortOrder sort_order)
Set sort order of annotations.
CConstRef< CSeq_feat > GetSeq_feat(void) const
Get current seq-feat.
CSeq_id_Handle GetLocationId(void) const
@ eSortOrder_Normal
default - increasing start, decreasing length
@ eSortOrder_None
do not sort annotations for faster retrieval
bool Empty(void) const THROWS_NONE
Check if CConstRef is empty â not pointing to any object which means having a null value.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
bool NotEmpty(void) const THROWS_NONE
Check if CConstRef is not empty â pointing to an object and has a non-null value.
bool Empty(void) const THROWS_NONE
Check if CRef is empty â not pointing to any object, which means having a null value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
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.
static string & ToUpper(string &str)
Convert string to upper case â string& version.
bool IsSetLocus_tag(void) const
systematic gene name (e.g., MI0001, ORF0069) Check if a value has been assigned to Locus_tag data mem...
const TLocus_tag & GetLocus_tag(void) const
Get the Locus_tag member data.
bool IsStr(void) const
Check if variant Str is selected.
E_Choice Which(void) const
Which variant is currently selected.
const TStr & GetStr(void) const
Get the variant data.
TStr & SetStr(void)
Select the variant.
TId GetId(void) const
Get the variant data.
TActivity & SetActivity(void)
Assign a value to Activity data member.
bool IsSetDesc(void) const
description (instead of name) Check if a value has been assigned to Desc data member.
const TDb & GetDb(void) const
Get the Db member data.
const TActivity & GetActivity(void) const
Get the Activity member data.
TEc & SetEc(void)
Assign a value to Ec data member.
const TName & GetName(void) const
Get the Name member data.
bool IsSetDb(void) const
ids in other dbases Check if a value has been assigned to Db data member.
bool IsSetEc(void) const
E.C.
void SetDesc(const TDesc &value)
Assign a value to Desc data member.
TProcessed GetProcessed(void) const
Get the Processed member data.
void SetProcessed(TProcessed value)
Assign a value to Processed data member.
bool IsSetName(void) const
protein name Check if a value has been assigned to Name data member.
const TDesc & GetDesc(void) const
Get the Desc member data.
bool IsSetActivity(void) const
activities Check if a value has been assigned to Activity data member.
const TEc & GetEc(void) const
Get the Ec member data.
TDb & SetDb(void)
Assign a value to Db data member.
TName & SetName(void)
Assign a value to Name data member.
bool IsSetExt(void) const
generic fields for ncRNA, tmRNA, miscRNA Check if a value has been assigned to Ext data member.
const TName & GetName(void) const
Get the variant data.
const TExt & GetExt(void) const
Get the Ext member data.
bool IsName(void) const
Check if variant Name is selected.
@ e_not_set
No variant selected.
TXref & SetXref(void)
Assign a value to Xref data member.
void ResetPartial(void)
Reset Partial data member.
const TData & GetData(void) const
Get the Data member data.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool IsProt(void) const
Check if variant Prot is selected.
void SetLocation(TLocation &value)
Assign a value to Location data member.
void SetPartial(TPartial value)
Assign a value to Partial data member.
void SetProduct(TProduct &value)
Assign a value to Product data member.
const TId & GetId(void) const
Get the Id member data.
const TLocal & GetLocal(void) const
Get the variant data.
bool IsSetXref(void) const
cite other relevant features Check if a value has been assigned to Xref data member.
const TLocation & GetLocation(void) const
Get the Location member data.
E_Choice
Choice variants.
bool IsLocal(void) const
Check if variant Local is selected.
bool IsGene(void) const
Check if variant Gene is selected.
const TData & GetData(void) const
Get the Data member data.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
void SetId(TId &value)
Assign a value to Id data member.
void SetData(TData &value)
Assign a value to Data data member.
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
const TProduct & GetProduct(void) const
Get the Product member data.
const TGene & GetGene(void) const
Get the variant data.
const TProt & GetProt(void) const
Get the variant data.
const TXref & GetXref(void) const
Get the Xref member data.
vector< CRef< CSeqFeatXref > > TXref
void ResetProduct(void)
Reset Product data member.
vector< CRef< CGb_qual > > TQual
const TRna & GetRna(void) const
Get the variant data.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
bool IsSetLocation(void) const
feature made from Check if a value has been assigned to Location data member.
@ e_Local
for local software use
void SetTo(TTo value)
Assign a value to To data member.
void SetId(TId &value)
Assign a value to Id data member.
void SetFrom(TFrom value)
Assign a value to From data member.
void SetStrand(TStrand value)
Assign a value to Strand data member.
const TSeq & GetSeq(void) const
Get the variant data.
TSeq & SetSeq(void)
Select the variant.
void SetData(TData &value)
Assign a value to Data data member.
TId & SetId(void)
Assign a value to Id data member.
const TInst & GetInst(void) const
Get the Inst member data.
const TId & GetId(void) const
Get the Id member data.
TLength GetLength(void) const
Get the Length member data.
list< CRef< CSeq_id > > TId
void SetBiomol(TBiomol value)
Assign a value to Biomol data member.
void SetDescr(TDescr &value)
Assign a value to Descr data member.
const TFtable & GetFtable(void) const
Get the variant data.
list< CRef< CSeq_feat > > TFtable
const TData & GetData(void) const
Get the Data member data.
void SetTech(TTech value)
Assign a value to Tech data member.
TMolinfo & SetMolinfo(void)
Select the variant.
@ eTech_concept_trans
conceptual translation
@ e_Molinfo
info on the molecule and techniques
constexpr auto sort(_Init &&init)
constexpr bool empty(list< Ts... >) noexcept
IMessage/IMessageListener interfaces and basic implementations.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4