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

Search Toolkit Book for CMultiReader

#include "multireader.hpp"
(Private to src/app/table2asn.)

+ Collaboration diagram for CMultiReader:

Public Types

using TAnnots = list< CRef< CSeq_annot > >
using TAnnotMap = map< string, list< CRef< CSeq_annot > >>

Public Member Functions

 CMultiReader (CTable2AsnContext &context)
 ~CMultiReader ()
void LoadTemplate (const string &ifname)
void LoadGFF3Fasta (istream &in, TAnnots &annots)
void LoadGFF3Fasta (istream &in, TAnnotMap &annotMap)
void AddAnnots (TAnnotMap &annotMap, set< string > &matchedAnnots, CBioseq &bioseq) const
void LoadAnnotMap (const string &filename, TAnnotMap &annotMap)
void AddAnnotToMap (CRef< CSeq_annot > pAnnot, TAnnotMap &annotMap)
void LoadDescriptors (const string &ifname, CRef< objects::CSeq_descr > &out_desc) const
void ApplyDescriptors (objects::CSeq_entry &obj, const objects::CSeq_descr &source) const
void WriteObject (const CSerialObject &, ostream &)
CRef< objects::CSeq_entry > ReadAlignment (CNcbiIstream &instream, const CArgs &args)
CRef< CSerialObjectReadNextEntry ()
CFormatGuess::EFormat OpenFile (const string &filename, CRef< CSerialObject > &input_sequence, TAnnotMap &annotMap)
CRef< CSerialObjectFetchEntry (const CFormatGuess::EFormat &format, const string &objectType, unique_ptr< CNcbiIstream > &pIstr, TAnnotMap &annotMap)

Static Public Member Functions

static void GetSeqEntry (CRef< objects::CSeq_entry > &entry, CRef< objects::CSeq_submit > &submit, CRef< CSerialObject > obj)

Static Public Attributes

static const set< TTypeInfokSupportedTypes

Private Member Functions

void MergeDescriptors (objects::CSeq_descr &dest, const objects::CSeq_descr &source) const
void MergeDescriptors (objects::CSeq_descr &dest, const objects::CSeqdesc &source) const
bool AtSeqenceData () const
CRef< objects::CSeq_entry > xReadFasta (CNcbiIstream &instream)
CRef< CSerialObjectxApplyTemplate (CRef< CSerialObject > obj, bool merge_template_descriptors) const
CRef< CSerialObjectxReadASN1Text (CObjectIStream &pObjIstrm) const
CRef< CSerialObjectxReadASN1Binary (CObjectIStream &pObjIstrm, const string &content_type) const
TAnnots xReadGFF3 (CNcbiIstream &instream, bool post_process)
TAnnots xReadGTF (CNcbiIstream &instream)
CRef< objects::CSeq_entry > xReadFlatfile (CFormatGuess::EFormat format, const string &filename)
void x_PostProcessAnnots (TAnnots &annots) const
bool xGetAnnotLoader (CAnnotationLoader &loader, const string &filename)
unique_ptr< CObjectIStreamxCreateASNStream (const string &filename) const
unique_ptr< CObjectIStreamxCreateASNStream (CFormatGuess::EFormat format, unique_ptr< istream > &instream) const
CFormatGuess::EFormat xInputGetFormat (CNcbiIstream &, CFileContentInfo *=nullptr) const
CFormatGuess::EFormat xAnnotGetFormat (CNcbiIstream &) const
bool x_HasMatch (bool matchVersions, const string &idString, TAnnotMap &annotMap, set< string > &matchedAnnots, list< CRef< CSeq_annot >> &annots) const
bool x_HasExactMatch (const string &idString, TAnnotMap &annotMap, set< string > &matchedAnnots, list< CRef< CSeq_annot >> &annots) const

Private Attributes

int m_iFlags
string m_AnnotName
string m_AnnotTitle
unique_ptr< CObjectIStreamm_obj_stream
shared_ptr< objects::CGff3LocationMerger > m_gff3_merger
bool mAtSequenceData
shared_mutex m_Mutex

Detailed Description

Definition at line 36 of file multireader.hpp.

Member Typedef Documentation

◆ TAnnotMap

