RUBIC.smk 1.21 KB
Newer Older
1
from Rubic import MarkerFile, BedFile
2

3
rule make_marker_file_RUBIC:
4 5 6 7 8 9 10 11
    """Make marker file to use as input for RUBIC based on segmentation file (start, center and end positions of each segment)."""
    input:
        "Input/Segments_tumor.txt"
    output:
        "Input/Markers.txt"
    run:
        MarkerFile(input[0], output[0])

12
rule run_RUBIC:
13 14 15 16 17 18 19 20 21 22
    """Run RUBIC for the tumor segmentation data."""
    input:
        seg="Input/Segments_tumor.txt",
        markers="Input/Markers.txt"
    output:
        out_gains="RUBIC/gains.txt",
        out_losses="RUBIC/losses.txt",
        out_plots="RUBIC/plots"
    params:
        fdr="0.25",
23
        genefile=os.path.join(workflow.basedir, config["biomart_genes"]) if config["biomart_genes"].startswith("input_files") else config["biomart_genes"]
24 25 26 27
    benchmark:
        "Benchmarks/RUBIC." + str(datetime.datetime.now()).replace(" ", "_") + ".txt"
    wrapper:
        "file:" + workflow.basedir +"/wrappers/rubic"
28

29
rule make_bed_file_RUBIC:
30 31 32 33 34
    input:
        gains="RUBIC/gains.txt",
        losses="RUBIC/losses.txt"
    output:
        bed="RUBIC/regions_track.bed"
35 36
    params:
        ref=config["reference"]
37
    run:
38
        BedFile(input.gains, input.losses, output.bed, params.ref)