NCBI C++ ToolKit
id_mapper_app.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: id_mapper_app.cpp 92090 2020-12-21 16:40:11Z grichenk $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Nathan Bouk
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 #include <corelib/ncbiapp.hpp>
34 #include <corelib/ncbistr.hpp>
35 #include <corelib/ncbidiag.hpp>
36 #include <corelib/ncbistd.hpp>
37 #include <corelib/ncbiobj.hpp>
38 #include <corelib/rwstream.hpp>
39 #include <dbapi/driver/drivers.hpp>
42 #include <util/compress/zlib.hpp>
43 #include <serial/serialbase.hpp>
44 #include <serial/serial.hpp>
45 #include <serial/objostrjson.hpp>
46 #include <serial/objistrasn.hpp>
47 #include <serial/objistr.hpp>
48 #include <objmgr/util/sequence.hpp>
55 #include <objects/seq/seq__.hpp>
59 #include <objmgr/scope.hpp>
61 #include <objmgr/feat_ci.hpp>
63 
66 
68 
69 //#include "feat_loader.hpp"
70 
71 
72 using namespace std;
73 using namespace ncbi;
74 using namespace objects;
75 
76 
77 
78 typedef map<string, CStopWatch> TTimerMap;
80 
81 
83 {
84 public:
85  virtual void Init(void);
86  virtual int Run();
87 
88 private:
89 
91  CBioseq::TAnnot Annots; // list of crefs to annots
92 
93 
94  int x_HandleFeatures(CGencollIdMapper& Mapper,
95  CGencollIdMapper::SIdSpec& DestSpec,
96  CNcbiOstream& Out);
97  int x_HandleAlignments(CGencollIdMapper& Mapper,
98  CGencollIdMapper::SIdSpec& DestSpec,
99  CNcbiOstream& Out);
100  int x_HandleEntries(CGencollIdMapper& Mapper,
101  CGencollIdMapper::SIdSpec& DestSpec,
102  CNcbiOstream& Out);
103 
104  void x_RecurseMapSeqAligns(CSeq_align& Align, int Row,
105  CGencollIdMapper& Mapper,
106  CGencollIdMapper::SIdSpec& DestSpec);
107 
108 };
109 
110 
112 {
113  // Create CGI argument descriptions class
114  // (For CGI applications only keys can be used)
115  unique_ptr<CArgDescriptions> arg_desc(new CArgDescriptions);
116 
117  // Specify USAGE context
118  arg_desc->SetUsageContext(GetArguments().GetProgramBasename(),
119  "Annot Fetching Tool");
120 
121  // Required arguments:
122 
123  // default argument
124  arg_desc->AddOptionalKey("gc", "string", "gencoll accession", CArgDescriptions::eString);
125  arg_desc->AddOptionalKey("gcf", "string", "gencoll asnt file", CArgDescriptions::eInputFile);
126 
127  arg_desc->AddOptionalKey("annot", "infile", "input annot file",
129  arg_desc->AddOptionalKey("align", "infile", "input align file",
131  arg_desc->AddOptionalKey("entry", "infile", "input entry file",
133  arg_desc->AddOptionalKey("row", "int", "only update this row in the alignment",
135 
136 
137  arg_desc->AddOptionalKey("typed", "string", "CGC_TypedSeqId", CArgDescriptions::eString);
138  arg_desc->AddOptionalKey("alias", "string", "CGC_SeqIdAlias", CArgDescriptions::eString);
139  arg_desc->AddOptionalKey("external", "string", "UCSC?", CArgDescriptions::eString);
140  arg_desc->AddOptionalKey("pattern", "string", "<prefix>%s<postfix>", CArgDescriptions::eString);
141 
142  arg_desc->AddOptionalKey("role", "string", "CGC_SequenceRole", CArgDescriptions::eString);
143  arg_desc->AddOptionalKey("primary", "string", "anything", CArgDescriptions::eString);
144 
145  arg_desc->AddKey("out", "outfile", "mapped file", CArgDescriptions::eOutputFile);
146 
147  arg_desc->AddOptionalKey("informat", "string", "accepted input formats. Temporarily doesnt work, asn text only.", CArgDescriptions::eString);
148 
149  SetupArgDescriptions(arg_desc.release());
150 }
151 
152 
154 {
156 
157  const CArgs& args = GetArgs();
158 
159  /*{{
160  string T = "2LHet";
161  CSeq_id TId;
162  try {
163  TId.Set(T);
164  cout << MSerial_AsnText << TId << endl;
165  }catch(...) {;}
166 
167  try {
168  TId.Set("030294");
169  cout << MSerial_AsnText << TId << endl;
170  }catch(...) {;}
171 
172  try {
173  TId.Set("68C5");
174  cout << MSerial_AsnText << TId << endl;
175  }catch(...) {;}
176 
177  try {
178  TId.Set("1234");
179  cout << MSerial_AsnText << TId << endl;
180  }catch(...) {;}
181 
182  try {
183  TId.Set("1");
184  cout << MSerial_AsnText << TId << endl;
185  }catch(...) {;}
186 
187  try {
188  TId.Set("11");
189  cout << MSerial_AsnText << TId << endl;
190  }catch(...) {;}
191 
192  try {
193  TId.Set("111");
194  cout << MSerial_AsnText << TId << endl;
195  }catch(...) {;}
196 
197  try {
198  TId.Set("111111111");
199  cout << MSerial_AsnText << TId << endl;
200  }catch(...) {;}
201 
202  try {
203  TId.Set("1111111111");
204  cout << MSerial_AsnText << TId << endl;
205  }catch(...) {;}
206 
207  try {
208  TId.Set("2111111111");
209  cout << MSerial_AsnText << TId << endl;
210  }catch(...) {;}
211 
212  try {
213  TId.Set("11111111111");
214  cout << MSerial_AsnText << TId << endl;
215  }catch(...) {;}
216 
217  try {
218  TId.Set("1111111111111");
219  cout << MSerial_AsnText << TId << endl;
220  }catch(...) {;}
221 
222  }}*/
223 
224  CRef<CGencollIdMapper> Mapper;
225 
226 
227  if(args["gc"].HasValue()) {
228  string GCAsm = args["gc"].AsString();
229  CGenomicCollectionsService GcService;
230  CRef<CGC_Assembly> Asm;
231  Asm = GcService.GetAssembly(GCAsm, "SequenceNames");//CGCClient_GetAssemblyRequest::eLevel_component);
232  //{{
233  // CNcbiOfstream Out("debug_gc.asnt");
234  // Out << MSerial_AsnText << *Asm;
235  // Out.close();
236  //}}
237  Mapper.Reset(new CGencollIdMapper(Asm));
238  } else if(args["gcf"].HasValue()) {
240  args["gcf"].AsInputFile() >> MSerial_AsnText >> *Asm;
241  Mapper.Reset(new CGencollIdMapper(Asm));
242  } else {
243  cerr << "Rquires either a -gc or a -gcf" << endl;
244  return -1;
245  }
246 
247 
250  m_Scope.Reset(new CScope(*om));
251  m_Scope->AddDefaults();
252 
253 
254  //cerr << MSerial_AsnText << *Mapper.GetInternalGencoll() << endl;
255 
256  CGencollIdMapper::SIdSpec DestSpec;
258  DestSpec.Alias = CGC_SeqIdAlias::e_Gi;
260  DestSpec.External.clear();
261  DestSpec.Pattern.clear();
262 
263  if(args["typed"].HasValue()) {
264  if(args["typed"].AsString() == "genbank")
266  if(args["typed"].AsString() == "refseq")
268  if(args["typed"].AsString() == "external")
270  if(args["typed"].AsString() == "private")
272  }
273 
274  if(args["alias"].HasValue()) {
275  if(args["alias"].AsString() == "public")
276  DestSpec.Alias = CGC_SeqIdAlias::e_Public;
277  if(args["alias"].AsString() == "gpipe")
278  DestSpec.Alias = CGC_SeqIdAlias::e_Gpipe;
279  if(args["alias"].AsString() == "gi")
280  DestSpec.Alias = CGC_SeqIdAlias::e_Gi;
281  if(args["alias"].AsString() == "notset")
282  DestSpec.Alias = CGC_SeqIdAlias::e_None;
283  }
284 
285  if(args["role"].HasValue()) {
286  if(args["role"].AsString() == "top") {
287  DestSpec.Role = eGC_SequenceRole_top_level;
288  }
289  if(args["role"].AsString() == "gpipetop") {
290  DestSpec.Role = eGC_SequenceRole_top_level;
291  }
292 
293  if(args["role"].AsString() == "chro")
295  if(args["role"].AsString() == "scaf")
296  DestSpec.Role = eGC_SequenceRole_scaffold;
297  if(args["role"].AsString() == "comp")
298  DestSpec.Role = eGC_SequenceRole_component;
299 
300  if(args["role"].AsString() == "notset") {
302  }
303  }
304 
305  if(args["external"].HasValue())
306  DestSpec.External = args["external"].AsString();
307 
308  if(args["pattern"].HasValue())
309  DestSpec.Pattern = args["pattern"].AsString();
310 
311  if(args["primary"].HasValue())
312  DestSpec.Primary = true;
313 
314 
315  ERR_POST(Warning << "Output ID Spec: " << DestSpec.ToString());
316 
317  CNcbiOstream& Out = args["out"].AsOutputFile();
318 
319  if(args["annot"].HasValue())
320  return x_HandleFeatures(*Mapper, DestSpec, Out);
321  else if(args["align"].HasValue())
322  return x_HandleAlignments(*Mapper, DestSpec, Out);
323  else if(args["entry"].HasValue())
324  return x_HandleEntries(*Mapper, DestSpec, Out);
325 
326  return 1;
327 }
328 
329 
331  CGencollIdMapper::SIdSpec& DestSpec,
332  CNcbiOstream& Out)
333 {
334  const CArgs& args = GetArgs();
335 
336  list<CRef<CSeq_annot> > Annots;
337  /*
338  CFeatLoader FeatLoader(m_Scope);
339  if(args["informat"].HasValue()) {
340  FeatLoader.SetReadFormat(args["informat"].AsString());
341  }
342  FeatLoader.LoadAnnots(args["annot"].AsInputFile(), Annots);
343  */
344  {{
345  CNcbiIstream& AnnotIn = args["annot"].AsInputFile();
346  while(AnnotIn) {
347  try {
348  CRef<CSeq_annot> Annot(new CSeq_annot);
349  AnnotIn >> MSerial_AsnText >> *Annot;
350  Annots.push_back(Annot);
351  } catch(CException& e) { cerr << e.ReportAll()<<endl;break; }
352  }
353  }}
354 
355  if(Annots.empty())
356  return 1;
357 
358  NON_CONST_ITERATE(list<CRef<CSeq_annot> >, AnnotIter, Annots) {
359  CRef<CSeq_annot> Annot = *AnnotIter;
360 
361  NON_CONST_ITERATE(CSeq_annot::C_Data::TFtable, featiter, Annot->SetData().SetFtable()) {
362  CRef<CSeq_feat> Feat = *featiter;
363 
366  //Mapper.Guess(Feat->GetLocation(), Spec);
367  //DestSpec.External = Spec.External;
368  //DestSpec.Pattern = Spec.Pattern;
369 
370  CGencollIdMapper::SIdSpec GuessSpec;
371 
372  CRef<CSeq_loc> Loc;
373  try {
374  Mapper.Guess(Feat->GetLocation(), GuessSpec);
375  //cerr << "Guessed: " << GuessSpec.ToString() << endl;
376  //cerr << "CanMeetSpec: " << (Mapper.CanMeetSpec(Feat->GetLocation(), DestSpec) ? "TRUE" : "FALSE" ) << endl;
377  //if(!GuessSpec.Pattern.empty() && DestSpec.Pattern.empty())
378  // DestSpec.Pattern = GuessSpec.Pattern;
379  Loc = Mapper.Map(Feat->GetLocation(), DestSpec);
380  //cerr << "Mapped: " << MSerial_AsnText << *Feat->GetLocation().GetId()
381  // << " to " << MSerial_AsnText << *Loc->GetId() << endl;
382  } catch(CException& e) {
383  cerr << "Map Exception: " << e.ReportAll() << endl;
384  }
385 
386  if(Loc.IsNull()) {
387  // cerr << "Map Fail" << endl;
388  // cerr << "Dest: " << DestSpec.ToString() << endl;
389  // cerr << "Guess: " << GuessSpec.ToString() << endl;
390  // cerr << MSerial_AsnText << Feat->GetLocation();
391  continue;
392  }
393 
394  Feat->SetLocation().Assign(*Loc);
395  }
396 
397  }
398 
399  //FeatLoader.WriteAnnots(Out, Annots, Mapper.GetInternalGencoll());
400 
401  ITERATE(list<CRef<CSeq_annot> >, AnnotIter, Annots) {
402  Out << MSerial_AsnText << **AnnotIter;
403  }
404 
405  return 0;
406 }
407 
408 
410  CGencollIdMapper::SIdSpec& DestSpec,
411  CNcbiOstream& Out)
412 {
413  const CArgs& args = GetArgs();
414 
415  CRef<CSeq_align_set> Alignments(new CSeq_align_set);
416 
417  int Row = -1;
418  if(args["row"].HasValue())
419  Row = args["row"].AsInteger();
420 
421  CNcbiIstream& In = args["align"].AsInputFile();
422  while(!In.eof()) {
423  CRef<CSeq_align_set> AlignSet(new CSeq_align_set);
424  CRef<CSeq_annot> Annot(new CSeq_annot);
425  CRef<CSeq_align> Align(new CSeq_align);
426 
427  off_t Pos = In.tellg();
428  if(Pos == -1)
429  break;
430 
431  try {
432  In.seekg(Pos);
433  In >> MSerial_AsnBinary >> *AlignSet;
434  //cerr << "Success Binary Seq-align-set" << endl;
435  Alignments->Set().insert(Alignments->Set().end(),
436  AlignSet->Set().begin(),
437  AlignSet->Set().end());
438  continue;
439  } catch(...) { ; }
440 
441  try {
442  In.seekg(Pos);
443  In >> MSerial_AsnBinary >> *Annot;
444  //cerr << "Success Binary Seq-annot" << endl;
445  Alignments->Set().insert(Alignments->Set().end(),
446  Annot->SetData().SetAlign().begin(),
447  Annot->SetData().SetAlign().end());
448  continue;
449  } catch(...) { ; }
450 
451  try {
452  In.seekg(Pos);
453  In >> MSerial_AsnBinary >> *Align;
454  //cerr << "Success Binary Seq-align" << endl;
455  Alignments->Set().push_back(Align);
456  continue;
457  } catch(...) { ; }
458 
459  try {
460  In.seekg(Pos);
461  //Pos = In.tellg();
462  In >> MSerial_AsnText >> *AlignSet;
463  //cerr << "Success Text Seq-align-set" << endl;
464  //cerr << Alignments->Set().size() << " "
465  // << AlignSet->Set().size() << endl;
466  Alignments->Set().insert(Alignments->Set().end(),
467  AlignSet->Set().begin(),
468  AlignSet->Set().end());
469  //cerr << Alignments->Set().size() << endl;
470  continue;
471  } catch(...) { ; }
472 
473  try {
474  In.seekg(Pos);
475  In >> MSerial_AsnText >> *Annot;
476  //cerr << "Success Text Seq-annot" << endl;
477  Alignments->Set().insert(Alignments->Set().end(),
478  Annot->SetData().SetAlign().begin(),
479  Annot->SetData().SetAlign().end());
480  continue;
481  } catch(...) { ; }
482 
483  try {
484  In.seekg(Pos);
485  In >> MSerial_AsnText >> *Align;
486  //cerr << "Success Text Seq-align" << endl;
487  Alignments->Set().push_back(Align);
488  continue;
489  } catch(...) { ; }
490 
491  if(!In.eof()) {
492  if(Alignments->Get().empty()) {
493  cerr << "File reader failure";
494  return 1;
495  }
496  }
497  //cerr << "Non-eof End of Filereader!" << endl;
498  }
499 
500  if(Alignments->Get().empty())
501  return 1;
502 
503 
505  Alignments->Set()) {
506  x_RecurseMapSeqAligns(**AlignIter, Row, Mapper, DestSpec);
507  }
508 
509  //cout << MSerial_AsnText << *Alignments;
510  ITERATE(CSeq_align_set::Tdata, AlignIter, Alignments->Get()) {
511  Out << MSerial_AsnText << **AlignIter;
512  }
513 
514  return 0;
515 }
516 
517 
519  CGencollIdMapper::SIdSpec& DestSpec,
520  CNcbiOstream& Out)
521 {
522  const CArgs& args = GetArgs();
523 
525 
526 
527  int Row = -1;
528  if(args["row"].HasValue())
529  Row = args["row"].AsInteger();
530 
531  CNcbiIstream& In = args["entry"].AsInputFile();
532  //while(!In.eof()) {
533  In >> MSerial_AsnText >> *Entry;
534 
535  //}
536 
537 
538  CTypeIterator<CSeq_align> AlignIter(*Entry);
539  while(AlignIter) {
540 
541  x_RecurseMapSeqAligns(*AlignIter, Row, Mapper, DestSpec);
542  ++AlignIter;
543  }
544 
545 
546  //ITERATE(CSeq_align_set::Tdata, AlignIter, Alignments->Get()) {
547  Out << MSerial_AsnText << *Entry;
548  //}
549 
550  return 0;
551 }
552 
553 
555  CGencollIdMapper& Mapper,
556  CGencollIdMapper::SIdSpec& DestSpec)
557 {
558  if(Align.GetSegs().IsDisc()) {
560  Align.SetSegs().SetDisc().Set()) {
561  x_RecurseMapSeqAligns(**AlignIter, Row, Mapper, DestSpec);
562  }
563  return;
564  }
565 
566  else if(Align.GetSegs().IsDenseg()) {
567 
568  CDense_seg& Denseg = Align.SetSegs().SetDenseg();
569  int Loop = 0;
570  NON_CONST_ITERATE(CDense_seg::TIds, IdIter, Denseg.SetIds()) {
571  //cerr << __LINE__ << " : " << Loop << " of " << Row << endl;
572  if(Row == -1 || Row == Loop) {
573  CSeq_id& Id = **IdIter;
574 
575  CSeq_loc Whole;
576  //Whole.SetWhole(Id);
577  CRef<CSeq_loc> T = Align.CreateRowSeq_loc(Row);
578  Whole.Assign(*T);
579 
580 
581  CRef<CSeq_loc> Mapped;
582  Mapped = Mapper.Map(Whole, DestSpec);
583 
584 
585  if(!Mapped.IsNull() && !Mapped->IsNull() && !Mapped->IsEmpty() ) {
586  //cerr << "Repping " << MSerial_AsnText << Whole
587  // << " with " << MSerial_AsnText << *Mapped << endl;
588  if(Whole.Equals(*Mapped)) {
589  //cerr << __LINE__ << " SKIP " << endl;
590  Loop++;
591  continue;
592  }
593  if(Mapped->IsWhole()) {
594  Id.Assign(Mapped->GetWhole());
595  } else if(Mapped->IsInt()) {
596  if(Whole.GetInt().GetLength() != Mapped->GetInt().GetLength()) {
597  cerr << __LINE__ << " : " << "Can not perfectly map from "
598  << Whole.GetInt().GetId().AsFastaString() << " to "
599  << Mapped->GetInt().GetId().AsFastaString() << " , "
600  << "The first is not entirely represented in the second." << endl;
601  }
602  CRef<CSeq_align> MapAlign;
603  try {
604  CSeq_loc_Mapper Mapper(Whole, *Mapped, NULL);
605  MapAlign = Mapper.Map(Align, Row);
606  } catch(CException& e) {
607  cerr <<__LINE__<< " : " << "CSeq_loc_Mapper ctor or Map exception" << endl;
608  ERR_POST(e.ReportAll());
609  }
610  //MapAlign = sequence::RemapAlignToLoc(Align, Row, *Mapped, NULL); // scope)
611  if(MapAlign) {
612  //cerr << __LINE__ << " ASSIGN_MAP " << endl;
613  Align.Assign(*MapAlign);
614  //cerr << MSerial_AsnText << Align;
615  //Denseg = Align.SetSegs().SetDenseg();
616  break;
617  } else {
618  cerr << __LINE__ << " FAIL_MAP " << endl;
619  }
620  //Denseg.RemapToLoc(Row, *Mapped, false);
621  /* Id.Assign(Mapped->GetInt().GetId());
622  TSignedSeqPos Offset = ((TSignedSeqPos)Mapped->GetStart(eExtreme_Positional))
623  - ((TSignedSeqPos)Whole.GetStart(eExtreme_Positional));
624  Denseg.OffsetRow(Row, Offset);
625  if(T->GetStrand() != Mapped->GetStrand()) {
626  Denseg.Reverse();
627  for(size_t I=0; I < Denseg.GetStrands().size(); I++) {
628  if( (I % Denseg.GetDim()) != Row ) {
629  if(Denseg.GetStrands()[I] == eNa_strand_plus)
630  Denseg.SetStrands()[I] = eNa_strand_minus;
631  else
632  Denseg.SetStrands()[I] = eNa_strand_plus;
633  }
634  }
635  }*/
636  }
637  } else {
638  cerr << "Align: Failed on " << MSerial_AsnText << Id ;
639  if(!Mapped.IsNull())
640  cerr << MSerial_AsnText << *Mapped << endl;
641  }
642  }
643 
644  Loop++;
645  }
646 
647  return;
648  }
649 
650  else if(Align.GetSegs().IsSpliced()) {
651  CSpliced_seg& Spliced = Align.SetSegs().SetSpliced();
652 
653  NON_CONST_ITERATE( list< CRef<CSpliced_exon> >, ExonIter, Spliced.SetExons()) {
654 
655  //
656  }
657 
658  }
659 
660 }
661 
662 
663 
664 /////////////////////////////////////////////////////////////////////////////
665 // MAIN
666 //
667 
668 int main(int argc, const char* argv[])
669 {
670  SetSplitLogFile(false);
673  int result = 1;
674  try {
675  result = CIdMapperTestApp().AppMain(argc, argv, 0, eDS_Default, 0);//, "../ctgoverlap_web.ini");
676  //_TRACE("back to normal diags");
677  } catch (CArgHelpException& e) {
678  cout << e.ReportAll() << endl;
679  }
680  return result;
681 }
static CRef< CScope > m_Scope
CArgDescriptions –.
Definition: ncbiargs.hpp:541
CArgHelpException –.
Definition: ncbiargs.hpp:158
CArgs –.
Definition: ncbiargs.hpp:379
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CReader *reader=0, CObjectManager::EIsDefault is_default=CObjectManager::eDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
Definition: gbloader.cpp:366
bool Guess(const objects::CSeq_loc &Loc, SIdSpec &Spec) const
Definition: id_mapper.cpp:129
CRef< objects::CSeq_loc > Map(const objects::CSeq_loc &Loc, const SIdSpec &Spec) const
Definition: id_mapper.cpp:168
CRef< CGC_Assembly > GetAssembly(const string &acc, const string &mode)
virtual void Init(void)
CBioseq::TAnnot Annots
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)
virtual int Run()
CRef< CScope > m_Scope
CScope –.
Definition: scope.hpp:92
CRef< CSeq_loc > CreateRowSeq_loc(TDim row) const
Definition: Seq_align.cpp:2028
Definition: Seq_entry.hpp:56
TSeqPos GetLength(void) const
CSeq_loc_Mapper –.
Template class for iteration on objects of class C.
Definition: iterator.hpp:673
Include a standard set of the NCBI C++ Toolkit most basic headers.
The NCBI C++ standard methods for dealing with std::string.
unsigned short Pos
#define T(s)
Definition: common.h:230
static void Init(void)
Definition: cursor6.c:76
User-defined methods of the data storage class.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:822
#define CNcbiApplication
@ eInputFile
Name of file (must exist and be readable)
Definition: ncbiargs.hpp:595
@ eString
An arbitrary string.
Definition: ncbiargs.hpp:589
@ eOutputFile
Name of file (must be writable)
Definition: ncbiargs.hpp:596
@ eInteger
Convertible into an integer number (int or Int8)
Definition: ncbiargs.hpp:592
#define NULL
Definition: ncbistd.hpp:225
void DBAPI_RegisterDriver_FTDS(void)
CDiagContext & GetDiagContext(void)
Get diag context instance.
Definition: logging.cpp:818
void SetSplitLogFile(bool value=true)
Split log files flag.
Definition: ncbidiag.cpp:6708
EDiagSev SetDiagPostLevel(EDiagSev post_sev=eDiag_Error)
Set the threshold severity for posting the messages.
Definition: ncbidiag.cpp:6132
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
Definition: ncbidiag.hpp:186
static void SetOldPostFormat(bool value)
Set old/new format flag.
Definition: ncbidiag.cpp:3352
@ eDS_Default
Try standard log file (app.name + ".log") in /log/, use stderr on failure.
Definition: ncbidiag.hpp:1790
@ eDiag_Info
Informational message.
Definition: ncbidiag.hpp:651
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
string ReportAll(TDiagPostFlags flags=eDPF_Exception) const
Report all exceptions.
Definition: ncbiexpt.cpp:370
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define MSerial_AsnBinary
Definition: serialbase.hpp:697
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:696
const string AsFastaString(void) const
Definition: Seq_id.cpp:2266
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
Definition: Seq_id.cpp:318
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.
Definition: scope.cpp:504
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
Definition: ncbiobj.hpp:735
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
Definition: ncbistre.hpp:146
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.
Definition: Seq_align_.cpp:310
TExons & SetExons(void)
Assign a value to Exons data member.
vector< CRef< CSeq_id > > TIds
Definition: Dense_seg_.hpp:106
bool IsDisc(void) const
Check if variant Disc is selected.
Definition: Seq_align_.hpp:772
bool IsSpliced(void) const
Check if variant Spliced is selected.
Definition: Seq_align_.hpp:778
list< CRef< CSeq_align > > Tdata
TIds & SetIds(void)
Assign a value to Ids data member.
Definition: Dense_seg_.hpp:511
const Tdata & Get(void) const
Get the member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
Definition: Seq_align_.hpp:921
bool IsDenseg(void) const
Check if variant Denseg is selected.
Definition: Seq_align_.hpp:740
void SetLocation(TLocation &value)
Assign a value to Location data member.
Definition: Seq_feat_.cpp:131
const TLocation & GetLocation(void) const
Get the Location member data.
Definition: Seq_feat_.hpp:1117
bool IsEmpty(void) const
Check if variant Empty is selected.
Definition: Seq_loc_.hpp:516
const TId & GetId(void) const
Get the Id member data.
const TWhole & GetWhole(void) const
Get the variant data.
Definition: Seq_loc_.cpp:172
bool IsWhole(void) const
Check if variant Whole is selected.
Definition: Seq_loc_.hpp:522
bool IsInt(void) const
Check if variant Int is selected.
Definition: Seq_loc_.hpp:528
const TInt & GetInt(void) const
Get the variant data.
Definition: Seq_loc_.cpp:194
bool IsNull(void) const
Check if variant Null is selected.
Definition: Seq_loc_.hpp:504
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_annot_.cpp:244
list< CRef< CSeq_feat > > TFtable
Definition: Seq_annot_.hpp:193
list< CRef< CSeq_annot > > TAnnot
Definition: Bioseq_.hpp:97
map< string, CStopWatch > TTimerMap
int main(int argc, const char *argv[])
TTimerMap TimerMap
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.
Definition: ncbiapp_api.hpp:54
Defines NCBI C++ diagnostic APIs, classes, and macros.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
The Object manager core.
void Out(T t, int w, CNcbiOstream &to=cout)
Definition: parse.cpp:467
Reader-writer based streams.
CRef< objects::CObjectManager > om
string ToString(void) const
Definition: id_mapper.cpp:1821
Definition: entry.h:57
else result
Definition: token2.c:20
ZLib Compression API.
Modified on Wed Jul 17 13:22:39 2024 by modify_doxy.py rev. 669887