86
87
/** Allocates memory for *sequence_blk and then populates it.
87
88
* @param buffer start of sequence [in]
88
89
* @param length query sequence length [in]
89
* @param context context number [in]
90
90
* @param seq_blk SequenceBlk to be allocated and filled in [out]
91
91
* @param buffer_allocated Is the buffer allocated? If yes, 'sequence_start' is
92
92
* the start of the sequence, otherwise it is 'sequence'. [in]
97
BlastSetUp_SeqBlkNew (const Uint1* buffer, Int4 length, Int4 context,
97
BlastSetUp_SeqBlkNew (const Uint1* buffer, Int4 length,
98
98
BLAST_SequenceBlk* *seq_blk, Boolean buffer_allocated);
100
100
/** Allocates a new sequence block structure.
198
198
NCBI_XBLAST_EXPORT
199
199
Int1 BLAST_ContextToFrame(EBlastProgramType prog_number, Uint4 context_number);
201
/** Given a context from BLAST engine core, return the query index.
202
* @param context Context saved in a BlastHSP structure [in]
203
* @param program Type of BLAST program [in]
204
* @return Query index in a set of queries or -1 on error
207
Int4 Blast_GetQueryIndexFromContext(Int4 context, EBlastProgramType program);
209
/** Deallocate memory for query information structure */
211
BlastQueryInfo* BlastQueryInfoFree(BlastQueryInfo* query_info);
213
/** Duplicates the query information structure */
215
BlastQueryInfo* BlastQueryInfoDup(BlastQueryInfo* query_info);
217
/** Obtains the sequence length for a given query in the query, without taking
218
* into consideration any applicable translations
219
* @param qinfo BlastQueryInfo structure [in]
220
* @param program CORE program type [in]
221
* @param query_index number of the query
222
* (query_index < BlastQueryInfo::num_queries) [in]
223
* @return the length of the query sequence requested
225
Int4 BlastQueryInfoGetQueryLength(const BlastQueryInfo* qinfo,
226
EBlastProgramType program,
229
/** Create auxiliary query structures with all data corresponding
230
* to a single query sequence within a concatenated set. Allocates the
231
* structures if the pointers are NULL on input; otherwise only changes the
233
* @param one_query_info_ptr Pointer to the query information structure for a
234
* single query. Allocated and filled here, so the
235
* caller of this function will be responsible for
237
* @param one_query_ptr Pointer to the query sequence block structure; allocated
238
* here, but the contents are not allocated; it is still
239
* safe to free by the caller after use. [out]
240
* @param query_info Query information structure containing information about a
241
* concatenated set. [in]
242
* @param query Query sequence block corresponding to a concatenated set of
244
* @param query_index Which query index to create the auxiliary structures
246
* @return -1 if memory allocation failed; 0 on success
249
Int2 Blast_GetOneQueryStructs(BlastQueryInfo** one_query_info_ptr,
250
BLAST_SequenceBlk** one_query_ptr,
251
const BlastQueryInfo* query_info,
252
BLAST_SequenceBlk* query, Int4 query_index);
255
201
/** Convert a sequence in ncbi4na or blastna encoding into a packed sequence
256
202
* in ncbi2na encoding. Needed for 2 sequences BLASTn comparison.
257
203
* @param buffer original sequence data (one base per byte) [in]
273
219
* concatenated sequence. [in]
275
221
NCBI_XBLAST_EXPORT
276
Int2 BLAST_InitDNAPSequence(BLAST_SequenceBlk* query_blk,
277
const BlastQueryInfo* query_info);
222
Int2 BLAST_CreateMixedFrameDNATranslation(BLAST_SequenceBlk* query_blk,
223
const BlastQueryInfo* query_info);
279
225
/** Translate nucleotide into 6 frames. All frames are put into a
280
226
* translation buffer, with sentinel NULLB bytes in between.
328
274
NCBI_XBLAST_EXPORT
329
275
Int4 BSearchInt4(Int4 n, Int4* A, Int4 size);
332
/** Search BlastContextInfo structures for the specified offset */
334
Int4 BSearchContextInfo(Int4 n, BlastQueryInfo * A);
337
/** Get the number of bytes required for the concatenated sequence
338
* buffer, given a query info structure. The context data should
339
* already be assigned.
340
* @param qinfo Query info structure. [in/out]
341
* @return Number of bytes for all queries and inter-query marks.
344
QueryInfo_GetSeqBufLen(const BlastQueryInfo* qinfo);
347
/** Copy the context query offsets to an allocated array of Int4.
348
* @param info Describes the concatenated query.
349
* @return Allocated array.
352
Int4 * ContextOffsetsToOffsetArray(BlastQueryInfo* info);
355
/** Copy the context query offsets from an array of Int4, allocating
356
* the context array if needed.
357
* @param info Destination for the values.
358
* @param new_offsets Array of values to copy from.
359
* @param prog The blast program type.
362
void OffsetArrayToContextOffsets(BlastQueryInfo * info,
364
EBlastProgramType prog);
367
277
/** Get the standard amino acid probabilities. This is basically a wrapper for
368
278
* BlastScoreBlkNew() and Blast_ResFreqStdComp() from blast_stat.c with a more
369
279
* intention-revealing name :)