Definition at line 44 of file multireader.hpp.

◆ TAnnots

Definition at line 43 of file multireader.hpp.

Constructor & Destructor Documentation

◆ CMultiReader()

CMultiReader::CMultiReader ( CTable2AsnContext context)

Definition at line 401 of file multireader.cpp.

◆ ~CMultiReader()

CMultiReader::~CMultiReader ( )

Definition at line 1002 of file multireader.cpp.

Member Function Documentation

◆ AddAnnots()

void CMultiReader::AddAnnots ( TAnnotMap annotMap,
set< string > &  matchedAnnots,
CBioseq bioseq 
) const

◆ AddAnnotToMap()

void CMultiReader::AddAnnotToMap ( CRef< CSeq_annot pAnnot,
TAnnotMap annotMap 

◆ ApplyDescriptors()

void CMultiReader::ApplyDescriptors ( objects::CSeq_entry &  obj,
const objects::CSeq_descr &  source 
) const

Definition at line 675 of file multireader.cpp.

References MergeDescriptors(), CSeq_entry::SetDescr(), and rapidjson::source.

◆ AtSeqenceData()

bool CMultiReader::AtSeqenceData ( ) const

Definition at line 70 of file multireader.hpp.

References mAtSequenceData.

Referenced by LoadGFF3Fasta().

◆ FetchEntry()

CRef< CSerialObject > CMultiReader::FetchEntry ( const CFormatGuess::EFormat format,
const string objectType,
unique_ptr< CNcbiIstream > &  pIstr,
TAnnotMap annotMap 

◆ GetSeqEntry()

void CMultiReader::GetSeqEntry ( CRef< objects::CSeq_entry > &  entry,
CRef< objects::CSeq_submit > &  submit,
CRef< CSerialObject obj 

◆ LoadAnnotMap()

void CMultiReader::LoadAnnotMap ( const string filename,
TAnnotMap annotMap 

◆ LoadDescriptors()

void CMultiReader::LoadDescriptors ( const string ifname,
CRef< objects::CSeq_descr > &  out_desc 
) const

◆ LoadGFF3Fasta() [1/2]

void CMultiReader::LoadGFF3Fasta ( istream &  in,
TAnnotMap annotMap 

Definition at line 716 of file multireader.cpp.

References AddAnnotToMap(), in(), and LoadGFF3Fasta().

◆ LoadGFF3Fasta() [2/2]

void CMultiReader::LoadGFF3Fasta ( istream &  in,
TAnnots annots 

◆ LoadTemplate()

void CMultiReader::LoadTemplate ( const string ifname)

◆ MergeDescriptors() [1/2]

void CMultiReader::MergeDescriptors ( objects::CSeq_descr &  dest,
const objects::CSeq_descr &  source 
) const

Referenced by ApplyDescriptors().

◆ MergeDescriptors() [2/2]

void CMultiReader::MergeDescriptors ( objects::CSeq_descr &  dest,
const objects::CSeqdesc &  source 
) const

◆ OpenFile()

CFormatGuess::EFormat CMultiReader::OpenFile ( const string filename,
CRef< CSerialObject > &  input_sequence,
TAnnotMap annotMap 

◆ ReadAlignment()

CRef< CSeq_entry > CMultiReader::ReadAlignment ( CNcbiIstream instream,
const CArgs args 

◆ ReadNextEntry()

CRef< CSerialObject > CMultiReader::ReadNextEntry ( )

Definition at line 862 of file multireader.cpp.

References m_obj_stream, and xReadASN1Text().

◆ WriteObject()

void CMultiReader::WriteObject ( const CSerialObject object,
ostream &  ostr 

◆ x_HasExactMatch()

bool CMultiReader::x_HasExactMatch ( const string idString,
CMultiReader::TAnnotMap annotMap,
set< string > &  matchedAnnots,
list< CRef< CSeq_annot >> &  annots 
) const

◆ x_HasMatch()

bool CMultiReader::x_HasMatch ( bool  matchVersions,
const string idString,
CMultiReader::TAnnotMap annotMap,
set< string > &  matchedAnnots,
list< CRef< CSeq_annot >> &  annots 
) const

◆ x_PostProcessAnnots()

void CMultiReader::x_PostProcessAnnots ( TAnnots annots) const

◆ xAnnotGetFormat()

CFormatGuess::EFormat CMultiReader::xAnnotGetFormat ( CNcbiIstream istr) const

◆ xApplyTemplate()

CRef< CSerialObject > CMultiReader::xApplyTemplate ( CRef< CSerialObject obj,
bool  merge_template_descriptors 
) const

◆ xCreateASNStream() [1/2]

unique_ptr< CObjectIStream > CMultiReader::xCreateASNStream ( CFormatGuess::EFormat  format,
unique_ptr< istream > &  instream 
) const

◆ xCreateASNStream() [2/2]

unique_ptr< CObjectIStream > CMultiReader::xCreateASNStream ( const string filename) const

Definition at line 961 of file multireader.cpp.

References CFormatGuess::eUnknown.

Referenced by LoadDescriptors(), LoadTemplate(), and xGetAnnotLoader().

◆ xGetAnnotLoader()

bool CMultiReader::xGetAnnotLoader ( CAnnotationLoader loader,
const string filename 

◆ xInputGetFormat()

CFormatGuess::EFormat CMultiReader::xInputGetFormat ( CNcbiIstream istr,
CFileContentInfo content_info = nullptr 
) const

◆ xReadASN1Binary()

CRef< CSerialObject > CMultiReader::xReadASN1Binary ( CObjectIStream pObjIstrm,
const string content_type 
) const

Definition at line 140 of file multireader.cpp.

References ObjectInfo(), CObjectIStream::Read(), and Ref().

Referenced by FetchEntry(), and OpenFile().

◆ xReadASN1Text()

CRef< CSerialObject > CMultiReader::xReadASN1Text ( CObjectIStream pObjIstrm) const

◆ xReadFasta()

CRef< CSeq_entry > CMultiReader::xReadFasta ( CNcbiIstream instream)

◆ xReadFlatfile()

CRef< CSeq_entry > CMultiReader::xReadFlatfile ( CFormatGuess::EFormat  format,
const string filename 

◆ xReadGFF3()

CMultiReader::TAnnots CMultiReader::xReadGFF3 ( CNcbiIstream instream,
bool  post_process 

◆ xReadGTF()

CMultiReader::TAnnots CMultiReader::xReadGTF ( CNcbiIstream instream)

Member Data Documentation

◆ kSupportedTypes

const set< TTypeInfo > CMultiReader::kSupportedTypes
Initial value:
= {

Definition at line 46 of file multireader.hpp.

Referenced by CTbl2AsnApp::ProcessOneFile(), and xInputGetFormat().

◆ m_AnnotName

string CMultiReader::m_AnnotName

Definition at line 92 of file multireader.hpp.

Referenced by xReadGFF3(), and xReadGTF().

◆ m_AnnotTitle

string CMultiReader::m_AnnotTitle

Definition at line 93 of file multireader.hpp.

Referenced by xReadGFF3(), and xReadGTF().

◆ m_context

CTable2AsnContext& CMultiReader::m_context

◆ m_gff3_merger

shared_ptr<objects::CGff3LocationMerger> CMultiReader::m_gff3_merger

Definition at line 96 of file multireader.hpp.

Referenced by x_PostProcessAnnots(), and xReadGFF3().

◆ m_iFlags

int CMultiReader::m_iFlags

Definition at line 91 of file multireader.hpp.

Referenced by FetchEntry(), OpenFile(), and xReadFasta().

◆ m_Mutex

shared_mutex CMultiReader::m_Mutex

Definition at line 98 of file multireader.hpp.

Referenced by x_HasExactMatch(), and x_HasMatch().

◆ m_obj_stream

unique_ptr<CObjectIStream> CMultiReader::m_obj_stream

Definition at line 95 of file multireader.hpp.

Referenced by FetchEntry(), OpenFile(), and ReadNextEntry().

◆ mAtSequenceData

bool CMultiReader::mAtSequenceData

Definition at line 97 of file multireader.hpp.

Referenced by AtSeqenceData(), and xReadGFF3().

The documentation for this class was generated from the following files:
Modified on Wed May 22 11:27:53 2024 by rev. 669887