NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
CFastaOstream Class Reference

Search Toolkit Book for CFastaOstream

FASTA-format output; see also ReadFasta in <objtools/readers/fasta.hpp> More...

#include <objmgr/util/sequence.hpp>

+ Inheritance diagram for CFastaOstream:
+ Collaboration diagram for CFastaOstream:

Classes

struct  SGapModText
 This indicates the text of the modifiers of a gap. More...
 

Public Types

enum  EFlags : long {
  fAssembleParts = 1 << 0 , fInstantiateGaps = 1 << 1 , fSuppressRange = 1 << 2 , fReverseStrand = 1 << 3 ,
  fKeepGTSigns = 1 << 4 , fMapMasksUp = 1 << 5 , fMapMasksDown = 1 << 6 , fNoExpensiveOps = 1 << 7 ,
  fShowModifiers = 1 << 8 , fNoDupCheck = 1 << 9 , fShowGapModifiers = 1 << 10 , fKeepUnknGapNomLen = 1 << 11 ,
  fShowGapsOfSizeZero = 1 << 12 , fEnableGI = 1 << 13 , fHideGenBankPrefix = 1 << 14 , fHTMLEncode = 1 << 15 ,
  fIgnoreOriginalID = 1 << 16 , eAssembleParts = fAssembleParts , eInstantiateGaps = fInstantiateGaps , fUseAutoDef = 1 << 17 ,
  fBaseFirstUnused = 1 << 18 , fDoNotUseAutoDef = 1 << 19 , fShowGnlAndAcc = 1 << 20
}
 
enum  EGapMode { eGM_one_dash , eGM_dashes , eGM_letters , eGM_count }
 How to represent gaps with fInstantiateGaps enabled, as it is by default. More...
 
enum  EMaskType { eSoftMask = 1 , eHardMask = 2 }
 Which residues to mask out in subsequent output. More...
 
typedef long TFlags
 binary OR of EFlags More...
 

Public Member Functions

 CFastaOstream (CNcbiOstream &out)
 
virtual ~CFastaOstream ()
 
virtual void Write (const CSeq_entry_Handle &handle, const CSeq_loc *location=0)
 Unspecified locations designate complete sequences; non-empty custom titles override the usual title determination logic. More...
 
virtual void Write (const CBioseq_Handle &handle, const CSeq_loc *location=0, const string &custom_title=kEmptyStr)
 
virtual void WriteTitle (const CBioseq_Handle &handle, const CSeq_loc *location=0, const string &custom_title=kEmptyStr)
 
virtual void WriteSequence (const CBioseq_Handle &handle, const CSeq_loc *location=0, CSeq_loc::EOpFlags merge_flags=CSeq_loc::fMerge_AbuttingOnly)
 
void Write (const CSeq_entry &entry, const CSeq_loc *location=0, bool no_scope=false)
 These versions may set up a temporary object manager scope In the common case of a raw bioseq, no scope is needed. More...
 
void Write (const CBioseq &seq, const CSeq_loc *location=0, bool no_scope=false, const string &custom_title=kEmptyStr)
 
void WriteTitle (const CBioseq &seq, const CSeq_loc *location=0, bool no_scope=false, const string &custom_title=kEmptyStr)
 
virtual bool SkipBioseq (const CBioseq &)
 Used only by Write(CSeq_entry[_Handle], ...); permissive by default. More...
 
virtual bool SkipBioseq (const CBioseq_Handle &handle)
 Delegates to the non-handle version by default for compatibility with older code; newer code should override this version. More...
 
CConstRef< CSeq_locGetMask (EMaskType type) const
 
void SetMask (EMaskType type, CConstRef< CSeq_loc > location)
 
TSeqPos GetWidth (void) const
 Other parameters... More...
 
void SetWidth (TSeqPos width)
 
TFlags GetAllFlags (void) const
 
void SetAllFlags (TFlags flags)
 
void SetFlag (EFlags flag)
 
void ResetFlag (EFlags flag)
 
void SetGapMode (EGapMode mode)
 
EGapMode GetGapMode (void) const
 

Static Public Member Functions

static void GetGapModText (const CSeq_gap &seq_gap, SGapModText &out_gap_mod_text)
 Given a CSeq_gap object, this outputs the Gap information. More...
 

Protected Member Functions

virtual void x_WriteSeqIds (const CBioseq &bioseq, const CSeq_loc *location)
 
virtual void x_WriteAsFasta (const CBioseq &bioseq)
 
virtual void x_GetBestId (CConstRef< CSeq_id > &gi_id, CConstRef< CSeq_id > &best_id, bool &hide_prefix, const CBioseq &bioseq)
 
virtual void x_WriteSeqTitle (const CBioseq_Handle &handle, const string &custom_title)
 
virtual void x_WriteBuffer (const char *buf, unsigned int count)
 

Protected Attributes

CNcbiOstreamm_Out
 
unique_ptr< sequence::CDeflineGenerator > m_Gen
 
TFlags m_Flags
 

Private Types

typedef AutoPtr< char, ArrayDeleter< char > > TCharBuf
 
typedef map< TSeqPos, intTMSMap
 

Private Member Functions

sequence::CDeflineGenerator::TUserFlags x_GetTitleFlags (void) const
 
CConstRef< CSeq_locx_MapMask (CSeq_loc_Mapper &mapper, const CSeq_loc &mask, const CSeq_id *base_seq_id, CScope *scope)
 
void x_GetMaskingStates (TMSMap &masking_states, const CSeq_id *base_seq_id, const CSeq_loc *location, CScope *scope)
 
void x_WriteSequence (const CSeqVector &vec, const TMSMap &masking_state)
 

Private Attributes

CConstRef< CSeq_locm_SoftMask
 
CConstRef< CSeq_locm_HardMask
 
TSeqPos m_Width
 
EGapMode m_GapMode
 
TSeq_id_HandleSet m_PreviousWholeIds
 
TCharBuf m_Dashes
 
TCharBuf m_LC_Ns
 
TCharBuf m_LC_Xs
 
TCharBuf m_UC_Ns
 
TCharBuf m_UC_Xs
 

Detailed Description

FASTA-format output; see also ReadFasta in <objtools/readers/fasta.hpp>

Definition at line 770 of file sequence.hpp.


The documentation for this class was generated from the following files:
Modified on Tue Dec 05 02:14:21 2023 by modify_doxy.py rev. 669887