NCBI C++ ToolKit
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CFastaOstreamEx Class Reference

Search Toolkit Book for CFastaOstreamEx

#include <objtools/writers/fasta_writer.hpp>

+ Inheritance diagram for CFastaOstreamEx:
+ Collaboration diagram for CFastaOstreamEx:

Public Member Functions

 CFastaOstreamEx (CNcbiOstream &out)
 
virtual ~CFastaOstreamEx ()=default
 
bool WriteFeatures (CFeat_CI feat_it, bool translate_cds)
 
void WriteFeature (const CSeq_feat &feat, CScope &scope, bool translate_cds=false)
 
void WriteFeatureTitle (const CSeq_feat &feat, CScope &scope, bool translate_cds=false)
 
void ResetFeatureCount (void)
 
- Public Member Functions inherited from CFeatWriter
virtual ~CFeatWriter (void)=default
 
bool WriteFeatures (CFeat_CI &first)
 
- Public Member Functions inherited from CInterruptable
 CInterruptable ()
 
virtual ~CInterruptable ()
 
void SetCanceler (ICanceled *pCanceller)
 
bool IsCanceled () const
 
- Public Member Functions inherited from ICanceled
virtual ~ICanceled ()
 
- Public Member Functions inherited from CFastaOstream
 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
 

Protected Member Functions

CRef< CSeq_locx_TrimLocation (TSeqPos frame, ENa_strand strand, CScope &scope, const CSeq_loc &loc)
 
virtual bool xWriteFeature (CFeat_CI feat_it) override
 
bool xWriteFeatureTitle (const CSeq_feat &feat, CScope &scope, bool translate_cds=false)
 
void x_WriteTranslatedCds (const CSeq_feat &cds, CScope &scope)
 
void x_WriteFeatureAttributes (const CSeq_feat &feat, CScope &scope) const
 
void x_AddGeneAttributes (const CSeq_feat &feat, CScope &scope, string &defline) const
 
void x_AddProteinNameAttribute (const CSeq_feat &feat, CScope &scope, string &defline) const
 
void x_AddDbxrefAttribute (const CSeq_feat &feat, CScope &scope, string &defline) const
 
void x_AddReadingFrameAttribute (const CSeq_feat &feat, string &defline) const
 
void x_AddncRNAClassAttribute (const CSeq_feat &feat, string &defline) const
 
void x_AddPseudoAttribute (const CSeq_feat &feat, CScope &scope, string &defline) const
 
void x_AddPseudoGeneAttribute (const CSeq_feat &feat, CScope &scope, string &defline) const
 
void x_AddRNAProductAttribute (const CSeq_feat &feat, string &defline) const
 
void x_AddPartialAttribute (const CSeq_feat &feat, CScope &scope, string &defline) const
 
void x_AddExceptionAttribute (const CSeq_feat &feat, string &defline) const
 
void x_AddProteinIdAttribute (const CSeq_feat &feat, CScope &scope, string &defline) const
 
void x_AddTranscriptIdAttribute (const CSeq_feat &feat, CScope &scope, string &defline) const
 
void x_AddTranslationExceptionAttribute (const CSeq_feat &feat, CScope &scope, string &defline) const
 
bool x_GetCodeBreak (const CSeq_feat &feat, const CCode_break &code_break, CScope &scope, string &cbstring) const
 
void x_AddLocationAttribute (const CSeq_feat &feat, CScope &scope, string &defline) const
 
void x_AddDeflineAttribute (const string &label, const string &value, string &defline) const
 
void x_AddMiscQualifierAttributes (const CSeq_feat &feat, string &defline) const
 
void x_AddGBkeyAttribute (const CSeq_feat &feat, string &defline) const
 
void x_AddDeflineAttribute (const string &label, bool value, string &defline) const
 
string x_GetCDSIdString (const CSeq_feat &cds, CScope &scope, bool translate_cds=false)
 
string x_GetRNAIdString (const CSeq_feat &rna, CScope &scope)
 
string x_GetProtIdString (const CSeq_feat &prot, CScope &scope)
 
string x_GetGeneIdString (const CSeq_feat &gene, CScope &scope)
 
string x_GetOtherIdString (const CSeq_feat &feat, CScope &scope)
 
virtual void x_WriteBuffer (const char *buf, unsigned int count) override
 
- Protected Member Functions inherited from CFastaOstream
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)
 

Protected Attributes

bool m_TranslateCds
 
TSeqPos m_FeatCount
 
CRef< CScopem_InternalScope
 
