Beispiel #1
0
def latex_bowtie(input, output, param):
    json_dict = json_load(input["json"])

    basic_map_table = []
    for sam in json_dict["stat"]:
        basic_map_table.append(
            [
                underline_to_space(sam),
                json_dict["stat"][sam]["total_reads"],
                json_dict["stat"][sam]["mappable_reads"],
                json_dict["stat"][sam]["mappable_rate"],
            ]
        )

    latex = JinjaTemplateCommand(
        name="mapping quality",
        template=input["template"],
        param={
            "section_name": "bowtie",
            "basic_map_table": basic_map_table,
            "mappable_ratio_graph": json_dict["output"]["pdf"],
            "render_dump": output["latex"],
        },
    )

    template_dump(latex)
Beispiel #2
0
def latex_venn(input, output, param):
    json_dict = json_load(input["json"])
    latex = JinjaTemplateCommand(
        name = "venn diagram latex",
        template = input["template"],
        param = {"section_name": "venn",
                 "venn_graph": json_dict["input"]["venn"],
                 "render_dump": output["latex"]})
    template_dump(latex)
Beispiel #3
0
def latex_cor(input, output, param):
    json_dict = json_load(input["json"])
    latex = JinjaTemplateCommand(
        name = "correlation",
        template = input["template"],
        param = {"section_name": "correlation",
                 "correlation_graph": json_dict["input"]["cor_pdf"],
                 "render_dump": output["latex"]})
    template_dump(latex)
Beispiel #4
0
def latex_macs2_on_sample(input, output, param):
    json_dict = json_load(input["json"])
    latex = JinjaTemplateCommand(
        name="redunRateQC",
        template=input["template"],
        param = {"section_name": "redundant",
                 "redundant_ratio_graph": json_dict["output"]["pdf"],
                 "render_dump": output["latex"]})

    template_dump(latex)
Beispiel #5
0
def latex_ceas(input, output, param):
    json_dict = json_load(input["json"])
    ceas_latex = JinjaTemplateCommand(
        name = "ceas redraw",
        template = input["template"],
        param = {"gene_distribution_graph": json_dict["output"]["metagene_dist_pdf"],
                 "section_name": "ceas",
                 "meta_gene_graph": json_dict["output"]["peakheight_and_pie_pdf"],
                 "render_dump" : output["latex"]})

    template_dump(ceas_latex)
Beispiel #6
0
def latex_seqpos(input, output, param):
    json_dict = json_load(input["json"])

    latex = JinjaTemplateCommand(
        name = "motif finding",
        template = input["template"],
        param = {"motif_table": json_dict["stat"]["satisfied_motifs"],
                 "section_name": "motif",
                 "render_dump": output["latex"]})

    template_dump(latex)
Beispiel #7
0
def latex_contamination(input, output, param):

    json_dict = json_load(input["json"])

    library_quality_latex = JinjaTemplateCommand(
        name="library contamination",
        template=input["template"],
        param={"section_name": "library_contamination",
               "library_contamination": json_dict["stat"],
               'prefix_dataset_id': json_dict["param"]['id'],
               "render_dump": output["latex"]
        })
    template_dump(library_quality_latex)
Beispiel #8
0
def latex_fastqc(input, output, param):
    json_dict = json_load(input["json"])

    fastqc_summary = []
    stat = json_dict["stat"]
    for sample in stat:
        fastqc_summary.append([underline_to_space(sample), stat[sample]["sequence_length"], stat[sample]["median"]])

    latex = JinjaTemplateCommand(
        template=input["template"],
        param={"section_name": "sequence_quality",
               "path": json_dict["output"]["pdf"],
               "fastqc_table": fastqc_summary,
               "fastqc_graph": json_dict["output"]["pdf"],
               'prefix_dataset_id': [ underline_to_space(i) for i in stat.keys() ],
               "render_dump": output["latex"]})
    template_dump(latex)
Beispiel #9
0
def latex_macs2(input, output, param):
    # TODO: qian work out the peaks_summary_result part


    json_dict = json_load(input["json"])

    summary = [underline_to_space(json_dict["param"]["id"]),
               json_dict["stat"]["qvalue"],
               json_dict["stat"]["totalpeak"],
               json_dict["stat"]["peaksge10"],
               json_dict["stat"]["shiftsize"]]

    high_confident_latex = JinjaTemplateCommand(
        name = "high confident latex",
        template = input["template"],
        param = {"section_name": "high_confident_peaks",
                 "peak_summary_table": summary,
                 "high_confident_peak_graph": json_dict["output"]["pdf"],
                 "render_dump": output["latex"]})

    template_dump(high_confident_latex)
Beispiel #10
0
def _s(json_path):
    return json_load(json_path)["stat"]
Beispiel #11
0
def _items(json_path):
    return json_load(json_path)["stat"].items()