赞
踩
仅供参考
编译此代码,您需要系统上已经安装 了“Gnu Scientific Library” (GSL)。
-
-
- #include <string>
- #include <iostream>
- #include <fstream>
- #include <vector>
- #include <sstream>
- #include <math.h>
- #include <cstdlib>
- #include <map>
- #include <gsl/gsl_randist.h>
- #include <gsl/gsl_cdf.h>
- //#include <gd.h>
-
- //#define DEBUG1
- //#define DEBUG2
- //#define DEBUG3
- //#define DEBUG4
- //#define DEBUG5
- //#define DEBUG6
- //#define DEBUG7
- //#define DEBUG8
- //#define DEBUG9
- //#define MATRIX_TRANSLATOR
- //#define BOUND_OLIGOS
-
- using namespace std;
-
- //CONSTANTS DEFINITIONS
- typedef double m_point;
- const int ALPHABET_SIZE = 4, SWITCH_TO_Z_VALUE = 500, MAX_DOTS = 150000, DA_TOP = 20;
- const char ALPHABET[4] = {'A','C','G','T'};
- const char C_ALPHABET[4] = {'T','G','C','A'};
- const m_point MIN_ADD_FREQ = 0.01, INF = 1000000000, CONSERVATION_THRESHOLD = 0.75;
- const char *matrix_files = "*.pro *.pfm";
- enum {A,C,G,T};
- char VI['T' + 1], rc_VI['T' + 1];
- //*fasta_files = "*.fasta",
- const char *m_start_identifier = "P0", *m_start_identifier_for_free_transfac = "PO", *m_data_start_identifier = "AC";
- enum {NO_FILES, BAD_MATRIX_FILE, MATRIX_NOT_ALLOCATED, MISSING_FASTA_FILE, BAD_FASTA_SEQUENCE,
- NO_MATRIX_FILE, BAD_MATRIX, NO_JASPAR_MATRIX_LIST, JASPAR_FILE_NOT_IN_LIST, CANT_COMPUTE_SCORES, READING_OUT_OF_MATRIX,
- NEED_COMPLETE_MATRIX, NO_BACKGROUND_AVAILABLE, NO_SEQUENCE, NO_TFBS, CANT_DO_POSITIONAL, SEQUENCE_SHORTER_THAN_WINDOW, BAD_BIG_VALUES, CANTOPENOUTPUT, TOO_MANY_EDGES, NO_BOF, BAD_FILE_FORMAT, NO_INDEX_FOUND, EVEN_PROBE, MISSING_CHIP_FILE, INCONSISTENT_CHIP, NO_MATRIX_FOR_DISTANCE_ANALYSIS}; //ERROR CODES
- const m_point step = 0.025; //bins step!!
- //END
-
- //OBJECTS DECLARATION
- #ifdef BOUND_OLIGOS
- class bound_oligos
- {
- private:
- void build_matrix();
- void build_pos_cor_matrix();
- void w2_vector(vector<string>*);
- int char_to_index(char);
- int observed_cooccurrences(int, char, int, char);
- vector<string> raw_mat;
- m_point **pos_cor_mat;
- string NAME;
- int **mat, x_size, y_size;
- public:
- vector<string> assign(vector<string>);
- string show_pos_cor_mat();
- };
- #endif
-
- class tfbs
- {
- private:
- bool raw_tfbsdata_parser();
- void j_raw_tfbsdata_parser();
- bool raw_matrix_parser();
- bool j_raw_matrix_parser();
- bool matrix_normalizer();
- void matrix_to_log();
- void matrix_min_max();
- void bns_sum();
- void matrix_average();
- void build_conservation_vector();
- vector<bool> v_conservation;
- vector<string> raw_matrix;
- vector<int> bns;
- vector<m_point> row;
- vector<string> raw_data;
- m_point bin_freq(int);
- string j_raw_data;
- m_point **matrix;
- m_point *mat_avg;
- m_point avg_row;
- m_point stddev_row;
- string file_name;
- // string raw_data;
- string ID;
- string NAME;
- string AC;
- int rowsize;
- int x_size;
- int bin_sum;
- m_point max_score;
- m_point min_score;
- bool matrix_alloc;
- bool norm_sec_step;
- public:
- bool assign(const char*);
- bool j_assign(const char*);
- bool w2_assign(vector<string>);
- #ifdef BOUND_OLIGOS
- bound_oligos bo;
- #endif
- string name();
- string id();
- string file();
- string matrix_id();
- string ac();
- string show_raw_matrix();
- #ifdef MATRIX_TRANSLATOR
- string matrix_translator();
- #endif
- string show_matrix();
- int get_bin_sum();
- m_point max();
- m_point min();
- void gen_bns();
- string show_bns();
- string show_bns_line();
- string show_conservation_vector(int);
- int m_length();
- bool assign_short_matrix(string);
- void row_average();
- void row_stddev();
- m_point get_value(int,int);
- m_point get_matrix_average(int);
- void row_push(m_point);
- void row_v_push(vector<m_point>);
- int row_size();
- int row_actual_size();
- m_point row_get(int);
- vector<m_point> row_get();
- m_point row_avg_get();
- m_point row_stddev_get();
- m_point bin_prob(int);
- vector<m_point>::iterator row_iter();
- unsigned int bin_hm(int);
- vector<int> bin_vector();
- // void draw_background();
- };
- class sequence
- {
- private:
- vector<vector<m_point> > seq_rel_scores;
- vector<vector<char > > seq_r_strand;
- vector<m_point> max_score;
- vector<m_point> rel_score;
- vector<m_point> rel_score2;
- vector<int> max_pos;
- vector<int> max_pos2;
- vector<char> max_strand;
- string NAME;
- string SEQ;
- string WRAP_NAME;
- string ID;
- string CHR;
- unsigned long int ABS_START;
- unsigned long int ABS_END;
- char STRAND;
- virtual void SCAN(vector<tfbs>::iterator,bool);
- void SCAN_SS(vector<tfbs>::iterator,bool);
- void store_complete_seq_scores(vector<m_point>::iterator,vector<m_point>::iterator,int,vector<tfbs>::iterator);
- void store_complete_seq_scores_ss(vector<m_point>::iterator,int,vector<tfbs>::iterator);
- // void set_seq_rel_max_pos();
- bool absolute_position_parser();
- protected:
- bool seq_cleaner();
- int char_to_index(char);
- int comp_char_to_index(char);
- m_point max_v(vector<m_point>*,int*);
- m_point max_v2(vector<m_point>*,int*);
- m_point sum_v(vector<m_point>*);
- public:
- m_point get_seq_rel_score_at_pos(int,int);
- m_point get_seq_rel_max_pos(int,int*,char*);
- unsigned long int get_abs_start();
- unsigned long int get_abs_end();
- string get_chr();
- char get_strand();
- bool assign(string);
- virtual void scan(vector<tfbs>*,int,bool);
- string name();
- string seq();
- string w_name();
- string get_id();
- m_point max(int);
- m_point rel(int);
- m_point rel2(int);
- int mpos(int);
- int mpos2(int);
- char mstrand(int);
- void reverse();
- };
-
- class big_sequence : public sequence
- {
- private:
- vector<vector <m_point> > MAX_REL_SCORE;
- vector<vector <int> > MAX_POS;
- vector<vector <string> > MAX_MOTIF;
- vector<vector<char> > MOTIF_STRAND;
- void SCAN(vector<tfbs>::iterator,bool);
- public:
- // vector<m_point> row_return(int);
- void scan(vector<tfbs>*,int,bool);
- string track_output(int);
- string inline_output();
- };
-
- class query
- {
- private:
- // m_point **correlation_matrix;
- int dam, bigst_seq_size;
- vector<sequence> QUERY;
- vector<tfbs> QTFBS;
- vector<m_point> ts;
- vector<m_point> zt;
- vector<m_point> bt;
- vector<m_point> min_binom_bins;
- vector<vector <m_point> > binom_bins;
- vector<int> seq_bin_num;
- vector<int> soil_pos;
- void distance_analysis();
- char comp_char(char);
- string revcomp(string, char);
- m_point t_den_calc(int,m_point,int,m_point);
- int max_v_pos(vector<m_point>);
- int min_v_pos(vector<m_point>);
- // void build_correlation_matrix(vector<tfbs>*);
- // void correlation_matrix_output(vector<tfbs>*,string);
- // void correlation_output(vector<tfbs>*,string);
- // void correlation_matrix_copy(m_point**, int);
- vector<int> matrix_line_max_pos(m_point*,int,int);
- vector<int> matrix_line_min_pos(m_point*,int,int);
- string positional_output();
- m_point seq_stats(int, m_point*);
- char flip_strand(char);
- // void draw_distr_graph(vector<m_point>*, vector<int>*, int, string);
- public:
- void assign(vector<sequence>,vector<tfbs>);
- void scan();
- void t_stud_calc(vector<tfbs>*);
- void z_test(vector<tfbs>*);
- void b_test(vector<tfbs>*);
- void bins_stuff(vector<tfbs>*);
- // void correlation(vector<tfbs>*);
- void pearson_corr();
- string binom_bins_line(int);
- void output(int,vector<tfbs>*);
- // void img_output(vector<tfbs>*);
- void zvectors_output(vector<tfbs>*);
- };
-
- class chip
- {
- private:
- vector<m_point> Log_Ratio;
- unsigned short int noe;
- vector<string> Chr;
- vector<m_point> exp_bg_means;
- vector<m_point> exp_fg_means;
- // vector<m_point> bin_label;
- vector<unsigned int> bins;
- vector<unsigned int> Start;
- vector<unsigned int> Stop;
- vector<m_point> Score;
- string current_chr, current_chr_seq;
- ofstream fout;
- bool consistency_check(vector<string> *);
- void stack_processor(vector<vector<string> > *);
- void set_bins();
- void display_bins();
- void Exp_Push_Mean(vector<string>*);
- void get_current_chr_seq(string, string*);
- public:
- chip();
- };
-
-
- //END
-
- //GLOBAL VARIABLES DECLARATION
- bool VERBOSE = false, BINS = false, COMPLETE_MATRIX = false, SHORT = false, SHOW_BINS_BINOM = false, USE_N = false, CORRELATION = false,
- COMPLETE_CORRELATION_MATRIX = false, GENERATE_MATRIX = false, POSITIONAL = false, USE_SUM = false, BIG_SEQ = false, PEARSON = false,
- NO_BACKGROUND = false, DOUBLE_STRAND = true, IMG_OUTPUT = false, TRASH_N = false, ZVECTOR_OUTPUT = false, USE_T = false,
- SHOW_CONSERVATION_VECTOR = false, REVERSE_STRAND = false, BED_OUTPUT = false, DRAW_BACKGROUND = false, BUILD_INDEX = false, NO_HEADER = false, CHIP = false;
- int BIG_WINDOW = 500, BIG_STEP = 250, SEQ_EDGE_START = 0, SEQ_EDGE_END = 0, MIN_SEQ_LENGTH = 0, TSS_POS = 0;
- string q_idlist, idfile, queryfile, promfile, matrixfile, usethismatrix, usethismatrixname, matrixlist, trackbg, w2file, fasta_matrix_file, bound_oligos_file, bg_for_img, magic, index_file, distance_analysis_matrix;
- vector<string> chip_files;
- vector<m_point> bins;
- double TRACK_CUTOFF = 0, CHIP_CUTOFF = 0.05, DISTANCE_CUTOFF = 0.000001;
- unsigned int SPLIT[2] = {0,0}, PROBE = 3;
- //END
-
- //FUNCTIONS DECLARATION
- vector<string> get_file_names(const char *);
- void error_handler(int, string);
- vector<tfbs> v_tfbs_builder(vector<string>);
- vector<sequence> v_sequence_builder(vector<string>, bool);
- vector<big_sequence> v_big_sequence_builder(vector<string>, bool);
- vector<string> fasta_reader(const char*);
- vector<vector <string> > w2_mat_reader(string);
- vector<vector <string> > wil_mat_reader(string);
- void v_tfbs_add_bof(vector<tfbs>*);
- void generate_output_matrix(vector<tfbs>*, vector<sequence>*);
- void generate_output_bins(vector<tfbs>*, vector<sequence>*);
- void generate_output_big_sequence(vector<tfbs>*, vector<big_sequence>*);
- void generate_tfbs_rows(vector<tfbs>*, vector<sequence>*, bool);
- //void generate_tfbs_rows(vector<tfbs>*, vector<big_sequence>*);
- void generate_tfbs_rows_from_matrix(vector<tfbs>*);
- void generate_tfbs_rows_from_short_matrix(vector<tfbs>*,ifstream*);
- void bins_gen();
- void command_line_parser(int, char**);
- void min_seq_length_fixer(vector<tfbs>*);
- void idfile_handler(vector<sequence> *);
- string build_sequence_index(vector<sequence>*);
- string show_conservation(vector<tfbs>*);
- bool id_check(vector<string> *, vector<sequence>::iterator);
- bool qlist_check(string, vector<string>*);
- void display_help();
- //END
-
- int main(int argc, char **argv)
- {
- vector<tfbs> TFBS;
- vector<sequence> SEQUENCE;
- vector<big_sequence> BIG_SEQUENCE;
- query Q;
-
- VI['A'] = 0;
- VI['C'] = 1;
- VI['G'] = 2;
- VI['T'] = 3;
-
- rc_VI['T'] = 0;
- rc_VI['G'] = 1;
- rc_VI['C'] = 2;
- rc_VI['A'] = 3;
-
- command_line_parser(argc, argv);
- bins_gen();
-
- if(CHIP)
- {
- chip C;
- }
-
- TFBS = v_tfbs_builder(get_file_names(matrix_files));
- min_seq_length_fixer(&TFBS);
-
- if((int)promfile.size() == 0 && (int)matrixfile.size() == 0 && usethismatrix.size() == 0 && !PEARSON && (int)usethismatrixname.size() == 0 && distance_analysis_matrix.empty())
- // SEQUENCE = v_sequence_builder(get_file_names(fasta_files),false);
- error_handler(NO_BACKGROUND_AVAILABLE,"");
-
- else if((int)promfile.size() != 0 && (int)matrixfile.size() == 0)
- {
- vector<string> pfile;
- pfile.push_back(promfile);
-
- if(!BIG_SEQ)
- {
- SEQUENCE = v_sequence_builder(pfile,false);
-
- if(!idfile.empty())
- idfile_handler(&SEQUENCE);
- }
-
- else
- {
- if(BIG_STEP > BIG_WINDOW || BIG_STEP < 1)
- error_handler(BAD_BIG_VALUES,"");
-
- BIG_SEQUENCE = v_big_sequence_builder(pfile,false);
- }
- }
-
- if((int)queryfile.size() != 0 && BIG_SEQUENCE.size() == 0)
- {
- vector<string> qfile;
- vector<sequence> QUERY;
- qfile.push_back(queryfile);
- QUERY = v_sequence_builder(qfile,true);
- Q.assign(QUERY,TFBS);
- QUERY.clear();
- qfile.clear();
- }
-
- else if(BIG_SEQUENCE.size() != 0)
- {
- cerr << "Processing..." << endl;
- for(int S = 0; S < BIG_SEQUENCE.size(); S++)
- BIG_SEQUENCE[S].scan(&TFBS,S,false);
-
- generate_output_big_sequence(&TFBS, &BIG_SEQUENCE);
- }
-
-
- if((int)matrixfile.size() == 0 && promfile.size() != 0)
- {
- for(int S = 0; S < SEQUENCE.size(); S++)
- SEQUENCE[S].scan(&TFBS,S,false);
-
- generate_tfbs_rows(&TFBS, &SEQUENCE, false);
-
- }
-
- else if(matrixfile.size() != 0 && promfile.size() == 0)
- generate_tfbs_rows_from_matrix(&TFBS);
-
- else if(matrixfile.size() == 0 && promfile.size() == 0)
- NO_BACKGROUND = true;
-
- if((int)queryfile.size() != 0)
- {
- Q.scan();
-
- if(PEARSON)
- Q.pearson_corr();
-
- if(!POSITIONAL && !NO_BACKGROUND)
- {
- Q.t_stud_calc(&TFBS);
- Q.bins_stuff(&TFBS);
- Q.z_test(&TFBS);
- Q.b_test(&TFBS);
- }
-
- Q.output(TFBS[0].row_size(),&TFBS);
-
- // if(IMG_OUTPUT && !POSITIONAL)
- // Q.img_output(&TFBS);
-
- if(ZVECTOR_OUTPUT)
- Q.zvectors_output(&TFBS);
- }
-
- // if(CORRELATION && TFBS.size() > 1)
- // Q.correlation(&TFBS);
-
- if((int)matrixfile.size() == 0 && (GENERATE_MATRIX || queryfile.size() == 0))
- generate_output_matrix(&TFBS, &SEQUENCE);
-
- else if((int)matrixfile.size() != 0 && !SHORT && (GENERATE_MATRIX || queryfile.size() == 0))
- {
- COMPLETE_MATRIX = false;
- promfile = matrixfile;
- generate_output_matrix(&TFBS, &SEQUENCE);
- }
-
- if(BINS)
- generate_output_bins(&TFBS, &SEQUENCE);
-
- cerr << endl;
-
- exit(EXIT_SUCCESS);
- }
-
- void display_help()
- {
- ifstream in("HELP.txt");
-
- if(!in)
- {
- cerr << "\nCan't find file: \"HELP.txt\" in this folder. Please check your installation." << endl;
- exit(1);
- }
-
- string line;
-
- while(getline(in,line))
- cerr << line << endl;
-
- in.close();
-
- /* cerr << endl << "SYNOPSIS" << endl
- << "\tpscan -q multifastafile -p multifastafile [options]" << endl
- << "\tpscan -p multifastafile [options]" << endl
- << "\tpscan -q multifastafile -M matrixfile [options]" << endl << endl
- << "OPTIONS" << endl
- << "\t[-q file] | Specify the multifasta file containing the foreground sequences." << endl << endl
- << "\t[-p file] | Specify the multifasta file containing the background sequences." << endl << endl
- << "\t[-m file] | Use it if the background data are already available in a file (see -g option)." << endl << endl
- << "\t[-M file] | Scan the foreground sequences using only the Jaspar/Transfac matrix file contained in the specified file." << endl << endl
- << "\t[-l file] | Use the matrices contained in the file (for matrix file format see below)." << endl << endl
- << "\t[-N name] | Use only the matrix with that name (usable only in association with -l)." << endl << endl
- << "\t[-ss] | Perform single strand only analysis." << endl << endl
- << "\t[-rs] | Perform single strand only analysis on the reverse strand." << endl << endl
- << "\t[-split num1 num2] | Sequences are scanned only from position num1 and for num2 nucleotides." << endl << endl
- << "\t[-trashn] | Discards sequences containing \"N\"." << endl << endl
- << "\t[-n] | Oligos containing \"N\" will not be discarded. Instead a \"N\" will obtain an \"average\" score." << endl << endl
- << "\t[-g] | If a background sequences file is used than a file will be written containing the data calculated" << endl <<
- "\t\tfor that background and the current set of matrices." << endl <<
- "\t\tFrom now on one can use that file (-m option) instead of the sequences file for faster calculations." << endl << endl
- << "\t[-ui file] | An index of the background file will be used to avoid duplicated sequences." << endl<< endl
- << "\t[-bi] | Build an index of the background sequences file (to be used later with the -ui option)." << endl <<
- "\t\tThis is useful when you have duplicated sequences in your background that may introduce a bias in your results." << endl << endl
- << "\t[-h] | Display this help." << endl << endl
- << "NOTES" << endl
- << "\tThe sequences to be used with Pscan have to be promoter sequences." << endl
- << "\tTo obtain meaningful results it's critical that the background and the foreground sequences are consistent between them either in size" << endl
- << "\tand in position (with respect to the transcription start site). For optimal results the foreground set should be a subset of the background set." << endl << endl
- << "\tIf the \"-l\" option is not used Pscan will try to find Jaspar/Transfac matrix files in the current folder." << endl
- << "\tJaspar files have \".pfm\" extension while Transfac ones have \".pro\" extension." << endl
- << "\tIf Jaspar matrix files are used than a file called \"matrix_list.txt\" must be present in the same folder." << endl
- << "\tThat file contains required info about the matrices in the \".pfm\" files." << endl << endl
- << "\tFor info on how Pscan works pleare refer to the paper." << endl << endl
- << "EXAMPLES" << endl << endl
- << "1)\tpscan -p human_450_50.fasta -bi" << endl << endl
- << "\tThis command will scan the file \"human_450_50.fasta\" using the matrices in the current folder." << endl
- << "\tIt is handy to use that command the first time one uses a set of matrices with a given background sequences file." << endl
- << "\tA file called human_450_50.short_matrix will be written and it can be used from now on every time you want to use" << endl
- << "\tthe same background sequences with the same set of matrices. A file called human_450_50.index will be written too" << endl
- << "\tand it will be useful every time you will use the same background file." << endl << endl
- << "2)\tpscan -q human_nfy_targets.fasta -m human_450_50.short_matrix -ui human_450_50.index" << endl << endl
- << "\tThis command will scan the file human_nfy_targets.fasta searching for over-represented binding sites (with respect" << endl
- << "\tto the preprocessed background contained in the \"human_450_50.short_matrix\" file) using the matrices in the current folder." << endl
- << "\tPlease note that the query file \"human_nfy_targets.fasta\" must be a subset of the sequences contained in the " << endl
- << "\tbackground file \"human_450_50.fasta\""
- << "\tin order to use the index file with the \"-ui\" option." << endl << "\tThis means that both the sequences and their FASTA headers used" << endl
- << "\tin the query file must appear"
- << "\tin the background file as well." << endl << "\tUsing the \"-ui\" option when the sequences contained in the query file are not a subset of" << endl
- << "\tthe background file will"
- << "have undefined/unpredictable outcomes."
- << "\tThe output will be a file called \"human_nfy_targets.fasta.res\" where you will find all the used matrices sorted by ascending P-value." << endl
- << "\tThe lower the P-value obtained by a matrix, the higher are the chances that the transcription factor associated to that matrix" << endl
- << "\tis a regulator of the input promoter sequences." << endl
- << "\tThe fields of the output are the following: \"Transcription Factor Name\", \"Matrix ID\", \"Z Score\", \"Pvalue\", \"Foreground Average\", \"Background Average\"." << endl << endl
- << "3)\tpscan -q human_nfy_targets.fasta -M MA0108.pfm" << endl << endl
- << "\tThis command will scan the sequences file \"human_nfy_targets.fasta\" using the matrix contained in \"MA0108.pfm\"." << endl
- << "\tThe result will be written in a file called \"human_nfy_targets.fasta.ris\" where you will find the sequences in input" << endl
- << "\tsorted by a descending score (between 1 and 0). The higher the score, the better is the oligo found with respect to the used matrix." << endl
- << "\tThe fields of the output are the following: \"Sequence Header\", \"Score\", \"Position from the end of sequence\", \"Oligo that obtained the score\"," << endl
- << "\tStrand where the oligo was found\"." << endl << endl
- << "4)\tpscan -p human_450_50.fasta -bi -l matrixfile.wil" << endl << endl
- << "\tThis command is like Example #1 with the difference that the matrices set to be used is the one contained in the \"matrixfile.wil\" file." << endl
- << "\tPlease look at the \"example_matrix_file.wil\" file included in this Pscan distribution to see the correct format for matrices file." << endl << endl
- << "5)\tpscan -q human_nfy_targets.fasta -l matrixfile.wil -N MATRIX1" << endl << endl
- << "\tThis command is like Example #3 but it will use the matrix called \"MATRIX1\" contained in the \"matrixfile.wil\" file." << endl << endl;
- */
- exit(1);
- }
-
- void command_line_parser(int argc, char **argv)
- {
- if(argc == 1)
- display_help();
-
- for(int i = 1; i < argc; i++)
- {
- string buf = argv[i];
-
- if(buf == "-q")
- {
- if(i < argc - 1)
- queryfile = argv[++i];
- continue;
- }
-
- if(buf == "-h")
- {
- display_help();
- continue;
- }
- /* if(buf == "-Q")
- {
- if(i < argc - 1)
- idfile = argv[++i];
- continue;
- }
- if(buf == "-d")
- {
- if(i < argc - 1)
- distance_analysis_matrix = argv[++i];
- continue;
- }
- */
- if(buf == "-ql")
- {
- if(i < argc - 1)
- q_idlist = argv[++i];
- continue;
- }
- /*
- if(buf == "-imgm")
- {
- if(i < argc - 1)
- bg_for_img = argv[++i];
- continue;
- }
- if(buf == "-magic")
- {
- if(i < argc - 1)
- magic = argv[++i];
- continue;
- }
- if(buf == "-track")
- {
- if(i < argc - 1)
- trackbg = argv[++i];
- continue;
- }*/
-
- else if(buf == "-p")
- {
- if(i < argc - 1)
- promfile = argv[++i];
- BIG_SEQ = false;
- continue;
- }
- /*
- else if(buf == "-P")
- {
- if(i < argc - 1)
- promfile = argv[++i];
- BIG_SEQ = true;
- // USE_N = true;
- continue;
- }
- else if(buf == "-chip")
- {
- i++;
- while(i < (argc))
- {
- buf = argv[i];
- if(buf[0] == '-')
- {
- i--;
- break;
- }
- else
- {
- chip_files.push_back(buf);
- i++;
- }
- }
-
- if(!chip_files.empty())
- CHIP = true;
- continue;
- }
- */
- else if(buf == "-m")
- {
- if(i < argc - 1)
- matrixfile = argv[++i];
- continue;
- }
- #ifdef BOUND_OLIGOS
- else if(buf == "-bo")
- {
- if(i < argc - 1)
- bound_oligos_file = argv[++i];
-
- continue;
- }
- #endif
-
- /* else if(buf == "-w2")
- {
- if(i < argc - 1)
- w2file = argv[++i];
- continue;
- }*/
- else if(buf == "-l")
- {
- if(i < argc - 1)
- fasta_matrix_file = argv[++i];
-
- continue;
- }
- else if(buf == "-ui")
- {
- if(i < argc - 1)
- index_file = argv[++i];
-
- continue;
- }
- else if(buf == "-M")
- {
- if(i < argc - 1)
- usethismatrix = argv[++i];
- continue;
- }
- else if(buf == "-N")
- {
- if(i < argc - 1)
- usethismatrixname = argv[++i];
- continue;
- }
- /*
- else if(buf == "-L")
- {
- if(i < argc - 1)
- matrixlist = argv[++i];
- continue;
- }*/
-
- /* else if(buf == "-start")
- {
- if(i < argc - 1)
- {
- SEQ_EDGE_START = atoi(argv[++i]);
- MIN_SEQ_LENGTH = SEQ_EDGE_START;
- }
- continue;
- }
- else if(buf == "-end")
- {
- if(i < argc - 1)
- {
- SEQ_EDGE_END = atoi(argv[++i]);
- MIN_SEQ_LENGTH = SEQ_EDGE_END;
- }
- continue;
- }
- else if(buf == "-min")
- {
- if(i < argc - 1)
- MIN_SEQ_LENGTH = atoi(argv[++i]);
- continue;
- }*/
- else if(buf == "-split")
- {
- if(i < argc - 2)
- {
- SPLIT[0] = atoi(argv[++i]);
- SPLIT[1] = atoi(argv[++i]);
- }
- continue;
- }
- /* else if(buf == "-w")
- {
- if(i < argc - 1)
- BIG_WINDOW = atoi(argv[++i]);
- continue;
- }
- else if(buf == "-step")
- {
- if(i< argc - 1)
- BIG_STEP = atoi(argv[++i]);
- continue;
- }
- else if(buf == "-probe")
- {
- if(i< argc - 1)
- PROBE = atoi(argv[++i]);
- continue;
- }
- else if(buf == "-tss")
- {
- if(i< argc - 1)
- TSS_POS = -atoi(argv[++i]);
- continue;
- }
- else if(buf == "-cut")
- {
- istringstream str;
- if(i< argc - 1)
- str.str(argv[++i]);
- str >> TRACK_CUTOFF;
- continue;
- }
- else if(buf == "-chip_cutoff")
- {
- istringstream str;
- if(i < argc - 1)
- str.str(argv[++i]);
- str >> CHIP_CUTOFF;
- }
- else if(buf == "-d_cutoff")
- {
- istringstream str;
- if(i < argc - 1)
- str.str(argv[++i]);
- str >> DISTANCE_CUTOFF;
- }
- else if(buf == "-v")
- {
- VERBOSE = true;
- continue;
- }*/
- else if(buf == "-bi")
- {
- BUILD_INDEX = true;
- continue;
- }
- /* else if(buf == "-drawbg")
- {
- DRAW_BACKGROUND = true;
- continue;
- }
- else if(buf == "-noheader")
- {
- NO_HEADER = true;
- continue;
- }
- else if(buf == "-cv")
- {
- SHOW_CONSERVATION_VECTOR = true;
- continue;
- }
- else if(buf == "-img")
- {
- IMG_OUTPUT = true;
- continue;
- }
- else if(buf == &
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。