& recType,
77 constpair<string, string>& featKey,
98 auto& features = typeIt->second;
99 autofeatIt = features.find(featKey);
100 if(featIt == features.end()) {
103 returnfeatIt->second;
111geneKey.second =
"";
116 autogeneParent = geneEntries->second.find(geneKey);
117 if(geneParent == geneEntries->second.end()) {
120 returngeneParent->second;
132 automrnaParent = mrnaEntries->second.find(mrnaKey);
133 if(mrnaParent == mrnaEntries->second.end()) {
136 returnmrnaParent->second;
141 const string&
type)
143 static const autoemptyMap =
TYPEMAP();
148 returntypeIt->second;
155 if(record.
Type() ==
"gene") {
169{
"initial",
"mrna"},
170{
"internal",
"mrna"},
171{
"terminal",
"mrna"},
172{
"start_codon",
"cds"},
173{
"stop_codon",
"cds"},
175 autorecType = record.
Type();
176 autoit = typeMap.
find(recType);
177 if(it != typeMap.
end()) {
213vector<string> ignoredFeatureTypes = {
214 "inter",
"inter_cns",
"intron",
"intron_cns",
216 if(find(ignoredFeatureTypes.begin(), ignoredFeatureTypes.end(),
217record.
Type()) != ignoredFeatureTypes.end()) {
235 autohandlerIt = handlerMap.find(record.
Type());
236 if(handlerIt == handlerMap.end()) {
238 throwerrorUnknownFeatureType;
240(this->*(handlerIt->second))(record, annot);
262 if(impliedRecord.
Type() !=
"mrna") {
332 if(record.
Type() ==
"gene") {
340 min(recordInt.GetFrom(), featureInt.GetFrom()));
342 max(recordInt.GetTo(), featureInt.GetTo()));
403 auto& cdsRef = pCds->
SetData().SetCdregion();
407 if(cdsStart == recordLoc.GetFrom()) {
408cdsRef.SetFrame(record.
Frame());
413 if(cdsStop == recordLoc.GetTo()) {
414cdsRef.SetFrame(record.
Frame());
427annot.
SetData().SetFtable().push_back(pFeature);
448 auto& geneRef = pFeature->
SetData().SetGene();
450 if(!locusTag.empty()) {
451geneRef.SetLocus_tag(locusTag);
472pFeature->
SetData().SetCdregion();
474pFeature->
SetData().SetCdregion().SetFrame(record.
Frame());
487{
"initial",
"mrna"},
488{
"internal",
"mrna"},
489{
"terminal",
"mrna"},
490{
"start_codon",
"cds"},
491{
"stop_codon",
"cds"},
493 stringmappedType(record.
Type());
494 autoit = typeMap.
find(record.
Type());
495 if(it != typeMap.
end()) {
496mappedType = it->second;
508record.
Type() ==
"mrna"?
522pFeature->
SetLocation().Assign(*pUpdatedLocation);
532vector<string> ignoredKeys = {
533 "exon_number",
"locus_tag",
541 auto key= entry.first;
542 if(find(ignoredKeys.begin(), ignoredKeys.end(),
key)
543!= ignoredKeys.end()) {
546 for(
auto value: entry.second) {
547 const auto& existingQuals = pFeature->
GetQual();
548 boolisDuplicate =
false;
549 for(
autoqualRef: existingQuals) {
550 if(qualRef->GetQual() ==
key&& qualRef->GetVal() ==
value) {
568 autogeneEntries =
mpFeatureMap->GetTypeMapFor(
"gene");
569 automrnaEntries =
mpFeatureMap->GetTypeMapFor(
"mrna");
570 autocdsEntries =
mpFeatureMap->GetTypeMapFor(
"cds");
572 for(
automrnaEntry: mrnaEntries) {
574 automrnaKey = mrnaEntry.first;
575 for(
autocdsEntry: cdsEntries) {
576 if(mrnaKey == cdsEntry.first) {
577cdsEntry.second->AddSeqFeatXref(mrnaEntry.second->GetId());
578mrnaEntry.second->AddSeqFeatXref(cdsEntry.second->GetId());
582mrnaKey.second =
"";
583 for(
autogeneEntry: geneEntries) {
584 if(mrnaKey == geneEntry.first) {
585geneEntry.second->AddSeqFeatXref(mrnaEntry.second->GetId());
586mrnaEntry.second->AddSeqFeatXref(geneEntry.second->GetId());
591 for(
autocdsEntry: cdsEntries) {
592 autocdsKey = cdsEntry.first;
594 for(
autogeneEntry: geneEntries) {
595 if(cdsKey == geneEntry.first) {
596geneEntry.second->AddSeqFeatXref(cdsEntry.second->GetId());
597cdsEntry.second->AddSeqFeatXref(geneEntry.second->GetId());
@ eExtreme_Positional
numerical value
static string xGetCookedFeatureType(const CGtfImportData &record)
void AddFeature(const CGtfImportData &record, CRef< CSeq_feat > &pFeat)
pair< string, string > FEATKEY
CRef< CSeq_feat > FindGeneParent(const CGtfImportData &record) const
CRef< CSeq_feat > FindMrnaParent(const CGtfImportData &record) const
const TYPEMAP & GetTypeMapFor(const string &type)
map< FEATKEY, CRef< CSeq_feat > > TYPEMAP
static FEATKEY FeatKeyOf(const CGtfImportData &record)
CRef< CSeq_feat > FindFeature(const CGtfImportData &record) const
void AddFeature(const string &recType, const pair< string, string > &featKey, CRef< CSeq_feat > &pFeat)
virtual ~CGtfAnnotAssembler()
void xProcessRecordMrna(const CGtfImportData &, CSeq_annot &)
void xUpdateMrna(const CGtfImportData &, CRef< CSeq_feat > &, CSeq_annot &)
void xAnnotAddFeature(const CGtfImportData &, CRef< CSeq_feat > &, CSeq_annot &)
void xCreateCds(const CGtfImportData &, CRef< CSeq_feat > &, CSeq_annot &)
void xFeatureUpdateLocation(const CGtfImportData &, CRef< CSeq_feat > &)
unique_ptr< CFeatureIdGenerator > mpIdGenerator
void xUpdateCds(const CGtfImportData &, CRef< CSeq_feat > &, CSeq_annot &)
CGtfAnnotAssembler(CImportMessageHandler &)
void xFeatureSetLocation(const CGtfImportData &, CRef< CSeq_feat > &)
unique_ptr< CFeatureMap > mpFeatureMap
void xFeatureSetMrna(const CGtfImportData &, CRef< CSeq_feat > &)
void xProcessRecordGene(const CGtfImportData &, CSeq_annot &)
void xCreateGene(const CGtfImportData &, CRef< CSeq_feat > &, CSeq_annot &)
void xFeatureSetCds(const CGtfImportData &, CRef< CSeq_feat > &)
void xFeatureSetQualifiers(const CGtfImportData &, CRef< CSeq_feat > &)
void ProcessRecord(const CFeatImportData &, CSeq_annot &) override
void xFeatureSetFeatId(const CGtfImportData &, CRef< CSeq_feat > &)
void xCreateMrna(const CGtfImportData &, CRef< CSeq_feat > &, CSeq_annot &)
void xFeatureSetGene(const CGtfImportData &, CRef< CSeq_feat > &)
void xProcessRecordCds(const CGtfImportData &, CSeq_annot &)
void xUpdateGene(const CGtfImportData &, CRef< CSeq_feat > &, CSeq_annot &)
void xAnnotGenerateXrefs(CSeq_annot &)
virtual void FinalizeAnnot(const CAnnotImportData &, CSeq_annot &) override
CCdregion::TFrame Frame() const
string AttributeValueOf(const std::string &) const
const CSeq_loc & Location() const
const std::string & Type() const
void AdjustFeatureType(const std::string &type)
std::string TranscriptId() const
std::string GeneId() const
const ATTRIBUTES & Attributes() const
void AmendMessage(const std::string &amend)
namespace ncbi::objects::
void AddQualifier(const string &qual_name, const string &qual_val)
Add a qualifier to this feature.
static CRef< CSeq_loc > AddLocations(const CSeq_loc &, const CSeq_loc &)
const_iterator end() const
const_iterator find(const key_type &key) const
void Reset(void)
Reset reference object.
void SetLocation(TLocation &value)
Assign a value to Location data member.
const TQual & GetQual(void) const
Get the Qual member data.
const TLocation & GetLocation(void) const
Get the Location member data.
bool IsGene(void) const
Check if variant Gene is selected.
const TData & GetData(void) const
Get the Data member data.
void SetId(TId &value)
Assign a value to Id data member.
void SetData(TData &value)
Assign a value to Data data member.
@ eFrame_not_set
not set, code uses one
bool IsInt(void) const
Check if variant Int is selected.
const TInt & GetInt(void) const
Get the variant data.
void SetData(TData &value)
Assign a value to Data data member.
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
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