vector<Int2> strand_v;
146strand_v.push_back((
Int2) (*iter).seqloc->GetStrand());
148sl->
Assign(*((*iter).seqloc));
153mask_sl->
Assign(*((*iter).mask));
154 SSeqLocsseq_loc(*sl, *((*iter).scope), *mask_sl);
155temp_slv.push_back(sseq_loc);
159 SSeqLocsseq_loc(*sl, *((*iter).scope));
160temp_slv.push_back(sseq_loc);
167 ITERATE(vector<Int2>, s_iter, strand_v)
213 if((retval = (*seq_info)->GetMaxLength()) > 0)
216 for(index=0; index<(*seq_info)->GetNumSeqs(); ++index)
217retval =
MAX(retval, (*seq_info)->GetSeqBlk(index)->length);
218(*seq_info)->SetMaxLength(retval);
233 for(index=0; index<(*seq_info)->GetNumSeqs(); ++index)
234retval =
MIN(retval, (*seq_info)->GetSeqBlk(index)->length);
247 Int8total_length = 0;
257 if((avg_length = (*seq_info)->GetAvgLength()) > 0)
260 if((num_seqs = (*seq_info)->GetNumSeqs()) == 0)
262 for(index = 0; index < num_seqs; ++index)
263total_length += (
Int8) (*seq_info)->GetSeqBlk(index)->length;
264avg_length = (
Uint4) (total_length / num_seqs);
265(*seq_info)->SetAvgLength(avg_length);
280 return(*seq_info)->GetNumSeqs();
297 return(*seq_info)->GetTotLength();
325 return(
Boolean) (*seq_info)->GetIsProtein();
344 if((*seq_info)->GetNumSeqs() == 0 || !args)
349 if(index >= (
Int4) (*seq_info)->GetNumSeqs())
368args->
seq->
oid= index;
398index = *((
Int4*) args);
399 return(*seq_info)->GetSeqBlk(index)->length;
425 if(itr->
current_pos>= (*seq_info)->GetNumSeqs())
520}
catch(
constncbi::CException& e) {
522}
catch(
conststd::exception& e) {
526 strdup(
"Caught unknown exception from CMultiSeqInfo constructor"));
562unique_ptr<SMultiSeqSrcNewArgs> args
564program, dbscan_mode));
#define sfree(x)
Safe free a pointer: belongs to a higher level header.
Definitions which are dependant on the NCBI C++ Object Manager.
Boolean Blast_SubjectIsProtein(EBlastProgramType p)
Returns true if the subject is protein.
EBlastProgramType
Defines the engine's notion of the different applications of the BLAST algorithm.
Boolean Blast_SubjectIsTranslated(EBlastProgramType p)
Returns true if the subject is translated.
#define BLAST_SEQSRC_ERROR
Error while retrieving sequence.
BlastSeqSrc * BlastSeqSrcNew(const BlastSeqSrcNewInfo *bssn_info)
Allocates memory for a BlastSeqSrc structure and then invokes the constructor function defined in its...
#define BLAST_SEQSRC_SUCCESS
Successful sequence retrieval.
#define BLAST_SEQSRC_MINLENGTH
Default minimal sequence length.
#define BLAST_SEQSRC_EOF
No more sequences available.
Definitions needed for implementing the BlastSeqSrc interface and low level details of the implementa...
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetReleaseSequence(BlastSeqSrc *var, ReleaseSeqBlkFnPtr arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetResetChunkIterator(BlastSeqSrc *var, ResetChunkIteratorFnPtr arg)
NCBI_XBLAST_EXPORT void * _BlastSeqSrcImpl_GetDataStructure(const BlastSeqSrc *var)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetGetTotLenStats(BlastSeqSrc *var, GetInt8FnPtr arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetGetSequence(BlastSeqSrc *var, GetSeqBlkFnPtr arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetGetNumSeqsStats(BlastSeqSrc *var, GetInt4FnPtr arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetGetTotLen(BlastSeqSrc *var, GetInt8FnPtr arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetGetSeqLen(BlastSeqSrc *var, GetInt4FnPtr arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetGetIsProt(BlastSeqSrc *var, GetBoolFnPtr arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetDataStructure(BlastSeqSrc *var, void *arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetCopyFnPtr(BlastSeqSrc *var, BlastSeqSrcCopier arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetGetAvgSeqLen(BlastSeqSrc *var, GetInt4FnPtr arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetIterNext(BlastSeqSrc *var, AdvanceIteratorFnPtr arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetGetMinSeqLen(BlastSeqSrc *var, GetInt4FnPtr arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetInitErrorStr(BlastSeqSrc *var, char *arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetDeleteFnPtr(BlastSeqSrc *var, BlastSeqSrcDestructor arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetGetName(BlastSeqSrc *var, GetStrFnPtr arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetGetMaxSeqLen(BlastSeqSrc *var, GetInt4FnPtr arg)
NCBI_XBLAST_EXPORT void _BlastSeqSrcImpl_SetGetNumSeqs(BlastSeqSrc *var, GetInt4FnPtr arg)
BLAST_SequenceBlk * BlastSequenceBlkFree(BLAST_SequenceBlk *seq_blk)
Deallocate memory for a sequence block.
void BlastSequenceBlkCopy(BLAST_SequenceBlk **copy, BLAST_SequenceBlk *src)
Copies contents of the source sequence block without copying sequence buffers; sets all "field_alloca...
Contains information about all sequences in a set.
Int8 GetTotLength()
Returns total length.
void SetupSubjects(TSeqLocVector &subjects, EBlastProgramType program, vector< BLAST_SequenceBlk * > *seqblk_vec, unsigned int *max_subjlen)
Sets up internal subject data structure for the BLAST search.
static BlastSeqSrc * s_MultiSeqSrcNew(BlastSeqSrc *retval, void *args)
Multi-sequence source constructor.
static void s_MultiSeqReleaseSequence(void *, BlastSeqSrcGetSeqArg *args)
Deallocates the uncompressed sequence buffer if necessary.
CMultiSeqInfo(TSeqLocVector &seq_vector, EBlastProgramType program, bool dbscan_mode)
Constructor from a vector of sequence location/scope pairs and a BLAST program type.
bool dbscan_mode
Database mode (not pairwise)
static Int4 s_MultiSeqGetMaxLength(void *multiseq_handle, void *)
The following functions interact with the C API, and have to be declared extern "C".
unsigned int m_iAvgLength
Average length of sequences in this set.
static BlastSeqSrc * s_MultiSeqSrcFree(BlastSeqSrc *seq_src)
Multi sequence source destructor: frees its internal data structure.
Uint4 GetMaxLength()
Setter and getter functions for the private fields.
static BlastSeqSrc * s_MultiSeqSrcCopy(BlastSeqSrc *seq_src)
Multi-sequence sequence source copier: creates a new reference to the CMultiSeqInfo object and copies...
static void s_MultiSeqResetChunkIter(void *)
Resets the internal bookmark iterator (N/A in this case)
static Int4 s_MultiSeqGetMinLength(void *multiseq_handle, void *)
Retrieves the length of the longest sequence in the BlastSeqSrc.
static Int8 s_MultiSeqGetTotLen(void *multiseq_handle, void *)
Returns total length in db scan mode.
bool m_DbScanMode
Database scanning mode (not pairwise)
bool m_ibIsProt
Internal fields.
static Int4 s_MultiSeqGetNumSeqs(void *multiseq_handle, void *)
Retrieves the number of sequences in the BlastSeqSrc.
static Int8 s_MultiSeqGetTotLenStats(void *, void *)
Returns 0 as this implementation does not use alias files.
BlastSeqSrc * MultiSeqBlastSeqSrcInit(TSeqLocVector &seq_vector, EBlastProgramType program, bool dbscan_mode=false)
Initialize the sequence source structure.
~CMultiSeqInfo()
Destructor.
static Int2 s_MultiSeqGetNextChunk(void *multiseq_handle, BlastSeqSrcIterator *itr)
Mirrors the database iteration interface.
void SetAvgLength(Uint4 val)
Sets average length.
SMultiSeqSrcNewArgs(TSeqLocVector sv, EBlastProgramType p, bool db)
Constructor.
static Int4 s_MultiSeqGetSeqLen(void *multiseq_handle, void *args)
Retrieve length of a given sequence.
static Int4 s_MultiSeqGetAvgLength(void *multiseq_handle, void *)
Retrieves the length of the longest sequence in the BlastSeqSrc.
bool GetIsProtein()
Answers whether sequences in this object are protein or nucleotide.
BLAST_SequenceBlk * GetSeqBlk(int index)
Returns sequence block structure for one of the sequences.
static Int4 s_MultiSeqIteratorNext(void *multiseq_handle, BlastSeqSrcIterator *itr)
Gets the next sequence index, given a BlastSeqSrc pointer.
Uint4 GetAvgLength()
Returns average length.
unsigned int m_iMaxLength
Length of the longest sequence in this set.
EBlastProgramType program
BLAST program.
static Boolean s_MultiSeqGetIsProt(void *multiseq_handle, void *)
Answers whether this object is for protein or nucleotide sequences.
vector< BLAST_SequenceBlk * > m_ivSeqBlkVec
Vector of sequence blocks.
Uint4 GetNumSeqs()
Returns number of sequences.
TSeqLocVector seq_vector
Vector of sequences.
static Int2 s_MultiSeqGetSequence(void *multiseq_handle, BlastSeqSrcGetSeqArg *args)
Retrieves the sequence for a given index, in a given encoding.
Int8 m_iTotalLength
Total length of sequences in this set.
void SetMaxLength(Uint4 val)
Sets maximal length.
static const char * s_MultiSeqGetName(void *, void *)
Always returns NcbiEmptyCStr.
static Int4 s_MultiSeqGetNumSeqsStats(void *, void *)
Returns zero as this implementation does not support alias files.
@ eBlastEncodingNcbi4na
NCBI4na.
@ eBlastEncodingNucleotide
Special encoding for preliminary stage of BLAST: permutation of NCBI4na.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
void SetStrand(ENa_strand strand)
Set the strand for all of the location's ranges.
void Reset(void)
Reset reference object.
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty â pointing to an object and has a non-null value.
int16_t Int2
2-byte (16-bit) signed integer
int32_t Int4
4-byte (32-bit) signed integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
int64_t Int8
8-byte (64-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define USING_SCOPE(ns)
Use the specified namespace.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
@ eNa_strand_both
in forward orientation
#define MIN(a, b)
returns smaller of a and b.
#define INT4_MAX
largest nubmer represented by signed int
Uint1 Boolean
bool replacment for C
#define FALSE
bool replacment for C indicating false.
#define UINT4_MAX
largest number represented by unsigned int.
#define MAX(a, b)
returns larger of a and b.
Implementation of the BlastSeqSrc interface for a vector of sequence locations.
vector< SSeqLoc > TSeqLocVector
Vector of sequence locations.
Structure to hold a sequence.
Uint1 * sequence_start
Start of sequence, usually one byte before sequence as that byte is a NULL sentinel byte.
Int4 oid
The ordinal id of the current sequence.
BlastMaskLoc * lcase_mask
Locations to be masked from operations on this sequence: lookup table for query; scanning for subject...
Boolean lcase_mask_allocated
TRUE if memory has been allocated for lcase_mask.
Uint1 * sequence
Sequence used for search (could be translation).
Boolean sequence_start_allocated
TRUE if memory has been allocated for sequence_start.
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.
unsigned int current_pos
Keep track of this iterator's current position, implementations use UINT4_MAX to indicate this is uni...
Complete type definition of the structure used to create a new BlastSeqSrc.
BlastSeqSrcConstructor constructor
User-defined function to initialize a BlastSeqSrc structure.
void * ctor_argument
Argument to the above function.
Complete type definition of Blast Sequence Source ADT.
Encapsulates the arguments needed to initialize multi-sequence source.
Structure to represent a single sequence to be fed to BLAST.
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