64 vector <string> units;
67 ITERATE(vector<string>, unit, units){
70 if (ch==
'[' || ch==
'{' || ch==
'X' || (*unit).length()==1 || (*unit)[1]==
'(') {
112 memset((
void*) &seq_arg, 0,
sizeof(seq_arg));
125 Int4 start_offset = 0;
128 while (start_offset < seq_arg.seq->length) {
136 if (hit_count == 0)
break;
138 for (
int index = 0; index < hit_count; ++index) {
139 vector<vector<int> > pos_list;
140 vector<int> pos(
m_Units.size());
144 ITERATE(vector<vector<int> >, it_pos, pos_list) {
149 ITERATE(vector<int>, q, *it_pos) {
152 r_start = r_end + *q;
164 _ASSERT(index + (
Int4)(pos_list.size()) - 1 < hit_count);
165 for (
unsigned int i = 1;
i< pos_list.size(); ++
i) {
167 _ASSERT(offset_pairs[index +
i].phi_offsets.
s_end + 1 == end);
169 index += pos_list.size() - 1;
200 vector<vector<int> > &ranges)
206 for (rep =0; rep <
m_Units[off].at_least; ++rep) {
210 while(off <
m_Units.size() - 1) {
214 if (rep >=
m_Units[off].at_most)
return;
215 if (
len + off + 1 <
m_Units.size() + rep)
return;
220 for (; rep <
len; ++rep) {
224 ranges.push_back(pos);
union BlastOffsetPair BlastOffsetPair
This symbol enables the verbose option in makeblastdb and other BLAST+ search command line applicatio...
#define sfree(x)
Safe free a pointer: belongs to a higher level header.
Int2 BlastScoringOptionsNew(EBlastProgramType program, BlastScoringOptions **options)
Allocate memory for BlastScoringOptions and fill with default values.
Int2 LookupTableOptionsNew(EBlastProgramType program, LookupTableOptions **options)
Allocate memory for lookup table options and fill with default values.
Declares the CBlastOptionsHandle and CBlastOptionsFactory classes.
BlastQueryInfo * BlastQueryInfoNew(EBlastProgramType program, int num_queries)
Allocate memory for query information structure.
Declarations of auxiliary functions using IBlastSeqInfoSrc to retrieve ids and related sequence infor...
#define BLAST_SEQSRC_ERROR
Error while retrieving sequence.
Int4 BlastSeqSrcIteratorNext(const BlastSeqSrc *seq_src, BlastSeqSrcIterator *itr)
Increments the BlastSeqSrcIterator.
BlastSeqSrcIterator * BlastSeqSrcIteratorFree(BlastSeqSrcIterator *itr)
Frees the BlastSeqSrcIterator structure.
BlastSeqSrcIterator * BlastSeqSrcIteratorNewEx(unsigned int chunk_sz)
Allocate and initialize an iterator over a BlastSeqSrc.
void BlastSeqSrcReleaseSequence(const BlastSeqSrc *seq_src, BlastSeqSrcGetSeqArg *getseq_arg)
Deallocate individual sequence.
Int4 BlastSeqSrcGetNumSeqs(const BlastSeqSrc *seq_src)
Get the number of sequences contained in the sequence source.
Int2 BlastSeqSrcGetSequence(const BlastSeqSrc *seq_src, BlastSeqSrcGetSeqArg *getseq_arg)
Retrieve an individual sequence.
#define BLAST_SEQSRC_EOF
No more sequences available.
Utilities initialize/setup BLAST.
Int2 BlastSetup_ScoreBlkInit(BLAST_SequenceBlk *query_blk, const BlastQueryInfo *query_info, const BlastScoringOptions *scoring_options, EBlastProgramType program_number, BlastScoreBlk **sbpp, double scale_factor, Blast_Message **blast_message, GET_MATRIX_PATH get_path)
Initializes the score block structure.
Internal auxiliary setup classes/functions for C++ BLAST APIs.
@ eBlastp
Protein-Protein.
BLAST_SequenceBlk * BlastSequenceBlkFree(BLAST_SequenceBlk *seq_blk)
Deallocate memory for a sequence block.
Wrapper class for BlastQueryInfo .
Wrapper class for BlastScoringOptions .
Wrapper class for Blast_Message .
Interface to create a BlastSeqSrc suitable for use in CORE BLAST from a a variety of BLAST database/s...
Wrapper class for LookupTableOptions .
NCBI C++ Object Manager dependant implementation of IQueryFactory.
Abstract base class to encapsulate retrieval of sequence identifiers.
#define test(a, b, c, d, e)
TSeedTopResults Run(CRef< CLocalDbAdapter > db)
CBlastScoreBlk m_ScoreBlk
BlastSeqSrc * MakeSeqSrc()
Retrieves or constructs the BlastSeqSrc.
static CBlastOptionsHandle * Create(EProgram program, EAPILocality locality=CBlastOptions::eLocal)
Creates an options handle object configured with default options for the requested program,...
CLookupTableWrap m_Lookup
void x_GetPatternRanges(vector< int > &pos, Uint4 off, Uint1 *seq, Uint4 len, vector< vector< int > > &ranges)
IBlastSeqInfoSrc * MakeSeqInfoSrc()
Retrieves or constructs the IBlastSeqInfoSrc.
char * BlastFindMatrixPath(const char *matrix_name, Boolean is_prot)
Returns the path to a specified matrix.
vector< CConstRef< CSeq_loc > > TSeedTopResults
vector< struct SPatternUnit > m_Units
static const EBlastProgramType m_Program
const char NCBISTDAA_TO_AMINOACID[]
Translates between ncbieaa and ncbistdaa.
void GetSequenceLengthAndId(const IBlastSeqInfoSrc *seqinfo_src, int oid, CRef< objects::CSeq_id > &seqid, TSeqPos *length)
Retrieves subject sequence Seq-id and length.
@ eBlastEncodingProtein
NCBIstdaa.
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
CPacked_seqint::TRanges TRanges
CConstRef< CSeq_id > GetSeqId(void) const
Get id which can be used to access this bioseq handle Throws an exception if none is available.
CScope & GetScope(void) const
Get scope this handle belongs to.
uint8_t Uint1
1-byte (8-bit) unsigned integer
int32_t Int4
4-byte (32-bit) signed integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
NCBI_NS_STD::string::size_type SIZE_TYPE
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string (in-place)
static string & ToUpper(string &str)
Convert string to upper case – string& version.
Int4 GetOffsetArraySize(LookupTableWrap *lookup)
Determine the size of the offsets arrays to be filled by the ScanSubject function.
Int2 LookupTableWrapInit(BLAST_SequenceBlk *query, const LookupTableOptions *lookup_options, const QuerySetUpOptions *query_options, BlastSeqLoc *lookup_segments, BlastScoreBlk *sbp, LookupTableWrap **lookup_wrap_ptr, const BlastRPSInfo *rps_info, Blast_Message **error_msg, BlastSeqSrc *seqsrc)
Create the lookup table for all query words.
#define MAX(a, b)
returns larger of a and b.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
Pseudo lookup table structure and database scanning functions used in PHI-BLAST.
Int4 PHIBlastScanSubject(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *query_blk, const BLAST_SequenceBlk *subject, Int4 *offset, BlastOffsetPair *offset_pairs, Int4 array_size)
Scans the subject sequence from "offset" to the end of the sequence.
Declares the CSeedTop class.
Defines a concrete strategy for the IBlastSeqInfoSrc interface for sequence identifiers retrieval fro...
Implementation of the BlastSeqSrc interface for a vector of sequence locations.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
vector< SSeqLoc > TSeqLocVector
Vector of sequence locations.
Uint1 * sequence
Sequence used for search (could be translation).
Structure used as the second argument to functions satisfying the GetSeqBlkFnPtr signature,...
Int4 oid
Oid in BLAST database, index in an array of sequences, etc [in].
EBlastEncoding encoding
Encoding of sequence, i.e.
BLAST_SequenceBlk * seq
Sequence to return, if NULL, it should allocated by GetSeqBlkFnPtr (using BlastSeqBlkNew or BlastSetU...
Complete type definition of Blast Sequence Source Iterator.
Complete type definition of Blast Sequence Source ADT.
char * phi_pattern
PHI-BLAST pattern.
Structure to represent a single sequence to be fed to BLAST.
This symbol enables the verbose option in makeblastdb and other BLAST+ search command line applicatio...
Uint4 s_start
Start offset of pattern in subject.
Uint4 s_end
End offset of pattern in subject.
struct BlastOffsetPair::@7 phi_offsets
Pattern offsets in subject (PHI BLAST only)
voidp calloc(uInt items, uInt size)