NCBI C++ ToolKit
context.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef OBJTOOLS_FORMAT___CONTEXT__HPP
2 #define OBJTOOLS_FORMAT___CONTEXT__HPP
3 
4 /* $Id: context.hpp 99481 2023-04-04 13:16:28Z stakhovv $
5 * ===========================================================================
6 *
7 * PUBLIC DOMAIN NOTICE
8 * National Center for Biotechnology Information
9 *
10 * This software/database is a "United States Government Work" under the
11 * terms of the United States Copyright Act. It was written as part of
12 * the author's official duties as a United States Government employee and
13 * thus cannot be copyrighted. This software/database is freely available
14 * to the public for use. The National Library of Medicine and the U.S.
15 * Government have not placed any restriction on its use or reproduction.
16 *
17 * Although all reasonable efforts have been taken to ensure the accuracy
18 * and reliability of the software and data, the NLM and the U.S.
19 * Government do not and cannot warrant the performance or results that
20 * may be obtained by using this software or data. The NLM and the U.S.
21 * Government disclaim all warranties, express or implied, including
22 * warranties of performance, merchantability or fitness for any particular
23 * purpose.
24 *
25 * Please cite the author in any work or product based on this material.
26 *
27 * ===========================================================================
28 *
29 * Author: Aaron Ucko, Mati Shomrat
30 *
31 * File Description:
32 * new (early 2003) flat-file generator -- context needed when (pre)formatting
33 *
34 */
35 #include <corelib/ncbistd.hpp>
36 #include <corelib/ncbiobj.hpp>
38 #include <objects/seq/Bioseq.hpp>
39 #include <objects/seq/Seq_inst.hpp>
40 #include <objects/seq/MolInfo.hpp>
44 #include <objmgr/bioseq_handle.hpp>
48 #include <objmgr/util/feature.hpp>
49 #include <objmgr/util/indexer.hpp>
50 
51 #include <util/range.hpp>
52 
55 
56 #include <memory>
57 
60 
61 class CScope;
62 class CMasterContext;
63 class CFlatFileContext;
65 
66 /////////////////////////////////////////////////////////////////////////////
67 //
68 // CBioseqContext
69 //
70 // information on the bioseq being formatted
71 
73 {
74 public:
75  // types
77  typedef vector<TRef> TReferences;
79 
80  // constructor
82  const CBioseq_Handle& seq,
83  CFlatFileContext& ffctx,
84  CMasterContext* mctx = nullptr,
85  CTopLevelSeqEntryContext* tlsec = nullptr);
86 
88  const CBioseq_Handle& prev_seq,
89  const CBioseq_Handle& seq,
90  const CBioseq_Handle& next_seq,
91  CFlatFileContext& ffctx,
92  CMasterContext* mctx = nullptr,
93  CTopLevelSeqEntryContext* tlsec = nullptr);
94  // destructor
95  ~CBioseqContext(void);
96 
97  // Get the bioseq's handle (and those of its neighbors)
98  CBioseq_Handle& GetPrevHandle(void) { return m_PrevHandle; }
99  CBioseq_Handle& GetHandle(void) { return m_Handle; }
100  const CBioseq_Handle& GetHandle(void) const { return m_Handle; }
101  CBioseq_Handle& GetNextHandle(void) { return m_NextHandle; }
102  CScope& GetScope(void) const { return m_Handle.GetScope(); }
103  feature::CFeatTree& GetFeatTree(void) { return m_FeatTree; }
104  bool UsingSeqEntryIndex(void) const;
105  const CRef<CSeqEntryIndex> GetSeqEntryIndex(void) const;
106 
107  // -- id information
108  CSeq_id* GetPrimaryId(void) { return m_PrimaryId; }
109  CSeq_id_Handle GetPreferredSynonym(const CSeq_id& id) const;
110  const string& GetAccession(void) const { return m_Accession; }
111  TGi GetGI(void) const { return m_Gi; }
112 
113  // molecular type (nucleotide / protein)
114  bool IsProt(void) const { return m_IsProt; }
115  bool IsNuc (void) const { return !m_IsProt; }
116 
117  CSeq_inst::TRepr GetRepr (void) const { return m_Repr; }
118  CSeq_inst::TMol GetMol (void) const { return m_Mol; }
119  const CMolInfo* GetMolinfo(void) const { return m_Molinfo; }
120  CMolInfo::TTech GetTech (void) const;
121  CMolInfo::TBiomol GetBiomol (void) const;
122  const CBioseq::TId& GetBioseqIds(void) const;
123 
124  // segmented bioseq
125  bool IsSegmented(void) const { return m_Repr == CSeq_inst::eRepr_seg; }
126  bool HasParts(void) const { return m_HasParts; }
127 
128  // part of a segmented bioseq
129  bool IsPart(void) const { return m_IsPart; }
130  SIZE_TYPE GetPartNumber (void) const { return m_PartNumber; }
131  SIZE_TYPE GetTotalNumParts(void) const;
132  CMasterContext& GetMaster (void) { return *m_Master; }
133  bool CanGetMaster (void) const { return m_Master.NotNull(); }
134  void SetMaster(CMasterContext& mctx);
135 
136  // top-level Seq-entry info
137  CTopLevelSeqEntryContext& GetTLSeqEntryCtx(void) { return *m_TLSeqEntryCtx; }
138  bool CanGetTLSeqEntryCtx (void) const { return m_TLSeqEntryCtx.NotNull(); }
139  bool IsBioseqInSameTopLevelSeqEntry(const CBioseq_Handle & seq);
140  bool IsSeqIdInSameTopLevelSeqEntry(const CSeq_id & seq_id );
141 
142  // delta sequence
143  bool IsDelta(void) const { return m_Repr == CSeq_inst::eRepr_delta; }
144  bool IsDeltaLitOnly(void) const { return m_IsDeltaLitOnly; }
145 
146  // Whole Genome Shotgun
147  bool IsWGS (void) const { return m_IsWGS; }
148  bool IsWGSMaster(void) const { return m_IsWGSMaster; }
149  const string& GetWGSMasterAccn(void) const { return m_WGSMasterAccn; }
150  const string& GetWGSMasterName(void) const { return m_WGSMasterName; }
151 
152  // Transcriptome Shotgun Assembly
153  bool IsTSA (void) const { return m_IsTSA; }
154  bool IsTSAMaster(void) const { return m_IsTSAMaster; }
155  const string& GetTSAMasterAccn(void) const { return m_TSAMasterAccn; }
156  const string& GetTSAMasterName(void) const { return m_TSAMasterName; }
157 
158  // Targeted Locus Study
159  bool IsTLS (void) const { return m_IsTLS; }
160  bool IsTLSMaster(void) const { return m_IsTLSMaster; }
161  const string& GetTLSMasterAccn(void) const { return m_TLSMasterAccn; }
162  const string& GetTLSMasterName(void) const { return m_TLSMasterName; }
163 
164  TReferences& SetReferences(void) { return m_References; }
165  const TReferences& GetReferences(void) const { return m_References; }
166 
167  // range on the bioseq to be formatted. the location is either
168  // whole or an interval (no complex locations allowed)
169  const CSeq_loc& GetLocation(void) const { return *m_Location; }
170  CSeq_loc_Mapper* GetMapper(void) { return m_Mapper; }
171 
172  bool DoContigStyle(void) const;
173  bool ShowGBBSource(void) const { return m_ShowGBBSource; }
174 
175  bool IsInSGS (void) const { return m_IsInSGS; } // Is in a small-gen set?
176  bool IsInGPS (void) const { return m_IsInGPS; } // Is in a gene-prod set?
177  bool IsInNucProt(void) const { return m_IsInNucProt; } // Is in a nuc-prot set?
178 
179  // type of bioseq?
180  bool IsGED (void) const { return m_IsGED; } // Genbank, EMBL or DDBJ
181  bool IsGenbank (void) const { return m_IsGenbank; } // Genbank
182  bool IsEMBL (void) const { return m_IsEMBL; } // EMBL
183  bool IsDDBJ (void) const { return m_IsDDBJ; } // DDBJ
184  bool IsPDB (void) const { return m_IsPDB; } // PDB
185  bool IsSP (void) const { return m_IsSP; } // SwissProt
186  bool IsTPA (void) const { return m_IsTPA; } // Third-Party Annotation
187  bool IsJournalScan (void) const { return m_IsJournalScan; } // scanned from journal
188  bool IsPatent (void) const { return m_IsPatent; } // patent
189  bool IsGbGenomeProject(void) const { return m_IsGbGenomeProject; } // AE
190  bool IsNcbiCONDiv (void) const { return m_IsNcbiCONDiv; } // CH
191  bool IsNcbiGenomes (void) const { return m_IsNcbiGenomes; } // db NCBI_GENOMES
192 
193  // RefSeq ID queries
194  bool IsRefSeq(void) const { return m_IsRefSeq; }
195  bool IsRSCompleteGenomic (void) const; // NC_
196  bool IsRSIncompleteGenomic(void) const; // NG_
197  bool IsRSMRna (void) const; // NM_
198  bool IsRSNonCodingRna (void) const; // NR_
199  bool IsRSProtein (void) const; // NP_
200  bool IsRSContig (void) const; // NT_
201  bool IsRSIntermedWGS (void) const; // NW_
202  bool IsRSPredictedMRna (void) const; // XM_
203  bool IsRSPredictedNCRna (void) const; // XR_
204  bool IsRSPredictedProtein (void) const; // XP_
205  bool IsRSWGSNuc (void) const; // NZ_
206  bool IsRSWGSProt (void) const; // ZP_
207  bool IsRSUniqueProt (void) const; // WP_
208 
209  bool IsEncode (void) const; // provided by the ENCODE project
210  const CUser_object& GetEncode(void) const;
211 
212  const string &GetFinishingStatus(void) const;
213  bool IsGenomeAssembly(void) const;
214  bool IsCrossKingdom(void) const;
215 
216  bool UsePDBCompoundForComment(void) const;
217  void SetPDBCompoundForComment(bool value);
218 
219  NCBI_DEPRECATED bool IsUnverified(void) const;
220  enum FUnverified {
221  fUnverified_None = 0, // for convenience
222 
223  fUnverified_Organism = 1 << 0,
224  fUnverified_SequenceOrAnnotation = 1 << 1,
225  fUnverified_Misassembled = 1 << 2,
226  fUnverified_Contaminant = 1 << 3
227  // if you add more here, make sure
228  // to update CFlatGatherer::x_UnverifiedComment
229  };
230  typedef Int8 TUnverified;
231  TUnverified GetUnverifiedType(void) const;
232  enum FUnreviewed {
233  fUnreviewed_None = 0, // for convenience
234 
235  fUnreviewed_Unannotated = 1 << 0
236  // if you add more here, make sure
237  // to update CFlatGatherer::x_UnreviewedComment
238  };
239  typedef Int8 TUnreviewed;
240  TUnreviewed GetUnreviewedType(void) const;
241  bool ShowAnnotCommentAsCOMMENT() const;
242 
243  bool IsHup(void) const { return m_IsHup; } // !!! should move to global?
244 
245  // patent seqid
246  int GetPatentSeqId (void) const { return m_PatSeqid; }
247 
248  // global data from CFlatFileContext
249  const CSubmit_block* GetSubmitBlock(void) const;
250  const CSeq_entry_Handle& GetTopLevelEntry(void) const;
251  const CFlatFileConfig& Config(void) const;
252  const SAnnotSelector* GetAnnotSelector(void) const;
253  SAnnotSelector& SetAnnotSelector(void);
254  const CSeq_loc* GetMasterLocation(void) const;
255  bool GetSGS(void) const;
256  bool IsGenbankFormat(void) const;
257 
258  bool HasOperon(void) const;
259  bool HasMultiIntervalGenes(void) const;
260 
261  /// Checks if CFlatFileConfig has an ICanceled, and throws
262  /// if it indicates cancellation.
263  void ThrowIfCanceled(void) const;
264 
265  /// Empty string if unavailable
266  const string & GetTaxname(void) const;
267 
268  /// Empty if no Filetrack URL.
269  const string & GetFiletrackURL(void) const { return m_FiletrackURL; }
270 
271  /// Empty if no Basemod URLs.
272  const vector< string > & GetBasemodURLs(void) const { return m_BasemodURLs; }
273 
274  // empty if there is none
275  const string & GetAuthorizedAccess(void) const { return m_AuthorizedAccess; }
276 
277  /// Empty or NULL if no points or if this bioseq isn't an optical map.
278  const CPacked_seqpnt * GetOpticalMapPoints(void) const {
279  return m_pOpticalMapPoints; }
280 
281  vector<string>* GetRefCache (void) const { return m_RefCache; }
282  void SetRefCache (vector<string>* rc) { m_RefCache = rc; }
283 
284 private:
285  void x_Init(const CBioseq_Handle& seq, const CSeq_loc* user_loc);
286  void x_SetId(void);
287  bool x_HasParts(void) const;
288  bool x_IsDeltaLitOnly(void) const;
289  bool x_IsPart(void) const;
291  SIZE_TYPE x_GetPartNumber(void);
292  bool x_IsInSGS(void) const;
293  bool x_IsInGPS(void) const;
294  bool x_IsInNucProt(void) const;
295  void x_SetLocation(const CSeq_loc* user_loc = nullptr);
296  void x_SetMapper(const CSeq_loc& loc);
297  void x_SetHasMultiIntervalGenes(void) const;
298  void x_SetDataFromUserObjects(void);
299  void x_CheckForShowComments() const;
300  void x_SetTaxname(void) const;
301  void x_SetFiletrackURL(const CUser_object& uo);
302  void x_SetAuthorizedAccess(const CUser_object& uo);
303  void x_SetOpticalMapPoints(void);
304  void x_SetEncode(const CUser_object& uo);
305 
306  CSeq_inst::TRepr x_GetRepr(void) const;
307  const CMolInfo* x_GetMolInfo(void) const;
308  bool x_HasOperon(void) const;
309 
310  // data
314  feature::CFeatTree m_FeatTree;
316  string m_Accession;
324  mutable string m_Taxname;
326  vector< string > m_BasemodURLs;
329  // used to destroy m_pOpticalMapPoints if it was manually
330  // created.
331  unique_ptr<CPacked_seqpnt> m_pOpticalMapPointsDestroyer;
332 
336 
337  // segmented bioseq
339  // part of a segmented bioseq
340  bool m_IsPart;
342  // delta bioseq
344 
345  bool m_IsProt; // Protein
346  bool m_IsInSGS; // Small-Genome Set
347  bool m_IsInGPS; // Genomic-Product Set
348  bool m_IsInNucProt; // Nuc-Prot Set
349  bool m_IsGED; // Genbank, Embl or Ddbj
350  bool m_IsGenbank; // Genbank
351  bool m_IsEMBL; // EMBL
352  bool m_IsDDBJ; // DDBJ
353  bool m_IsPDB; // PDB
354  bool m_IsSP; // SwissProt
355  bool m_IsTPA; // Third Party Annotation
356  bool m_IsJournalScan; // scanned from journal
358  unsigned int m_RefseqInfo;
359  bool m_IsGbGenomeProject; // GenBank Genome project data
360  bool m_IsNcbiCONDiv; // NCBI CON division
361  bool m_IsNcbiGenomes; // NCBI_GENOMES
363  bool m_IsGI;
364  bool m_IsWGS;
366  bool m_IsTSA;
368  bool m_IsTLS;
370  bool m_IsHup;
374  mutable bool m_HasOperon;
377  mutable bool m_IsCrossKingdom;
383 
385 
391  mutable vector<string>* m_RefCache;
394 };
395 
396 
397 /////////////////////////////////////////////////////////////////////////////
398 //
399 // CMasterContext
400 //
401 // When formatting segmented bioseq CMasterContext holds information
402 // on the Master bioseq.
403 
405 {
406 public:
407  // constructor
408  CMasterContext(const CBioseq_Handle& master);
409  // destructor
410  ~CMasterContext(void);
411 
412  // Get the segmented bioseq's handle
413  const CBioseq_Handle& GetHandle(void) const { return m_Handle; }
414  // Get the number of parts
415  SIZE_TYPE GetNumParts (void) const { return m_NumParts; }
416  // Get the base name
417  const string& GetBaseName (void) const { return m_BaseName; }
418 
419  // Find the serial number of a part in the segmented bioseq
420  SIZE_TYPE GetPartNumber(const CBioseq_Handle& part);
421 
422 private:
423  void x_SetBaseName(void);
424  void x_SetNumParts(void);
425 
426  // data
428  string m_BaseName;
430 };
431 
432 
433 /////////////////////////////////////////////////////////////////////////////
434 //
435 // CFlatFileContext
436 
438 {
439 public:
440  // types
442  typedef vector< CRef<CBioseqContext> > TSections;
443 
444  // constructor
445  CFlatFileContext(const CFlatFileConfig& cfg) : m_Cfg(cfg), m_SmallGenomeSet(false) { }
446  // destructor
448 
449  const CSeq_entry_Handle& GetEntry(void) const { return m_Entry; }
450  void SetEntry(const CSeq_entry_Handle& entry) { m_Entry = entry; }
451 
452  const CSubmit_block* GetSubmitBlock(void) const { return m_Submit; }
453  void SetSubmit(const CSubmit_block& sub) { m_Submit = &sub; }
454 
455  const CFlatFileConfig& GetConfig(void) const { return m_Cfg; }
456  CFlatFileConfig& SetConfig(void) { return m_Cfg; }
457  void SetConfig(const CFlatFileConfig& cfg) { m_Cfg = cfg; }
458 
459  const SAnnotSelector* GetAnnotSelector(void) const;
460  SAnnotSelector& SetAnnotSelector(void);
461  void SetAnnotSelector(const SAnnotSelector&);
462 
463  const CSeq_loc* GetLocation(void) const { return m_Loc; }
464  void SetLocation(const CSeq_loc* loc) { m_Loc.Reset(loc); }
465 
466  const feature::CFeatTree* GetFeatTree(void) const { return m_FeatTree; }
467  feature::CFeatTree* GetFeatTree(void) { return m_FeatTree; }
468  void SetFeatTree(feature::CFeatTree* tree) { m_FeatTree.Reset(tree); }
469 
470  bool UsingSeqEntryIndex(void) const { return (m_Idx != 0); }
471  const CRef<CSeqEntryIndex> GetSeqEntryIndex(void) const { return m_Idx; }
472  void SetSeqEntryIndex(CRef<CSeqEntryIndex> idx) { m_Idx = idx; }
473  void ResetSeqEntryIndex(void) { m_Idx.Reset(); }
474 
475  bool GetSGS(void) const { return m_SmallGenomeSet; }
476  void SetSGS(const bool sgs) { m_SmallGenomeSet = sgs; }
477 
478  void AddSection(TSection& section) { m_Sections.push_back(section); }
479 
480  void Reset(void);
481 
482 private:
483 
488  unique_ptr<SAnnotSelector> m_Selector;
493 };
494 
495 /////////////////////////////////////////////////////////////////////////////
496 //
497 // CTopLevelSeqEntryContext
498 
499 // This class is for information about a top-level Seq-entry which
500 // doesn't belong in the entry itself because it has to be calculated
501 // from it. Also, it doesn't belong in CFlatFileContext because it's
502 // not formatting information.
503 
505 {
506 public:
507  CTopLevelSeqEntryContext( const CSeq_entry_Handle &entry_handle, bool useIndexedFasterSets = false );
508  void x_InitSeqs (const CSeq_entry& sep);
509 
510  bool GetCanSourcePubsBeFused(void) const { return m_CanSourcePubsBeFused; }
511  bool GetHasSmallGenomeSet(void) const { return m_HasSmallGenomeSet; }
512 
513 private:
516 };
517 
518 
519 /////////////////////////////////////////////////////////////////////////////
520 // inline methods
521 
522 // -------- CBioseqContext
523 
524 inline
526 {
527  return m_Handle.GetBioseqCore()->GetId();
528 }
529 
530 inline
532 {
533  return m_Master->GetNumParts();
534 }
535 
536 inline
538  m_Master.Reset(&mctx);
539 }
540 
541 inline
543 {
544  return seq.GetTopLevelEntry() == m_Handle.GetTopLevelEntry();
545 }
546 
547 inline
549 {
550  return GetScope().GetBioseqHandleFromTSE(seq_id, m_Handle);
551 }
552 
553 inline
555 {
557 }
558 
559 inline
561 {
563 }
564 
565 inline
566 bool CBioseqContext::IsRSMRna(void) const
567 {
568  return m_RefseqInfo == CSeq_id::eAcc_refseq_mrna; // NM_
569 }
570 
571 inline
573 {
574  return m_RefseqInfo == CSeq_id::eAcc_refseq_ncrna; // NR_
575 }
576 
577 inline
579 {
580  return m_RefseqInfo == CSeq_id::eAcc_refseq_prot; // NP_
581 }
582 
583 inline
585 {
586  return m_RefseqInfo == CSeq_id::eAcc_refseq_contig; // NT_
587 }
588 
589 inline
591 {
593 }
594 
595 inline
597 {
599 }
600 
601 inline
603 {
605 }
606 
607 inline
609 {
611 }
612 
613 inline
615 {
616  // ignore "master" bit if it's there
618 }
619 
620 inline
622 {
624 }
625 
626 inline
627 bool CBioseqContext::IsRSUniqueProt(void) const // WP
628 {
629  return m_RefseqInfo == CSeq_id::eAcc_refseq_unique_prot; // WP_
630 }
631 
632 inline
633 bool CBioseqContext::IsEncode(void) const
634 {
635  return m_Encode.NotEmpty();
636 }
637 
638 inline
640 {
641  _ASSERT(IsEncode());
642  return *m_Encode;
643 }
644 
645 inline
646 const string &CBioseqContext::GetFinishingStatus(void) const
647 {
648  return m_FinishingStatus;
649 }
650 
651 inline
653 {
654  return m_IsGenomeAssembly;
655 }
656 
657 inline
659 {
660  return ( m_fUnverified != fUnverified_None );
661 }
662 
663 inline
665 {
666  return m_fUnverified;
667 }
668 
669 inline
671 {
672  return m_fUnreviewed;
673 }
674 
675 inline
677 {
678  return m_FFCtx.UsingSeqEntryIndex();
679 }
680 
681 inline
683 {
684  return m_FFCtx.GetSeqEntryIndex();
685 }
686 
687 
688 inline
690 {
691  return m_FFCtx.GetConfig();
692 }
693 
694 inline
696 {
697  return m_FFCtx.GetSubmitBlock();
698 }
699 
700 inline
702 {
703  return m_FFCtx.GetEntry();
704 }
705 
706 inline
708 {
709  return m_FFCtx.GetAnnotSelector();
710 }
711 
712 inline
714 {
715  return m_FFCtx.SetAnnotSelector();
716 }
717 
718 inline
720 {
721  return m_FFCtx.GetLocation();
722 }
723 
724 
725 inline
726 bool CBioseqContext::GetSGS(void) const
727 {
728  return m_FFCtx.GetSGS();
729 }
730 
731 inline
733 {
735 }
736 
737 
738 inline
740 {
742 }
743 
744 
745 inline
747 {
748  return (Config().IsFormatGenbank() ||
749  Config().IsFormatGBSeq() ||
750  Config().IsFormatDDBJ());
751 }
752 
753 
754 inline
756 {
758 }
759 
760 // -------- CFlatFileContext
761 
762 inline
764 {
765  return m_Selector.get();
766 }
767 
768 inline
770 {
771  if (! m_Selector) {
773  }
774 
775  return *m_Selector;
776 }
777 
778 
779 inline
781 {
782  m_Selector.reset(new SAnnotSelector(sel));
783 }
784 
785 
786 inline
788 {
789  m_Entry.Reset();
790  m_Sections.clear();
791  m_Submit.Reset();
792  m_Selector.reset();
793  m_Loc.Reset();
794  m_SmallGenomeSet = false;
795 }
796 
797 
800 
801 #endif /* OBJTOOLS_FORMAT___CONTEXT__HPP */
User-defined methods of the data storage class.
#define false
Definition: bool.h:36
const TReferences & GetReferences(void) const
Definition: context.hpp:165
bool IsDeltaLitOnly(void) const
Definition: context.hpp:144
CBioseq_Handle m_NextHandle
Definition: context.hpp:313
bool IsRSPredictedNCRna(void) const
Definition: context.hpp:602
bool IsTLS(void) const
Definition: context.hpp:159
CRef< CSeq_loc_Mapper > m_Mapper
Definition: context.hpp:388
const string & GetTSAMasterName(void) const
Definition: context.hpp:156
bool IsNcbiCONDiv(void) const
Definition: context.hpp:190
CBioseq_Handle & GetHandle(void)
Definition: context.hpp:99
CSeq_inst::TMol GetMol(void) const
Definition: context.hpp:118
CConstRef< CSeq_loc > m_Location
Definition: context.hpp:387
bool IsGenomeAssembly(void) const
Definition: context.hpp:652
CMasterContext & GetMaster(void)
Definition: context.hpp:132
CTopLevelSeqEntryContext & GetTLSeqEntryCtx(void)
Definition: context.hpp:137
CScope & GetScope(void) const
Definition: context.hpp:102
bool IsWGSMaster(void) const
Definition: context.hpp:148
bool m_IsCrossKingdom
Definition: context.hpp:377
bool IsUnverified(void) const
Definition: context.hpp:658
bool IsRSPredictedProtein(void) const
Definition: context.hpp:608
const string & GetTLSMasterAccn(void) const
Definition: context.hpp:161
const string & GetFinishingStatus(void) const
Definition: context.hpp:646
bool CanGetMaster(void) const
Definition: context.hpp:133
bool IsEncode(void) const
Definition: context.hpp:633
bool IsJournalScan(void) const
Definition: context.hpp:187
CBioseq_Handle m_Virtual
Definition: context.hpp:389
string m_WGSMasterAccn
Definition: context.hpp:317
bool m_HasOperon
Definition: context.hpp:374
bool m_ShowAnnotCommentAsCOMMENT
Definition: context.hpp:381
SIZE_TYPE m_PartNumber
Definition: context.hpp:341
bool IsRSIncompleteGenomic(void) const
Definition: context.hpp:560
SAnnotSelector & SetAnnotSelector(void)
Definition: context.hpp:713
bool m_IsWGSMaster
Definition: context.hpp:365
bool UsingSeqEntryIndex(void) const
Definition: context.hpp:676
TUnreviewed m_fUnreviewed
Definition: context.hpp:380
TUnverified GetUnverifiedType(void) const
Definition: context.hpp:664
bool IsProt(void) const
Definition: context.hpp:114
string m_Taxname
Definition: context.hpp:324
bool IsTLSMaster(void) const
Definition: context.hpp:160
bool IsRSWGSProt(void) const
Definition: context.hpp:621
Int8 TUnreviewed
Definition: context.hpp:239
const CMolInfo * GetMolinfo(void) const
Definition: context.hpp:119
int GetPatentSeqId(void) const
Definition: context.hpp:246
bool m_UsePDBCompoundForComment
Definition: context.hpp:378
TReferences m_References
Definition: context.hpp:386
bool IsGbGenomeProject(void) const
Definition: context.hpp:189
const CFlatFileConfig & Config(void) const
Definition: context.hpp:689
vector< TRef > TReferences
Definition: context.hpp:77
bool IsDDBJ(void) const
Definition: context.hpp:183
CBioseq_Handle & GetPrevHandle(void)
Definition: context.hpp:98
unique_ptr< CPacked_seqpnt > m_pOpticalMapPointsDestroyer
Definition: context.hpp:331
unsigned int m_RefseqInfo
Definition: context.hpp:358
TUnreviewed GetUnreviewedType(void) const
Definition: context.hpp:670
bool m_IsNcbiGenomes
Definition: context.hpp:361
CMolInfo::TBiomol GetBiomol(void) const
Definition: context.hpp:739
bool IsBioseqInSameTopLevelSeqEntry(const CBioseq_Handle &seq)
Definition: context.hpp:542
const CSubmit_block * GetSubmitBlock(void) const
Definition: context.hpp:695
CSeq_inst::TRepr GetRepr(void) const
Definition: context.hpp:117
bool IsInGPS(void) const
Definition: context.hpp:176
CRef< CSeq_id > m_PrimaryId
Definition: context.hpp:315
CSeq_loc_Mapper * GetMapper(void)
Definition: context.hpp:170
bool IsRSMRna(void) const
Definition: context.hpp:566
bool IsNcbiGenomes(void) const
Definition: context.hpp:191
bool IsTSAMaster(void) const
Definition: context.hpp:154
bool IsPDB(void) const
Definition: context.hpp:184
bool IsRSIntermedWGS(void) const
Definition: context.hpp:590
string m_TSAMasterAccn
Definition: context.hpp:319
CSeq_id * GetPrimaryId(void)
Definition: context.hpp:108
const CPacked_seqpnt * m_pOpticalMapPoints
Definition: context.hpp:328
bool IsEMBL(void) const
Definition: context.hpp:182
const string & GetWGSMasterAccn(void) const
Definition: context.hpp:149
const CSeq_entry_Handle & GetTopLevelEntry(void) const
Definition: context.hpp:701
TGi GetGI(void) const
Definition: context.hpp:111
bool IsTSA(void) const
Definition: context.hpp:153
CRef< CReferenceItem > TRef
Definition: context.hpp:76
bool IsNuc(void) const
Definition: context.hpp:115
bool IsRefSeq(void) const
Definition: context.hpp:194
void ThrowIfCanceled(void) const
Checks if CFlatFileConfig has an ICanceled, and throws if it indicates cancellation.
Definition: context.hpp:755
bool IsRSContig(void) const
Definition: context.hpp:584
bool m_IsTLSMaster
Definition: context.hpp:369
bool m_HasMultiIntervalGenes
Definition: context.hpp:375
CConstRef< CUser_object > m_Encode
Definition: context.hpp:384
string m_WGSMasterName
Definition: context.hpp:318
bool m_IsGbGenomeProject
Definition: context.hpp:359
bool ShowGBBSource(void) const
Definition: context.hpp:173
const CBioseq::TId & GetBioseqIds(void) const
Definition: context.hpp:525
CConstRef< CMolInfo > m_Molinfo
Definition: context.hpp:335
CSeq_inst::TRepr m_Repr
Definition: context.hpp:333
TReferences & SetReferences(void)
Definition: context.hpp:164
bool IsGED(void) const
Definition: context.hpp:180
void SetRefCache(vector< string > *rc)
Definition: context.hpp:282
bool CanGetTLSeqEntryCtx(void) const
Definition: context.hpp:138
bool m_IsJournalScan
Definition: context.hpp:356
CRange< TSeqPos > TRange
Definition: context.hpp:78
bool IsRSNonCodingRna(void) const
Definition: context.hpp:572
CBioseq_Handle x_GetMasterForPart(void) const
bool m_IsGenomeAssembly
Definition: context.hpp:376
const CUser_object & GetEncode(void) const
Definition: context.hpp:639
bool m_IsGenbank
Definition: context.hpp:350
bool IsRSUniqueProt(void) const
Definition: context.hpp:627
bool GetSGS(void) const
Definition: context.hpp:726
bool IsDelta(void) const
Definition: context.hpp:143
const CPacked_seqpnt * GetOpticalMapPoints(void) const
Empty or NULL if no points or if this bioseq isn't an optical map.
Definition: context.hpp:278
const CSeq_loc & GetLocation(void) const
Definition: context.hpp:169
vector< string > * m_RefCache
Definition: context.hpp:391
bool IsRSProtein(void) const
Definition: context.hpp:578
CSeq_inst::TMol m_Mol
Definition: context.hpp:334
string m_FiletrackURL
Definition: context.hpp:325
bool IsWGS(void) const
Definition: context.hpp:147
bool IsRSWGSNuc(void) const
Definition: context.hpp:614
SIZE_TYPE GetTotalNumParts(void) const
Definition: context.hpp:531
bool m_ShowAnnotCommentAsCOMMENT_checked
Definition: context.hpp:382
bool IsGenbank(void) const
Definition: context.hpp:181
CBioseq_Handle m_Handle
Definition: context.hpp:312
bool m_IsInNucProt
Definition: context.hpp:348
string m_TSAMasterName
Definition: context.hpp:320
SIZE_TYPE GetPartNumber(void) const
Definition: context.hpp:130
const CSeq_loc * GetMasterLocation(void) const
Definition: context.hpp:719
const vector< string > & GetBasemodURLs(void) const
Empty if no Basemod URLs.
Definition: context.hpp:272
bool IsInNucProt(void) const
Definition: context.hpp:177
CMolInfo::TTech GetTech(void) const
Definition: context.hpp:732
string m_Accession
Definition: context.hpp:316
const CRef< CSeqEntryIndex > GetSeqEntryIndex(void) const
Definition: context.hpp:682
bool m_IsNcbiCONDiv
Definition: context.hpp:360
bool IsSegmented(void) const
Definition: context.hpp:125
void SetMaster(CMasterContext &mctx)
Definition: context.hpp:537
bool IsHup(void) const
Definition: context.hpp:243
Int8 TUnverified
Definition: context.hpp:230
bool IsInSGS(void) const
Definition: context.hpp:175
bool IsPart(void) const
Definition: context.hpp:129
bool IsSP(void) const
Definition: context.hpp:185
bool m_ShowGBBSource
Definition: context.hpp:372
vector< string > * GetRefCache(void) const
Definition: context.hpp:281
const CBioseq_Handle & GetHandle(void) const
Definition: context.hpp:100
CBioseq_Handle & GetNextHandle(void)
Definition: context.hpp:101
CFlatFileContext & m_FFCtx
Definition: context.hpp:390
bool m_IsDeltaLitOnly
Definition: context.hpp:343
const string & GetTSAMasterAccn(void) const
Definition: context.hpp:155
const string & GetTLSMasterName(void) const
Definition: context.hpp:162
TUnverified m_fUnverified
Definition: context.hpp:379
string m_AuthorizedAccess
Definition: context.hpp:327
string m_TLSMasterName
Definition: context.hpp:322
feature::CFeatTree m_FeatTree
Definition: context.hpp:314
bool HasParts(void) const
Definition: context.hpp:126
bool IsRSCompleteGenomic(void) const
Definition: context.hpp:554
vector< string > m_BasemodURLs
Definition: context.hpp:326
const SAnnotSelector * GetAnnotSelector(void) const
Definition: context.hpp:707
bool IsGenbankFormat(void) const
Definition: context.hpp:746
string m_FinishingStatus
Definition: context.hpp:323
CRef< CTopLevelSeqEntryContext > m_TLSeqEntryCtx
Definition: context.hpp:393
bool IsRSPredictedMRna(void) const
Definition: context.hpp:596
bool IsTPA(void) const
Definition: context.hpp:186
bool IsSeqIdInSameTopLevelSeqEntry(const CSeq_id &seq_id)
Definition: context.hpp:548
CRef< CMasterContext > m_Master
Definition: context.hpp:392
const string & GetWGSMasterName(void) const
Definition: context.hpp:150
feature::CFeatTree & GetFeatTree(void)
Definition: context.hpp:103
string m_TLSMasterAccn
Definition: context.hpp:321
CBioseq_Handle m_PrevHandle
Definition: context.hpp:311
bool m_IsTSAMaster
Definition: context.hpp:367
const string & GetAuthorizedAccess(void) const
Definition: context.hpp:275
bool IsPatent(void) const
Definition: context.hpp:188
const string & GetFiletrackURL(void) const
Empty if no Filetrack URL.
Definition: context.hpp:269
const string & GetAccession(void) const
Definition: context.hpp:110
CBioseq_Handle –.
void ThrowIfCanceled(void) const
This throws a CFlatException if flatfile generation cancellation has been requested via ICanceled.
CFlatFileConfig & SetConfig(void)
Definition: context.hpp:456
unique_ptr< SAnnotSelector > m_Selector
Definition: context.hpp:488
void SetLocation(const CSeq_loc *loc)
Definition: context.hpp:464
TSections m_Sections
Definition: context.hpp:486
CSeq_entry_Handle m_Entry
Definition: context.hpp:485
const CSubmit_block * GetSubmitBlock(void) const
Definition: context.hpp:452
const SAnnotSelector * GetAnnotSelector(void) const
Definition: context.hpp:763
~CFlatFileContext(void)
Definition: context.hpp:447
SAnnotSelector & SetAnnotSelector(void)
Definition: context.hpp:769
const CRef< CSeqEntryIndex > GetSeqEntryIndex(void) const
Definition: context.hpp:471
CFlatFileContext(const CFlatFileConfig &cfg)
Definition: context.hpp:445
void SetSubmit(const CSubmit_block &sub)
Definition: context.hpp:453
CRef< CSeqEntryIndex > m_Idx
Definition: context.hpp:491
CConstRef< CSeq_loc > m_Loc
Definition: context.hpp:489
CRef< feature::CFeatTree > m_FeatTree
Definition: context.hpp:490
CFlatFileConfig m_Cfg
Definition: context.hpp:484
void SetSeqEntryIndex(CRef< CSeqEntryIndex > idx)
Definition: context.hpp:472
feature::CFeatTree * GetFeatTree(void)
Definition: context.hpp:467
bool m_SmallGenomeSet
Definition: context.hpp:492
void ResetSeqEntryIndex(void)
Definition: context.hpp:473
bool UsingSeqEntryIndex(void) const
Definition: context.hpp:470
CRef< CBioseqContext > TSection
Definition: context.hpp:441
CConstRef< CSubmit_block > m_Submit
Definition: context.hpp:487
void SetConfig(const CFlatFileConfig &cfg)
Definition: context.hpp:457
bool GetSGS(void) const
Definition: context.hpp:475
const CSeq_entry_Handle & GetEntry(void) const
Definition: context.hpp:449
vector< CRef< CBioseqContext > > TSections
Definition: context.hpp:442
const feature::CFeatTree * GetFeatTree(void) const
Definition: context.hpp:466
void SetSGS(const bool sgs)
Definition: context.hpp:476
const CFlatFileConfig & GetConfig(void) const
Definition: context.hpp:455
void SetEntry(const CSeq_entry_Handle &entry)
Definition: context.hpp:450
const CSeq_loc * GetLocation(void) const
Definition: context.hpp:463
void Reset(void)
Definition: context.hpp:787
void SetFeatTree(feature::CFeatTree *tree)
Definition: context.hpp:468
void AddSection(TSection &section)
Definition: context.hpp:478
const string & GetBaseName(void) const
Definition: context.hpp:417
const CBioseq_Handle & GetHandle(void) const
Definition: context.hpp:413
string m_BaseName
Definition: context.hpp:428
SIZE_TYPE m_NumParts
Definition: context.hpp:429
CBioseq_Handle m_Handle
Definition: context.hpp:427
SIZE_TYPE GetNumParts(void) const
Definition: context.hpp:415
CObject –.
Definition: ncbiobj.hpp:180
CRef –.
Definition: ncbiobj.hpp:618
CScope –.
Definition: scope.hpp:92
CSeq_entry_Handle –.
Definition: Seq_entry.hpp:56
CSeq_loc_Mapper –.
CSubmit_block –.
CTopLevelSeqEntryContext(const CSeq_entry_Handle &entry_handle, bool useIndexedFasterSets=false)
Definition: context.cpp:1303
bool GetHasSmallGenomeSet(void) const
Definition: context.hpp:511
bool GetCanSourcePubsBeFused(void) const
Definition: context.hpp:510
void x_InitSeqs(const CSeq_entry &sep)
Definition: context.cpp:1253
bool IsCrossKingdom(const COrg_ref &org, string &first_kingdom, string &second_kingdom)
Definition: cleanup.cpp:2251
char value[7]
Definition: config.c:431
Include a standard set of the NCBI C++ Toolkit most basic headers.
EUnverifiedType GetUnverifiedType(const string &value)
Definition: macro_util.cpp:913
@ eAcc_refseq_unique_prot
Definition: Seq_id.hpp:387
@ eAcc_refseq_contig
Definition: Seq_id.hpp:390
@ eAcc_refseq_mrna_predicted
Definition: Seq_id.hpp:408
@ eAcc_refseq_mrna
Definition: Seq_id.hpp:385
@ eAcc_refseq_prot
Definition: Seq_id.hpp:384
@ eAcc_refseq_wgs_nuc
Definition: Seq_id.hpp:391
@ eAcc_refseq_wgs_prot
Definition: Seq_id.hpp:392
@ eAcc_refseq_ncrna
Definition: Seq_id.hpp:386
@ eAcc_refseq_chromosome
Definition: Seq_id.hpp:399
@ eAcc_refseq_genomic
Definition: Seq_id.hpp:400
@ eAcc_refseq_prot_predicted
Definition: Seq_id.hpp:407
@ fAcc_master
Definition: Seq_id.hpp:230
@ eAcc_refseq_ncrna_predicted
Definition: Seq_id.hpp:409
@ eAcc_refseq_wgs_intermed
Definition: Seq_id.hpp:401
CBioseq_Handle GetBioseqHandleFromTSE(const CSeq_id &id, const CTSE_Handle &tse)
Get bioseq handle for sequence withing one TSE.
Definition: scope.cpp:253
TBioseqCore GetBioseqCore(void) const
Get bioseq core structure.
void Reset(void)
Reset handle and make it not to point to any seq-entry.
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:1439
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
bool NotEmpty(void) const THROWS_NONE
Check if CConstRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:1392
#define NCBI_DEPRECATED
int64_t Int8
8-byte (64-bit) signed integer
Definition: ncbitype.h:104
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
NCBI_NS_STD::string::size_type SIZE_TYPE
Definition: ncbistr.hpp:132
#define NCBI_FORMAT_EXPORT
Definition: ncbi_export.h:496
ERepr
representation class
Definition: Seq_inst_.hpp:91
const TId & GetId(void) const
Get the Id member data.
Definition: Bioseq_.hpp:290
TTech GetTech(void) const
Get the Tech member data.
Definition: MolInfo_.hpp:497
list< CRef< CSeq_id > > TId
Definition: Bioseq_.hpp:94
TBiomol GetBiomol(void) const
Get the Biomol member data.
Definition: MolInfo_.hpp:447
EMol
molecule class in living organism
Definition: Seq_inst_.hpp:108
@ eRepr_seg
segmented sequence
Definition: Seq_inst_.hpp:95
@ eRepr_delta
sequence made by changes (delta) to others
Definition: Seq_inst_.hpp:100
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
SAnnotSelector –.
#define _ASSERT
Modified on Sat Dec 09 04:47:11 2023 by modify_doxy.py rev. 669887