src/algo/align/util/demo/compart/em.cpp File Reference

#include <ncbi_pch.hpp>
#include "em.hpp"
#include <corelib/ncbi_system.hpp>
#include <corelib/ncbifile.hpp>
#include <util/random_gen.hpp>
#include <algo/align/util/compartment_finder.hpp>
#include <objtools/blast/seqdb_reader/seqdb.hpp>
#include <math.h>

Include dependency graph for em.cpp:

Go to the source code of this file.

Classes

class  CReverseAndComplement< T >

Defines

#define QCOMP_COUNT_NrMERS
#define QCOMP_PREPARE_SHIFTED_GENOMIC_IDX
#define QCOMP_CREATE_GENOMIC_IDX(w8, gccur)
#define CHECK_MEMMAP(mm, ofs, len)
#define EXTEND_USING_SEQUENCE_CHARS

Functions

const Uint4 kNr (14)
const size_t kNrMersTotal (1<< (kNr *2))
const double kRepeatsPercentile (0.995)
const Uint4 kN (16)
const Uint8 kNMersTotal (Uint8(1)<< (kN *2))
const string kFileExt_Masked (".rep")
const string kFileExt_Remap (".idc")
const string kFileExt_Offsets (".ofs")
const string kFileExt_Positions (".pos")
const Uint8 kUI8_LoWord (0xFFFFFFFF)
const Uint8 kUI8_LoByte (kUI8_LoWord >> 24)
const Uint8 kUI8_MidWord (kUI8_LoWord<< 16)
const Uint8 kUI8_HiWord (kUI8_LoWord<< 32)
const Uint8 kUI8_LoFive (kUI8_LoWord|(kUI8_LoWord<< 8))
const Uint8 kUI8_LoHalfWordEachByte ((Uint8(0x0F0F0F0F)<< 32)|0x0F0F0F0F)
const Uint4 kUI4_Lo28 (0xFFFFFFFF >> 4)
const Uint8 kUI8_SeqDb_lo (0x03030303)
const Uint8 kUI8_SeqDb ((kUI8_SeqDb_lo<< 32)|kUI8_SeqDb_lo)
const Int8 kDiagMax (numeric_limits< Int8 >::max())
const Uint8 kSeqDbMemBound (512 *1024 *1024)
const size_t kMapGran (512 *1024 *1024)
char DecodeSeqDbChar (Uint1 c)
void CheckWrittenFile (const string &filename, const Uint8 &len_bytes)
template<typename T>
ReverseAndComplement (T v)
string GetLocalBaseName (const string &extended_name, const string &sfx)
string ReplaceExt (const string &extended_name, const string &new_ext)
template<typename VectorT>
string g_SaveToTemp (const VectorT &v)
template<typename VectorT>
void g_RestoreFromTemp (const string &filename, VectorT *pvd)
bool PLoWord (const Uint8 &lhs, const Uint8 &rhs)
bool PDiag (const Uint8 &lhs, const Uint8 &rhs)
CRandom::TValue GenerateSeed (const string &str)

Variables

CReverseAndComplement< Uint4g_RC


Define Documentation

#define CHECK_MEMMAP mm,
ofs,
len   ) 
 

Value:

{{ \
    const size_t ofs1 (mm.GetOffset());     \
    if(ofs1 != ofs) {                                                        \
        cerr << "Real offset " << ofs1 << " different from " << ofs << endl; \
    }                                                                        \
    const size_t len1 (mm.GetSize());                                    \
    if(len1 != len) {                                                        \
        cerr << "Real length " << len1 << " different from " << len << endl; \
    } \
}}

Definition at line 913 of file em.cpp.

#define EXTEND_USING_SEQUENCE_CHARS
 

#define QCOMP_COUNT_NrMERS
 

Value:

{{ \
                if(gccur + 16 >= current_offset + bases) { \
                    break; \
                } \
                const Uint4 mer4 (ui8 & kUI8_LoWord); \
                ++NrCounts[mer4 >> 4];           \
                gccur += 4; \
                ui8 >>= 8; \
                }}

Referenced by CElementaryMatching::x_InitFilteringVector().

#define QCOMP_CREATE_GENOMIC_IDX w8,
gccur   ) 
 

Value:

{ \
                    if(gccur + 16 >= current_offset + bases) { \
                        break; \
                    } \
                    const Uint8 mer (w8 & kUI8_LoWord); \
                    if(strand) { \
                        if(m_Mers.get_at(mer)) { \
                            MersAndCoords[mcidx++] = (mer << 32) | gccur; \
                        } \
                    } \
                    else { \
                        const Uint4 rc (g_RC(Uint4(mer))); \
                        if(m_Mers.get_at(rc)) { \
                            MersAndCoords[mcidx++] = (Uint8(rc) << 32) | \
                                ((current_offset + bases - gccur - 16) \
                                 + current_offset); \
                        } \
                    } \
                    gccur += 4; \
                    w8 >>= 8; \
                }

#define QCOMP_PREPARE_SHIFTED_GENOMIC_IDX
 

Value:

size_t gccur2 (gccur + 2); \
                const Uint8 ui8_2930 (w8 >> 60); \
                Uint8 ui8_ls4 (w8 << 4); \
                const Uint8 ui8_mask (ui8_ls4 & kUI8_LoHalfWordEachByte); \
                ui8_ls4 &= kUI8_LoHalfWordEachByte << 4; \
                ui8_ls4 |= (ui8_mask >> 16) | (ui8_2930 << 48);


