(*
GetExons().begin())->GetProduct_strand();
75 return(*
GetExons().begin())->GetGenomic_strand();
83 "CSpliced_seg::GetSeqStrand(): Invalid row number");
96 boollast_exon_gen_rev =
false;
97 boollast_exon_prod_rev =
false;
103 boolexon_gen_rev =
false;
109exon_gen_rev = aln_gen_rev;
111 if(exon_it !=
GetExons().begin() && last_exon_gen_rev != exon_gen_rev)
return false;
112last_exon_gen_rev = exon_gen_rev;
114 boolexon_prod_rev =
false;
120exon_prod_rev = aln_prod_rev;
122 if(exon_it !=
GetExons().begin() && last_exon_prod_rev != exon_prod_rev)
return false;
123last_exon_prod_rev = exon_prod_rev;
140 autoprod_start = pstart.
IsNucpos() ? pstart.GetNucpos() :
141pstart.GetProtpos().GetAmin() * 3 + pstart.GetProtpos().GetFrame() - 1;
142 autoprod_end = pend.IsNucpos() ? pend.GetNucpos() :
143pend.GetProtpos().GetAmin() * 3 + pend.GetProtpos().GetFrame() - 1;
146 if(prod_end > last_prod_start)
return false;
149 if(prod_start < last_prod_end)
return false;
152last_prod_start = prod_start;
153last_prod_end = prod_end;
161 TSeqPosinternal_unaligned = 0;
163CSpliced_seg::TExons::const_reverse_iterator it =
GetExons().rbegin();
164CSpliced_seg::TExons::const_reverse_iterator
prev=
GetExons().rbegin();
165CSpliced_seg::TExons::const_reverse_iterator end =
GetExons().rend();
167 for(++it; it != end; ++it, ++
prev) {
168internal_unaligned += (*it)->GetProduct_start().GetNucpos() -
169(*prev)->GetProduct_end().GetNucpos() - 1;
172 for(++it; it != end; ++it, ++
prev) {
173 TSeqPoscurr_nuc = (*it)->GetProduct_start().AsSeqPos();
174 TSeqPoslast_nuc = (*prev)->GetProduct_end().AsSeqPos();
175internal_unaligned += curr_nuc - last_nuc - 1;
180CSpliced_seg::TExons::const_iterator it =
GetExons().begin();
181CSpliced_seg::TExons::const_iterator
prev=
GetExons().begin();
182CSpliced_seg::TExons::const_iterator end =
GetExons().end();
184 for(++it; it != end; ++it, ++
prev) {
185internal_unaligned += (*it)->GetProduct_start().GetNucpos() -
186(*prev)->GetProduct_end().GetNucpos() - 1;
189 for(++it; it != end; ++it, ++
prev) {
190 TSeqPoscurr_nuc = (*it)->GetProduct_start().AsSeqPos();
191 TSeqPoslast_nuc = (*prev)->GetProduct_end().AsSeqPos();
192internal_unaligned += curr_nuc - last_nuc - 1;
196 returninternal_unaligned;
207product_position_limits.
SetTo((
prot? product_length * 3 : product_length) -1);
212 "CSpliced_seg::Validate(): poly-a on a protein");
215 if(poly_a > 0 &&
TSeqPos(poly_a) > product_position_limits.
GetTo()+1) {
217 "CSpliced_seg::Validate(): poly-a > product-length");
220product_position_limits.
SetFrom(poly_a+1);
222product_position_limits.
SetTo(poly_a-1);
229 "CSpliced_seg::Validate(): Spiced-seg is empty (has no exons)");
239 if(product_start > product_end) {
241 "CSpliced_seg::Validate(): product_start > product_end");
243 if(product_start < product_position_limits.
GetFrom() || product_position_limits.
GetTo() < product_end) {
245 "CSpliced_seg::Validate(): illegal product position in regard to poly-a and/or product-length ");
249 "CSpliced_seg::Validate(): genomic_start > genomic_end");
256 "product-id not set.");
260 "product-id should be set on the level of Spliced-seg XOR Spliced-exon.");
264 "genomic-id not set.");
271 "product-strand can be set on level of Spliced-seg XOR Spliced-exon.");
273 boolproduct_plus =
true;
279 if(
prot&& !product_plus) {
281 "Protein product cannot have a negative strand.");
295 switch(chunk.
Which()) {
297chunk_product_len = chunk_genomic_len = chunk.
GetMatch();
300chunk_product_len = chunk_genomic_len = chunk.
GetDiag();
303chunk_product_len = chunk_genomic_len = chunk.
GetMismatch();
314exon_product_len += chunk_product_len;
315exon_genomic_len += chunk_genomic_len;
317 if(exon_product_len != product_end - product_start + 1) {
319 "Product exon range length is not consistent with exon chunks.");
321 if(exon_genomic_len !=
324 "Genomic exon range length is not consistent with exon chunks.");
327 TSeqPosexon_product_len = product_end - product_start + 1;
329 if(exon_product_len != exon_genomic_len) {
331 "Product and genomic exon range lengths are not consistent.");
344 "CSpliced_seg::GetSeqRange(): Spiced-seg is empty (has no exons)");
354((*exon_it)->GetProduct_start().GetNucpos(),
355(*exon_it)->GetProduct_end().GetNucpos()));
362((*exon_it)->GetProduct_start().GetProtpos().GetAmin(),
363(*exon_it)->GetProduct_end().GetProtpos().GetAmin()));
369 "Invalid product type");
376((*exon_it)->GetGenomic_start(),
377(*exon_it)->GetGenomic_end()));
382 "CSpliced_seg::GetSeqRange(): Invalid row number");
409 staticvector<TSignedSeqPos>
413vector<TSignedSeqPos> rv;
414rv.reserve(lens.size());
423rv.push_back((end + 1) -
offset);
425rv.push_back(start +
offset);
441vector<TSeqPos> product_lens;
442vector<TSeqPos> genomic_lens;
447product_lens.push_back(part.
GetMatch());
448genomic_lens.push_back(part.
GetMatch());
452}
else if(part.
IsDiag()) {
453product_lens.push_back(part.
GetDiag());
454genomic_lens.push_back(part.
GetDiag());
457genomic_lens.push_back(0);
459product_lens.push_back(0);
462 throwruntime_error(
"unhandled part type in Spliced-enon");
468genomic_lens.push_back(
len);
469product_lens.push_back(
len);
473lens.reserve(product_lens.size());
474 for(
size_t i= 0;
i< product_lens.size(); ++
i) {
475lens.push_back(
max(product_lens[
i], genomic_lens[
i]));
485vector<TSignedSeqPos> product_starts;
490vector<TSignedSeqPos> genomic_starts =
496starts.reserve(product_starts.size() + genomic_starts.size());
497 for(
size_t i= 0;
i< lens.size(); ++
i) {
498starts.push_back(product_starts[
i]);
499starts.push_back(genomic_starts[
i]);
510 for(
size_t i= 0;
i< lens.size(); ++
i) {
511strands.push_back(product_strand);
512strands.push_back(genomic_strand);
555product_strand, genomic_strand,
556product_id, genomic_id);
558ds_align->
SetSegs().SetDenseg(*ds);
560disc->
SetSegs().SetDisc().Set().push_back(ds_align);
578product_strand, genomic_strand,
579product_id, genomic_id);
583ds_align->
SetSegs().SetDenseg(*ds);
585disc->
SetSegs().SetDisc().Set().push_back(ds_align);
592 "unhandled product type in spliced seg");
bool IsReverse(ENa_strand s)
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)
void Compact()
Join adjacent mergeable segments to create a more compact alignment.
TSeqRange GetRowSeq_range(CSeq_align::TDim row, bool always_as_nuc) const
Return exon's range within this row.
TSeqPos GetSeqStop(TDim row) const
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
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).
CRef< CSeq_align > AsDiscSeg() const
Convert this alignment to a discontinuous segment.
TSeqPos InternalUnaligned(void) const
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
int TSignedSeqPos
Type for signed sequence position.
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
C * SerialClone(const C &src)
Create on heap a clone of the source object.
static TThisType GetWhole(void)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
void SetFrom(TFrom value)
Assign a value to From data member.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
void SetTo(TTo value)
Assign a value to To data member.
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.
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
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.
vector< ENa_strand > TStrands
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.
TDiag GetDiag(void) const
Get the variant data.
vector< TSignedSeqPos > TStarts
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.
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.
TStrands & SetStrands(void)
Assign a value to Strands data member.
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.
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.
TProduct_strand GetProduct_strand(void) const
Get the Product_strand member data.
TIds & SetIds(void)
Assign a value to Ids data member.
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
@ eType_disc
discontinuous alignment
@ eProduct_type_transcript
ENa_strand
strand of nucleic acid
constexpr bool empty(list< Ts... >) noexcept
#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