// -*- mode: c++; indent-tabs-mode: nil; -*- // // Copyright 2009 Illumina, Inc. // // This software is covered by the "Illumina Genome Analyzer Software // License Agreement" and the "Illumina Source Code License Agreement", // and certain third party copyright/licenses, and any user of this // source file is bound by the terms therein (see accompanying files // Illumina_Genome_Analyzer_Software_License_Agreement.pdf and // Illumina_Source_Code_License_Agreement.pdf and third party // copyright/license notices). // // /// \file /// \author Chris Saunders /// #ifndef __BLT_SHARED_HH #define __BLT_SHARED_HH #include "blt_util/blt_types.hh" #include "blt_util/pos_range.hh" #include "blt_util/seq_util.hh" #include extern const char STDIN_FILENAME[]; extern const int DEFAULT_MIN_QSCORE; extern const int DEFAULT_MIN_SINGLE_ALIGN_SCORE; extern const int DEFAULT_MIN_PAIRED_ALIGN_SCORE; extern const double DEFAULT_BACON_CALL_THRESH; extern const double DEFAULT_BACON_HET_SNP_RATIO_THRESH; extern const unsigned MAX_FLANK_SIZE; enum { MAX_READ_SIZE = 250 }; enum { MAX_READ_REF_DELETION_SIZE = 150 }; namespace LOG_LEVEL { enum index_t{ DEFAULT = 0, // 0 = errors and low-frequency warnings ALLWARN = 1 // all other warnings }; } struct blt_options { blt_options() : lsnp_alpha(0), bsnp_diploid_theta(0), bsnp_monoploid_theta(0), bsnp_nploid_ploidy(0), bsnp_nploid_snp_prob(0), bsnp_ssd_no_mismatch(0), bsnp_ssd_one_mismatch(0), adis_lrt_alpha(0), adis_table_alpha(0), adis_win_lrt_alpha(0), adis_win_lrt_flank_size(0), acov_alpha(0), is_lsnp(false), is_bsnp_diploid(false), is_bsnp_monoploid(false), is_bsnp_nploid(false), is_bsnp_diploid_file(false), is_bsnp_diploid_allele_file(false), is_bsnp_diploid_allele_print_empty(false), is_adis_lrt(false), is_adis_table(false), is_adis_win_lrt(false), is_acov(false), min_qscore(DEFAULT_MIN_QSCORE), min_single_align_score(DEFAULT_MIN_SINGLE_ALIGN_SCORE), min_paired_align_score(DEFAULT_MIN_PAIRED_ALIGN_SCORE), single_align_score_exclude_mode(false), single_align_score_rescue_mode(false), is_min_win_qscore(false), min_win_qscore(0), min_win_qscore_flank_size(0), is_max_win_mismatch(false), max_win_mismatch(0), max_win_mismatch_flank_size(0), is_counts(false), is_bacon_snp(false), is_bacon_allele(false), is_bacon_allele_print_empty(false), bacon_call_thresh(DEFAULT_BACON_CALL_THRESH), bacon_second_call_thresh(DEFAULT_BACON_CALL_THRESH), bacon_het_snp_ratio_thresh(DEFAULT_BACON_HET_SNP_RATIO_THRESH), is_print_evidence(false), is_print_all_site_evidence(false), is_read_sample(false), read_sample_rate(0), is_ref_set(false), is_filter_anom(false), is_include_singleton(false), is_include_anomalous(false), is_clobber(false), is_report_range_ref(false), is_print_all_poly_gt(false), is_print_used_allele_counts(false), max_basecall_filter_fraction(1.), max_vexp_iterations(0), is_min_vexp(false), min_vexp(0), verbosity(LOG_LEVEL::DEFAULT), is_write_variable_metadata(true) {} double lsnp_alpha; double bsnp_diploid_theta; double bsnp_monoploid_theta; int bsnp_nploid_ploidy; double bsnp_nploid_snp_prob; double bsnp_ssd_no_mismatch; double bsnp_ssd_one_mismatch; double adis_lrt_alpha; double adis_table_alpha; double adis_win_lrt_alpha; unsigned adis_win_lrt_flank_size; double acov_alpha; bool is_lsnp; bool is_bsnp_diploid; bool is_bsnp_monoploid; bool is_bsnp_nploid; bool is_bsnp_diploid_file; bool is_bsnp_diploid_allele_file; bool is_bsnp_diploid_allele_print_empty; bool is_adis_lrt; bool is_adis_table; bool is_adis_win_lrt; bool is_acov; int min_qscore; int min_single_align_score; int min_paired_align_score; bool single_align_score_exclude_mode; bool single_align_score_rescue_mode; bool is_min_win_qscore; int min_win_qscore; unsigned min_win_qscore_flank_size; bool is_max_win_mismatch; unsigned max_win_mismatch; unsigned max_win_mismatch_flank_size; bool is_counts; bool is_bacon_snp; bool is_bacon_allele; bool is_bacon_allele_print_empty; double bacon_call_thresh; double bacon_second_call_thresh; double bacon_het_snp_ratio_thresh; bool is_print_evidence; bool is_print_all_site_evidence; pos_range report_range; // requested report range bool is_read_sample; double read_sample_rate; bool is_ref_set; std::string ref_seq_file; bool is_filter_anom; bool is_include_singleton; bool is_include_anomalous; std::vector sorted_filenames; std::string counts_filename; std::string bacon_snp_filename; std::string bacon_allele_filename; std::string bsnp_diploid_filename; std::string bsnp_diploid_allele_filename; bool is_clobber; bool is_report_range_ref; bool is_print_all_poly_gt; // print the posterior probabilities for all genotypes bool is_print_used_allele_counts; // print allele counts as in CASAVA 1.7 output double max_basecall_filter_fraction; // if more than this fraction of basecalls are filtered out, than don't report the snp int max_vexp_iterations; bool is_min_vexp; double min_vexp; LOG_LEVEL::index_t verbosity; bool is_write_variable_metadata; }; // data deterministically derived from the input options: // struct blt_deriv_options { pos_range report_range_limit; // maximum report range }; void get_blt_deriv_options(const blt_options& client_opt, const pos_t ref_size, blt_deriv_options& client_dopt); struct blt_read_counts { blt_read_counts() : subsample_filter(0), primary_filter(0), duplicate(0), unmapped(0), large_ref_deletion(0), align_score_filter(0), used(0) {} void report(std::ostream& os) const; unsigned subsample_filter; unsigned primary_filter; unsigned duplicate; unsigned unmapped; unsigned large_ref_deletion; unsigned align_score_filter; unsigned used; }; #endif