Function Documentation

void CheckWrittenFile const string &  filename,
const Uint8 len_bytes
 

Definition at line 132 of file em.cpp.

References GetLength().

Referenced by CElementaryMatching::x_WriteIndexFile().

char DecodeSeqDbChar Uint1  c  ) 
 

Definition at line 92 of file em.cpp.

template<typename VectorT>
void g_RestoreFromTemp const string &  filename,
VectorT *  pvd
 

Definition at line 306 of file em.cpp.

References GetLength(), and CMemoryFile::Map().

template<typename VectorT>
string g_SaveToTemp const VectorT &  v  ) 
 

Definition at line 271 of file em.cpp.

References CMemoryFile_Base::eCreate, CMemoryFile_Base::eMMP_Write, CMemoryFile_Base::eMMS_Shared, CDirEntry::GetTmpNameEx(), and CMemoryFile::Map().

Referenced by CElementaryMatching::x_Search().

CRandom::TValue GenerateSeed const string &  str  ) 
 

Definition at line 1720 of file em.cpp.

References ITERATE.

Referenced by CElementaryMatching::x_InitBasic().

string GetLocalBaseName const string &  extended_name,
const string &  sfx
 

Definition at line 239 of file em.cpp.

References CDirEntry::SplitPath().

Referenced by CElementaryMatching::x_InitBasic().

const Int8 @0::kDiagMax numeric_limits< Int8 >::  max()  )  [static]
 

Referenced by CElementaryMatching::x_ExtendHit().

const string @0::kFileExt_Masked ".rep"   )  [static]
 

Referenced by CElementaryMatching::x_Cleanup().

const string @0::kFileExt_Offsets ".ofs"   )  [static]
 

Referenced by CElementaryMatching::Run(), CElementaryMatching::x_Cleanup(), CElementaryMatching::x_InitParticipationVector(), CElementaryMatching::x_Search(), and CElementaryMatching::x_WriteIndexFile().

const string @0::kFileExt_Positions ".pos"   )  [static]
 

Referenced by CElementaryMatching::Run(), CElementaryMatching::x_Cleanup(), CElementaryMatching::x_Search(), and CElementaryMatching::x_WriteIndexFile().

const string @0::kFileExt_Remap ".idc"   )  [static]
 

Referenced by CElementaryMatching::x_Cleanup(), and CElementaryMatching::x_LoadRemapData().

const size_t @0::kMapGran 512 *1024 *  1024  )  [static]
 

Referenced by CElementaryMatching::x_Search().

const Uint4 @0::kN 16   )  [static]
 

const Uint8 @0::kNMersTotal Uint8(1)<< (kN *2)   )  [static]
 

Referenced by CElementaryMatching::x_InitParticipationVector().

const Uint4 @0::kNr 14   )  [static]
 

const size_t @0::kNrMersTotal 1<<   (kNr *2)  )  [static]
 

Referenced by CElementaryMatching::x_InitFilteringVector().

const double @0::kRepeatsPercentile 0.  995  )  [static]
 

const Uint8 @0::kSeqDbMemBound 512 *1024 *  1024  )  [static]
 

Referenced by CElementaryMatching::x_InitFilteringVector().

const Uint4 @0::kUI4_Lo28 0xFFFFFFFF >>  4  )  [static]
 

const Uint8 @0::kUI8_HiWord kUI8_LoWord<<  32  )  [static]
 

Referenced by CElementaryMatching::x_WriteIndexFile().

const Uint8 @0::kUI8_LoByte kUI8_LoWord >>  24  )  [static]
 

const Uint8 @0::kUI8_LoFive kUI8_LoWord|  (kUI8_LoWord<< 8)  )  [static]
 

const Uint8 @0::kUI8_LoHalfWordEachByte (Uint8(0x0F0F0F0F)<< 32)|  0x0F0F0F0F  )  [static]
 

const Uint8 @0::kUI8_LoWord 0xFFFFFFFF   )  [static]
 

Referenced by CElementaryMatching::x_InitParticipationVector().

const Uint8 @0::kUI8_MidWord kUI8_LoWord<<  16  )  [static]
 

const Uint8 @0::kUI8_SeqDb (kUI8_SeqDb_lo<< 32)|  kUI8_SeqDb_lo  )  [static]
 

const Uint8 @0::kUI8_SeqDb_lo 0x03030303   )  [static]
 

bool PDiag const Uint8 lhs,
const Uint8 rhs
 

Definition at line 1115 of file em.cpp.

Referenced by CElementaryMatching::x_CompartPair().

bool PLoWord const Uint8 lhs,
const Uint8 rhs
 

Definition at line 1109 of file em.cpp.

string ReplaceExt const string &  extended_name,
const string &  new_ext
 

Definition at line 251 of file em.cpp.

References CDirEntry::SplitPath().

Referenced by CElementaryMatching::x_Search().

template<typename T>
T ReverseAndComplement v  ) 
 

Definition at line 158 of file em.cpp.

Referenced by CReverseAndComplement< T >::CReverseAndComplement().


Variable Documentation

CReverseAndComplement<Uint4> g_RC [static]
 

Definition at line 208 of file em.cpp.


Generated on Mon Dec 7 06:53:02 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:21:16 2009 by modify_doxy.py rev. 173732