Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add samtools to this container? #9

Open
byee4 opened this issue Dec 4, 2023 · 0 comments
Open

add samtools to this container? #9

byee4 opened this issue Dec 4, 2023 · 0 comments
Assignees

Comments

@byee4
Copy link
Member

byee4 commented Dec 4, 2023

https://github.com/YeoLab/containers/blob/88f550d6756fa2c99bfd166d65c3d5e26219147e/images/skipper/bedtools_2.31.0/Dockerfile#L25C33-L25C34

Can we add samtools to this Dockerfile and rebuild the container? We'll need it for this Skipper rule:

rule make_scaled_bigwig:
    input:
        CHROM_SIZES,
        bam = lambda wildcards: replicate_label_to_bams[wildcards.replicate_label],
    output:
        bg_plus = temp("output/bedgraphs/scaled/plus/{replicate_label}.scaled.plus.bg"),
        bg_minus = temp("output/bedgraphs/scaled/minus/{replicate_label}.scaled.minus.bg"),
        bw_plus = "output/bigwigs/scaled/plus/{replicate_label}.scaled.plus.bw",
        bw_minus = "output/bigwigs/scaled/minus/{replicate_label}.scaled.minus.bw",
    params:
        error_file = "stderr/{replicate_label}.make_bigwig.err",
        out_file = "stdout/{replicate_label}.make_bigwig.out",
        run_time = "40:00",
        memory = "1000",
        job_name = "make_bigwig"
    benchmark: "benchmarks/bigwigs/unassigned_experiment.{replicate_label}.make_bigwig.txt"
    container:
        "docker://howardxu520/skipper:bedtools_2.31.0"
    shell:
        "factor=$(samtools idxstats {input.bam} | awk '{{sum += $3}} END {{print 10**6 / sum}}');"
        "bedtools genomecov -scale $factor -split -strand + -bg -ibam {input.bam} | sort -k1,1 -k2,2n | grep -v EBV > {output.bg_plus};"
        "bedtools genomecov -scale $factor -split -strand - -bg -ibam {input.bam} | sort -k1,1 -k2,2n | grep -v EBV > {output.bg_minus};"
        "{TOOL_DIR}/bedGraphToBigWig {output.bg_plus} {CHROM_SIZES} {output.bw_plus};" 
        "{TOOL_DIR}/bedGraphToBigWig {output.bg_minus} {CHROM_SIZES} {output.bw_minus};"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants