-
Notifications
You must be signed in to change notification settings - Fork 0
feat: workflow and config templates #29
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
Merged
ameynert
merged 24 commits into
am_feat_template_update
from
am_snakefile_and_config_templates
Mar 14, 2025
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
6e5e4d1
feat: template workflow and config/config_schema
ameynert c84ef78
feat: added development section to README
ameynert 412660b
feat: moved snakefile and config up a level, added config schema doc
ameynert 10a0725
feat: tweak config validation description
ameynert 1c5896c
feat: added input and output description suggestions to README
ameynert f491ad6
fix: extra character in code block
ameynert aa04242
feat: expand recommendations
ameynert 8563056
fix: typo
ameynert 6d87fa8
feat: expanded example Snakefile, use docstrings on rules
ameynert 09da155
chore: add error_summary.txt to .gitignore
ameynert b1f572b
feat: move guidelines to Notion page
ameynert dc42a5a
feat: use experiment in snakefile
ameynert 143663d
feat: add reference to config
ameynert a9e1e09
feat: warning for input description in README
ameynert 8be33e2
feat: update README with suggestions
ameynert 0c5b872
feat: use configfile directive
ameynert 155e171
feat: ran snakefmt linting
ameynert 00e10c7
feat: simplified instructions
ameynert ae8e224
feat: remove error_summary.txt, prematurely added
ameynert 5f55b34
feat: remove fgsmk function
ameynert daf3875
fix: README links
ameynert 38aaa91
feat: table code-formatting for field names
ameynert 82d7467
feat: clarified warning block
ameynert 6b2f0e6
feat: add input descriptions to README
ameynert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
################################################################################ | ||
# Pipeline for {{cookiecutter.project_slug}} | ||
################################################################################ | ||
|
||
from snakemake.utils import validate | ||
|
||
|
||
################################################################################ | ||
# Utility methods and variables | ||
################################################################################ | ||
|
||
|
||
configfile: workflow.basedir + "/config/config.yml" | ||
|
||
|
||
validate(config, workflow.basedir + "/config/config_schema.yml") | ||
|
||
|
||
################################################################################ | ||
# Snakemake rules | ||
################################################################################ | ||
|
||
EXPERIMENT = config["experiment"] | ||
SAMPLES = config["samples"] | ||
REFERENCE_URL = config["reference"] | ||
READS = ["1", "2"] | ||
BWA_INDEX_EXTS = [".amb", ".ann", ".bwt", ".pac", ".sa"] | ||
|
||
|
||
rule all: | ||
input: | ||
multiext("data/resources/ref.fa", *BWA_INDEX_EXTS), | ||
expand("data/raw/{EXPERIMENT}/{sample}_R{read}.fastq.gz", sample=SAMPLES, read=READS), | ||
|
||
|
||
rule download_raw_data: | ||
""" | ||
Downloads the raw reads for each sample. | ||
|
||
Output: | ||
reads: A gzip-compressed FASTQ file. | ||
""" | ||
output: | ||
reads="data/raw/{EXPERIMENT}/{sample}_R{read}.fastq.gz", | ||
log: | ||
"logs/download_raw_data.{sample}.R{read}.log", | ||
shell: | ||
""" | ||
( | ||
# wget -O {output.reads} https://to/data/{wildcards.sample}_R{wildcards.read}.fastq.gz | ||
touch {output.reads} | ||
) &> {log} | ||
""" | ||
|
||
|
||
rule index_reference_genome: | ||
""" | ||
Runs bwa indexing on the reference genome. | ||
|
||
Input: | ||
ref: The reference genome in FASTA format. | ||
|
||
Output: | ||
indexes: The BWA index files for the reference genome. | ||
""" | ||
input: | ||
ref="data/resources/ref.fa", | ||
output: | ||
indexes=multiext("data/resources/ref.fa", *BWA_INDEX_EXTS), | ||
log: | ||
"logs/index_reference_genome.log", | ||
shell: | ||
""" | ||
( | ||
# bwa index {input.ref} | ||
touch {output.indexes} | ||
) &> {log} | ||
""" | ||
|
||
ameynert marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
rule download_reference_genome: | ||
""" | ||
Downloads the reference genome FASTA file. | ||
|
||
Output: | ||
ref: The reference genome in FASTA format. | ||
""" | ||
params: | ||
ref_url=REFERENCE_URL, | ||
output: | ||
ref="data/resources/ref.fa", | ||
log: | ||
"logs/download_reference_genome.log", | ||
shell: | ||
""" | ||
( | ||
# wget -O {output.ref}.gz {params.ref_url} | ||
# gunzip {output.ref}.gz | ||
touch {output.ref} | ||
) &> {log} | ||
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
################################################################################ | ||
# Configuration file for {{cookiecutter.project_slug}} | ||
################################################################################ | ||
|
||
experiment: "experiment1" | ||
samples: ["sample1", "sample2"] | ||
reference: https://ftp.ensembl.org/pub/current_fasta/homo_sapiens/dna/Homo_sapiens.GRCh38.dna.toplevel.fa.gz | ||
ameynert marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
$schema: "https://json-schema.org/draft/2020-12/schema" | ||
description: Config schema for {{cookiecutter.project_slug}} | ||
|
||
type: object | ||
|
||
properties: | ||
experiment: | ||
type: string | ||
description: Name of the experiment. | ||
example: "{{cookiecutter.project_slug}}" | ||
|
||
reference: | ||
type: string | ||
description: URL to the reference genome FASTA. | ||
example: https://ftp.ensembl.org/pub/current_fasta/homo_sapiens/dna/Homo_sapiens.GRCh38.dna.toplevel.fa.gz | ||
|
||
samples: | ||
type: array | ||
description: List of sample identifiers. | ||
example: ["sample1", "sample2"] | ||
|
||
p_value_cutoff: | ||
type: number | ||
description: P-value cutoff for statistical significance. | ||
default: 0.05 | ||
|
||
required: | ||
- experiment | ||
- samples | ||
- reference |
Empty file.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.