Esempio n. 1
0
def confirm(config_section, config_value, mcode):
    str_conf = read_config(config_section, config_value)
    if not str_conf == '':
        if int(mcode == 33):
            if str_conf != "true":
                str_conf = "'Single-end'."
                mcode = 3
            else:
                str_conf = "'Paired-end'."
                mcode = 3
        outtxt = true_false_fields_config(str_conf)
        if outtxt == "":
            outtxt = str_conf
        print "The current status is: " + mcolor(outtxt)
        # it seems user configured before so asking again to re-config.
        answer = query_yes_no("Do you want to re-config this part?", None)
        if answer:
            return True
        else:
            message(mcode, "--> Keeping the default value.")
    else:
        print "Please config parameter ..."
        return True
Esempio n. 2
0
def show_config():
    print "\n" + "==" * 30
    print "Here is summary of configuration parameters: \n"
    print "- RAW files location: " + mcolor(
        read_config("GENERAL", "raw_dataset"))
    print "- Number and Size of the data-set: " + mcolor(read_config("GENERAL", "number_of_dataset"))\
          + " Files and Total size: " + mcolor(read_config("GENERAL", "dataset_size"))+" Gigabyte"
    print "- The directory of results: " + mcolor(
        read_config("GENERAL", "result_pipeline"))
    print "- Genome type: " + mcolor(read_config("GENERAL", "genome_type"))
    print "- Genome folder location: " + mcolor(
        read_config("GENERAL", "genome_ref"))
    print "     -- Genome Reference name: " + mcolor(
        read_config("GENERAL", "genome_name"))
    print "- Paired End: " + mcolor(
        true_false_fields_config(read_config("GENERAL", "pairs_mode")))
    print "- Trimmomatic location: " + mcolor(
        read_config("Trimmomatic", "trim_path"))
    print "     -- JAVA path: " + mcolor(
        read_config("Trimmomatic", "java_path"))
    print "     -- ILLUMINACLIP: " + mcolor(read_config("Trimmomatic", "name_adap"))\
          +":"+mcolor(read_config("Trimmomatic", "ill_clip"))

    print "     -- LEADING: " + mcolor(read_config("Trimmomatic", "LEADING"))
    print "     -- TRAILING: " + mcolor(read_config("Trimmomatic", "TRAILING"))
    print "     -- SLIDINGWINDOW: " + mcolor(
        read_config("Trimmomatic", "SLIDINGWINDOW"))
    print "     -- MINLEN: " + mcolor(read_config("Trimmomatic", "MINLEN"))
    print "     -- Number of Threads: " + mcolor(
        read_config("Trimmomatic", "n_th"))

    print "- QC-Fastq path: " + mcolor(read_config("GENERAL", "fastq_path"))
    print "- Bismark parameters: " + mcolor(
        read_config("Bismark", "bismark_path"))
    print "     -- Nucleotide status: " + mcolor(
        read_config("Bismark", "nucleotide"))
    print "     -- Number of Parallel: " + mcolor(
        read_config("Bismark", "bis_parallel")) + " Threads."
    print "     -- Buffer size: " + mcolor(read_config(
        "Bismark", "buf_size")) + " Gigabyte."
    print "     -- Samtools Path: " + mcolor(
        read_config("Bismark", "samtools_path"))
    print "     -- Intermediate for MethExtractor: " + mcolor(
        true_false_fields_config(read_config("Bismark", "intermediate_files")))
    print "- Methylation extraction parameters( Only for quick run)"
    print "     -- Minimum read coverage: " + mcolor(
        read_config("Methimpute", "mincov"))
    print "- Methimpute Part:"
    print "     -- Methimpute Intermediate : " + mcolor(
        true_false_fields_config(read_config("Methimpute", "intermediate")))
    if (read_config("Methimpute", "intermediate") == "true"):
        print "     -- Methimpute probability(Intermediate): " + mcolor(
            read_config("Methimpute", "intermediate_mode"))

    print "     -- Methimpute Fit reports: " + mcolor(
        true_false_fields_config(read_config("Methimpute", "fit_output")))
    print "     -- Methimpute Enrichment plots: " + mcolor(
        true_false_fields_config(read_config("Methimpute", "enrichment_plot")))
    print "     -- Methimpute Full report: " + mcolor(
        true_false_fields_config(read_config("Methimpute", "full_report")))
    print "     -- Methimpute Context: " + mcolor(
        read_config("Methimpute", "context_report"))
    print "- Parallel mode is: " + mcolor(
        true_false_fields_config(read_config("GENERAL", "parallel_mode")))
    if (read_config("GENERAL", "parallel_mode") == "true"):
        print "     -- Number of Parallel: " + mcolor(
            read_config("GENERAL", "npar")) + " Cores."
    print "- E-mail notification: " + mcolor(
        true_false_fields_config(read_config("EMAIL", "active")))
    if (read_config("EMAIL", "active") == "true"):
        print "     -- E-mail address: " + mcolor(
            read_config("EMAIL", "email_rec"))

    message(0, "...")