<
classTAlnSeqId>
71 return newTAlnSeqId(
id);
78 template<
classTAlnSeqId>
98 template<
classTAlnSeqId,
classTIdConverter = CAlnSeqIdConverter<TAlnSeqId> >
121 constTSegs& segs = seq_align.
GetSegs();
123 switch(segs.Which()) {
126 boolfirst_disc =
true;
138 "Inconsistent Seq-ids across the disc alignments.");
144 caseTSegs::e_Dendiag:
146 boolfirst_diag =
true;
150id_vec.resize(ids.size());
152 else if(id_vec.size() != ids.size()) {
154 "Inconsistent Seq-ids.");
161 else if(*id_vec[
row] != TAlnSeqId(**id_it)) {
163 string(
"Inconsistent Seq-ids: ") +
164id_vec[
row]->AsString() +
" != "+
165TAlnSeqId(**id_it).AsString() +
".");
173 caseTSegs::e_Denseg:
176id_vec.resize(ids.size());
177 for(
size_t i= 0;
i< ids.size(); ++
i) {
184 boolfirst_seg =
true;
187 typedefvector<TLen> TLenVec;
189 ITERATE(TSegs::TStd, std_it, segs.GetStd()) {
190 const CStd_seg& std_seg = **std_it;
192id_vec.resize(std_seg.
GetDim());
194 else if(id_vec.size() != (
size_t) std_seg.
GetDim()) {
196 "The Std-seg dim's need to be consistent.");
198 if(std_seg.
GetLoc().size() != id_vec.size()) {
200 "Number of seq-locs inconsistent with dim.");
206TLenVec seg_lens(std_seg.
GetDim());
209 switch((*loc_it)->Which()) {
214 id.Reset(
NewAlnSeqId((*loc_it)->GetInt().GetId()));
217 id.Reset(
NewAlnSeqId((*loc_it)->GetPnt().GetId()));
220 stringerr_str =
string(
"Seq-loc of type ") +
221(*loc_it)->SelectionName((*loc_it)->Which()) +
222 "is not supported.";
227seg_lens[
i] = (*loc_it)->GetTotalRange().GetLength();
230id_vec[
i].Reset(
id);
232 else if(*id_vec[
i] != *
id) {
233 stringerr(
"Inconsistent Seq-ids found in seg ");
235 ". Excpected "+ id_vec[
i]->AsString() +
236 ", encountered "+
id->AsString() +
".";
246 ITERATE(TLenVec, len_i, seg_lens) {
247 if(*len_i == 0)
continue;
248 if(min_len == 0 || min_len > *len_i) {
251 if(max_len < *len_i) {
255 if(min_len < max_len) {
256 boolnuc_prot_diag = (min_len == max_len / 3 ||
257min_len - 1 == max_len / 3 ?
259 for(
size_ti_lcl=0; i_lcl< seg_lens.size(); ++i_lcl) {
260 if( nuc_prot_diag ) {
261id_vec[i_lcl]->SetBaseWidth(
262seg_lens[i_lcl] == min_len ? 3 : 1);
271 caseTSegs::e_Packed:
274id_vec.resize(ids.size());
275 for(
size_t i= 0;
i< ids.size(); ++
i) {
280 caseTSegs::e_Sparse:
283 for(
size_t row= 0;
row< rows.size(); ++
row) {
287id_vec.resize(segs.GetSparse().GetRows().size() + 1);
288id_vec[0].Reset(first_id);
290 else if(*id_vec[0] != *first_id) {
291 stringerr(
"Inconsistent Seq-ids found in row ");
299 caseTSegs::e_Spliced:
307id_vec[0]->SetBaseWidth(
prot? 3 : 1);
310id_vec[1]->SetBaseWidth(1);
315 "Seq-align.segs not set.");
318 "This type of alignment is not supported.");
331 returnx.size() == y.size() &&
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Default seq-id converter.
TAlnSeqId * operator()(const CSeq_id &id) const
Scope-aware seq-id converter.
TAlnSeqId * operator()(const CSeq_id &id) const
CScopeAlnSeqIdConverter(CScope *scope)
void Validate(bool full_test=false) const
Include a standard set of the NCBI C++ Toolkit most basic headers.
CSeq_align::C_Segs::TDendiag TDendiag
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
TObjectType * Release(void)
Release a reference to the object and return a pointer to the object.
TParent::position_type position_type
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
vector< CRef< CSeq_id > > TIds
vector< CRef< CSeq_loc > > TLoc
vector< CRef< CSparse_align > > TRows
const TGenomic_id & GetGenomic_id(void) const
Get the Genomic_id member data.
const TLoc & GetLoc(void) const
Get the Loc member data.
const TProduct_id & GetProduct_id(void) const
Get the Product_id member data.
const TFirst_id & GetFirst_id(void) const
Get the First_id member data.
TProduct_type GetProduct_type(void) const
Get the Product_type member data.
vector< CRef< CSeq_id > > TIds
vector< CRef< CSeq_id > > TIds
TDim GetDim(void) const
Get the Dim member data.
const TSecond_id & GetSecond_id(void) const
Get the Second_id member data.
list< CRef< CSeq_align > > Tdata
const TSegs & GetSegs(void) const
Get the Segs member data.
@ e_Empty
to NULL one Seq-id in a collection
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
#define row(bind, expected)
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