;
85 virtual void Init(
void);
104 voidx_RecurseMapSeqAligns(
CSeq_align& Align,
intRow,
118arg_desc->SetUsageContext(GetArguments().GetProgramBasename(),
119 "Annot Fetching Tool");
127arg_desc->AddOptionalKey(
"annot",
"infile",
"input annot file",
129arg_desc->AddOptionalKey(
"align",
"infile",
"input align file",
131arg_desc->AddOptionalKey(
"entry",
"infile",
"input entry file",
133arg_desc->AddOptionalKey(
"row",
"int",
"only update this row in the alignment",
147arg_desc->AddOptionalKey(
"informat",
"string",
"accepted input formats. Temporarily doesnt work, asn text only.",
CArgDescriptions::eString);
149SetupArgDescriptions(arg_desc.release());
228 stringGCAsm = args[
"gc"].AsString();
231Asm = GcService.
GetAssembly(GCAsm,
"SequenceNames");
238}
else if(args[
"gcf"].
HasValue()) {
243cerr <<
"Rquires either a -gc or a -gcf"<< endl;
264 if(args[
"typed"].AsString() ==
"genbank")
266 if(args[
"typed"].AsString() ==
"refseq")
268 if(args[
"typed"].AsString() ==
"external")
270 if(args[
"typed"].AsString() ==
"private")
275 if(args[
"alias"].AsString() ==
"public")
277 if(args[
"alias"].AsString() ==
"gpipe")
279 if(args[
"alias"].AsString() ==
"gi")
281 if(args[
"alias"].AsString() ==
"notset")
286 if(args[
"role"].AsString() ==
"top") {
289 if(args[
"role"].AsString() ==
"gpipetop") {
293 if(args[
"role"].AsString() ==
"chro")
295 if(args[
"role"].AsString() ==
"scaf")
297 if(args[
"role"].AsString() ==
"comp")
300 if(args[
"role"].AsString() ==
"notset") {
305 if(args[
"external"].
HasValue())
306DestSpec.
External= args[
"external"].AsString();
309DestSpec.
Pattern= args[
"pattern"].AsString();
320 returnx_HandleFeatures(*Mapper, DestSpec,
Out);
321 else if(args[
"align"].
HasValue())
322 returnx_HandleAlignments(*Mapper, DestSpec,
Out);
323 else if(args[
"entry"].
HasValue())
324 returnx_HandleEntries(*Mapper, DestSpec,
Out);
336list<CRef<CSeq_annot> > Annots;
350Annots.push_back(Annot);
383cerr <<
"Map Exception: "<< e.
ReportAll() << endl;
386 if(
Loc.IsNull()) {
419Row = args[
"row"].AsInteger();
427off_t
Pos= In.tellg();
435Alignments->
Set().insert(Alignments->
Set().end(),
436AlignSet->Set().begin(),
437AlignSet->Set().end());
445Alignments->
Set().insert(Alignments->
Set().end(),
446Annot->SetData().SetAlign().begin(),
447Annot->SetData().SetAlign().end());
455Alignments->
Set().push_back(Align);
466Alignments->
Set().insert(Alignments->
Set().end(),
467AlignSet->Set().begin(),
468AlignSet->Set().end());
477Alignments->
Set().insert(Alignments->
Set().end(),
478Annot->SetData().SetAlign().begin(),
479Annot->SetData().SetAlign().end());
487Alignments->
Set().push_back(Align);
492 if(Alignments->
Get().empty()) {
493cerr <<
"File reader failure";
500 if(Alignments->
Get().empty())
505Alignments->
Set()) {
506x_RecurseMapSeqAligns(**AlignIter, Row, Mapper, DestSpec);
529Row = args[
"row"].AsInteger();
541x_RecurseMapSeqAligns(*AlignIter, Row, Mapper, DestSpec);
560Align.
SetSegs().SetDisc().Set()) {
561x_RecurseMapSeqAligns(**AlignIter, Row, Mapper, DestSpec);
572 if(Row == -1 || Row == Loop) {
582Mapped = Mapper.
Map(Whole, DestSpec);
588 if(Whole.Equals(*Mapped)) {
595}
else if(Mapped->
IsInt()) {
597cerr << __LINE__ <<
" : "<<
"Can not perfectly map from " 598<< Whole.GetInt().GetId().AsFastaString() <<
" to " 600<<
"The first is not entirely represented in the second."<< endl;
605MapAlign = Mapper.
Map(Align, Row);
607cerr <<__LINE__<<
" : "<<
"CSeq_loc_Mapper ctor or Map exception"<< endl;
613Align.
Assign(*MapAlign);
618cerr << __LINE__ <<
" FAIL_MAP "<< endl;
668 int main(
intargc,
const char* argv[])
static CRef< CScope > m_Scope
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CReader *reader=0, CObjectManager::EIsDefault is_default=CObjectManager::eDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
bool Guess(const objects::CSeq_loc &Loc, SIdSpec &Spec) const
CRef< objects::CSeq_loc > Map(const objects::CSeq_loc &Loc, const SIdSpec &Spec) const
CRef< CGC_Assembly > GetAssembly(const string &acc, const string &mode)
int x_HandleFeatures(CGencollIdMapper &Mapper, CGencollIdMapper::SIdSpec &DestSpec, CNcbiOstream &Out)
int x_HandleEntries(CGencollIdMapper &Mapper, CGencollIdMapper::SIdSpec &DestSpec, CNcbiOstream &Out)
void x_RecurseMapSeqAligns(CSeq_align &Align, int Row, CGencollIdMapper &Mapper, CGencollIdMapper::SIdSpec &DestSpec)
int x_HandleAlignments(CGencollIdMapper &Mapper, CGencollIdMapper::SIdSpec &DestSpec, CNcbiOstream &Out)
CRef< CSeq_loc > CreateRowSeq_loc(TDim row) const
TSeqPos GetLength(void) const
Template class for iteration on objects of class C.
Include a standard set of the NCBI C++ Toolkit most basic headers.
The NCBI C++ standard methods for dealing with std::string.
User-defined methods of the data storage class.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
@ eInputFile
Name of file (must exist and be readable)
@ eString
An arbitrary string.
@ eOutputFile
Name of file (must be writable)
@ eInteger
Convertible into an integer number (int or Int8)
void DBAPI_RegisterDriver_FTDS(void)
CDiagContext & GetDiagContext(void)
Get diag context instance.
void SetSplitLogFile(bool value=true)
Split log files flag.
EDiagSev SetDiagPostLevel(EDiagSev post_sev=eDiag_Error)
Set the threshold severity for posting the messages.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
static void SetOldPostFormat(bool value)
Set old/new format flag.
@ eDS_Default
Try standard log file (app.name + ".log") in /log/, use stderr on failure.
@ eDiag_Info
Informational message.
void Warning(CExceptionArgs_Base &args)
string ReportAll(TDiagPostFlags flags=eDPF_Exception) const
Report all exceptions.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define MSerial_AsnBinary
#define MSerial_AsnText
I/O stream manipulators â.
const string AsFastaString(void) const
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
CRef< CSeq_loc > Map(const CSeq_loc &src_loc)
Map seq-loc.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
void Reset(void)
Reset reference object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null â same effect as Empty().
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
void Run(void)
Enter the main loop.
@ eGC_SequenceRole_top_level
@ eGC_SequenceRole_component
@ eGC_SequenceRole_scaffold
@ eGC_SequenceRole_chromosome
Tdata & Set(void)
Assign a value to data member.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
TExons & SetExons(void)
Assign a value to Exons data member.
vector< CRef< CSeq_id > > TIds
bool IsDisc(void) const
Check if variant Disc is selected.
bool IsSpliced(void) const
Check if variant Spliced is selected.
list< CRef< CSeq_align > > Tdata
TIds & SetIds(void)
Assign a value to Ids data member.
const Tdata & Get(void) const
Get the member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
bool IsDenseg(void) const
Check if variant Denseg is selected.
void SetLocation(TLocation &value)
Assign a value to Location data member.
const TLocation & GetLocation(void) const
Get the Location member data.
bool IsEmpty(void) const
Check if variant Empty is selected.
const TId & GetId(void) const
Get the Id member data.
const TWhole & GetWhole(void) const
Get the variant data.
bool IsWhole(void) const
Check if variant Whole is selected.
bool IsInt(void) const
Check if variant Int is selected.
const TInt & GetInt(void) const
Get the variant data.
bool IsNull(void) const
Check if variant Null is selected.
void SetData(TData &value)
Assign a value to Data data member.
list< CRef< CSeq_feat > > TFtable
list< CRef< CSeq_annot > > TAnnot
map< string, CStopWatch > TTimerMap
int main(int argc, const char *argv[])
Magic spell ;-) needed for some weird compilers... very empiric.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
#define GetArgs
Avoid preprocessor name clash with the NCBI C Toolkit.
Defines NCBI C++ diagnostic APIs, classes, and macros.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
void Out(T t, int w, CNcbiOstream &to=cout)
Reader-writer based streams.
CRef< objects::CObjectManager > om
string ToString(void) const
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