Skip to content

Commit

Permalink
Bug fixed
Browse files Browse the repository at this point in the history
Bug fixed
  • Loading branch information
youngchan919 committed May 17, 2019
1 parent 0ef35d6 commit a9f160a
Show file tree
Hide file tree
Showing 14 changed files with 371 additions and 1,044 deletions.
2 changes: 1 addition & 1 deletion src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "peprocess.h"
#include "seprocess.h"
int main(int argc,char* argv[]){
C_global_variable gv; //global variable, include statistic information
//C_global_variable gv; //global variable, include statistic information
C_global_parameter gp; //global parameter generated by commands
check_module(argc,argv); //check module
global_parameter_initial(argc,argv,gp); //initial global parameter
Expand Down
17 changes: 9 additions & 8 deletions src/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ quartile_result cal_quar_from_map(map<int,int> data){
}
return return_value;
}
quartile_result cal_quar_from_array(unsigned long long data[],int len){
quartile_result cal_quar_from_array(long long data[],int len){
//cout<<len<<"\there"<<endl;
quartile_result return_value;
unsigned long long total_num(0);
Expand Down Expand Up @@ -120,8 +120,9 @@ int check_gz_empty(string a){
if(gzgets(gzfp,line_info,MAXLEN)!=NULL){
return 1;
}
gzclose(gzfp);
return -1;
gzclose(gzfp);

}
void remove_space(string &a){
string b;
Expand Down Expand Up @@ -171,11 +172,11 @@ void line_split(string line_info,char sep,vector<string> &elements){
if(line_info[ix]!=sep){
element+=line_info[ix];
}else{
elements.push_back(element);
elements.emplace_back(element);
element="";
}
}
elements.push_back(element);
elements.emplace_back(element);
}
void line_split(string line_info,vector<string> &elements){
elements.clear();
Expand All @@ -184,11 +185,11 @@ void line_split(string line_info,vector<string> &elements){
if(!isspace(line_info[ix])){
element+=line_info[ix];
}else{
elements.push_back(element);
elements.emplace_back(element);
element="";
}
}
elements.push_back(element);
elements.emplace_back(element);
}
void line_split(string line_info,char sep,set<string> &elements){
elements.clear();
Expand Down Expand Up @@ -294,7 +295,7 @@ string join_vector(vector<string> a,string sep){
return result;
}
string link_dir_file(string dir,string file){
string::size_type index;
//string::size_type index;
// remove null char in the start or end;
dir.erase(0,dir.find_first_not_of(" "));
dir.erase(dir.find_last_not_of(" ")+1);
Expand Down Expand Up @@ -433,4 +434,4 @@ vector<string> get_se_hard_trim(string a){
exit(1);
}
return tmp_eles;
}
}
14 changes: 7 additions & 7 deletions src/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ class quartile_result{
float first10_quar,last10_quar;
};

quartile_result cal_quar_from_map(map<int,int> data);
quartile_result cal_quar_from_array(unsigned long long data[],int len);
//quartile_result cal_quar_from_map(map<int,int> data);
quartile_result cal_quar_from_array(long long data[],int len);
vector<string> get_pe_hard_trim(string a);
vector<string> get_se_hard_trim(string a);
//vector<string> get_se_hard_trim(string a);
void check_gz_file(string a);
int check_gz_empty(string a);
void remove_space(string &a);
int file_exist_and_not_empty(string file_name);
void uniq_vector(vector<string> &a);
//void remove_space(string &a);
//int file_exist_and_not_empty(string file_name);
//void uniq_vector(vector<string> &a);
string get_local_time();
void line_split(string line_info,char sep,vector<string> &elements);
void line_split(string line_info,char sep,set<string> &elements);
void line_split(string line_info,vector<string> &elements);
int count_gc(string a);
//int count_gc(string a);
void int2string(int &a,string &b);
void double2string(double &a,string &b);
void float2string(float &a,string &b);
Expand Down
2 changes: 1 addition & 1 deletion src/global_parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class C_global_parameter{
isAdptList_(true), isFull_(false), size_(0), cleanQualSys_(ILLUMINA_), filterAdapter_(true),seqType_(0),outType_(0),highAType_(0)
*/
C_global_parameter():is_streaming(false),seq_type("0"),index_remove(false),qualityPhred(33),outputQualityPhred(33),adapter_discard_or_trim("discard"),contam_discard_or_trim("discard"),adapter_method("hd"),whether_add_pe_info(false),output_file_type("fastq"),lowQual(5),lowQualityBaseRatio(0.5),meanQuality(-1),n_ratio(0.05),highA_ratio(-1),polyG_tail(-1),polyX_num(-1),overlap_length(-1),peMismatchRatio(0.1),max_read_length(-1),min_read_length(30),output_clean(0),have_output1(0),have_output2(0),adaMis(2),adaMR(0.5),ctMatchR("0.2"),adaEdge(6),adaRCtg(6),adaRAr(0.8),adaRMa(5),adaREr(0.4),adaRMm(4),threads_num(6),patchSize(0),split_line(10000000),mode(""),total_reads_num(0),f_total_reads_ratio(0),l_total_reads_num(0),total_reads_num_random(true),clean_file_reads(0){};
C_global_parameter(int argc,char* argv[]);
//C_global_parameter(int argc,char* argv[]);

string mode;
string module_name;
Expand Down
21 changes: 12 additions & 9 deletions src/global_variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ using namespace::std;
//#define REAL_MAX 50
class C_filter_stat{
public:
C_filter_stat():in_adapter_list_num(0),include_adapter_seq_num(0),include_contam_seq_num(0),n_ratio_num(0),highA_num(0),polyX_num(0),tile_num(0),fov_num(0),low_qual_base_ratio_num(0),mean_quality_num(0),short_len_num(0),long_len_num(0),over_lapped_num(0),no_3_adapter_num(0),int_insertNull_num(0),include_adapter_seq_num1(0),include_adapter_seq_num2(0),include_adapter_seq_num_overlap(0),include_contam_seq_num1(0),include_contam_seq_num2(0),include_contam_seq_num_overlap(0),n_ratio_num1(0),n_ratio_num2(0),n_ratio_num_overlap(0),highA_num1(0),highA_num2(0),highA_num_overlap(0),polyX_num1(0),polyX_num2(0),polyX_num_overlap(0),low_qual_base_ratio_num1(0),low_qual_base_ratio_num2(0),low_qual_base_ratio_num_overlap(0),mean_quality_num1(0),mean_quality_num2(0),mean_quality_num_overlap(0),short_len_num1(0),short_len_num2(0),short_len_num_overlap(0),long_len_num1(0),long_len_num2(0),long_len_num_overlap(0){};
C_filter_stat():in_adapter_list_num(0),include_adapter_seq_num(0),include_contam_seq_num(0),n_ratio_num(0),highA_num(0),polyX_num(0),tile_num(0),fov_num(0),low_qual_base_ratio_num(0),mean_quality_num(0),short_len_num(0),long_len_num(0),over_lapped_num(0),no_3_adapter_num(0),int_insertNull_num(0),include_adapter_seq_num1(0),include_adapter_seq_num2(0),include_adapter_seq_num_overlap(0),include_contam_seq_num1(0),include_contam_seq_num2(0),include_contam_seq_num_overlap(0),n_ratio_num1(0),n_ratio_num2(0),n_ratio_num_overlap(0),highA_num1(0),highA_num2(0),highA_num_overlap(0),polyX_num1(0),polyX_num2(0),polyX_num_overlap(0),low_qual_base_ratio_num1(0),low_qual_base_ratio_num2(0),low_qual_base_ratio_num_overlap(0),mean_quality_num1(0),mean_quality_num2(0),mean_quality_num_overlap(0),short_len_num1(0),short_len_num2(0),short_len_num_overlap(0),long_len_num1(0),long_len_num2(0),long_len_num_overlap(0){
include_global_contam_seq_num=include_global_contam_seq_num1=include_global_contam_seq_num2=include_global_contam_seq_num_overlap=0;
polyG_num=polyG_num1=polyG_num2=polyG_num_overlap=0;
};
//int output_reads_num;
int in_adapter_list_num;
int include_adapter_seq_num,include_adapter_seq_num1,include_adapter_seq_num2,include_adapter_seq_num_overlap;
Expand All @@ -36,32 +39,32 @@ class C_general_stat{
C_general_stat();
int read_max_length;
int read_length;
int reads_number;
unsigned long long base_number;
unsigned long long a_number,c_number,g_number,t_number,n_number;
long long reads_number;
long long base_number;
long long a_number,c_number,g_number,t_number,n_number;
//unsigned long long a_ratio,c_ratio,g_ratio,t_ratio,n_ratio;
unsigned long long q20_num,q30_num;
long long q20_num,q30_num;
//unsigned long long q20_ratio,q30_ratio;
};

class C_reads_pos_base_stat{
public:
C_reads_pos_base_stat();
unsigned long long position_acgt_content[READ_MAX_LEN][5];
long long position_acgt_content[READ_MAX_LEN][5];
//map<int,map<char,int> > position_acgt_content_ratio;
};

class C_reads_pos_qual_stat{
public:
C_reads_pos_qual_stat();
unsigned long long position_qual[READ_MAX_LEN][MAX_QUAL];
long long position_qual[READ_MAX_LEN][MAX_QUAL];
//map<int,map<int,int> > position_qual_ratio;
};
class C_reads_trim_stat{
public:
C_reads_trim_stat();
unsigned long long hlq[READ_MAX_LEN],ht[READ_MAX_LEN];
unsigned long long ta[READ_MAX_LEN],tlq[READ_MAX_LEN],tt[READ_MAX_LEN];
long long hlq[READ_MAX_LEN],ht[READ_MAX_LEN];
long long ta[READ_MAX_LEN],tlq[READ_MAX_LEN],tt[READ_MAX_LEN];
};
class C_fastq_file_stat{
public:
Expand Down
Loading

0 comments on commit a9f160a

Please sign in to comment.