Skip to content

Fix warnings #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions align.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ void SingleAlign::ConvertBinaySeq() {


void SingleAlign::SnpAlign(RefSeq &ref, bit32_t mode) {
bit32_t i,j,jj1,jj,m, modeindex, cmodeindex, mc, h, read_chain_index_mask, *_refloc0;
Hit prefetch_hit, _hHit;
bit32_t i,j,jj,m, modeindex, cmodeindex, mc, h, read_chain_index_mask, *_refloc0;
Hit _hHit;

//cout<<_pread->seq<<endl;
if(param.RRBS_flag){ //RRBS mode
Expand Down Expand Up @@ -370,7 +370,7 @@ void SingleAlign::SortHits4PE(int n) {
}

int SingleAlign::TrimAdapter() {
bit32_t i,j,k,m,m0, pos;
bit32_t i,k,m0, pos;
raw_readlen=_pread->seq.size();
for(i=0; i<param.n_adapter; i++){
for(pos=param.seed_size+param.index_interval-1;pos<_pread->seq.size()-4;pos++){
Expand Down Expand Up @@ -416,7 +416,7 @@ int SingleAlign::RunAlign(RefSeq &ref) {
}

void SingleAlign::ReorderSeed(RefSeq &ref) {
bit32_t i,ii,s, total, tt;
bit32_t i,ii, total, tt;
//for(i=0;i<map_readlen-param.seed_size;i++) {disp_bfa(param.map3to4(seed_array[i])); cout<<i<<":"<<ref.index2[seed_array[i]].n[0]<<":"<<ref.index2[seed_array[i]].n[1]<<endl;}
for(read_chain_index=0;read_chain_index<2;read_chain_index++) {
if(!xflag_chain[read_chain_index]) continue;
Expand Down
8 changes: 4 additions & 4 deletions align.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ inline void SingleAlign::CountMismatch(bit64_t *q, bit32_t offset, bit64_t *s) {
}
}
else {
if((tmp_snp=N_count+param.XM64((((*q)>>offset)&param.XC64(*s)^(*s))&((q[FIXELEMENT])>>offset)))>snp_thres) return;
if((tmp_snp=N_count+param.XM64(((((*q)>>offset)&param.XC64(*s))^(*s))&((q[FIXELEMENT])>>offset)))>snp_thres) return;
for(bit32_t i=1;i<FIXELEMENT;i++) {
if((tmp_snp+=param.XM64(((((q[i-1]<<1)<<(63-offset))|q[i]>>offset)&param.XC64(s[i])^s[i])&(((q[FIXELEMENT-1+i]<<1)<<(63-offset))|q[i+FIXELEMENT]>>offset)))>snp_thres) return;
if((tmp_snp+=param.XM64((((((q[i-1]<<1)<<(63-offset))|q[i]>>offset)&param.XC64(s[i]))^s[i])&(((q[FIXELEMENT-1+i]<<1)<<(63-offset))|q[i+FIXELEMENT]>>offset)))>snp_thres) return;
}
/*
tmp_snp=N_count;
Expand All @@ -134,7 +134,7 @@ inline void SingleAlign::CountMismatch(bit64_t *q, bit32_t offset, bit64_t *s) {

inline bit32_t SingleAlign::MismatchPattern0(bit64_t *q, bit64_t *s, bit32_t offset) {
register bit64_t tmp;
bit32_t *mm_array; int i, j,jj, ss=0;
bit32_t *mm_array,i;int j,jj, ss=0;
//cout<<"in MMpattern() gap_index:"<<gap_index<<endl;
//cout<<" offset="<<seglen_offset<<" end_element="<<end_element<<" end_offset="<<end_offset<<endl;
mm_array=mm_index[0];
Expand Down Expand Up @@ -171,7 +171,7 @@ inline bit32_t SingleAlign::MismatchPattern0(bit64_t *q, bit64_t *s, bit32_t off

inline bit32_t SingleAlign::MismatchPattern1(bit64_t *q, bit64_t *s, bit32_t gap_index, bit32_t offset) {
register bit64_t tmp; register bit32_t shift;
bit32_t *mm_array; int i,ii, j,jj, ss=0;
bit32_t *mm_array,i; int ii, j,jj, ss=0;
//cout<<"in MMpattern() gap_index:"<<gap_index<<endl;
//cout<<"shift="<<(1-((int)gap_index%2)*2)*((int)gap_index+1)/2<<" offset="<<seglen_offset<<" end_element="<<end_element;
//cout<<" end_offset="<<end_offset<<endl;
Expand Down
5 changes: 2 additions & 3 deletions dbseq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void RefSeq::UnmaskRegion() {
}

void RefSeq::find_CCGG() {
bit32_t tmp_offset,tmp_max, seedloc, right=0xffffffffu, seglen; int i,j;
bit32_t tmp_offset,tmp_max, seedloc, right=0xffffffffu, seglen,i,j;
vector<ref_loc_t> tmpset_index_BSW[50], tmpset_index_BSC[50];
vector<pair<ref_loc_t, bit32_t> > tmp_CCGG_sites;
//vector<pair<ref_loc_t, bit32_t> >::iterator rit;
Expand Down Expand Up @@ -378,7 +378,7 @@ void RefSeq::AllocIndex() {

void RefSeq::ReleaseIndex() {
bit32_t i;
KmerLoc *v; KmerLoc2 *u;
KmerLoc *v;
if(param.RRBS_flag){
for(i=0,v=index; i<total_kmers; i++,v++) {
if(v->n1) delete [] v->loc1;
Expand Down Expand Up @@ -461,7 +461,6 @@ void RefSeq::t_FillIndex(bit32_t ref_chain) {
}

void RefSeq::CreateIndex() {
bit32_t i;
InitialIndex();
CalKmerFreq();
AllocIndex();
Expand Down
4 changes: 2 additions & 2 deletions gzstream/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ test_gunzip : test_gunzip.o libgzstream.a
${CXX} -o test_gunzip test_gunzip.o ${LDFLAGS}

clean :
rm *.o libgzstream.a
rm -f *.o libgzstream.a

cleanall :
rm *.o libgzstream.a test_gzip test_gunzip
rm -f *.o libgzstream.a test_gzip test_gunzip

# ============================================================================
# EOF
Expand Down
13 changes: 8 additions & 5 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,15 +409,16 @@ void RunProcess(void) {
else message<<"\tmax number of mismatches: read_length * "<<param.max_snp_num-100<<"% ";
message<<" \tmax gap size: "<<param.gap<<" \tkmer cut-off ratio: "<<param.max_kmer_ratio<<" \tmax multi-hits: "<<param.max_num_hits<<endl;
message<<"\tquality cutoff: "<<(int)param.qual_threshold<<" \tbase quality char: '"<<param.zero_qual<<"'"<<" \tmax Ns: "<<param.max_ns;
if(param.max_readlen<(FIXELEMENT-1)*SEGLEN) message<<" \thard clip length: "<<param.max_readlen; message<<endl;
if(param.max_readlen<(FIXELEMENT-1)*SEGLEN) message<<" \thard clip length: "<<param.max_readlen<<endl;
if(param.pairend||param.RRBS_flag) message<<"\tmin fragment size: "<<param.min_insert<<" \tmax fragemt size: "<<param.max_insert<<endl;
if(param.nt3) message<<"\t3-nucleotide alignment mode: "<<param.read_nt<<" <=> "<<param.ref_nt;
else message<<"\twildcard alignment mode: "<<param.read_nt<<" in reads => "<<param.ref_nt<<" in reference";
message<<" \tseed size: "<<param.seed_size<<" \tindex interval: "<<param.index_interval<<endl;
message<<"\talignment report: ";
if(param.report_repeat_hits==0) message<<"unique alignments only";
if(param.report_repeat_hits==1) message<<"unique + one random multiple alignments";
if(param.report_repeat_hits==2) message<<"unique + all multiple alignments"; message<<endl;
if(param.report_repeat_hits==2) message<<"unique + all multiple alignments";
message<<endl;
if(param.pairend){
message<<"\tmapping strand (read_1): ++,-+";
if(param.chains) message<< ",+-,--";
Expand All @@ -434,15 +435,16 @@ void RunProcess(void) {
message<<"\tRRBS digestion site: ";
for(bit32_t i=0; i<param.digest_site.size(); i++)
message<<param.digest_site[i].substr(0,param.digest_pos[i])<<'-'<<param.digest_site[i].substr(param.digest_pos[i])<<" ";
message<<endl;
message<<endl;
}
info(2);
string err_msg;
//pair-end alignment
if(param.pairend) {
message<<"[bsmap] @"<<Curr_Time()<<" \tPair-end alignment("<<param.num_procs<<" threads),"; info(1);
message<<" \tstart from read pair #"<<param.read_start;
if(~param.read_end) message<<" \tend at read pair #"<<param.read_end; info(2); message<<endl; info(1);
if(~param.read_end) message<<" \tend at read pair #"<<param.read_end;
info(2); message<<endl; info(1);
err_msg="failed to open read file #1 (check -a option): ";
message<<"\tInput read file #1: "<<query_a_file;
param.gz_input=check_ifile(query_a_file, err_msg);
Expand Down Expand Up @@ -524,7 +526,8 @@ void RunProcess(void) {
else {
message<<"[bsmap] @"<<Curr_Time()<<" \tSingle-end alignment("<<param.num_procs<<" threads),"; info(1);
message<<" \tstart from read #"<<param.read_start;
if(~param.read_end) message<<" \tend at read #"<<param.read_end; info(2); cerr<<endl; info(1);
if(~param.read_end) message<<" \tend at read #"<<param.read_end;
info(2); cerr<<endl; info(1);
err_msg="failed to open read file (check -a option): ";
message<<"\tInput read file: "<<query_a_file;
param.gz_input=check_ifile(query_a_file, err_msg);
Expand Down
3 changes: 1 addition & 2 deletions pairs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ int PairAlign::GetPairs(bit32_t na, bit32_t nb)

int PairAlign::RunAlign(RefSeq &ref)
{
bit32_t n,i,j,seedseg_num;
bit32_t n,i,j;

for(i=0; i<=MAXSNPS*2; i++) _cur_n_hits[i]=0;
for(i=0; i<=MAXSNPS; i++) for(j=0; j<=MAXSNPS; j++) checked_pair_mismatch[i][j]=0;
Expand All @@ -142,7 +142,6 @@ int PairAlign::RunAlign(RefSeq &ref)
_sa.seedseg_num=min((bit32_t)((_sa._pread->seq.size()-param.index_interval+1)/param.seed_size),_sa.read_max_snp_num+1);
_sb.seedseg_num=min((bit32_t)((_sb._pread->seq.size()-param.index_interval+1)/param.seed_size),_sb.read_max_snp_num+1);

seedseg_num=max(_sa.seedseg_num,_sb.seedseg_num);
_sa.ConvertBinaySeq();
_sb.ConvertBinaySeq();
_sa.snp_thres=_sa.read_max_snp_num;
Expand Down