Skip to content

Commit

Permalink
dryrun passed
Browse files Browse the repository at this point in the history
  • Loading branch information
SilasK committed Jul 26, 2023
1 parent d96386b commit 25bebfb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions workflow/rules/cobinning.smk
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ def get_filtered_contigs_of_bingroup(wildcards):
}


def get_bams_of_bingroup(wildcards):

samples_of_group = get_samples_of_bingroup(wildcards)

return expand("Intermediate/cobinning/{bingroup}/bams/{sample}.sorted.bam", sample= samples_of_group)


rule combine_contigs:
Expand Down Expand Up @@ -161,7 +166,7 @@ rule sort_bam:

rule summarize_bam_contig_depths:
input:
bam=expand(rules.sort_bam.output, sample=SAMPLES),
bams= get_bams_of_bingroup,
output:
"Intermediate/cobinning/{bingroup}/coverage.jgi.tsv",
log:
Expand All @@ -174,7 +179,7 @@ rule summarize_bam_contig_depths:
shell:
"jgi_summarize_bam_contig_depths "
" --outputDepth {output} "
" {input.bam} &> {log} "
" {input.bams} &> {log} "


localrules:
Expand Down Expand Up @@ -233,7 +238,7 @@ localrules:

rule parse_vamb_output:
input:
expand(rules.run_vamb.output, bingroup = SampleTable.BinGroup.unique()),
expand(rules.run_vamb.output, bingroup = sampleTable.BinGroup.unique()),
output:
renamed_clusters="Intermediate/cobinning/vamb_clusters.tsv.gz",
cluster_atributions= expand(vamb_cluster_attribution_path, sample=SAMPLES),
Expand Down
6 changes: 3 additions & 3 deletions workflow/rules/semibin.smk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
rule semibin_generate_data_multi:
input:
fasta=rules.combine_contigs.output,
bams=lambda wc: expand(rules.sort_bam.output, sample= get_samples_of_bingroup(wc)),
bams=get_bams_of_bingroup,
output:
directory("Intermediate/cobinning/{bingroup}/semibin/data_multi")
# expand(
Expand Down Expand Up @@ -37,7 +37,7 @@ rule semibin_train:
input:
flag = "{sample}/{sample}_contigs.fasta",
fasta_sample = rules.filter_contigs.output,
bams= rules.semibin_generate_data_multi.input.bams,
bams= get_bams_of_bingroup,
data_folder= rules.semibin_generate_data_multi.output[0],
output:
"Intermediate/cobinning/{bingroup}/semibin/models/{sample}/model.h5",
Expand Down Expand Up @@ -97,7 +97,7 @@ rule run_semibin:
benchmark:
"logs/benchmarks/semibin/bin/{sample}.tsv"
params:
output_dir= lambda wc, output: os.path.dirname(output[0])
output_dir= lambda wc, output: os.path.dirname(output[0]),
data = lambda wc, input: Path(input.data_folder)/"samples"/wc.sample/"data.csv",
min_bin_kbs=int(config["cobining_min_bin_size"] / 1000),
extra=config["semibin_options"],
Expand Down

0 comments on commit 25bebfb

Please sign in to comment.