A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/seqdbvol_8cpp.html below:

NCBI C++ ToolKit: src/objtools/blast/seqdb_reader/seqdbvol.cpp File Reference

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...
  static void  s_SeqDBMapNA2ToNA4 (const char *buf2bit, vector< char > &buf4bit, int base_length)   Convert sequence data from NA2 to NA4 format. More...
  static void  s_SeqDBMapNA2ToNA8Setup (TTable &translated)   Build NA2 to Ncbi-NA8 translation table. More...
  static void  s_SeqDBMapNA2ToNA8 (const char *buf2bit, char *buf8bit, const SSeqDBSlice &range)   Convert sequence data from NA2 to NA8 format. More...
  static void  s_SeqDBMapNcbiNA8ToBlastNA8 (char *buf, const SSeqDBSlice &range)   Convert sequence data from Ncbi-NA8 to Blast-NA8 format. More...
  Uint4  s_ResLenNew (const vector< Int4 > &ambchars, Uint4 i)   Get length of ambiguous region (new version) More...
  Uint4  s_ResPosNew (const vector< Int4 > &ambchars, Uint4 i)   Get position of ambiguous region (new version) More...
  Uint4  s_ResVal (const vector< Int4 > &ambchars, Uint4 i)   Get ambiguous residue value (old version) More...
  Uint4  s_ResLenOld (const vector< Int4 > &ambchars, Uint4 i)   Get ambiguous region length (old version) More...
  Uint4  s_ResPosOld (const vector< Int4 > &ambchars, Uint4 i)   Get ambiguous residue value (old version) More...
  static void  s_SeqDBRebuildDNA_NA4 (vector< char > &buf4bit, const vector< Int4 > &amb_chars)   Rebuild an ambiguous region from sequence and ambiguity data. More...
  static void  s_SeqDBRebuildDNA_NA8 (char *seq, const vector< Int4 > &amb_chars, const SSeqDBSlice &region)   Rebuild an ambiguous region from sequence and ambiguity data. More...
  static void  s_SeqDBWriteSeqDataProt (CSeq_inst &seqinst, const char *seq_buffer, int length)   Store protein sequence data in a Seq-inst. More...
  static void  s_SeqDBWriteSeqDataNucl (CSeq_inst &seqinst, const char *seq_buffer, int length)   Store non-ambiguous nucleotide sequence data in a Seq-inst. More...
  static void  s_SeqDBWriteSeqDataNucl (CSeq_inst &seqinst, const char *seq_buffer, int length, vector< Int4 > &amb_chars)   Store non-ambiguous nucleotide sequence data in a Seq-inst. More...
  static void  s_GetBioseqTitle (CRef< CBlast_def_line_set > deflines, string &title)   Get the title string for a CBioseq. More...
  static bool  s_SeqDB_SeqIdIn (const list< CRef< CSeq_id > > &seqids, const CSeq_id &target)   Search for a Seq-id in a list of Seq-ids. More...
  static CRef< CBlast_def_line_sets_OssToDefline (const CUser_field::TData::TOss &oss)   Efficiently decode a Blast-def-line-set from binary ASN.1. More...
  template<class T > CRef< CBlast_def_line_sets_ExtractBlastDefline (const T &bioseq)   static void  s_SeqDBMaskSequence (char *seq, CSeqDB::TSequenceRanges *masks, char mask_letter, const SSeqDBSlice &range)   void  SeqDB_UnpackAmbiguities (const CTempString &sequence, const CTempString &ambiguities, string &result)   Unpack an ambiguous nucleotide sequence. More...
  bool  s_IncludeDefline_Taxid (const CBlast_def_line &def, const set< TTaxId > &user_tax_ids)   bool  s_IncludeDefline_MaskFilter (const CBlast_def_line &def, Uint8 mask)   bool  s_IncludeDefline_NegativeTaxid (const CBlast_def_line &def, const set< TTaxId > &user_tax_ids)   template<class T > static void  s_SeqDBFitsInFour (T id)  

Implementation for the CSeqDBVol class, which provides an interface for all functionality of one database volume.

Definition in file seqdbvol.cpp.

◆ TRangeVector

List 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.

Parameters
ambchars The packed ambiguity data. [in] i The index into the ambiguity data. [in]
Returns
The region length.

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.

Parameters
ambchars The packed ambiguity data. [in] i The index into the ambiguity data. [in]
Returns
The residue value.

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.

Parameters
ambchars The packed ambiguity data. [in] i The index into the ambiguity data. [in]
Returns
The region length.

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.

Parameters
ambchars The packed ambiguity data. [in] i The index into the ambiguity data. [in]
Returns
The residue value.

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.

Parameters
ambchars The packed ambiguity data. [in] i The index into the ambiguity data. [in]
Returns
The residue value.

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  ) static

Convert 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.

Parameters
buf2bit The NA2 input data. [in] buf4bit The NcbiNA4 output data. [out] base_length The length (in bases) of the input data. [in]

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.

Returns
The NA2 to NA4 translation table

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).

Parameters
buf2bit The NA2 input data. [in] buf8bit The start of the Ncbi-NA8 output data. [out] buf8bit_end The end of the Ncbi-NA8 output data. [out] sentinel_bytes Specify true if sentinel bytes should be included. [in] range The subregion of the sequence to work on. [in]

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.

Returns
The NA2 to NA8 translation table

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  ) static

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 4 bit representations.

Parameters
buf4bit Sequence data for a sequence. [in|out] amb_chars Corresponding ambiguous data. [in]

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.

Parameters
seq Sequence data for a sequence. [in|out] amb_chars Corresponding ambiguous data. [in] region If non-null, the part of the sequence to get. [in]

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.

Parameters
seqinst The Seq-inst to return the data in. [out] seq_buffer The input sequence data. [in] length The length (in bases) of the input data. [in]

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.

Parameters
seqinst The Seq-inst to return the data in. [out] seq_buffer The input sequence data in Ncbi-NA4 format. [in] length The length (in bases) of the input data. [in] amb_chars The ambiguity data for this sequence. [in]

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.

Parameters
sequence Sequence data in NA2 format with encoded length. [in] ambiguities Sequence ambiguities packed in blastdb format. [in] result Unpacked sequence in Ncbi NA8 format. [out]

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