NCBI C++ ToolKit
Spliced_seg.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: Spliced_seg.cpp 97297 2022-07-05 14:56:08Z grichenk $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Kamen Todorov
27  *
28  * File Description:
29  * User-defined methods for Spliced-seg.
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using the following specifications:
34  * 'seqalign.asn'.
35  */
36 
37 // standard includes
38 #include <ncbi_pch.hpp>
39 
40 // generated includes
42 
43 // generated classes
44 
46 
47 BEGIN_objects_SCOPE // namespace ncbi::objects::
48 
49 // destructor
51 {
52 }
53 
54 
57 {
58  switch (row) {
59  case 0:
60  if (CanGetProduct_strand()) {
61  return GetProduct_strand();
62  } else {
63  if ((*GetExons().begin())->CanGetProduct_strand()) {
64  return (*GetExons().begin())->GetProduct_strand();
65  } else {
66  return eNa_strand_unknown;
67  }
68  }
69  break;
70  case 1:
71  if (CanGetGenomic_strand()) {
72  return GetGenomic_strand();
73  } else {
74  if ((*GetExons().begin())->CanGetGenomic_strand()) {
75  return (*GetExons().begin())->GetGenomic_strand();
76  } else {
77  return eNa_strand_unknown;
78  }
79  }
80  break;
81  default:
82  NCBI_THROW(CSeqalignException, eInvalidRowNumber,
83  "CSpliced_seg::GetSeqStrand(): Invalid row number");
84  }
85 }
86 
87 
89 {
90  TSeqPos last_gen_start = kInvalidSeqPos;
91  TSeqPos last_gen_end = kInvalidSeqPos;
92  TSeqPos last_prod_start = kInvalidSeqPos;
93  TSeqPos last_prod_end = kInvalidSeqPos;
94  bool aln_gen_rev = CanGetGenomic_strand() && IsReverse(GetGenomic_strand());
95  bool aln_prod_rev = CanGetProduct_strand() && IsReverse(GetProduct_strand());
96  bool last_exon_gen_rev = false;
97  bool last_exon_prod_rev = false;
98 
99  ITERATE (CSpliced_seg::TExons, exon_it, GetExons()) {
100  const CSpliced_exon& exon = **exon_it;
101 
102  // Check for strand consistency
103  bool exon_gen_rev = false;
104  if (exon.CanGetGenomic_strand()) {
105  exon_gen_rev = IsReverse(exon.GetGenomic_strand());
106  if (CanGetGenomic_strand() && exon_gen_rev != aln_gen_rev) return false;
107  }
108  else {
109  exon_gen_rev = aln_gen_rev;
110  }
111  if (exon_it != GetExons().begin() && last_exon_gen_rev != exon_gen_rev) return false;
112  last_exon_gen_rev = exon_gen_rev;
113 
114  bool exon_prod_rev = false;
115  if (exon.CanGetProduct_strand()) {
116  exon_prod_rev = IsReverse(exon.GetProduct_strand());
117  if (CanGetProduct_strand() && exon_prod_rev != aln_prod_rev) return false;
118  }
119  else {
120  exon_prod_rev = aln_prod_rev;
121  }
122  if (exon_it != GetExons().begin() && last_exon_prod_rev != exon_prod_rev) return false;
123  last_exon_prod_rev = exon_prod_rev;
124 
125  // Check the order of exons. This check may fail on valid alignments, e.g.
126  // for a cross-origin location on a circular sequence.
127  if (last_gen_start != kInvalidSeqPos) {
128  if (exon_gen_rev) {
129  if (exon.GetGenomic_end() > last_gen_start) return false;
130  }
131  else {
132  if (exon.GetGenomic_start() < last_gen_end) return false;
133  }
134  }
135  last_gen_start = exon.GetGenomic_start();
136  last_gen_end = exon.GetGenomic_end();
137 
138  const auto& pstart = exon.GetProduct_start();
139  const auto& pend = exon.GetProduct_end();
140  auto prod_start = pstart.IsNucpos() ? pstart.GetNucpos() :
141  pstart.GetProtpos().GetAmin() * 3 + pstart.GetProtpos().GetFrame() - 1;
142  auto prod_end = pend.IsNucpos() ? pend.GetNucpos() :
143  pend.GetProtpos().GetAmin() * 3 + pend.GetProtpos().GetFrame() - 1;
144  if (last_prod_start != kInvalidSeqPos) {
145  if (exon_prod_rev || (exon.CanGetProduct_strand() && IsReverse(exon.GetProduct_strand()))) {
146  if (prod_end > last_prod_start) return false;
147  }
148  else {
149  if (prod_start < last_prod_end) return false;
150  }
151  }
152  last_prod_start = prod_start;
153  last_prod_end = prod_end;
154  }
155  return true;
156 }
157 
158 
159 void CSpliced_seg::Validate(bool /*full_test*/) const
160 {
162 
163  TSeqRange product_position_limits = TSeqRange::GetWhole();
164  if (IsSetProduct_length()) {
165  TSeqPos product_length = GetProduct_length();
166  product_position_limits.SetTo((prot ? product_length * 3 : product_length) -1);
167  }
168  if (IsSetPoly_a()) {
169  if (prot) {
170  NCBI_THROW(CSeqalignException, eInvalidAlignment,
171  "CSpliced_seg::Validate(): poly-a on a protein");
172  }
173  int poly_a = GetPoly_a();
174  if (poly_a > 0 && TSeqPos(poly_a) > product_position_limits.GetTo()+1) {
175  NCBI_THROW(CSeqalignException, eInvalidAlignment,
176  "CSpliced_seg::Validate(): poly-a > product-length");
177  }
179  product_position_limits.SetFrom(poly_a+1);
180  } else {
181  product_position_limits.SetTo(poly_a-1);
182  }
183  }
184 
185 
186  if (GetExons().empty()) {
187  NCBI_THROW(CSeqalignException, eInvalidAlignment,
188  "CSpliced_seg::Validate(): Spiced-seg is empty (has no exons)");
189  }
190 
191  ITERATE (CSpliced_seg::TExons, exon_it, GetExons()) {
192 
193  const CSpliced_exon& exon = **exon_it;
194 
195  /// Positions
196  TSeqPos product_start = exon.GetProduct_start().AsSeqPos();
197  TSeqPos product_end = exon.GetProduct_end().AsSeqPos();
198  if (product_start > product_end) {
199  NCBI_THROW(CSeqalignException, eInvalidAlignment,
200  "CSpliced_seg::Validate(): product_start > product_end");
201  }
202  if (product_start < product_position_limits.GetFrom() || product_position_limits.GetTo() < product_end) {
203  NCBI_THROW(CSeqalignException, eInvalidAlignment,
204  "CSpliced_seg::Validate(): illegal product position in regard to poly-a and/or product-length ");
205  }
206  if (exon.GetGenomic_end() < exon.GetGenomic_start()) {
207  NCBI_THROW(CSeqalignException, eInvalidAlignment,
208  "CSpliced_seg::Validate(): genomic_start > genomic_end");
209  }
210 
211 
212  /// Ids
213  if ( !(IsSetProduct_id() || exon.IsSetProduct_id()) ) {
214  NCBI_THROW(CSeqalignException, eInvalidAlignment,
215  "product-id not set.");
216  }
217  if (IsSetProduct_id() == exon.IsSetProduct_id()) {
218  NCBI_THROW(CSeqalignException, eInvalidAlignment,
219  "product-id should be set on the level of Spliced-seg XOR Spliced-exon.");
220  }
221  if ( !(IsSetGenomic_id() || exon.IsSetGenomic_id()) ) {
222  NCBI_THROW(CSeqalignException, eInvalidAlignment,
223  "genomic-id not set.");
224  }
225 
226 
227  /// Strands
228  if (IsSetProduct_strand() && exon.IsSetProduct_strand()) {
229  NCBI_THROW(CSeqalignException, eInvalidAlignment,
230  "product-strand can be set on level of Spliced-seg XOR Spliced-exon.");
231  }
232  bool product_plus = true;
233  if (exon.CanGetProduct_strand()) {
234  product_plus = exon.GetProduct_strand() != eNa_strand_minus;
235  } else if (CanGetProduct_strand()) {
236  product_plus = GetProduct_strand() != eNa_strand_minus;
237  }
238  if (prot && !product_plus) {
239  NCBI_THROW(CSeqalignException, eInvalidAlignment,
240  "Protein product cannot have a negative strand.");
241  }
242 
243 
244  /// Ranges
245  if (exon.IsSetParts()) {
246  TSeqPos exon_product_len = 0;
247  TSeqPos exon_genomic_len = 0;
248  ITERATE (CSpliced_exon::TParts, chunk_it, exon.GetParts()) {
249  const CSpliced_exon_chunk& chunk = **chunk_it;
250 
251  TSeqPos chunk_product_len = 0;
252  TSeqPos chunk_genomic_len = 0;
253 
254  switch (chunk.Which()) {
256  chunk_product_len = chunk_genomic_len = chunk.GetMatch();
257  break;
259  chunk_product_len = chunk_genomic_len = chunk.GetDiag();
260  break;
262  chunk_product_len = chunk_genomic_len = chunk.GetMismatch();
263  break;
265  chunk_product_len = chunk.GetProduct_ins();
266  break;
268  chunk_genomic_len = chunk.GetGenomic_ins();
269  break;
270  default:
271  break;
272  }
273  exon_product_len += chunk_product_len;
274  exon_genomic_len += chunk_genomic_len;
275  }
276  if (exon_product_len != product_end - product_start + 1) {
277  NCBI_THROW(CSeqalignException, eInvalidAlignment,
278  "Product exon range length is not consistent with exon chunks.");
279  }
280  if (exon_genomic_len !=
281  exon.GetGenomic_end() - exon.GetGenomic_start() + 1) {
282  NCBI_THROW(CSeqalignException, eInvalidAlignment,
283  "Genomic exon range length is not consistent with exon chunks.");
284  }
285  } else {
286  TSeqPos exon_product_len = product_end - product_start + 1;
287  TSeqPos exon_genomic_len = exon.GetGenomic_end() - exon.GetGenomic_start() + 1;
288  if (exon_product_len != exon_genomic_len) {
289  NCBI_THROW(CSeqalignException, eInvalidAlignment,
290  "Product and genomic exon range lengths are not consistent.");
291  }
292  }
293  }
294 
295 }
296 
297 
300 {
301  if (GetExons().empty()) {
302  NCBI_THROW(CSeqalignException, eInvalidAlignment,
303  "CSpliced_seg::GetSeqRange(): Spiced-seg is empty (has no exons)");
304  }
306  switch (row) {
307  case 0:
308  switch (GetProduct_type()) {
310  ITERATE(TExons, exon_it, GetExons()) {
311  result.CombineWith
313  ((*exon_it)->GetProduct_start().GetNucpos(),
314  (*exon_it)->GetProduct_end().GetNucpos()));
315  }
316  break;
318  ITERATE(TExons, exon_it, GetExons()) {
319  result.CombineWith
321  ((*exon_it)->GetProduct_start().GetProtpos().GetAmin(),
322  (*exon_it)->GetProduct_end().GetProtpos().GetAmin()));
323 
324  }
325  break;
326  default:
327  NCBI_THROW(CSeqalignException, eInvalidAlignment,
328  "Invalid product type");
329  }
330  break;
331  case 1:
332  ITERATE(TExons, exon_it, GetExons()) {
333  result.CombineWith
335  ((*exon_it)->GetGenomic_start(),
336  (*exon_it)->GetGenomic_end()));
337  }
338  break;
339  default:
340  NCBI_THROW(CSeqalignException, eInvalidRowNumber,
341  "CSpliced_seg::GetSeqRange(): Invalid row number");
342  }
343  return result;
344 }
345 
346 
347 TSeqPos
349 {
350  const CSpliced_exon &first_exon = *(GetSeqStrand(row) == eNa_strand_minus
351  ? GetExons().back() : GetExons().front());
352  return first_exon.GetRowSeq_range(row, false).GetFrom();
353 }
354 
355 
356 TSeqPos
358 {
359  const CSpliced_exon &last_exon = *(GetSeqStrand(row) == eNa_strand_minus
360  ? GetExons().front() : GetExons().back());
361  return last_exon.GetRowSeq_range(row, false).GetTo();
362 }
363 
364 
365 //////////////////////////////////////////////////////////////////////////////
366 
367 
368 static vector<TSignedSeqPos>
369 s_CalculateStarts(const vector<TSeqPos>& lens, ENa_strand strand,
370  TSeqPos start, TSeqPos end)
371 {
372  vector<TSignedSeqPos> rv;
373  rv.reserve(lens.size());
374  TSignedSeqPos offset = 0;
375  ITERATE (vector<TSeqPos>, len, lens) {
376  if (*len == 0) {
377  // a gap
378  rv.push_back(-1);
379  } else {
380  if (IsReverse(strand)) {
381  offset += *len;
382  rv.push_back((end + 1) - offset);
383  } else {
384  rv.push_back(start + offset);
385  offset += *len;
386  }
387  }
388  }
389  return rv;
390 }
391 
392 
393 static CRef<CDense_seg>
395  ENa_strand product_strand, ENa_strand genomic_strand,
396  const CSeq_id& product_id, const CSeq_id& genomic_id)
397 {
399 
400  vector<TSeqPos> product_lens;
401  vector<TSeqPos> genomic_lens;
402  if (exon.IsSetParts() && !exon.GetParts().empty()) {
403  ITERATE (CSpliced_exon::TParts, iter, exon.GetParts()) {
404  const CSpliced_exon_chunk& part = **iter;
405  if (part.IsMatch()) {
406  product_lens.push_back(part.GetMatch());
407  genomic_lens.push_back(part.GetMatch());
408  } else if (part.IsMismatch()) {
409  product_lens.push_back(part.GetMismatch());
410  genomic_lens.push_back(part.GetMismatch());
411  } else if (part.IsDiag()) {
412  product_lens.push_back(part.GetDiag());
413  genomic_lens.push_back(part.GetDiag());
414  } else if (part.IsProduct_ins()) {
415  product_lens.push_back(part.GetProduct_ins());
416  genomic_lens.push_back(0);
417  } else if (part.IsGenomic_ins()) {
418  product_lens.push_back(0);
419  genomic_lens.push_back(part.GetGenomic_ins());
420  } else {
421  throw runtime_error("unhandled part type in Spliced-enon");
422  }
423  }
424  }
425  else {
426  TSeqPos len = exon.GetGenomic_end() - exon.GetGenomic_start() + 1;
427  genomic_lens.push_back(len);
428  product_lens.push_back(len);
429  }
430 
431  CDense_seg::TLens& lens = ds->SetLens();
432  lens.reserve(product_lens.size());
433  for (size_t i = 0; i < product_lens.size(); ++i) {
434  lens.push_back(max(product_lens[i], genomic_lens[i]));
435  }
436 
437  if (exon.IsSetProduct_strand()) {
438  product_strand = exon.GetProduct_strand();
439  }
440  if (exon.IsSetGenomic_strand()) {
441  genomic_strand = exon.GetGenomic_strand();
442  }
443 
444  vector<TSignedSeqPos> product_starts;
445  product_starts =
446  s_CalculateStarts(product_lens, product_strand,
447  exon.GetProduct_start().AsSeqPos(),
448  exon.GetProduct_end().AsSeqPos());
449  vector<TSignedSeqPos> genomic_starts =
450  s_CalculateStarts(genomic_lens, genomic_strand,
451  exon.GetGenomic_start(),
452  exon.GetGenomic_end());
453 
454  CDense_seg::TStarts& starts = ds->SetStarts();
455  starts.reserve(product_starts.size() + genomic_starts.size());
456  for (size_t i = 0; i < lens.size(); ++i) {
457  starts.push_back(product_starts[i]); // product row first
458  starts.push_back(genomic_starts[i]);
459  }
460  ds->SetIds().push_back(CRef<CSeq_id>(SerialClone(
461  exon.IsSetProduct_id() ? exon.GetProduct_id() : product_id)));
462  ds->SetIds().push_back(CRef<CSeq_id>(SerialClone(
463  exon.IsSetGenomic_id() ? exon.GetGenomic_id() : genomic_id)));
464 
465  // Set strands, unless they're both plus
466  if (!(product_strand == eNa_strand_plus
467  && genomic_strand == eNa_strand_plus)) {
468  CDense_seg::TStrands& strands = ds->SetStrands();
469  for (size_t i = 0; i < lens.size(); ++i) {
470  strands.push_back(product_strand);
471  strands.push_back(genomic_strand);
472  }
473  }
474 
475  ds->SetNumseg((CDense_seg::TNumseg)lens.size());
476 
477  ds->Compact(); // join adjacent match/mismatch/diag parts
478 
479  /// copy scores
480  if (exon.IsSetScores()) {
482  CRef<CScore> s(new CScore);
483  s->Assign(**iter);
484  ds->SetScores().push_back(s);
485  }
486  }
487 
488  return ds;
489 }
490 
491 
493 {
494  CRef<CSeq_align> disc(new CSeq_align);
496 
497  switch (GetProduct_type()) {
499  {{
500  ENa_strand product_strand = eNa_strand_plus;
501  if (IsSetProduct_strand()) {
502  product_strand = GetProduct_strand();
503  }
504  ENa_strand genomic_strand = eNa_strand_plus;
505  if (IsSetGenomic_strand()) {
506  genomic_strand = GetGenomic_strand();
507  }
508  const CSeq_id& product_id = GetProduct_id();
509  const CSeq_id& genomic_id = GetGenomic_id();
510 
511  //for exon in spliced_seg.GetSegs().GetSpliced().GetExons()[:] {
513  CRef<CDense_seg> ds = s_ExonToDenseg(**exon,
514  product_strand, genomic_strand,
515  product_id, genomic_id);
516  CRef<CSeq_align> ds_align(new CSeq_align);
517  ds_align->SetSegs().SetDenseg(*ds);
519  disc->SetSegs().SetDisc().Set().push_back(ds_align);
520  }
521  }}
522  break;
523 
525  {{
526  ENa_strand product_strand = eNa_strand_plus;
527  ENa_strand genomic_strand = eNa_strand_plus;
528  if (IsSetGenomic_strand()) {
529  genomic_strand = GetGenomic_strand();
530  }
531  const CSeq_id& product_id = GetProduct_id();
532  const CSeq_id& genomic_id = GetGenomic_id();
533 
534  //for exon in spliced_seg.GetSegs().GetSpliced().GetExons()[:] {
536  CRef<CDense_seg> ds = s_ExonToDenseg(**exon,
537  product_strand, genomic_strand,
538  product_id, genomic_id);
539  ds->SetWidths().push_back(3);
540  ds->SetWidths().push_back(1);
541  CRef<CSeq_align> ds_align(new CSeq_align);
542  ds_align->SetSegs().SetDenseg(*ds);
544  disc->SetSegs().SetDisc().Set().push_back(ds_align);
545  }
546  }}
547  break;
548 
549  default:
551  "unhandled product type in spliced seg");
552  break;
553  }
554 
555  return disc;
556 }
557 
558 
559 END_objects_SCOPE // namespace ncbi::objects::
560 
562 
563 /* Original file checksum: lines: 57, chars: 1732, CRC32: fa335290 */
bool IsReverse(ENa_strand s)
Definition: Na_strand.hpp:75
static vector< TSignedSeqPos > s_CalculateStarts(const vector< TSeqPos > &lens, ENa_strand strand, TSeqPos start, TSeqPos end)
static CRef< CDense_seg > s_ExonToDenseg(const CSpliced_exon &exon, ENa_strand product_strand, ENa_strand genomic_strand, const CSeq_id &product_id, const CSeq_id &genomic_id)
User-defined methods of the data storage class.
TWidths & SetWidths(void)
Definition: Dense_seg.hpp:217
void Compact()
Join adjacent mergeable segments to create a more compact alignment.
Definition: Dense_seg.cpp:432
TSeqPos AsSeqPos() const
Definition: Product_pos.cpp:56
Definition: Score.hpp:57
CSpliced_exon_chunk –.
TSeqRange GetRowSeq_range(CSeq_align::TDim row, bool always_as_nuc) const
Return exon's range within this row.
TSeqPos GetSeqStop(TDim row) const
int TDim
types
Definition: Spliced_seg.hpp:66
~CSpliced_seg(void)
Definition: Spliced_seg.cpp:50
CRange< TSeqPos > GetSeqRange(TDim row) const
GetSeqRange NB: In case the product-type is protein, these only return the amin part of Prot-pos.
bool IsConsistentBiologicalOrder(void) const
Definition: Spliced_seg.cpp:88
TSeqPos GetSeqStart(TDim row) const
void Validate(bool full_test=false) const
Validators.
ENa_strand GetSeqStrand(TDim row) const
Get strand (the first one if segments have different strands).
Definition: Spliced_seg.cpp:56
CRef< CSeq_align > AsDiscSeg() const
Convert this alignment to a discontinuous segment.
int offset
Definition: replacements.h:160
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
int TSignedSeqPos
Type for signed sequence position.
Definition: ncbimisc.hpp:887
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
Definition: ncbimisc.hpp:878
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
C * SerialClone(const C &src)
Create on heap a clone of the source object.
Definition: serialbase.hpp:512
static TThisType GetWhole(void)
Definition: range.hpp:272
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
void SetFrom(TFrom value)
Assign a value to From data member.
Definition: Range_.hpp:231
TTo GetTo(void) const
Get the To member data.
Definition: Range_.hpp:269
TFrom GetFrom(void) const
Get the From member data.
Definition: Range_.hpp:222
void SetTo(TTo value)
Assign a value to To data member.
Definition: Range_.hpp:278
bool IsSetProduct_strand(void) const
should be 'plus' or 'minus' Check if a value has been assigned to Product_strand data member.
TLens & SetLens(void)
Assign a value to Lens data member.
Definition: Dense_seg_.hpp:561
const TGenomic_id & GetGenomic_id(void) const
Get the Genomic_id member data.
bool IsSetParts(void) const
basic seqments always are in biologic order Check if a value has been assigned to Parts data member.
TMatch GetMatch(void) const
Get the variant data.
list< CRef< CScore > > Tdata
Definition: Score_set_.hpp:90
vector< TSeqPos > TLens
Definition: Dense_seg_.hpp:108
bool IsSetProduct_strand(void) const
should be 'plus' or 'minus' Check if a value has been assigned to Product_strand data member.
const TProduct_id & GetProduct_id(void) const
Get the Product_id member data.
TGenomic_start GetGenomic_start(void) const
Get the Genomic_start member data.
const TProduct_id & GetProduct_id(void) const
Get the Product_id member data.
bool IsMismatch(void) const
Check if variant Mismatch is selected.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
Definition: Seq_align_.cpp:310
vector< ENa_strand > TStrands
Definition: Dense_seg_.hpp:109
TProduct_length GetProduct_length(void) const
Get the Product_length member data.
bool IsSetPoly_a(void) const
start of poly(A) tail on the transcript For sense transcripts: aligned product positions < poly-a <= ...
TScores & SetScores(void)
Assign a value to Scores data member.
Definition: Dense_seg_.hpp:611
TDiag GetDiag(void) const
Get the variant data.
vector< TSignedSeqPos > TStarts
Definition: Dense_seg_.hpp:107
TProduct_type GetProduct_type(void) const
Get the Product_type member data.
TMismatch GetMismatch(void) const
Get the variant data.
TGenomic_strand GetGenomic_strand(void) const
Get the Genomic_strand member data.
bool IsSetGenomic_strand(void) const
genomic-strand represents the strand of translation Check if a value has been assigned to Genomic_str...
bool CanGetProduct_strand(void) const
Check if it is safe to call GetProduct_strand method.
bool IsSetProduct_id(void) const
product is either protein or transcript (cDNA) Check if a value has been assigned to Product_id data ...
void SetType(TType value)
Assign a value to Type data member.
Definition: Seq_align_.hpp:818
const TParts & GetParts(void) const
Get the Parts member data.
const TProduct_start & GetProduct_start(void) const
Get the Product_start member data.
const TProduct_end & GetProduct_end(void) const
Get the Product_end member data.
bool IsSetProduct_id(void) const
product is either protein or transcript (cDNA) Check if a value has been assigned to Product_id data ...
bool IsGenomic_ins(void) const
Check if variant Genomic_ins is selected.
bool IsMatch(void) const
Check if variant Match is selected.
bool CanGetGenomic_strand(void) const
Check if it is safe to call GetGenomic_strand method.
TGenomic_ins GetGenomic_ins(void) const
Get the variant data.
bool IsSetGenomic_strand(void) const
Check if a value has been assigned to Genomic_strand data member.
const TScores & GetScores(void) const
Get the Scores member data.
TStarts & SetStarts(void)
Assign a value to Starts data member.
Definition: Dense_seg_.hpp:536
TStrands & SetStrands(void)
Assign a value to Strands data member.
Definition: Dense_seg_.hpp:586
list< CRef< CSpliced_exon > > TExons
const TExons & GetExons(void) const
Get the Exons member data.
TGenomic_strand GetGenomic_strand(void) const
Get the Genomic_strand member data.
TProduct_strand GetProduct_strand(void) const
Get the Product_strand member data.
bool IsDiag(void) const
Check if variant Diag is selected.
void SetNumseg(TNumseg value)
Assign a value to Numseg data member.
Definition: Dense_seg_.hpp:474
list< CRef< CSpliced_exon_chunk > > TParts
bool IsSetProduct_length(void) const
length of the product, in bases/residues from this (or from poly-a if present), a 3' unaligned length...
bool CanGetProduct_strand(void) const
Check if it is safe to call GetProduct_strand method.
TPoly_a GetPoly_a(void) const
Get the Poly_a member data.
TGenomic_end GetGenomic_end(void) const
Get the Genomic_end member data.
const Tdata & Get(void) const
Get the member data.
Definition: Score_set_.hpp:165
TProduct_strand GetProduct_strand(void) const
Get the Product_strand member data.
TIds & SetIds(void)
Assign a value to Ids data member.
Definition: Dense_seg_.hpp:511
bool IsSetGenomic_id(void) const
Check if a value has been assigned to Genomic_id data member.
bool IsProduct_ins(void) const
Check if variant Product_ins is selected.
bool IsNucpos(void) const
Check if variant Nucpos is selected.
TProduct_ins GetProduct_ins(void) const
Get the variant data.
const TGenomic_id & GetGenomic_id(void) const
Get the Genomic_id member data.
bool CanGetGenomic_strand(void) const
Check if it is safe to call GetGenomic_strand method.
bool IsSetGenomic_id(void) const
Check if a value has been assigned to Genomic_id data member.
bool IsSetScores(void) const
scores for this exon Check if a value has been assigned to Scores data member.
E_Choice Which(void) const
Which variant is currently selected.
@ e_Product_ins
insertion in product sequence (i.e. gap in the genomic sequence)
@ e_Diag
both sequences are represented, there is sufficient similarity between product and genomic sequences....
@ e_Genomic_ins
insertion in genomic sequence (i.e. gap in the product sequence)
@ e_Match
both sequences represented, product and genomic sequences match
@ e_Mismatch
both sequences represented, product and genomic sequences do not match
@ eType_partial
mapping pieces together
Definition: Seq_align_.hpp:103
@ eType_disc
discontinuous alignment
Definition: Seq_align_.hpp:104
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
@ eNa_strand_plus
Definition: Na_strand_.hpp:66
@ eNa_strand_minus
Definition: Na_strand_.hpp:67
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
int i
int len
constexpr bool empty(list< Ts... >) noexcept
T max(T x_, T y_)
#define row(bind, expected)
Definition: string_bind.c:73
else result
Definition: token2.c:20
Modified on Wed Apr 24 14:20:34 2024 by modify_doxy.py rev. 669887