NCBI C++ ToolKit
Classes | Macros | Functions
compart_matching.cpp File Reference
#include <ncbi_pch.hpp>
#include <math.h>
#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 <algo/align/splign/compart_matching.hpp>
+ Include dependency graph for compart_matching.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  CReverseAndComplement< T >
 

Macros

#define QCOMP_COUNT_NrMERS
 
#define QCOMP_PREPARE_SHIFTED_GENOMIC_IDX
 
#define QCOMP_CREATE_GENOMIC_IDX(w8, gccur)
 
#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

char DecodeSeqDbChar (Uint1 c)
 
void CheckWrittenFile (const string &filename, const Uint8 &len_bytes)
 
template<typename T >
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, const string &path)
 
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)
 

Macro Definition 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; \
} \
}}
if(yy_accept[yy_current_state])
int len
#define const
Definition: zconf.h:217

Definition at line 1226 of file compart_matching.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; \
}}
unsigned int Uint4
Alias for unsigned int.
Definition: ncbitype.h:121
if(yy_accept[yy_current_state])
#define const
Definition: zconf.h:217

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; \
}
unsigned NCBI_INT8_TYPE Uint8
Unsigned 8 byte sized integer.
Definition: ncbitype.h:146
unsigned int Uint4
Alias for unsigned int.
Definition: ncbitype.h:121
if(yy_accept[yy_current_state])
#define const
Definition: zconf.h:217

Referenced by CElementaryMatching::x_CreateIndex().

#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; \
}
unsigned NCBI_INT8_TYPE Uint8
Unsigned 8 byte sized integer.
Definition: ncbitype.h:146
unsigned int Uint4
Alias for unsigned int.
Definition: ncbitype.h:121
if(yy_accept[yy_current_state])
#define const
Definition: zconf.h:217
#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);
unsigned NCBI_INT8_TYPE Uint8
Unsigned 8 byte sized integer.
Definition: ncbitype.h:146
#define const
Definition: zconf.h:217

Referenced by CElementaryMatching::x_CreateIndex().

#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);
unsigned NCBI_INT8_TYPE Uint8
Unsigned 8 byte sized integer.
Definition: ncbitype.h:146
#define const
Definition: zconf.h:217

Function Documentation

void CheckWrittenFile ( const string filename,
const Uint8 len_bytes 
)
char DecodeSeqDbChar ( Uint1  c)

Definition at line 93 of file compart_matching.cpp.

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

Definition at line 298 of file compart_matching.cpp.

References GetLength(), and CDirEntry::Remove().

Referenced by CElementaryMatching::x_InitFilteringVector().

template<typename VectorT >
string g_SaveToTemp ( const VectorT &  v,
const string path 
)
CRandom::TValue GenerateSeed ( const string str)

Definition at line 2023 of file compart_matching.cpp.

References ITERATE.

Referenced by CElementaryMatching::x_InitBasic().

string GetLocalBaseName ( const string extended_name,
const string sfx 
)

Definition at line 248 of file compart_matching.cpp.

References CDirEntry::SplitPath().

Referenced by CElementaryMatching::x_InitBasic().

bool PDiag ( const Uint8 lhs,
const Uint8 rhs 
)

Definition at line 1429 of file compart_matching.cpp.

Referenced by CElementaryMatching::x_CompartPair().

bool PLoWord ( const Uint8 lhs,
const Uint8 rhs 
)

Definition at line 1423 of file compart_matching.cpp.

Referenced by CElementaryMatching::x_CompartVolume().

string ReplaceExt ( const string extended_name,
const string new_ext 
)

Definition at line 260 of file compart_matching.cpp.

References CDirEntry::SplitPath().

Referenced by CElementaryMatching::x_Search().

template<typename T >
T ReverseAndComplement ( T  v)

Definition at line 167 of file compart_matching.cpp.

References i, and T.

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

Modified on Thu Mar 30 17:13:38 2017 by modify_doxy.py rev. 506947