{
"start_codon", TYPE_start_codon},
43{
"stop_codon", TYPE_stop_codon},
45{
"5utr", TYPE_5utr},
46{
"initial", TYPE_initial},
47{
"exon", TYPE_exon},
48{
"single", TYPE_exon},
49{
"internal", TYPE_exon},
50{
"terminal", TYPE_terminal},
51{
"3utr", TYPE_3utr},
69 if(recordPart.empty()) {
104 returntypeIt->second;
128 if(mStrand != other.mStrand) {
131 return((mStart <= other.mStart) && (mStop >= other.mStop));
146pLocation->
SetInt(*pInterval);
174mIdResolver(idResolver)
182 const string& prefixOverride)
185 static constlist<string> cdsTypes{
"start_codon",
"stop_codon",
"cds"};
186 static constlist<string> transcriptTypes = {
"5utr",
"3utr",
"exon",
187 "initial",
"internal",
"terminal",
"single"};
189 autoprefix = prefixOverride;
190 if(prefixOverride.empty()) {
192 if(std::find(cdsTypes.begin(), cdsTypes.end(), prefix) != cdsTypes.end()) {
195 else if(std::find(transcriptTypes.begin(), transcriptTypes.end(), prefix)
196!= transcriptTypes.end()) {
197prefix =
"transcript";
200 if(prefix ==
"gene") {
201 return(prefix +
":"+ record.
GeneKey());
203 return(prefix +
":"+ record.
FeatureKey());
243 for(
auto& existingRecord: existingEntry->second) {
244 if(existingRecord.Contains(
location)) {
248existingRecord.mType =
location.mType;
249existingRecord.mPartNum =
location.mPartNum;
254 if(
location.Contains(existingRecord)) {
258 location.mPartNum = existingRecord.mPartNum;
264existingEntry->second.push_back(
location);
288 if(locations.empty()) {
316 "Cannot call MergeLocationDefault with empty location");
318 if(locations.size() == 1) {
319 auto& onlyOne = locations.front();
320pSeqloc = onlyOne.GetLocation();
325 auto& mix = pSeqloc->
SetMix();
326 for(
auto&
location: locations) {
327mix.AddSeqLoc(*
location.GetLocation());
340 "Cannot call MergeLocationForCds with empty location");
344 auto& mix = pSeqloc->
SetMix();
345 for(
auto&
location: locations) {
346mix.AddSeqLoc(*
location.GetLocation());
359 "Cannot call MergeLocationForGene with empty location");
362 if(pSeqloc->
IsInt()) {
379 if(rangeStart >= rangeStop) {
381 new CSeq_interval(*pRangeId, rangeStop, rangeStart, rangeStrand));
382pSeqloc->
SetInt(*pOverlap);
386 autoit = seqlocIntervals.begin();
387 autooldFrom = (*it)->GetFrom();
388 autooldTo = (*it)->GetTo();
390 for(it++; it != seqlocIntervals.end(); it++) {
391 autonewFrom = (*it)->GetFrom();
392 autonewTo = (*it)->GetTo();
393 if(newTo >= oldFrom) {
397pMix->AddInterval(*pRangeId, 0, oldTo, rangeStrand);
398oldFrom = newFrom, oldTo = newTo;
401 if(oldFrom > oldTo) {
404pMix->AddInterval(*pRangeId, oldFrom, oldTo, rangeStrand);
409 if(rangeStart <= rangeStop) {
411 new CSeq_interval(*pRangeId, rangeStart, rangeStop, rangeStrand));
412pSeqloc->
SetInt(*pOverlap);
416 autoit = seqlocIntervals.begin();
417 autooldFrom = (*it)->GetFrom();
418 autooldTo = (*it)->GetTo();
419 for(it++; it != seqlocIntervals.end(); it++) {
420 autonewFrom = (*it)->GetFrom();
421 autonewTo = (*it)->GetTo();
422 if(newFrom >= oldTo) {
426pMix->AddInterval(*pRangeId, oldFrom, oldTo, rangeStrand);
427oldFrom = 0, oldTo = newTo;
430 if(oldFrom > oldTo) {
433pMix->AddInterval(*pRangeId, oldFrom, oldTo, rangeStrand);
@ eExtreme_Biological
5' and 3'
CRef< CSeq_id > GetSeqId(TReaderFlags, SeqIdResolver=nullptr) const
ENa_strand Strand() const
const string & NormalizedType() const
string ValueOf(const string &key) const
CRef< CSeq_loc > MergeLocationForCds(LOCATIONS &)
void AddRecordForId(const string &, const CGtfReadRecord &)
void AddRecord(const CGtfReadRecord &)
CRef< CSeq_loc > MergeLocation(CSeqFeatData::ESubtype, LOCATIONS &)
void AddStubForId(const string &)
CGtfLocationMerger(unsigned int flags=0, CGff3ReadRecord::SeqIdResolver=nullptr)
CRef< CSeq_loc > MergeLocationDefault(LOCATIONS &)
CRef< CSeq_loc > MergeLocationForTranscript(LOCATIONS &)
CRef< CSeq_loc > MergeLocationForGene(LOCATIONS &)
CGff3ReadRecord::SeqIdResolver mIdResolver
list< CGtfLocationRecord > LOCATIONS
LOCATION_MAP mMapIdToLocations
string GetFeatureIdFor(const CGtfReadRecord &, const string &="")
CGtfLocationRecord & operator=(const CGtfLocationRecord &)
RecordType GetRecordType(const CGtfReadRecord &)
bool Contains(const CGtfLocationRecord &) const
static TYPEORDER_MAP msTypeOrder
static bool CompareTypeAndPartNumbers(const CGtfLocationRecord &lhs, const CGtfLocationRecord &rhs)
CGtfLocationRecord(const CGtfReadRecord &, unsigned int, CGff3ReadRecord::SeqIdResolver)
CRef< CSeq_loc > GetLocation()
const CGtfAttributes & GtfAttributes() const
string FeatureKey() const
const_iterator end() const
const_iterator find(const key_type &key) const
The NCBI C++ standard methods for dealing with std::string.
static const char location[]
unsigned int TSeqPos
Type for sequence locations and lengths.
#define NCBI_ASSERT(expr, mess)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
ENa_strand GetStrand(void) const
Get the location's strand.
void ChangeToPackedInt(void)
Works only if location is currently an interval, point, packed-int (handled trivially),...
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
CRef< CSeq_loc > Merge(TOpFlags flags, ISynonymMapper *syn_mapper) const
All functions create and return a new seq-loc object.
bool IsSetStrand(EIsSetStrand flag=eIsSetStrand_Any) const
Check if strand is set for any/all part(s) of the seq-loc depending on the flag.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
void SetNull(void)
Override all setters to incorporate cache invalidation.
TSeqPos GetStop(ESeqLocExtremes ext) const
#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 StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
void SetTo(TTo value)
Assign a value to To data member.
const Tdata & Get(void) const
Get the member data.
void SetId(TId &value)
Assign a value to Id data member.
void SetFrom(TFrom value)
Assign a value to From data member.
bool IsInt(void) const
Check if variant Int is selected.
void SetStrand(TStrand value)
Assign a value to Strand data member.
const TPacked_int & GetPacked_int(void) const
Get the variant data.
static bool s_IsTranscriptType(int recType)
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