Skip to content

Commit

Permalink
Add get_peak_files function to retrieve peak files based on assay type
Browse files Browse the repository at this point in the history
  • Loading branch information
alsmith151 committed Feb 5, 2024
1 parent 00634af commit 5ebfd2f
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions seqnado/workflow/rules/hub.smk
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,30 @@ def get_hub_input(wildcards):
return input_files


def get_peak_files(wildcards):
peak_files = []

if config["call_peaks"]:
if ASSAY == "ChIP":
peak_files.extend(
expand(
"seqnado_output/peaks/{method}/{sample}.bed",
method=config["peak_calling_method"],
sample=SAMPLE_NAMES_IP,
)
)
elif ASSAY == "ATAC":
peak_files.extend(
expand(
"seqnado_output/peaks/{method}/{sample}.bed",
method=config["peak_calling_method"],
sample=SAMPLE_NAMES,
)
)

return peak_files


rule save_design:
output:
"seqnado_output/design.csv",
Expand All @@ -104,11 +128,7 @@ rule save_design:

rule validate_peaks:
input:
peaks=expand(
"seqnado_output/peaks/{method}/{sample}.bed",
method=config["peak_calling_method"],
sample=SAMPLE_NAMES,
),
get_peak_files,
output:
sentinel="seqnado_output/peaks/.validated",
container:
Expand Down

0 comments on commit 5ebfd2f

Please sign in to comment.