38 #ifndef OBJTOOLS_BLAST_GENE_INFO_READER___GENE_INFO_READER__HPP
39 #define OBJTOOLS_BLAST_GENE_INFO_READER___GENE_INFO_READER__HPP
54 #define GENE_INFO_PATH_ENV_VARIABLE "GENE_INFO_PATH"
57 #define GENE_GI2GENE_FILE_NAME "geneinfo.g2i"
59 #define GENE_GENE2OFFSET_FILE_NAME "geneinfo.i2o"
61 #define GENE_GI2OFFSET_FILE_NAME "geneinfo.g2o"
63 #define GENE_GENE2GI_FILE_NAME "geneinfo.i2g"
65 #define GENE_ALL_GENE_DATA_FILE_NAME "geneinfo.dat"
67 #define GENE_GENERAL_INFO_FILE_NAME "geneinfo.log"
168 const string& strGene2OffsetFile,
169 const string& strGi2OffsetFile,
170 const string& strAllGeneDataFile,
171 const string& strGene2GiFile,
172 bool bGiToOffsetLookup =
true);
bool x_GeneIdToOffset(int geneId, int &nOffset)
Set the offset value given a Gene ID.
string m_strGi2OffsetFile
Path to the Gi to Offset file.
bool x_GeneIdToGi(int geneId, int iGiField, list< TGi > &listGis)
Fill the Gi list given a Gene ID, and the Gi field index, which represents the Gi type to be read fro...
CNcbiIfstream m_inAllData
Input stream for the Gene data file.
unique_ptr< CMemoryFile > m_memGi2GeneFile
Memory-mapped Gi to Gene ID file.
bool m_bGiToOffsetLookup
Perform Gi to Offset lookups directly.
CGeneInfoFileReader(const string &strGi2GeneFile, const string &strGene2OffsetFile, const string &strGi2OffsetFile, const string &strAllGeneDataFile, const string &strGene2GiFile, bool bGiToOffsetLookup=true)
Construct using direct paths.
virtual ~CGeneInfoFileReader()
Destructor.
void x_MapMemFiles()
Memory-map all the files.
unique_ptr< CMemoryFile > m_memGi2OffsetFile
Memory-mapped Gi to Offset file.
virtual bool GetGeneInfoForGi(TGi gi, TGeneInfoList &infoList)
GetGeneInfoForGi implementation, see IGeneInfoInput.
TGeneIdToGeneInfoMap m_mapIdToInfo
Cached map of looked up Gene Info objects.
unique_ptr< CMemoryFile > m_memGene2GiFile
Memory-mapped Gene ID to Gi file.
string m_strGene2GiFile
Path to the Gene ID to Gi file.
virtual bool GetGeneIdsForGi(TGi gi, TGeneIdList &geneIdList)
GetGeneIdsForGi implementation, see IGeneInfoInput.
virtual bool GetRNAGisForGeneId(int geneId, TGiList &giList)
GetRNAGisForGeneId implementation, see IGeneInfoInput.
void x_UnmapMemFiles()
Unmap all the memory-mapped files.
string m_strGene2OffsetFile
Path to the Gene ID to Offset file.
string m_strGi2GeneFile
Path to the Gi to Gene ID file.
bool x_GiToGeneId(TGi gi, list< int > &listGeneIds)
Fill the Gene ID list given a Gi.
unique_ptr< CMemoryFile > m_memGene2OffsetFile
Memory-mapped Gene ID to Offset file.
bool x_GiToOffset(TGi gi, list< int > &listOffsets)
Set the offset value given a Gi.
virtual bool GetGenomicGisForGeneId(int geneId, TGiList &giList)
GetGenomicGisForGeneId implementation, see IGeneInfoInput.
virtual bool GetProteinGisForGeneId(int geneId, TGiList &giList)
GetProteinGisForGeneId implementation, see IGeneInfoInput.
virtual bool GetGeneInfoForId(int geneId, TGeneInfoList &infoList)
GetGeneInfoForId implementation, see IGeneInfoInput.
bool x_OffsetToInfo(int nOffset, CRef< CGeneInfo > &info)
Read Gene data at the given offset and create the info object.
string m_strAllGeneDataFile
Path to the file containing all the Gene data.
CGeneInfoFileReader(bool bGiToOffsetLookup=true)
Construct using paths read from an environment variable.
General file processing routines and structures.
Gene information class and related interfaces.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
#define NCBI_XOBJREAD_EXPORT
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...