Implementation for the CSeqDBVol class, which provides an interface for all functionality of one database volume. More...
Go to the source code of this file.
Go to the SVN repository for this file.
static void s_SeqDBMapNA2ToNA4Setup (TTable &translated) Build NA2 to NcbiNA4 translation table. More...Implementation for the CSeqDBVol class, which provides an interface for all functionality of one database volume.
Definition in file seqdbvol.cpp.
◆ TRangeVectorList of offset ranges as begin/end pairs.
Definition at line 1605 of file seqdbvol.cpp.
◆ TTable ◆ s_ExtractBlastDefline() ◆ s_GetBioseqTitle() ◆ s_IncludeDefline_MaskFilter() ◆ s_IncludeDefline_NegativeTaxid() ◆ s_IncludeDefline_Taxid()Definition at line 1910 of file seqdbvol.cpp.
References set< Key, Compare >::end(), set< Key, Compare >::find(), CBlast_def_line_Base::GetLinks(), CBlast_def_line_Base::GetTaxid(), set< Key, Compare >::insert(), CBlast_def_line_Base::IsSetLinks(), CBlast_def_line_Base::IsSetTaxid(), ITERATE, set< Key, Compare >::size(), and TAX_ID_FROM.
Referenced by CSeqDBVol::x_GetFilteredHeader().
◆ s_OssToDefline() ◆ s_ResLenNew()Get length of ambiguous region (new version)
Given an ambiguity element in the new format, this returns the length of the ambiguous region.
Definition at line 642 of file seqdbvol.cpp.
References i.
Referenced by s_SeqDBRebuildDNA_NA4(), and s_SeqDBRebuildDNA_NA8().
◆ s_ResLenOld()Get ambiguous region length (old version)
Given an ambiguity element in the old format, this returns the length of the ambiguous region.
Definition at line 694 of file seqdbvol.cpp.
References i.
Referenced by s_SeqDBRebuildDNA_NA4(), and s_SeqDBRebuildDNA_NA8().
◆ s_ResPosNew()Get position of ambiguous region (new version)
Given an ambiguity element in the new format, this returns the position of the ambiguous region.
Definition at line 658 of file seqdbvol.cpp.
References i.
Referenced by s_SeqDBRebuildDNA_NA4(), and s_SeqDBRebuildDNA_NA8().
◆ s_ResPosOld()Get ambiguous residue value (old version)
Given an ambiguity element in the old format, this returns the position of the ambiguous region.
Definition at line 710 of file seqdbvol.cpp.
References i.
Referenced by s_SeqDBRebuildDNA_NA4(), and s_SeqDBRebuildDNA_NA8().
◆ s_ResVal()Get ambiguous residue value (old version)
Given an ambiguity element in the old format, this returns the residue value to use for all bases in the ambiguous region.
Definition at line 678 of file seqdbvol.cpp.
References i.
Referenced by s_SeqDBRebuildDNA_NA4(), and s_SeqDBRebuildDNA_NA8().
◆ s_SeqDB_SeqIdIn() ◆ s_SeqDBFitsInFour()template<class T >
static void s_SeqDBFitsInFour ( T id ) static ◆ s_SeqDBMapNA2ToNA4() static void s_SeqDBMapNA2ToNA4 ( const char * buf2bit, vector< char > & buf4bit, int base_length ) staticConvert sequence data from NA2 to NA4 format.
This uses a translation table to convert nucleotide data. The input data is in NA2 format, the output data will be in NcbiNA4 format.
Definition at line 403 of file seqdbvol.cpp.
References _ASSERT, base_length, i, and t.
Referenced by s_SeqDBWriteSeqDataNucl().
◆ s_SeqDBMapNA2ToNA4Setup()Build NA2 to NcbiNA4 translation table.
This builds a translation table for nucleotide data. The table will be used by s_SeqDBMapNA2ToNA4(). The table is indexed by the packed nucleotide representation, or "NA2" format, which encodes four bases per byte. The elements of the table are the unpacked "Ncbi-NA4" representation, which encodes two bases per byte.
Definition at line 360 of file seqdbvol.cpp.
References convert().
Referenced by CNA2ToNA4MapTable::CNA2ToNA4MapTable().
◆ s_SeqDBMapNA2ToNA8()Convert sequence data from NA2 to NA8 format.
This uses a translation table to convert nucleotide data. The input data is in NA2 format, the output data will be in Ncbi-NA8 format. This function also optionally adds sentinel bytes to the start and end of the data (needed by some applications).
Definition at line 499 of file seqdbvol.cpp.
References _ASSERT, SSeqDBSlice::begin, SSeqDBSlice::end, and t.
Referenced by CSeqDBVol::GetAmbigPartialSeq(), SeqDB_UnpackAmbiguities(), and CSeqDBVol::x_GetAmbigSeq().
◆ s_SeqDBMapNA2ToNA8Setup()Build NA2 to Ncbi-NA8 translation table.
This builds a translation table for nucleotide data. The table will be used by s_SeqDBMapNA2ToNA8(). The table is indexed by the packed nucleotide representation, or "NA2" format, which encodes four bases per byte. The elements of the table are the unpacked "Ncbi-NA8" representation, which encodes one base per byte.
Definition at line 455 of file seqdbvol.cpp.
References i.
Referenced by CNA2ToNA8MapTable::CNA2ToNA8MapTable().
◆ s_SeqDBMapNcbiNA8ToBlastNA8() ◆ s_SeqDBMaskSequence() ◆ s_SeqDBRebuildDNA_NA4() static void s_SeqDBRebuildDNA_NA4 ( vector< char > & buf4bit, const vector< Int4 > & amb_chars ) staticRebuild an ambiguous region from sequence and ambiguity data.
When sequence data for a blast database is built, ambiguous regions are replaced with random strings of the four standard nucleotides. The ambiguity data is seperately encoded as a sequence of integer values. This function unpacks the ambiguity data and replaces the randomized bases with correct (ambiguous) encodings. This version works with 4 bit representations.
Definition at line 729 of file seqdbvol.cpp.
References i, s_ResLenNew(), s_ResLenOld(), s_ResPosNew(), s_ResPosOld(), and s_ResVal().
Referenced by s_SeqDBWriteSeqDataNucl().
◆ s_SeqDBRebuildDNA_NA8()Rebuild an ambiguous region from sequence and ambiguity data.
When sequence data for a blast database is built, ambiguous regions are replaced with random strings of the four standard nucleotides. The ambiguity data is seperately encoded as a sequence of integer values. This function unpacks the ambiguity data and replaces the randomized bases with correct (ambiguous) encodings. This version works with 8 bit representations.
Definition at line 804 of file seqdbvol.cpp.
References SSeqDBSlice::begin, SSeqDBSlice::end, i, s_ResLenNew(), s_ResLenOld(), s_ResPosNew(), s_ResPosOld(), and s_ResVal().
Referenced by CSeqDBVol::GetAmbigPartialSeq(), SeqDB_UnpackAmbiguities(), and CSeqDBVol::x_GetAmbigSeq().
◆ s_SeqDBWriteSeqDataNucl() [1/2]Store non-ambiguous nucleotide sequence data in a Seq-inst.
This function reads length elements from seq_buffer and stores them in a Seq-inst object. It also sets appropriate encoding information in that object. No ambiguity information is used. The input array is assumed to be in 2 bit representation.
Definition at line 896 of file seqdbvol.cpp.
References CSeq_inst_Base::eMol_na, i, CSeq_inst_Base::SetMol(), and CSeq_inst_Base::SetSeq_data().
Referenced by CSeqDBVol::GetBioseq().
◆ s_SeqDBWriteSeqDataNucl() [2/2]Store non-ambiguous nucleotide sequence data in a Seq-inst.
This function reads length elements from seq_buffer and stores them in a Seq-inst object. It also sets appropriate encoding information in that object. No ambiguity information is used. The input array is assumed to be in Ncbi-NA4 representation.
Definition at line 934 of file seqdbvol.cpp.
References CSeq_inst_Base::eMol_na, s_SeqDBMapNA2ToNA4(), s_SeqDBRebuildDNA_NA4(), CSeq_inst_Base::SetMol(), and CSeq_inst_Base::SetSeq_data().
◆ s_SeqDBWriteSeqDataProt() ◆ SeqDB_UnpackAmbiguities()Unpack an ambiguous nucleotide sequence.
This method provides a way to unpack nucleotide sequence data that has been packed in blast database format. One source of such data is the GetRawSeqAndAmbig() method in the CSeqDBExpert class. The output format is ncbi8na.
Definition at line 1716 of file seqdbvol.cpp.
References A, base_length, CTempString::data(), free(), i, CTempString::length(), malloc(), NCBI_THROW, result, s_SeqDBMapNA2ToNA8(), s_SeqDBRebuildDNA_NA8(), and SeqDB_GetStdOrd().
Referenced by CWriteDB_Impl::x_ComputeHash().
◆ SeqDB_ncbina8_to_blastna8 unsigned SeqDB_ncbina8_to_blastna8[] Initial value:= {
15,
0,
1,
6,
2,
4,
9,
13,
3,
8,
5,
12,
7,
11,
10,
14
}
Definition at line 590 of file seqdbvol.cpp.
Referenced by s_SeqDBMapNcbiNA8ToBlastNA8().
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4