vector<
int>& indices)
const 61 intnum_queries = align.size();
62 intlength = align[0].GetLength();
68retval->
SetDim(num_queries);
73denseg->
SetDim(num_queries);
79vector<int> seq_off(num_queries, 0);
80 for(
int i= 0;
i< num_queries;
i++) {
81 const CSeq_loc& seqloc = *m_tQueries[indices[
i]];
88denseg->
SetIds().push_back(
id);
90 else if(seqloc.
IsInt()) {
93denseg->
SetIds().push_back(
id);
107 for(
i= 1, seg_len = 1;
i< length;
i++, seg_len++) {
108 for(j = 0; j < num_queries; j++) {
120 if(j < num_queries) {
125 for(j = 0; j < num_queries; j++) {
130denseg->
SetStarts().push_back(seq_off[j]);
131seq_off[j] += seg_len;
134denseg->
SetLens().push_back(seg_len);
142 for(j = 0; j < num_queries; j++) {
146denseg->
SetStarts().push_back(seq_off[j]);
148denseg->
SetLens().push_back(seg_len);
151retval->
SetSegs().SetDenseg(*denseg);
161 "Results were not computed");
165vector<int> indices(num_queries);
169 for(
int i= 0;
i< num_queries;
i++) {
179 intnum_selected = indices.size();
180vector<CSequence> new_align(num_selected);
181vector<int> new_indices(num_selected);
186 for(
int i= 0;
i< num_selected;
i++) {
187 if(indices[
i] < 0 || indices[
i] >=
m_Results.size()) {
189 "Sequence index out of range");
192new_indices[
i] =
i;
Simultaneously align multiple protein sequences.
CRef< objects::CSeq_align > x_GetSeqalign(const vector< CSequence > &align, vector< int > &indices) const
Produce a seqalign representing the specified alignment, using a subset of the sequences.
CRef< objects::CSeq_align > GetResults(void) const
Retrieve the current aligned results in Seq-align format.
vector< CSequence > m_Results
Class for representing protein sequences.
static void CompressSequences(vector< CSequence > &seq, vector< int > index_list)
Given a collection of sequences, remove all sequence positions where a subset of the sequences all co...
static const unsigned char kGapChar
The ncbistdaa code for a gap.
Interface for CMultiAligner.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
#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.
TLens & SetLens(void)
Assign a value to Lens data member.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
void SetDim(TDim value)
Assign a value to Dim data member.
void SetDim(TDim value)
Assign a value to Dim data member.
void SetType(TType value)
Assign a value to Type data member.
TStarts & SetStarts(void)
Assign a value to Starts data member.
void SetNumseg(TNumseg value)
Assign a value to Numseg data member.
TIds & SetIds(void)
Assign a value to Ids data member.
const TId & GetId(void) const
Get the Id member data.
const TWhole & GetWhole(void) const
Get the variant data.
TFrom GetFrom(void) const
Get the From member data.
bool IsWhole(void) const
Check if variant Whole is selected.
bool IsInt(void) const
Check if variant Int is selected.
const TInt & GetInt(void) const
Get the variant data.
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