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/bioseq__edit__sample_8cpp_source.html below:

NCBI C++ ToolKit: src/sample/app/objmgr/bioseq_edit_sample.cpp Source File

93  auto

ids = handle.

GetId

();

94  for

(

const auto

&

id

: ids) {

95  if

(&

id

!= &ids.front()) {

114  return

*

id

.

Get

().m_Handle;

121  for

(

const auto

&

id

: ids) {

122  if

(&

id

!= &ids.front()) {

125

os <<

id

.AsString();

130 template

<

typename

TParam,

typename

TFunction>

131 string ToString

(

const

TParam& param, TFunction func)

191  for

(

const auto

&

id

: ids) {

246  if

(os) *os <<

m_Test1

<<

" --> "

;

300  for

(; iter; ++iter) {

306  m_SIH

= *ids.begin();

334

GetParentBioseq_set();

421  for

(

CFeat_CI

feat_it(scope, seq_loc, sel); feat_it; ++feat_it) {

462

annot->

SetData

().SetFtable();

466

new_feat->

SetTitle

(

"Test Feature"

);

467

new_feat->

SetData

().SetComment();

498  virtual void Init

(

void

);

499  virtual int Run

(

void

);

513

: m_DbEngine(

"AsnDB"

)

553

arg_desc->AddKey(

"gi"

,

"SeqEntryID"

,

"GI id of the Seq-Entry to fetch"

,

559  string

prog_description =

"Example of the C++ Object Manager usage\n"

;

560

arg_desc->SetUsageContext(

GetArguments

().GetProgramBasename(), prog_description,

false

);

632

os << ot.

GetName

() <<

"... "

;

635  if

(!ot.

Do

(*scope, &os)) {

642  if

(ot.

Check

(*scope, &os))

662 

// Get list of synonyms for the Seq-id.

663

// * With GenBank loader this request should not load the whole Bioseq.

664

CBioseq_Handle::TId ids = scope.GetIds(seq_id);

666

ITERATE (CBioseq_Handle::TId, id_it, ids) {

667

if (id_it != ids.begin())

668

os << " + "; // print id separator

669

os << id_it->AsString();

674 

// Get Bioseq handle for the Seq-id.

675

// * Most of requests will use this handle.

676

CBioseq_Handle bioseq_handle = scope.GetBioseqHandle(seq_id);

678

// Terminate the program if the GI cannot be resolved to a Bioseq.

679

if ( !bioseq_handle ) {

680

ERR_POST(Fatal << "Bioseq not found, with GI=" << seq_id.GetGi());

682

s_PrintIds(bioseq_handle, os);

685 

// Use CSeqdesc iterator.

686

// Iterate through all descriptors -- starting from the Bioseq, go

687

// all the way up the Seq-entries tree, to the top-level Seq-entry (TSE).

689

CBioseq_EditHandle edit = bioseq_handle.GetEditHandle();

690

CSeq_entry_Handle parent = bioseq_handle.GetParentEntry();

692

edit.AddId(GetNewIdHandle());

693

// edit.RemoveId(idh);

695

os << "---------------- Before descr is added -----------" << endl;

696

s_PrintDescr(bioseq_handle, os);

697

os << "----------------------- end ----------------------" << endl;

699

CRef<CSeqdesc> desc(new CSeqdesc);

700

desc->SetComment("-------------- ADDED COMMENT1 ------------");

701

CScopeTransaction trans = scope.GetTransaction();

702

CBioseq_EditHandle edit = bioseq_handle.GetEditHandle();

703

edit.AddSeqdesc(*desc);

706

os << "------------- After descr is added -----" << endl;

707

s_PrintDescr(bioseq_handle, os);

708

os << "-------------------- end -------------" << endl;

710

os << "Before featre is removed : ";

711

CSeq_annot_Handle annot;

712

s_PrintFeat(bioseq_handle, os);

714

CScopeTransaction tr = scope.GetTransaction();

715

for (CFeat_CI feat_it(bioseq_handle); feat_it; ++feat_it) {

716

annot = feat_it.GetAnnot();

717

// annot.GetEditHandle().Remove();

718

const CMappedFeat& feat = *feat_it;

719

feat.GetSeq_feat_Handle().Remove();

725

os << "Before featre is added : ";

727

CScopeTransaction tr = scope.GetTransaction();

729

CSeq_feat *nf = new CSeq_feat;

730

nf->SetTitle("Add Featue");

731

nf->SetData().SetComment();

732

nf->SetLocation().SetWhole().Assign(*bioseq_handle.GetSeqId());

733

annot.GetEditHandle().AddFeat(*nf);

734

for (CFeat_CI feat_it(bioseq_handle); feat_it; ++feat_it) {

735

CSeq_annot_Handle annot = feat_it.GetAnnot();

736

CSeq_feat *nf = new CSeq_feat;

737

nf->SetTitle("Add Featue");

738

nf->SetData().SetComment();

739

nf->SetLocation().SetWhole().Assign(*bioseq_handle.GetSeqId());

740

annot.GetEditHandle().AddFeat(*nf);

744

os << "After featre is added : ";

745

s_PrintFeat(bioseq_handle, os);

747

os << "Changes are made." << endl;

751

void CEditBioseqSampleApp::x_RunCheck(const CSeq_id& seq_id,

754

CRef<CScope> pscope = CreateScope();

755

CScope& scope = *pscope;

757

CBioseq_Handle bioseq_handle = scope.GetBioseqHandle(seq_id);

758

s_PrintIds(bioseq_handle, os);

759

os << "*******************************" << endl;

760

s_PrintDescr(bioseq_handle, os);

761

os << "*******************************" << endl;

762

s_PrintFeat(bioseq_handle, os);

764

os << "Check is done." << endl;

int NcbiSys_main(int argc, ncbi::TXChar *argv[])

static const CSeq_id_Handle & s_GetNewIdHandle()

string ToString(const TParam &param, TFunction func)

void s_PrintIds1(const CBioseq_Handle::TId &ids, CNcbiOstream &os)

void s_PrintIds(const CBioseq_Handle &handle, CNcbiOstream &os)

virtual bool Check(CScope &scope, CNcbiOstream *os)

const CSeq_id_Handle & m_SeqId

virtual bool Do(CScope &scope, CNcbiOstream *os)

CAddBioseqChecker(const CSeq_id_Handle &seq_id)

virtual ~CAddBioseqChecker()

virtual ~CAddFeatChecker()

CAddFeatChecker(const CSeq_id_Handle &seq_id)

virtual bool Do(CScope &scope, CNcbiOstream *os)

virtual bool Check(CScope &scope, CNcbiOstream *os)

const CSeq_id_Handle & m_SeqId

virtual bool Check(CScope &scope, CNcbiOstream *os)

virtual bool Do(CScope &scope, CNcbiOstream *os)

const CSeq_id_Handle & m_SeqId

CAddIdChecker(const CSeq_id_Handle &seq_id)

static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CRef< CDataLoader >, CRef< IEditsDBEngine >, CRef< IEditSaver > saver=CRef< IEditSaver >(), CObjectManager::EIsDefault is_default=CObjectManager::eNonDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)

list< TOperation > TOperations

AutoPtr< IOperationTest > TOperation

CRef< CScope > x_CreateScope()

virtual void Init(void)

Initialize the application.

virtual int Run(void)

Run the application.

static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CReader *reader=0, CObjectManager::EIsDefault is_default=CObjectManager::eDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)

unique_ptr< CSeq_id_Handle > m_Handle

CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:

virtual ~CRemoveBioseqChecker()

CBioseq_EditHandle::ERemoveMode m_RemoveMode

CRemoveBioseqChecker(const CSeq_id_Handle &seq_id, bool keep_seqentry)

const CSeq_id_Handle & m_SeqId

virtual bool Check(CScope &scope, CNcbiOstream *os)

CRef< CBioseq_set > m_BSet

virtual bool Do(CScope &scope, CNcbiOstream *os)

virtual bool Check(CScope &scope, CNcbiOstream *os)

virtual ~CRemoveFeatChecker()

const CSeq_id_Handle & m_SeqId

virtual bool Do(CScope &scope, CNcbiOstream *os)

CRemoveFeatChecker(const CSeq_id_Handle &seq_id)

virtual ~CRemoveIdChecker()

const CSeq_id_Handle & m_SeqId

virtual bool Do(CScope &scope, CNcbiOstream *os)

CRemoveIdChecker(const CSeq_id_Handle &seq_id)

virtual bool Check(CScope &scope, CNcbiOstream *os)

CResetIdChecker(const CSeq_id_Handle &seq_id)

virtual bool Check(CScope &scope, CNcbiOstream *os)

virtual bool Do(CScope &scope, CNcbiOstream *os)

const CSeq_id_Handle & m_SeqId

virtual ~CResetIdChecker()

T & Get(void)

Create the variable if not created yet, return the reference.

void Commit()

Finish the editing operation.

void SetNameDesc(const string &name)

CSeq_feat_EditHandle –.

namespace ncbi::objects::

IOperationTest(const string &name)

virtual bool Check(CScope &scope, CNcbiOstream *os)=0

void SetName(const string &name)

virtual ~IOperationTest()

virtual bool Do(CScope &scope, CNcbiOstream *os)=0

Include a standard set of the NCBI C++ Toolkit most basic headers.

#define GI_FROM(T, value)

const CNcbiRegistry & GetConfig(void) const

Get the application's cached configuration parameters (read-only).

virtual const CArgs & GetArgs(void) const

Get parsed command line arguments.

int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)

Main function (entry point) for the NCBI application.

virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)

Setup the command line argument descriptions.

const CNcbiArguments & GetArguments(void) const

Get the application's cached unprocessed command-line arguments.

@ eIntId

Convertible to TIntId (int or Int8 depending on NCBI_INT8_GI)

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

Set object to copy of another one.

virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const

Check if both objects contain the same values.

@ eSerial_AsnText

ASN.1 text.

static CSeq_id_Handle GetGiHandle(TGi gi)

Faster way to create a handle for a gi.

static CObjectOStream * Open(ESerialDataFormat format, CNcbiOstream &outStream, bool deleteOutStream)

Create serial object writer and attach it to an output stream.

TIds GetIds(const CSeq_id &id, TGetFlags flags=0)

Get "native" bioseq ids without filtering and matching.

CScopeTransaction GetTransaction()

static CRef< CObjectManager > GetInstance(void)

Return the existing object manager or create one.

CBioseq_Handle GetBioseqHandle(const CSeq_id &id)

Get bioseq handle by seq-id.

void AddDefaults(TPriority pri=kPriority_Default)

Add default data loaders from object manager.

CBioseq_set_EditHandle GetEditHandle(void) const

Get 'edit' version of handle.

vector< CSeq_id_Handle > TId

bool AddId(const CSeq_id_Handle &id) const

CSeq_entry_Handle GetParentEntry(void) const

Get parent Seq-entry handle.

CConstRef< TObject > GetCompleteObject(void) const

CBioseq_EditHandle AttachBioseq(CBioseq &seq, int index=-1) const

Attach a bioseq.

void Remove(void) const

Remove the feature from Seq-annot.

CSeq_feat_EditHandle AddFeat(const CSeq_feat &new_obj) const

void Remove(ERemoveMode mode=eRemoveSeq_entry) const

CBioseq_set_Handle GetParentBioseq_set(void) const

Get parent bioseq-set handle.

CConstRef< TObject > GetCompleteObject(void) const

CSeq_annot_EditHandle AttachAnnot(CSeq_annot &annot) const

Attach an annotation.

bool RemoveId(const CSeq_id_Handle &id) const

CBioseq_EditHandle GetEditHandle(void) const

Get 'edit' version of handle.

CSeq_annot_EditHandle GetEditHandle(void) const

Get 'edit' version of handle.

ERemoveMode

Remove current bioseq from its location.

bool HasParentEntry(void) const

Check if current seq-entry has a parent.

const TId & GetId(void) const

SAnnotSelector & SetResolveAll(void)

SetResolveAll() is equivalent to SetResolveMethod(eResolve_All).

@ eLevel_Mains

Main bioseq only.

void Reset(void)

Reset reference object.

IO_PREFIX::ostream CNcbiOstream

Portable alias for ostream.

void CONNECT_Init(const IRWRegistry *reg=0, CRWLock *lock=0, TConnectInitFlags flag=eConnectInit_OwnNothing, FSSLSetup ssl=0)

Init [X]CONNECT library with the specified "reg" and "lock" (ownership for either or both can be deta...

void SetLocation(TLocation &value)

Assign a value to Location data member.

void SetTitle(const TTitle &value)

Assign a value to Title data member.

void SetData(TData &value)

Assign a value to Data data member.

@ e_not_set

No variant selected.

void SetData(TData &value)

Assign a value to Data data member.

TId & SetId(void)

Assign a value to Id data member.

void ResetId(void)

Reset Id data member.

@ eMol_not_set

> cdna = rna

Defines the CNcbiApplication and CAppException classes for creating NCBI applications.

Defines command line argument related classes.

Defines unified interface to application:

static bool GetSeqId(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)


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