A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/gtf__writer_8cpp_source.html below:

NCBI C++ ToolKit: src/objtools/writers/gtf_writer.cpp Source File

75  unsigned int

uFlags ) :

85  unsigned int

uFlags ) :

104  const auto

& display_range =

GetRange

();

105  CFeat_CI

feat_iter(bsh, display_range, sel);

108

vector<CMappedFeat> vRoots = fc.

FeatTree

().GetRootFeatures();

110  for

(

auto

pit = vRoots.begin(); pit != vRoots.end(); ++pit) {

127  m_Os

<<

"#gtf-version 2.2"

<<

'\n'

;

167  "Processing terminated by user"

);

210

list<CRef<CGtfRecord>> records;

215  for

(

const auto

& record: records) {

227  const string

& transcriptIdPreAssigned)

230  string

transcriptId(transcriptIdPreAssigned);

239

tf =

context

.FeatTree().GetParent(mf);

244

transcriptId = featIt->second;

247

list<CRef<CGtfRecord>> records;

252  for

(

const auto

& record: records) {

264  const string

& transcriptIdPreAssigned )

267  string

transcriptId(transcriptIdPreAssigned);

269

list<CRef<CGtfRecord>> records;

273  for

(

const auto

& record: records) {

293  bool

needsPartNumbers = (sublocs.size() > 1);

294  unsigned int

partNum = 1;

295  for

(

auto

it = sublocs.begin(); it != sublocs.end(); it++ ) {

303

pRecord->SetEndpoints(intv.

GetFrom

(), intv.

GetTo

(), strand);

304  if

(needsPartNumbers) {

305

pRecord->SetPartNumber(partNum++);

307

recordList.push_back(pRecord);

318  const string

& transcriptId)

327  if

(!transcriptId.empty()) {

328

pRecord->SetTranscriptId(transcriptId);

340

mfLocAsPackedInt.

Assign

(mfLoc);

346  if

(isTransSpliced) {

347  auto

rnaStart = sublocs.front()->GetFrom();

348  auto

rnaStop = sublocs.front()->GetTo();

349  for

(

const auto

& loc : sublocs) {

350  auto

start = loc->GetFrom();

351  if

(start < rnaStart) {

354  auto

stop = loc->GetTo();

355  if

(stop > rnaStop) {

359

pRecord->SetEndpoints(rnaStart, rnaStop, mfStrand);

362  TSeqPos

lastFrom = sublocs.front()->GetFrom();

363  TSeqPos

lastTo = sublocs.front()->GetTo();

364  auto

it = sublocs.begin();

365  bool

iterationDone(

false

);

366  for

( it++; it != sublocs.end() && !iterationDone; it++ ) {

371  if

(intv.

GetTo

() <= lastFrom) {

375

pRecord->SetEndpoints(lastFrom, lastTo, mfLoc.GetStrand());

376

recordList.push_back(pRecord);

378  if

(!transcriptId.empty()) {

379

pRecord->SetTranscriptId(transcriptId);

385

lastTo = intv.

GetTo

();

393

iterationDone =

true

;

398  if

(intv.

GetFrom

() >= lastTo) {

399

lastTo = intv.

GetTo

();

402

pRecord->SetEndpoints(lastFrom, lastTo, mfLoc.GetStrand());

403

recordList.push_back(pRecord);

405  if

(!transcriptId.empty()) {

406

pRecord->SetTranscriptId(transcriptId);

412

lastTo = intv.

GetTo

();

418

pRecord->SetEndpoints(lastFrom, lastTo, mfLoc.GetStrand());

420

recordList.push_back(pRecord);

422  bool

needPartNumbers = (recordList.size() > 1);

423  unsigned int

partNum = 1;

424  for

(

auto

& record: recordList) {

425  if

(needPartNumbers) {

426

record->SetPartNumber(partNum++);

428

record->SetType(

"transcript"

);

429

record->SetGbKeyFrom(mf);

439  const string

& parentTranscriptId)

442  string

transcriptId(parentTranscriptId);

447

mfLocAsPackedInt.

Assign

(mfLoc);

455  if

(cdsFeat.GetData().GetCdregion().IsSetFrame()) {

456

phase =

max

(cdsFeat.GetData().GetCdregion().GetFrame()-1, 0);

459  unsigned int

partNum = 1;

460  for

(

auto

pInterval : sublocs) {

468

pRecord->SetEndpoints(intv.

GetFrom

(), intv.

GetTo

(), strand);

469  if

(needsPartNumbers) {

472  if

(!transcriptId.empty()) {

473

pRecord->SetTranscriptId(transcriptId);

476

transcriptId = pRecord->TranscriptId();

478

pRecord->SetCdsPhase(phase);

479

recordList.push_back(pRecord);

480

phase = (3 - ((intv.

GetLength

()+3 - phase)%3))%3;

484  unsigned int

basesToLose = 3;

485  while

(basesToLose > 0 && !recordList.empty()) {

486  auto

pLastRecord = recordList.back();

487  auto

lastSize = pLastRecord->SeqStop() - pLastRecord->SeqStart() + 1;

488  auto

lastStrand = pLastRecord->SeqStrand();

489  if

(lastSize > basesToLose) {

491

pLastRecord->SetEndpoints(

492

pLastRecord->SeqStart() + basesToLose, pLastRecord->SeqStop(), lastStrand);

495

pLastRecord->SetEndpoints(

496

pLastRecord->SeqStart(), pLastRecord->SeqStop() - basesToLose, lastStrand);

501

recordList.erase(--recordList.end());

502

basesToLose -= lastSize;

508  int

basePairsNeeded = 3;

509  auto

currentIt = sublocs.begin();

510  unsigned int

partNumber = 1;

511  unsigned int

baseCount = 0;

513  while

(basePairsNeeded > 0 && currentIt != sublocs.end()) {

515  auto

currentFrom = currentLoc.

GetFrom

();

516  auto

currentTo = currentLoc.

GetTo

();

524

pRecord->SetType(

"start_codon"

);

526  if

(currentTo >= currentFrom + basePairsNeeded -1) {

528

pRecord->SetEndpoints(currentTo - basePairsNeeded + 1, currentTo, currentStrand);

531

pRecord->SetEndpoints(currentFrom, currentFrom + basePairsNeeded -1, currentStrand);

536

pRecord->SetEndpoints(currentFrom, currentTo, currentStrand);

537

basePairsNeeded = basePairsNeeded - (currentTo - currentFrom + 1);

540  if

(partNumber > 1 || basePairsNeeded > 0) {

541

pRecord->SetPartNumber(partNumber++);

543  if

(!transcriptId.empty()) {

544

pRecord->SetTranscriptId(transcriptId);

547

pRecord->SetCdsPhase((3-baseCount)%3);

548

baseCount += pRecord->GetExtent();

549

recordList.push_back(pRecord);

556

list<CRef<CGtfRecord>> stopCodonParts;

557  int

basePairsNeeded = 3;

558  auto

currentIt = sublocs.rbegin();

559  while

(basePairsNeeded > 0 && currentIt != sublocs.rend()) {

561  auto

currentFrom = currentLoc.

GetFrom

();

562  auto

currentTo = currentLoc.

GetTo

();

570

pRecord->SetType(

"stop_codon"

);

572  if

(currentTo >= currentFrom + basePairsNeeded - 1) {

574

pRecord->SetEndpoints(currentFrom, currentFrom + basePairsNeeded - 1, currentStrand);

577

pRecord->SetEndpoints(currentTo - basePairsNeeded + 1, currentTo, currentStrand);

582

pRecord->SetEndpoints(currentFrom, currentTo, currentStrand);

583

basePairsNeeded = basePairsNeeded - (currentTo - currentFrom + 1);

586  if

(!transcriptId.empty()) {

587

pRecord->SetTranscriptId(transcriptId);

589

stopCodonParts.push_front(pRecord);

592  unsigned int

partNumber = 1;

593  bool

needPartNumbers = (stopCodonParts.size() > 1);

594  unsigned int

baseCount = 0;

595  for

(

auto

& pRecord: stopCodonParts) {

596  if

(needPartNumbers) {

597

pRecord->SetPartNumber(partNumber++);

600

pRecord->SetCdsPhase((3-baseCount)%3);

601

baseCount += pRecord->GetExtent();

602

recordList.push_back(pRecord);

609  for

(

auto

& pRecord: recordList) {

621  const string

& transcriptId)

625  if

(!transcriptId.empty()) {

626

pMrna->SetTranscriptId(transcriptId);

631

pMrna->CorrectType(

"exon"

);

634  unsigned int

uExonNumber = 1;

637

pLocMrna->

Add

( loc );

643  const

list<CRef<CSeq_interval>>& sublocs = pLocMrna->

GetPacked_int

().

Get

();

644  for

(

auto

it = sublocs.begin(); it != sublocs.end(); ++it) {

648

pExon->MakeChildRecord(*pMrna, subint, uExonNumber++);

649

pExon->DropAttributes(

"gbkey"

);

665  const auto

& quals = mf.

GetQual

();

666  auto

it = quals.begin();

667  for

( ; it != quals.end(); ++it) {

668  if

(!(*it)->CanGetQual() || !(*it)->CanGetVal()) {

671  if

((*it)->GetQual() ==

"standard_name"

) {

672

record.

SetType

((*it)->GetVal());

687

record.

SetType

(

"transcript"

);

713  const auto

& quals = mf.

GetQual

();

714  auto

it = quals.begin();

715  for

(; it != quals.end(); ++it) {

716  if

(!(*it)->CanGetQual() || !(*it)->CanGetVal()) {

719  if

((*it)->GetQual() ==

"gff_source"

) {

728

mf.

GetExt

(),

"ModelEvidence"

);

729  if

(model_evidence) {

731  if

(model_evidence->

HasField

(

"Method"

) ) {

741

mf.

GetExts

(),

"ModelEvidence"

);

742  if

(model_evidence) {

744  if

(model_evidence->

HasField

(

"Method"

)) {

756  if

(!typeFromId.empty()) {

783  const

vector<string> specialCases = {

793  for

(

auto

qual: quals) {

794  if

(!qual->IsSetQual() || !qual->IsSetVal()) {

797  auto

specialCase = std::find(

798

specialCases.begin(), specialCases.end(), qual->GetQual());

799  if

(specialCase != specialCases.end()) {

840  return

featIt->second;

843  auto

parent =

context

.FeatTree().GetParent(mf);

846  return

featIt->second;

849  auto

children =

context

.FeatTree().GetChildren(mf);

850  for

(

auto

child : children) {

853  return

featIt->second;

877  static

list<CSeqFeatData::ESubtype> nonRnaTranscripts = {

888

nonRnaTranscripts.begin(), nonRnaTranscripts.end(), featSubtype);

889  if

(it == nonRnaTranscripts.end()) {

922  switch

(featSubtype) {

965  if

(featId.empty()) {

969  if

(featId.empty()) {

986  unsigned int

suffix = 1;

1009  if

(!record.

GeneId

().empty()) {

1017  const auto

& geneIdQual = mf.

GetNamedQual

(

"gene_id"

);

1018  if

(!geneIdQual.empty()) {

1037  if

(geneId.empty() && geneRef.IsSetLocus_tag()) {

1038

geneId = geneRef.GetLocus_tag();

1040  if

(geneId.empty() && geneRef.IsSetLocus()) {

1041

geneId = geneRef.GetLocus();

1043  if

(geneId.empty() && geneRef.IsSetSyn() ) {

1044

geneId = geneRef.GetSyn().front();

1046  if

(geneId.empty()) {

1064  unsigned int

suffix = 1;

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.

@ eExtreme_Biological

5' and 3'

User-defined methods of the data storage class.

bool CdsNeedsExonNumbers() const

void AssignExonNumberTo(CGtfRecord &gtfRecord) const

CWriterBase implementation that formats Genbank objects as plain GFF files.

virtual bool xAssignFeatureAttributeDbxref(CGffFeatureRecord &, CGffFeatureContext &, const string &label, const CMappedFeat &)

virtual bool xAssignFeature(CGffFeatureRecord &, CGffFeatureContext &, const CMappedFeat &)

static bool HasAccaptableTranscriptParent(CGffFeatureContext &, const CMappedFeat &)

virtual bool xWriteAllChildren(CGffFeatureContext &, const CMappedFeat &)

static bool xIntervalsNeedPartNumbers(const list< CRef< CSeq_interval >> &)

CMappedFeat xGenerateMissingTranscript(CGffFeatureContext &, const CMappedFeat &)

virtual string StrType() const

virtual string StrSeqStop() const

virtual string StrAttributes() const

virtual string StrScore() const

void SetType(const string &)

virtual string StrPhase() const

void SetMethod(const string &)

bool SetAttribute(const string &, const string &)

virtual string StrSeqStart() const

virtual string StrSeqId() const

bool AddAttribute(const string &, const string &)

virtual string StrStrand() const

virtual string StrMethod() const

void AssignShouldInheritPseudo(bool shouldInheritPseudo)

feature::CFeatTree & FeatTree()

virtual string StrStructibutes() const

string NextId(const string prefix)

void SetGeneId(const std::string &geneId)

string TranscriptId() const

void SetTranscriptId(const std::string &transcriptId)

virtual bool xAssignFeatureAttributeTranscriptId(CGtfRecord &, CGffFeatureContext &, const CMappedFeat &)

map< CMappedFeat, string > mMapFeatToGeneId

virtual bool xAssignFeaturesGene(list< CRef< CGtfRecord >> &, CGffFeatureContext &, const CMappedFeat &)

bool xAssignFeatureMethod(CGffFeatureRecord &, CGffFeatureContext &, const CMappedFeat &) override

virtual bool xWriteRecordsGene(CGffFeatureContext &, const CMappedFeat &)

CGtfIdGenerator mIdGenerator

bool xWriteRecord(const CGffWriteRecord *)

virtual bool xAssignFeaturesCds(list< CRef< CGtfRecord >> &, CGffFeatureContext &, const CMappedFeat &, const string &="")

virtual bool xAssignFeatureAttributeTranscriptBiotype(CGtfRecord &, CGffFeatureContext &, const CMappedFeat &)

bool xAssignFeatureAttributeNote(CGffFeatureRecord &, CGffFeatureContext &, const CMappedFeat &) override

bool xWriteFeature(CGffFeatureContext &, const CMappedFeat &) override

bool x_WriteBioseqHandle(CBioseq_Handle) override

bool xAssignFeatureAttributesFormatSpecific(CGffFeatureRecord &, CGffFeatureContext &, const CMappedFeat &) override

virtual bool xWriteRecordsTranscript(CGffFeatureContext &, const CMappedFeat &, const string &="")

std::string xGenericTranscriptId(const CMappedFeat &)

bool WriteHeader() override

Write a file header identifying the file content as GFF version 2.

CGtfWriter(CScope &, CNcbiOstream &, unsigned int=0)

bool xAssignFeatureAttributesQualifiers(CGffFeatureRecord &, CGffFeatureContext &, const CMappedFeat &) override

bool xAssignFeatureAttributeDbxref(CGffFeatureRecord &, CGffFeatureContext &, const CMappedFeat &) override

virtual bool xWriteRecordsCds(CGffFeatureContext &, const CMappedFeat &, const string &="")

virtual bool xAssignFeatureAttributeGeneId(CGtfRecord &, CGffFeatureContext &, const CMappedFeat &)

bool xAssignFeatureType(CGffFeatureRecord &, CGffFeatureContext &, const CMappedFeat &) override

virtual bool xWriteFeatureExons(CGffFeatureContext &, const CMappedFeat &, const string &="")

std::string xGenericGeneId(const CMappedFeat &, CGffFeatureContext &)

virtual bool xAssignFeaturesTranscript(list< CRef< CGtfRecord >> &, CGffFeatureContext &, const CMappedFeat &, const string &)

TSeqPos GetLength(void) const

static bool FeatureToSoType(const CSeq_feat &, string &)

bool HasField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const

Verify that a named field exists.

const CUser_field & GetField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const

Access a named field in this user object.

static bool CompareFeatures(const CMappedFeat &lhs, const CMappedFeat &rhs)

static CConstRef< CUser_object > GetUserObjectByType(const CUser_object &uo, const string &strType)

static bool GetIdType(CBioseq_Handle, string &)

virtual const CRange< TSeqPos > & GetRange(void) const

bool GetBestId(CSeq_id_Handle idh, CScope &scope, string &best_id) const

virtual SAnnotSelector & SetAnnotSelector(void)

const_iterator end() const

const_iterator find(const key_type &key) const

const_iterator begin() const

const_iterator find(const key_type &key) const

const_iterator end() const

unsigned int TSeqPos

Type for sequence locations and lengths.

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

void ChangeToPackedInt(void)

Works only if location is currently an interval, point, packed-int (handled trivially),...

virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)

Override Assign() to incorporate cache invalidation.

void Add(const CSeq_loc &other)

Simple adding of seq-locs.

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.

CMappedFeat GetBestGeneForFeat(const CMappedFeat &feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0, CFeatTree::EBestGeneType lookup_type=CFeatTree::eBestGene_TreeOnly)

CMappedFeat GetParentFeature(const CMappedFeat &feat)

CSeq_id_Handle GetIdHandle(const CSeq_loc &loc, CScope *scope)

CBioseq_Handle GetBioseqHandle(const CSeq_id &id)

Get bioseq handle by seq-id.

const string & GetNamedQual(const CTempString &qual_name) const

Return a named qualifier.

bool IsSetExcept(void) const

bool GetExcept(void) const

bool IsSetComment(void) const

const CSeq_feat::TExts & GetExts(void) const

const CSeqFeatData & GetData(void) const

bool IsSetExcept_text(void) const

bool IsSetProduct(void) const

const string & GetComment(void) const

const CUser_object & GetExt(void) const

const string & GetExcept_text(void) const

CScope & GetScope(void) const

Get scope this handle belongs to.

bool IsSetExts(void) const

bool IsSetQual(void) const

CSeqFeatData::ESubtype GetFeatSubtype(void) const

CSeqFeatData::E_Choice GetFeatType(void) const

const CSeq_feat::TQual & GetQual(void) const

bool IsSetExt(void) const

CSeq_id_Handle GetProductId(void) const

const CSeq_loc & GetLocation(void) const

const CSeq_feat & GetOriginalFeature(void) const

Get original feature with unmapped location/product.

const CSeq_feat & GetMappedFeature(void) const

Feature mapped to the master sequence.

void Reset(void)

Reset reference object.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

IO_PREFIX::ostream CNcbiOstream

Portable alias for ostream.

static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)

Find the pattern in the string.

static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)

Convert UInt to string.

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.

const TStr & GetStr(void) const

Get the variant data.

const TData & GetData(void) const

Get the Data member data.

const TGene & GetGene(void) const

Get the variant data.

bool IsRna(void) const

Check if variant Rna is selected.

const Tdata & Get(void) const

Get the member data.

TFrom GetFrom(void) const

Get the From member data.

bool IsSetStrand(void) const

Check if a value has been assigned to Strand data member.

bool CanGet(void) const

Check if it is safe to call Get method.

TStrand GetStrand(void) const

Get the Strand member data.

TTo GetTo(void) const

Get the To member data.

const TPacked_int & GetPacked_int(void) const

Get the variant data.

constexpr auto sort(_Init &&init)

static CS_CONTEXT * context


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