From 491a683754720635f4e143c5b4b7f7316b8b4dee Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Tue, 3 Oct 2017 21:18:02 +0200 Subject: [PATCH] dbseq: Remove trailing spaces --- dbseq.cpp | 62 +++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/dbseq.cpp b/dbseq.cpp index c0b21a8..bbf6432 100644 --- a/dbseq.cpp +++ b/dbseq.cpp @@ -42,7 +42,7 @@ ref_loc_t RefSeq::LoadNextSeq(igzstream &fin) { if(!param.gz_ref) return 0; fin>>c; if(fin.eof()) return 0; string::iterator z=_seq.begin(); - _length=0; + _length=0; fin>>_name; fin.getline(ch, 1000); while(!fin.eof()) { fin>>c; if(fin.eof()) break; @@ -85,7 +85,7 @@ void RefSeq::BinSeq(OneBfa &a) { void RefSeq::cBinSeq(OneBfa &a) { a.n=(_length+(SEGLEN-1))/SEGLEN+BINSEQPAD; //SEGLENbp, bit(SEGLEN*2) for each element. put 2 extra elements at the 3'end to invoid overflow /* int t=a.n*SEGLEN-_length; - cout << _length<< " "< tmpset_index_BSW[50], tmpset_index_BSC[50]; vector > tmp_CCGG_sites; //vector >::iterator rit; - + std::transform(_seq.begin(),_seq.end(),_seq.begin(),static_cast < int(*)(int) > (toupper)); tmp_offset=title[_count-1].rc_offset-param.seed_size; @@ -170,12 +170,12 @@ void RefSeq::find_CCGG() { for(j=0;j+11;++rit) { for(i=j+1,seglen=0;i=param.min_insert) break; + if((seglen=tmp_CCGG_sites[i].first+tmp_CCGG_sites[i].second-tmp_CCGG_sites[j].first)>=param.min_insert) break; if(seglen>param.max_insert||seglen1;++rit) { for(i=j-1,seglen=0;i>=0;--i) @@ -186,15 +186,15 @@ void RefSeq::find_CCGG() { } for(i=0;i>1)>>(63-_a*2)))>>param.seed_bits_lz); //if(_a>=0) return param.XT((*_m>>_a)¶m.seed_bits); @@ -313,7 +313,7 @@ void RefSeq::CalKmerFreq() { void RefSeq::t_CalKmerFreq(bit32_t ref_chain) { bit64_t *_m; bit32_t i,j,i2, prefetch, ptr=0; bit32_t dbs[PREFETCH_CAL_UNIT]; - prefetch=PREFETCH_CAL_UNIT*param.index_interval; + prefetch=PREFETCH_CAL_UNIT*param.index_interval; for(vector::iterator p=_blocks.begin(); p!=_blocks.end(); p++) { if(p->id%2!=ref_chain) continue; //cout<<"seg:"<begin<<" "<end<n1>0) { @@ -351,7 +351,7 @@ void RefSeq::AllocIndex() { mem_pool.push_back(ptr); for(i=0,u=index2; in[1]+u->n[0]; kmer_count[i]=t; - if(t==0) continue; + if(t==0) continue; if(ptr_count+t>=block_size-PREFETCH_LOOP) { if(t>=block_size-PREFETCH_LOOP) { u->loc1= new bit32_t[t+PREFETCH_LOOP]; @@ -404,7 +404,7 @@ void RefSeq::FillIndex() { tmphit.chr=chr|(j<<16); _m=bfa[chr].s; for(it=CCGG_index[j][chr].begin();it!=CCGG_index[j][chr].end();++it) { z=index+s_MakeSeed_1(_m+(*it)/SEGLEN,(*it)%SEGLEN); - tmphit.loc=(*it); + tmphit.loc=(*it); z->loc1[z->n1++]=tmphit; } if(param.pairend||param.chains) { @@ -413,7 +413,7 @@ void RefSeq::FillIndex() { for(it=CCGG_index[j][chr1].begin();it!=CCGG_index[j][chr1].end();++it) { if(tmp_offset<*it) continue; z=index+s_MakeSeed_1(_m+(int)(tmp_offset-*it)/SEGLEN,(tmp_offset-*it)%SEGLEN); - tmphit.loc=(tmp_offset-*it); + tmphit.loc=(tmp_offset-*it); z->loc1[z->n1++]=tmphit; } } @@ -439,11 +439,11 @@ void RefSeq::FillIndex() { } void RefSeq::t_FillIndex(bit32_t ref_chain) { - KmerLoc2 *z2; Hit tmphit; + KmerLoc2 *z2; Hit tmphit; bit64_t *_m; bit32_t i2,j,i,prefetch, tmp=1-ref_chain, ptr=0; bit32_t dbs[PREFETCH_CRT_UNIT]; prefetch=PREFETCH_CRT_UNIT*param.index_interval; - for(vector::iterator p=_blocks.begin(); p!=_blocks.end(); p++) { + for(vector::iterator p=_blocks.begin(); p!=_blocks.end(); p++) { if(p->id%2!=ref_chain) continue; tmphit.chr=p->id; _m=bfa[tmphit.chr].s; i2=((p->end-param.seed_size)/param.index_interval)*param.index_interval; @@ -471,7 +471,7 @@ void RefSeq::CreateIndex() { void RefSeq::FinishIndex() { bit32_t i; - if(param.RRBS_flag) + if(param.RRBS_flag) for(i=0;i RefSeq::CCGG_seglen(ref_id_t chr, ref_loc_t pos, int rea //cout<<"pos:"<(pos+1,CCGG_sites[chr2][mid+1]-midval+2); left=mid;right=mid+1;break; - } + } else if(midval RefSeq::CCGG_seglen(ref_id_t chr, ref_loc_t pos, int rea //cout<<"pos:"<size())) right++; + while(((seg_end=(*CCGG_sites_chr)[right].first+(*CCGG_sites_chr)[right].second)size())) right++; //cout<<"pos:"<(CCGG_sites[chr2][left]+1, CCGG_sites[chr2][right]-CCGG_sites[chr2][left]+2); return pair(seg_start+1, seg_end-seg_start); -} +} + - ref_loc_t RefSeq::hit2int(Hit h) { return ref_anchor[h.chr/2]+h.loc; }