- Protected Attributes inherited from CInterruptable
ICanceledmpCancelled
 
- Protected Attributes inherited from CFastaOstream
CNcbiOstreamm_Out
 
unique_ptr< sequence::CDeflineGenerator > m_Gen
 
TFlags m_Flags
 

Additional Inherited Members

- Public Types inherited from CFastaOstream
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...
 
- Static Public Member Functions inherited from CFastaOstream
static void GetGapModText (const CSeq_gap &seq_gap, SGapModText &out_gap_mod_text)
 Given a CSeq_gap object, this outputs the Gap information. More...
 

Detailed Description

Definition at line 50 of file fasta_writer.hpp.

Constructor & Destructor Documentation

◆ CFastaOstreamEx()

CFastaOstreamEx::CFastaOstreamEx ( CNcbiOstream out)
explicit

Definition at line 67 of file fasta_writer.cpp.

◆ ~CFastaOstreamEx()

virtual CFastaOstreamEx::~CFastaOstreamEx ( )
virtualdefault

Member Function Documentation

◆ ResetFeatureCount()

void CFastaOstreamEx::ResetFeatureCount ( void  )

Definition at line 76 of file fasta_writer.cpp.

References m_FeatCount.

◆ WriteFeature()

void CFastaOstreamEx::WriteFeature ( const CSeq_feat feat,
CScope scope,
bool  translate_cds = false 
)

◆ WriteFeatures()

bool CFastaOstreamEx::WriteFeatures ( CFeat_CI  feat_it,
bool  translate_cds 
)

Definition at line 82 of file fasta_writer.cpp.

References m_TranslateCds, and CFeatWriter::WriteFeatures().

◆ WriteFeatureTitle()

void CFastaOstreamEx::WriteFeatureTitle ( const CSeq_feat feat,
CScope scope,
bool  translate_cds = false 
)

Definition at line 174 of file fasta_writer.cpp.

References xWriteFeatureTitle().

Referenced by CAsn2FastaApp::HandleSeqEntry().

◆ x_AddDbxrefAttribute()

void CFastaOstreamEx::x_AddDbxrefAttribute ( const CSeq_feat feat,
CScope scope,
string defline 
) const
protected

◆ x_AddDeflineAttribute() [1/2]

void CFastaOstreamEx::x_AddDeflineAttribute ( const string label,
bool  value,
string defline 
) const
protected

Definition at line 548 of file fasta_writer.cpp.

References NStr::IsBlank(), label, and rapidjson::value.

◆ x_AddDeflineAttribute() [2/2]

void CFastaOstreamEx::x_AddDeflineAttribute ( const string label,
const string value,
string defline 
) const
protected

◆ x_AddExceptionAttribute()

void CFastaOstreamEx::x_AddExceptionAttribute ( const CSeq_feat feat,
string defline 
) const
protected

◆ x_AddGBkeyAttribute()

void CFastaOstreamEx::x_AddGBkeyAttribute ( const CSeq_feat feat,
string defline 
) const
protected

◆ x_AddGeneAttributes()

void CFastaOstreamEx::x_AddGeneAttributes ( const CSeq_feat feat,
CScope scope,
string defline 
) const
protected

◆ x_AddLocationAttribute()

void CFastaOstreamEx::x_AddLocationAttribute ( const CSeq_feat feat,
CScope scope,
string defline 
) const
protected

◆ x_AddMiscQualifierAttributes()

void CFastaOstreamEx::x_AddMiscQualifierAttributes ( const CSeq_feat feat,
string defline 
) const
protected

◆ x_AddncRNAClassAttribute()

void CFastaOstreamEx::x_AddncRNAClassAttribute ( const CSeq_feat feat,
string defline 
) const
protected

◆ x_AddPartialAttribute()

void CFastaOstreamEx::x_AddPartialAttribute ( const CSeq_feat feat,
CScope scope,
string defline 
) const
protected

◆ x_AddProteinIdAttribute()

void CFastaOstreamEx::x_AddProteinIdAttribute ( const CSeq_feat feat,
CScope scope,
string defline 
) const
protected

◆ x_AddProteinNameAttribute()

void CFastaOstreamEx::x_AddProteinNameAttribute ( const CSeq_feat feat,
CScope scope,
string defline 
) const
protected

◆ x_AddPseudoAttribute()

void CFastaOstreamEx::x_AddPseudoAttribute ( const CSeq_feat feat,
CScope scope,
string defline 
) const
protected

◆ x_AddPseudoGeneAttribute()

