& common_subject
75 getFromTo(left_genomic_int, from1, to1, left_strand);
76 getFromTo(right_genomic_int, from2, to2, right_strand);
78 intleft_frame = (from1-1)%3+1;
79 intright_frame = (from2-1)%3+1;
82 if(left_strand != right_strand)
94 intspace = ((
int)from2-(
int)to1)/3+1;
98 intnum=0, numFit=0, numGI=0;
99 intnumLeft=0, numRight=0;
100vector<perfectHitStr> left_perfect;
101vector<perfectHitStr> right_perfect;
106 intn_frameshift_pairs=0;
107list<problemStr> problemsl;
108list<problemStr> problemsr;
111 stringany_common_subject=
"";
115 if(!(*left_annot)->GetData().IsAlign())
continue;
118vector<long> left_gis =
getGIs(left_annot);
125 if(!(*right_annot)->GetData().IsAlign())
continue;
128vector<long> right_gis =
getGIs(right_annot);
131 if(!
giMatch(left_gis, right_gis))
142report->
s_id= left_gis[0];
148 intframe_to =frame_from;
159 if( (!reverse &&
fit_blast(left, right, left_annot, right_annot, left_qLen, right_qLen, space, report)) ||
160( reverse &&
fit_blast(right, left, right_annot, left_annot, right_qLen, left_qLen, space, report))
165 if(numFit==1) any_common_subject = this_subject;
166 if(common_subject.size()==0 && this_subject.find(
"hypothetical")==string::npos)
169common_subject = this_subject;
170 if(
PrintDetails())
NcbiCerr<<
"zero common_subject changed to non-hypothetical this_subject "<< this_subject
175 charbufferchar[20480]; memset(bufferchar, 0, 20480);
176strstream
buffer(bufferchar, 20480);
179 if(common_subject.size())
181misc_feat <<
"potential frameshift: common BLAST hit: " 182<< common_subject <<
'\0';
197problemsl.push_back(problem);
201problemsr.push_back(problem);
203n_frameshift_pairs++;
211num=numLeft*numRight;
212 if(common_subject.size()==0) common_subject = any_common_subject;
218 if(qname.find(
"hypothetical") != string::npos || qrname.find(
"hypothetical") != string::npos)
221<<
"one of those is hypo: FRAMESHIFT"<<
NcbiEndl;
230<<
"numFit < 2: NOT A FRAMESHIFT"<<
NcbiEndl;
236 if(left_perfect.size() || right_perfect.size())
239<<
"there are exhonerating hits: NOT A FRAMESHIFT"<<
NcbiEndl;
246<<
"there are no exhonerating hits: FRAMESHIFT"<<
NcbiEndl;
255<<
"numFit = 0: NOT A FRAMESHIFT"<<
NcbiEndl;
265 charbufferchar[2048]; memset(bufferchar, 0, 2048);
266strstream
buffer(bufferchar, 2048);
267 buffer<<
"Left sequence has "<< left_perfect.size() <<
" perfect hits."<<
NcbiEndl;
268 ITERATE(vector<perfectHitStr>, hit, left_perfect)
272 buffer<<
"Right sequence has "<< right_perfect.size() <<
" perfect hits."<<
NcbiEndl;
273 ITERATE(vector<perfectHitStr>, hit, right_perfect)
277 buffer<<
"In total, "<< numFit <<
" pairs of hits (out of "<< num <<
") match for these two sequences."<<
NcbiEndl;
294CBioseq::TAnnot::const_iterator& left_annot,
295CBioseq::TAnnot::const_iterator& right_annot,
296 intleft_qLen,
intright_qLen,
311 intleft_qFrom, left_qTo, right_qFrom, right_qTo;
312 intleft_sFrom, left_sTo, right_sFrom, right_sTo;
313 getBounds(left_annot, &left_qFrom, &left_qTo, &left_sFrom, &left_sTo);
314 getBounds(right_annot, &right_qFrom, &right_qTo, &right_sFrom, &right_sTo);
320report->
space= space;
321report->
s_name=
"cannot get subject name";
366 result= result_left > 0 && result_right > 0;
static bool PrintDetails(int current_verbosity=m_current_verbosity)
static string GetProtName(const CBioseq &seq)
static bool giMatch(const vector< long > &left, const vector< long > &right)
static int getQueryLen(const CBioseq &seq)
static vector< long > getGIs(CBioseq::TAnnot::const_iterator &annot)
static bool has_blast_hits(const CBioseq &seq)
static void IncreaseVerbosity(void)
static int collectPerfectHits(vector< perfectHitStr > &perfect, const CBioseq &seq)
static string getAnnotComment(CBioseq::TAnnot::const_iterator &annot)
static string getAnnotName(CBioseq::TAnnot::const_iterator &annot)
static bool hasGenomicLocation(const CBioseq &seq)
static void DecreaseVerbosity(void)
static void getBounds(CBioseq::TAnnot::const_iterator &annot, int *qFrom, int *qTo, int *sFrom, int *sTo)
static void printPerfectHit(const perfectHitStr &hit, ostream &out=NcbiCout)
static void PopVerbosity(void)
static const CSeq_loc & getGenomicLocation(const CBioseq &seq)
static void printReport(distanceReportStr *report, ostream &out=NcbiCout)
static int getLenScore(CBioseq::TAnnot::const_iterator &annot)
static void getFromTo(const CSeq_loc &loc, TSeqPos &from, TSeqPos &to, ENa_strand &strand)
bool fit_blast(const CBioseq &left, const CBioseq &right, string &common_subject)
static void PushVerbosity(void)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
ENa_strand
strand of nucleic acid
const TInst & GetInst(void) const
Get the Inst member data.
const TAnnot & GetAnnot(void) const
Get the Annot member data.
TMol GetMol(void) const
Get the Mol member data.
list< CRef< CSeq_annot > > TAnnot
unsigned int
A callback function used to compare two keys in a database.
int addProblems(list< problemStr > &dest, const list< problemStr > &src)
string GetStringDescr(const CBioseq &bioseq)
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