78 virtual void Init(
void);
79 virtual int Run(
void);
80 virtual void Exit(
void);
103 arg_desc->SetUsageContext(
GetArguments().GetProgramBasename(),
104 "Demonstrate CFeatTree class.");
106 arg_desc->AddDefaultKey(
"gi",
"gi",
107 "The gi for the Bioseq of interest, e.g. 455025.",
110 arg_desc->AddDefaultKey(
"from",
"from",
111 "The starting position of the range.",
114 arg_desc->AddDefaultKey(
"to",
"to",
115 "The ending position of the range.",
143 CScope scope(*object_manager);
154 cout <<
"Bioseq state: 0x"
160 cout <<
"Title: " <<
gen.GenerateDefline(bioseq_handle) << endl;
166 cout <<
"Searching whole bioseq, gi|" <<
m_gi <<
" length = "
169 seq_loc.
SetInt().SetId(seq_id);
172 cout <<
"Searching bioseq interval, gi|" <<
m_gi <<
":"
189 cout << feat_it.
GetSize() <<
" features found." << endl;
193 feature::CFeatTree feat_tree;
194 feat_tree.AddFeatures(feat_it);
205 for (feat_it.
Rewind(); feat_it; ++feat_it) {
219 gene.
Reset(seq_feat_ref);
236 feattree_map[feat_str] = gene_str;
237 gene_set.
insert(gene_str);
242 cout << feattree_map.
size() <<
" features mapped to genes." << endl;
243 cout << gene_set.
size() <<
" unique genes found." << endl;
size_t GetSize(void) const
Class for computing sequences' titles ("definitions").
virtual void Exit(void)
Cleanup on application exit.
static string FeatString(CConstRef< CSeq_feat > seq_feat)
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)
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
ESubtype GetSubtype(void) const
iterator_bool insert(const value_type &val)
The NCBI C++ standard methods for dealing with std::string.
API (CDeflineGenerator) for computing sequences' titles ("definitions").
USING_SCOPE(ncbi::objects)
int NcbiSys_main(int argc, ncbi::TXChar *argv[])
#define GI_FROM(T, value)
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)
@ eInteger
Convertible into an integer number (int or Int8)
#define MSerial_AsnText
I/O stream manipulators –.
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.
TBioseqStateFlags GetState(void) const
Get state of the bioseq.
TSeqPos GetBioseqLength(void) const
SAnnotSelector & SetResolveAll(void)
SetResolveAll() is equivalent to SetResolveMethod(eResolve_All).
SAnnotSelector & SetAdaptiveDepth(bool value=true)
SetAdaptiveDepth() requests to restrict subsegment resolution depending on annotations found on lower...
SAnnotSelector & ExcludeNamedAnnots(const CAnnotName &name)
Add named annot to set of annots names to exclude.
CConstRef< CSeq_feat > GetSeq_feat(void) const
Get current seq-feat.
void Reset(void)
Reset reference object.
const TData & GetData(void) const
Get the Data member data.
TFrom GetFrom(void) const
Get the From member data.
TGi & SetGi(void)
Select the variant.
TTo GetTo(void) const
Get the To member data.
const TInt & GetInt(void) const
Get the variant data.
static void hex(unsigned char c)
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Defines command line argument related classes.
Miscellaneous common-use basic types and functionality.
NCBI C++ stream class wrappers for triggering between "new" and "old" C++ stream libraries.