(
void);
71 virtual int Run(
void);
83arg_desc->AddKey(
"gi",
"SeqEntryID",
"GI id of the Seq-Entry to fetch",
88 stringprog_description =
"Example of the C++ Object Manager usage\n";
89arg_desc->SetUsageContext(
GetArguments().GetProgramBasename(), prog_description,
false);
117 CScopescope(*object_manager);
131 for(
const auto&
id: ids) {
132 if( &
id!= &ids.front() ) {
135cout <<
id.AsString();
145 if( !bioseq_handle ) {
154cout <<
"Sequence: length="<< seq_vect.
size();
168 unsigneddesc_count = 0;
169 for(
CSeqdesc_CIdesc_it(bioseq_handle); desc_it; ++desc_it) {
172cout <<
"# of descriptors: "<< desc_count << endl;
188cout <<
"# of features:"<< endl;
190 unsignedfeat_count = 0;
193 for(
CFeat_CIfeat_it(scope, seq_loc, sel); feat_it; ++feat_it) {
198cout <<
" [whole] Any: "<< feat_count << endl;
202 unsignedgene_count = 0;
204 for(
CFeat_CIfeat_it(scope, seq_loc, sel); feat_it; ++feat_it) {
207cout <<
" [whole] Genes: "<< gene_count << endl;
211seq_loc.
SetInt().SetId().SetGi(gi);
212seq_loc.
SetInt().SetFrom(0);
213seq_loc.
SetInt().SetTo(9);
215 unsignedranged_feat_count = 0;
217 for(
CFeat_CIfeat_it(scope, seq_loc, sel); feat_it; ++feat_it) {
220cout <<
" [0..9] Any: "<< ranged_feat_count << endl;
228 unsignedranged_tse_feat_count = 0;
231ranged_tse_feat_count++;
233cout <<
" [0..999, TSE] Any: " 234<< ranged_tse_feat_count << endl;
239cout <<
"# of alignments:"<< endl;
242 unsignedalign_count = 0;
243 for(
CAlign_CIalign_it(scope, seq_loc); align_it; ++align_it) {
246cout <<
" [whole] Any: "<< align_count << endl;
249cout <<
"Done"<< endl;
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CReader *reader=0, CObjectManager::EIsDefault is_default=CObjectManager::eDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
virtual void Init(void)
Initialize the application.
virtual int Run(void)
Run the application.
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const char * str(char *buf, int n)
#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)
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
void Fatal(CExceptionArgs_Base &args)
TIds GetIds(const CSeq_id &id, TGetFlags flags=0)
Get "native" bioseq ids without filtering and matching.
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.
vector< CSeq_id_Handle > TId
CRef< CSeq_loc > GetRangeSeq_loc(TSeqPos start, TSeqPos stop, ENa_strand strand=eNa_strand_unknown) const
Return CSeq_loc referencing the given range and strand on the bioseq If start == 0,...
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
CSeqVector GetSeqVector(EVectorCoding coding, ENa_strand strand=eNa_strand_plus) const
Get sequence: Iupacna or Iupacaa if use_iupac_coding is true.
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
SAnnotSelector & SetFeatType(TFeatType type)
Set feature type (also set annotation type to feat)
SAnnotSelector & SetResolveAll(void)
SetResolveAll() is equivalent to SetResolveMethod(eResolve_All).
SAnnotSelector & SetLimitTSE(const CTSE_Handle &limit)
Limit annotations to those from the TSE only.
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const
Fill the buffer string with the sequence data for the interval [start, stop).
static string PrintableString(const CTempString str, TPrintableMode mode=fNewLine_Quote|fNonAscii_Passthru)
Get a printable version of the specified string.
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...
@ e_not_set
No variant selected.
TGi & SetGi(void)
Select the variant.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Defines command line argument related classes.
Defines unified interface to application:
int NcbiSys_main(int argc, ncbi::TXChar *argv[])
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