void CFastaOstreamEx::x_AddPseudoGeneAttribute ( const CSeq_feat feat,
CScope scope,
string defline 
) const
protected

◆ x_AddReadingFrameAttribute()

void CFastaOstreamEx::x_AddReadingFrameAttribute ( const CSeq_feat feat,
string defline 
) const
protected

◆ x_AddRNAProductAttribute()

void CFastaOstreamEx::x_AddRNAProductAttribute ( const CSeq_feat feat,
string defline 
) const
protected

◆ x_AddTranscriptIdAttribute()

void CFastaOstreamEx::x_AddTranscriptIdAttribute ( const CSeq_feat feat,
CScope scope,
string defline 
) const
protected

◆ x_AddTranslationExceptionAttribute()

void CFastaOstreamEx::x_AddTranslationExceptionAttribute ( const CSeq_feat feat,
CScope scope,
string defline 
) const
protected

◆ x_GetCDSIdString()

string CFastaOstreamEx::x_GetCDSIdString ( const CSeq_feat cds,
CScope scope,
bool  translate_cds = false 
)
protected

◆ x_GetCodeBreak()

bool CFastaOstreamEx::x_GetCodeBreak ( const CSeq_feat feat,
const CCode_break code_break,
CScope scope,
string cbstring 
) const
protected

◆ x_GetGeneIdString()

string CFastaOstreamEx::x_GetGeneIdString ( const CSeq_feat gene,
CScope scope 
)
protected

Definition at line 524 of file fasta_writer.cpp.

References CSeq_feat_Base::GetLocation(), and s_GetDeflineIdString().

Referenced by xWriteFeatureTitle().

◆ x_GetOtherIdString()

string CFastaOstreamEx::x_GetOtherIdString ( const CSeq_feat feat,
CScope scope 
)
protected

◆ x_GetProtIdString()

string CFastaOstreamEx::x_GetProtIdString ( const CSeq_feat prot,
CScope scope 
)
protected

Definition at line 506 of file fasta_writer.cpp.

References prot, and s_GetDeflineIdString().

◆ x_GetRNAIdString()

string CFastaOstreamEx::x_GetRNAIdString ( const CSeq_feat rna,
CScope scope 
)
protected

◆ x_TrimLocation()

CRef< CSeq_loc > CFastaOstreamEx::x_TrimLocation ( TSeqPos  frame,
ENa_strand  strand,
CScope scope,
const CSeq_loc loc 
)
protected

◆ x_WriteBuffer()

void CFastaOstreamEx::x_WriteBuffer ( const char *  buf,
unsigned int  count 
)
overrideprotectedvirtual

Reimplemented from CFastaOstream.

Definition at line 1188 of file fasta_writer.cpp.

References count, CInterruptable::IsCanceled(), NCBI_THROW, and CFastaOstream::x_WriteBuffer().

◆ x_WriteFeatureAttributes()

void CFastaOstreamEx::x_WriteFeatureAttributes ( const CSeq_feat feat,
CScope scope 
) const
protected

◆ x_WriteTranslatedCds()

void CFastaOstreamEx::x_WriteTranslatedCds ( const CSeq_feat cds,
CScope scope 
)
protected

◆ xWriteFeature()

bool CFastaOstreamEx::xWriteFeature ( CFeat_CI  feat_it)
overrideprotectedvirtual

Reimplemented from CFeatWriter.

Definition at line 92 of file fasta_writer.cpp.

References CSeq_feat_Handle::GetScope(), CMappedFeat::GetSeq_feat(), m_TranslateCds, and WriteFeature().

◆ xWriteFeatureTitle()

bool CFastaOstreamEx::xWriteFeatureTitle ( const CSeq_feat feat,
CScope scope,
bool  translate_cds = false 
)
protected

Member Data Documentation

◆ m_FeatCount

TSeqPos CFastaOstreamEx::m_FeatCount
protected

Definition at line 180 of file fasta_writer.hpp.

Referenced by ResetFeatureCount(), and xWriteFeatureTitle().

◆ m_InternalScope

CRef<CScope> CFastaOstreamEx::m_InternalScope
protected

Definition at line 181 of file fasta_writer.hpp.

Referenced by x_WriteTranslatedCds().

◆ m_TranslateCds

bool CFastaOstreamEx::m_TranslateCds
protected

Definition at line 179 of file fasta_writer.hpp.

Referenced by WriteFeatures(), and xWriteFeature().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:58:21 2024 by modify_doxy.py rev. 669887