phase = (prot_prev+1)%3;
87 charaa =
m_protein[prev_not_intron_pos];
89 intadded_len =
min(3-phase,
len);
90 if(prev_not_intron_pos ==
m_protein.size()-1 && phase+added_len==3 && (phase==1 ||
m_protein[prev_not_intron_pos-1]==aa)) {
98prot_prev += added_len;
104 const char* p =
buf.c_str();
128 size_tstart_pos =
m_dna.size()-
len;
131 size_tprev_exon_pos = 0;
132 if(phase+
len>=3 &&
133((prev_exon_pos=
m_protein.find_last_not_of(is_insertion?INTRON:
INTRON_OR_GAP,start_pos-1))!=start_pos-1 ||
136 stringcodon =
m_dna.substr(prev_exon_pos-phase+1,phase)+
m_dna.substr(start_pos,3-phase);
138 for(
size_t i= prev_exon_pos-phase+1;
i<=prev_exon_pos;++
i) {
151 for( ; start_pos+3 <=
m_dna.size(); start_pos += 3) {
157 if(start_pos <
m_dna.size()) {
197 const string& triplet)
199 return table.GetCodonResidue(
200 table.SetCodonState(triplet[0], triplet[1], triplet[2]));
204 boolprev_3_prime_splice,
boolcur_5_prime_splice,
206 int& nuc_prev,
int& prot_prev,
207 intnuc_cur_start,
intprot_cur_start)
213 intprot_hole_len = prot_cur_start - prot_prev -1;
214 intnuc_hole_len = nuc_cur_start - nuc_prev -1;
216 boolcan_show_splices = prot_hole_len < nuc_hole_len -4;
217 if(can_show_splices && prev_3_prime_splice) {
219nuc_hole_len = nuc_cur_start - nuc_prev -1;
221 if(can_show_splices && cur_5_prime_splice) {
223nuc_hole_len = nuc_cur_start - nuc_prev -1;
227 _ASSERT( prot_hole_len>0 || nuc_hole_len>0 );
230left_gap = (prot_hole_len-nuc_hole_len)/2;
234 AddDNAText(genomic_ci,nuc_prev,nuc_hole_len);
235 if(prot_hole_len>nuc_hole_len)
241left_gap = (nuc_hole_len-prot_hole_len)/2;
246 if(prot_hole_len<nuc_hole_len)
250 if(can_show_splices && cur_5_prime_splice) {
263 const string& matrix_name)
265 const CSpliced_seg& sps = seqalign.GetSegs().GetSpliced();
289 if(packed_mtx ==
NULL)
297 boolprev_3_prime_splice =
false;
298 intprev_genomic_ins = 0;
308nuc_cur_start -= nuc_from;
309nuc_cur_end -= nuc_from;
311 swap(nuc_cur_start,nuc_cur_end);
312nuc_cur_start = nuc_to - nuc_cur_start;
313nuc_cur_end = nuc_to - nuc_cur_end;
317prot_prev+1 != prot_cur_start || !( (prev_3_prime_splice && cur_5_prime_splice) || (prot_cur_start==0 && nuc_cur_start==0) );
320 AddHoleText(prev_3_prime_splice, cur_5_prime_splice,
321genomic_ci, protein_ci,
323nuc_cur_start, prot_cur_start);
324prev_genomic_ins = 0;
326 intintron_len = nuc_cur_start - nuc_prev -1;
327 AddDNAText(genomic_ci, nuc_prev, intron_len);
342prev_genomic_ins = 0;
347}
else if(chunk.
IsMatch()) {
368 if(0<=prot_prev && prot_prev<prot_len-1 && (prot_prev+1)%3==0)
372prev_genomic_ins = (prev_genomic_ins+
len)%3;
376 _ASSERT(prot_prev <= prot_cur_end);
378 _ASSERT(prot_prev == prot_cur_end);
379 _ASSERT(nuc_prev == nuc_cur_end);
386 intnuc_cur_start = nuc_to - nuc_from +1;
387 intprot_cur_start = prot_len;
388 if(prot_prev+1 != prot_cur_start || nuc_prev+1 != nuc_cur_start) {
389 boolcur_5_prime_splice =
false;
390 AddHoleText(prev_3_prime_splice, cur_5_prime_splice,
391genomic_ci, protein_ci,
393nuc_cur_start, prot_cur_start);
407 if((*b)->GetId() !=
NULL&& (*b)->GetId()->Match(nucid)) {
414genomic->
SetInt().SetFrom(0);
@ eExtreme_Positional
numerical value
USING_SCOPE(ncbi::objects)
static const CTrans_table & GetTransTable(int id)
SNCBIFullScoreMatrix m_matrix
void AddProtText(objects::CSeqVector_CI &protein_ci, int &prot_prev, int len)
static const char MATCH_CHAR
static const char INTRON_CHAR
static char TranslateTriplet(const objects::CTrans_table &table, const string &triplet)
static const char INTRON_OR_GAP[]
static const char SPACE_CHAR
const objects::CTrans_table * m_trans_table
static const char BAD_OR_MISMATCH[]
static const char MISMATCH_CHAR
void AddDNAText(objects::CSeqVector_CI &genomic_ci, int &nuc_prev, int len)
CProteinAlignText(objects::CScope &scope, const objects::CSeq_align &seqalign, const string &matrix_name="BLOSUM62")
void AddSpliceText(objects::CSeqVector_CI &genomic_ci, int &nuc_prev, char match)
void TranslateDNA(int phase, size_t len, bool is_insertion)
void AddHoleText(bool prev_3_prime_splice, bool cur_5_prime_splice, objects::CSeqVector_CI &genomic_ci, objects::CSeqVector_CI &protein_ci, int &nuc_prev, int &prot_prev, int nuc_cur_start, int prot_cur_start)
static CRef< objects::CSeq_loc > GetGenomicBounds(objects::CScope &scope, const objects::CSeq_align &seqalign)
void MatchText(size_t len, bool is_match=false)
static const char BAD_PIECE_CHAR
static const char POSIT_CHAR
static const char GAP_CHAR
Include a standard set of the NCBI C++ Toolkit most basic headers.
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void SetPacked_int(TPacked_int &v)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
TRange GetTotalRange(void) const
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
void SetStrand(ENa_strand strand)
Set the strand for all of the location's ranges.
void SetNull(void)
Override all setters to incorporate cache invalidation.
TSeqPos GetStop(ESeqLocExtremes ext) const
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
CRef< CSeq_loc > Seq_loc_Merge(const CSeq_loc &loc, CSeq_loc::TOpFlags flags, CScope *scope)
Merge ranges in the seq-loc.
const COrg_ref & GetOrg_ref(const CBioseq_Handle &handle)
Return the org-ref associated with a given sequence.
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer)
Fill the buffer string with the sequence data for the interval [start, stop).
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
NCBI_NS_STD::string::size_type SIZE_TYPE
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
const TDonor_after_exon & GetDonor_after_exon(void) const
Get the Donor_after_exon member data.
const TGenomic_id & GetGenomic_id(void) const
Get the Genomic_id member data.
bool CanGetAcceptor_before_exon(void) const
Check if it is safe to call GetAcceptor_before_exon method.
bool CanGetBases(void) const
Check if it is safe to call GetBases method.
bool CanGetBounds(void) const
Check if it is safe to call GetBounds method.
TMatch GetMatch(void) const
Get the variant data.
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 TAcceptor_before_exon & GetAcceptor_before_exon(void) const
Get the Acceptor_before_exon member data.
bool IsMismatch(void) const
Check if variant Mismatch is selected.
TProduct_length GetProduct_length(void) const
Get the Product_length member data.
TDiag GetDiag(void) const
Get the variant data.
TMismatch GetMismatch(void) const
Get the variant data.
TGenomic_strand GetGenomic_strand(void) const
Get the Genomic_strand member data.
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.
const TSpliced & GetSpliced(void) const
Get the variant data.
list< CRef< CSeq_loc > > TBounds
bool IsGenomic_ins(void) const
Check if variant Genomic_ins is selected.
bool IsMatch(void) const
Check if variant Match is selected.
TGenomic_ins GetGenomic_ins(void) const
Get the variant data.
list< CRef< CSpliced_exon > > TExons
const TExons & GetExons(void) const
Get the Exons member data.
bool IsDiag(void) const
Check if variant Diag is selected.
const TBases & GetBases(void) const
Get the Bases member data.
list< CRef< CSpliced_exon_chunk > > TParts
bool CanGetDonor_after_exon(void) const
Check if it is safe to call GetDonor_after_exon method.
TGenomic_end GetGenomic_end(void) const
Get the Genomic_end member data.
bool IsProduct_ins(void) const
Check if variant Product_ins is selected.
TProduct_ins GetProduct_ins(void) const
Get the variant data.
const TSegs & GetSegs(void) const
Get the Segs member data.
const TBounds & GetBounds(void) const
Get the Bounds member data.
ENa_strand
strand of nucleic acid
bool IsWhole(void) const
Check if variant Whole is selected.
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
static int match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket, PCRE2_SIZE frame_size, pcre2_match_data *match_data, match_block *mb)
const SNCBIPackedScoreMatrix * NCBISM_GetStandardMatrix(const char *name)
void NCBISM_Unpack(const SNCBIPackedScoreMatrix *psm, SNCBIFullScoreMatrix *fsm)
Expand a packed score matrix into an unpacked one, which callers can proceed to index directly by sta...
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