Skip to content

Commit

Permalink
better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimens committed Jul 4, 2024
1 parent 457771a commit eafe4ac
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 44 deletions.
12 changes: 6 additions & 6 deletions src/harpy/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def align():
"options": ["--extra-params", "--genome", "--molecule-distance", "--quality-filter"],
},
{
"name": "Other Options",
"name": "Workflow Controls",
"options": ["--conda", "--depth-window", "--hpc", "--output-dir", "--quiet", "--skipreports", "--snakemake", "--threads", "--help"],
},
],
Expand All @@ -44,7 +44,7 @@ def align():
"options": ["--ema-bins", "--extra-params", "--genome", "--platform", "--quality-filter", "--whitelist"],
},
{
"name": "Other Options",
"name": "Workflow Controls",
"options": ["--conda", "--depth-window", "--hpc", "--output-dir", "--quiet", "--skipreports", "--snakemake", "--threads", "--help"],
},
],
Expand All @@ -54,7 +54,7 @@ def align():
"options": ["--extra-params", "--genome", "--molecule-distance", "--quality-filter", "--read-length"],
},
{
"name": "Other Options",
"name": "Workflow Controls",
"options": ["--conda", "--depth-window", "--hpc", "--output-dir", "--quiet", "--skipreports", "--snakemake", "--threads", "--help"],
},
]
Expand All @@ -70,7 +70,7 @@ def align():
@click.option('-q', '--quiet', is_flag = True, show_default = True, default = False, help = 'Don\'t show output text while running')
@click.option('-o', '--output-dir', type = click.Path(exists = False), default = "Align/bwa", show_default=True, help = 'Output directory name')
@click.option('--snakemake', type = str, help = 'Additional Snakemake parameters, in quotes')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission config.yaml file')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission `config.yaml` file')
@click.option('--conda', is_flag = True, default = False, help = 'Use conda/mamba instead of container')
@click.option('--skipreports', is_flag = True, show_default = True, default = False, help = 'Don\'t generate HTML reports')
@click.option('--config-only', is_flag = True, hidden = True, default = False, help = 'Create the config.yaml file and exit')
Expand Down Expand Up @@ -145,7 +145,7 @@ def bwa(inputs, output_dir, genome, depth_window, threads, extra_params, quality
@click.option('-q', '--quiet', is_flag = True, show_default = True, default = False, help = 'Don\'t show output text while running')
@click.option('-o', '--output-dir', type = click.Path(exists = False), default = "Align/ema", show_default=True, help = 'Output directory name')
@click.option('--snakemake', type = str, help = 'Additional Snakemake parameters, in quotes')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission config.yaml file')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission `config.yaml` file')
@click.option('--conda', is_flag = True, default = False, help = 'Use conda/mamba instead of container')
@click.option('--skipreports', is_flag = True, show_default = True, default = False, help = 'Don\'t generate HTML reports')
@click.option('--config-only', is_flag = True, hidden = True, default = False, help = 'Create the config.yaml file and exit')
Expand Down Expand Up @@ -237,7 +237,7 @@ def ema(inputs, output_dir, platform, whitelist, genome, depth_window, threads,
@click.option('-q', '--quiet', is_flag = True, show_default = True, default = False, help = 'Don\'t show output text while running')
@click.option('-o', '--output-dir', type = click.Path(exists = False), default = "Align/strobealign", show_default=True, help = 'Output directory name')
@click.option('--snakemake', type = str, help = 'Additional Snakemake parameters, in quotes')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission config.yaml file')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission `config.yaml` file')
@click.option('--conda', is_flag = True, default = False, help = 'Use conda/mamba instead of container')
@click.option('--skipreports', is_flag = True, show_default = True, default = False, help = 'Don\'t generate HTML reports')
@click.option('--config-only', is_flag = True, hidden = True, default = False, help = 'Create the config.yaml file and exit')
Expand Down
12 changes: 6 additions & 6 deletions src/harpy/deconvolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"options": ["--density", "--dropout", "--kmer-length", "--window-size"],
},
{
"name": "Other Options",
"name": "Workflow Controls",
"options": ["--conda", "--hpc", "--output-dir", "--quiet", "--snakemake", "--threads", "--help"],
},
]
Expand All @@ -27,24 +27,24 @@
@click.option('-k', '--kmer-length', default = 21, show_default = True, type=int, help = 'Size of kmers')
@click.option('-w', '--window-size', default = 40, show_default = True, type=int, help = 'Size of window guaranteed to contain at least one kmer')
@click.option('-d', '--density', default = 3, show_default = True, type = click.IntRange(min = 1, max_open = True), help = 'On average, 1/2^d kmers are indexed')
@click.option('-m', '--min-reads', default = 1, show_default = True, type = click.IntRange(min = 1, max_open = True), help = 'Minimum cloud size to deconvolve')
@click.option('-a', '--dropout', default = 0, show_default = True, type = click.IntRange(min = 0, max_open = True), help = 'Minimum cloud size to deconvolve')
@click.option('-t', '--threads', default = 4, show_default = True, type = click.IntRange(min = 1, max_open = True), help = 'Number of threads to use')
@click.option('-q', '--quiet', is_flag = True, show_default = True, default = False, help = 'Don\'t show output text while running')
@click.option('-o', '--output-dir', type = click.Path(exists = False), default = "Deconvolve", show_default=True, help = 'Output directory name')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission config.yaml file')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission `config.yaml` file')
@click.option('--conda', is_flag = True, default = False, help = 'Use conda/mamba instead of container')
@click.option('--snakemake', type = str, help = 'Additional Snakemake parameters, in quotes')
@click.option('--config-only', is_flag = True, hidden = True, show_default = True, default = False, help = 'Create the config.yaml file and exit')
@click.argument('inputs', required=True, type=click.Path(exists=True, readable=True), nargs=-1)
def deconvolve(inputs, output_dir, kmer_length, window_size, density, min_reads, threads, snakemake, quiet, hpc, conda, config_only):
def deconvolve(inputs, output_dir, kmer_length, window_size, density, dropout, threads, snakemake, quiet, hpc, conda, config_only):
"""
Resolve clashing barcodes from different molecules
Provide the input fastq files and/or directories at the end of the command
as individual files/folders, using shell wildcards (e.g. `data/acronotus*.fq`), or both.
The term "cloud" refers to the collection of all sequences that feature the same barcode. By default,
`dropout` is set to `1`, meaning it will consider all barcodes, even clouds with singleton.
`dropout` is set to `0`, meaning it will consider all barcodes, even clouds with singleton.
"""
output_dir = output_dir.rstrip("/")
workflowdir = f"{output_dir}/workflow"
Expand All @@ -69,7 +69,7 @@ def deconvolve(inputs, output_dir, kmer_length, window_size, density, min_reads,
config.write(f"kmer_length: {kmer_length}\n")
config.write(f"window_size: {window_size}\n")
config.write(f"density: {density}\n")
config.write(f"dropout: {min_reads - 1}\n")
config.write(f"dropout: {dropout}\n")
config.write(f"workflow_call: {command}\n")
config.write("inputs:\n")
for i in fqlist:
Expand Down
4 changes: 2 additions & 2 deletions src/harpy/demultiplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def demultiplex():
"options": ["--schema"],
},
{
"name": "Other Options",
"name": "Workflow Controls",
"options": ["--conda", "--hpc", "--output-dir", "--quiet", "--skipreports", "--snakemake", "--threads", "--help"],
},
]
Expand All @@ -42,7 +42,7 @@ def demultiplex():
@click.option('-q', '--quiet', is_flag = True, show_default = True, default = False, help = 'Don\'t show output text while running')
@click.option('-o', '--output-dir', type = click.Path(exists = False), default = "Demultiplex", show_default=True, help = 'Output directory name')
@click.option('--snakemake', type = str, help = 'Additional Snakemake parameters, in quotes')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission config.yaml file')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission `config.yaml` file')
@click.option('--conda', is_flag = True, default = False, help = 'Use conda/mamba instead of container')
@click.option('--skipreports', is_flag = True, show_default = True, default = False, help = 'Don\'t generate HTML reports')
@click.option('--config-only', is_flag = True, hidden = True, default = False, help = 'Create the config.yaml file and exit')
Expand Down
4 changes: 2 additions & 2 deletions src/harpy/impute.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"options": ["--extra-params", "--parameters", "--vcf", "--vcf-samples"],
},
{
"name": "Other Options",
"name": "Workflow Controls",
"options": ["--conda", "--hpc", "--output-dir", "--quiet", "--skipreports", "--snakemake", "--threads", "--help"],
},
]
Expand All @@ -33,7 +33,7 @@
@click.option('-q', '--quiet', is_flag = True, show_default = True, default = False, help = 'Don\'t show output text while running')
@click.option('-o', '--output-dir', type = click.Path(exists = False), default = "Impute", show_default=True, help = 'Output directory name')
@click.option('--snakemake', type = str, help = 'Additional Snakemake parameters, in quotes')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission config.yaml file')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission `config.yaml` file')
@click.option('--conda', is_flag = True, default = False, help = 'Use conda/mamba instead of container')
@click.option('--skipreports', is_flag = True, show_default = True, default = False, help = 'Don\'t generate HTML reports')
@click.option('--config-only', is_flag = True, hidden = True, default = False, help = 'Create the config.yaml file and exit')
Expand Down
4 changes: 2 additions & 2 deletions src/harpy/phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"options": ["--extra-params", "--genome", "--ignore-bx", "--molecule-distance", "--prune-threshold", "--vcf", "--vcf-samples"],
},
{
"name": "Other Options",
"name": "Workflow Controls",
"options": ["--conda", "--hpc", "--output-dir", "--quiet", "--skipreports", "--snakemake", "--threads", "--help"],
},
]
Expand All @@ -35,7 +35,7 @@
@click.option('-q', '--quiet', is_flag = True, show_default = True, default = False, help = 'Don\'t show output text while running')
@click.option('-o', '--output-dir', type = click.Path(exists = False), default = "Phase", show_default=True, help = 'Output directory name')
@click.option('--snakemake', type = str, help = 'Additional Snakemake parameters, in quotes')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission config.yaml file')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission `config.yaml` file')
@click.option('--conda', is_flag = True, default = False, help = 'Use conda/mamba instead of container')
@click.option('--skipreports', is_flag = True, show_default = True, default = False, help = 'Don\'t generate HTML reports')
@click.option('--config-only', is_flag = True, hidden = True, default = False, help = 'Create the config.yaml file and exit')
Expand Down
4 changes: 2 additions & 2 deletions src/harpy/preflight.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def preflight():
@click.option('-q', '--quiet', is_flag = True, show_default = True, default = False, help = 'Don\'t show output text while running')
@click.option('-o', '--output-dir', type = click.Path(exists = False), default = "Preflight/fastq", show_default=True, help = 'Output directory name')
@click.option('--snakemake', type = str, help = 'Additional Snakemake parameters, in quotes')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission config.yaml file')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission `config.yaml` file')
@click.option('--conda', is_flag = True, default = False, help = 'Use conda/mamba instead of container')
@click.option('--config-only', is_flag = True, hidden = True, default = False, help = 'Create the config.yaml file and exit')
@click.argument('inputs', required=True, type=click.Path(exists=True), nargs=-1)
Expand Down Expand Up @@ -97,7 +97,7 @@ def fastq(inputs, output_dir, threads, snakemake, quiet, hpc, conda, config_only
@click.option('-q', '--quiet', is_flag = True, show_default = True, default = False, help = 'Don\'t show output text while running')
@click.option('-o', '--output-dir', type = click.Path(exists = False), default = "Preflight/bam", show_default=True, help = 'Output directory name')
@click.option('--snakemake', type = str, help = 'Additional Snakemake parameters, in quotes')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission config.yaml file')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission `config.yaml` file')
@click.option('--conda', is_flag = True, default = False, help = 'Use conda/mamba instead of container')
@click.option('--config-only', is_flag = True, hidden = True, default = False, help = 'Create the config.yaml file and exit')
@click.argument('inputs', required=True, type=click.Path(exists=True, readable=True), nargs=-1)
Expand Down
13 changes: 7 additions & 6 deletions src/harpy/qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"options": ["--deconvolve", "--deconvolve-params", "--deduplicate", "--extra-params", "--min-length", "--max-length", "--trim-adapters"],
},
{
"name": "Other Options",
"name": "Workflow Controls",
"options": ["--conda", "--hpc", "--output-dir", "--quiet", "--skipreports", "--snakemake", "--threads", "--help"],
},
]
Expand All @@ -34,7 +34,7 @@
@click.option('-t', '--threads', default = 4, show_default = True, type = click.IntRange(min = 4, max_open = True), help = 'Number of threads to use')
@click.option('-q', '--quiet', is_flag = True, default = False, help = 'Don\'t show output text while running')
@click.option('-o', '--output-dir', type = click.Path(exists = False), default = "QC", show_default=True, help = 'Output directory name')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission config.yaml file')
@click.option('--hpc', type = click.Path(exists = True, file_okay = False, readable=True), help = 'Directory with HPC submission `config.yaml` file')
@click.option('--conda', is_flag = True, default = False, help = 'Use conda/mamba instead of container')
@click.option('--snakemake', type = str, help = 'Additional Snakemake parameters, in quotes')
@click.option('--skipreports', is_flag = True, default = False, help = 'Don\'t generate HTML reports')
Expand All @@ -47,13 +47,14 @@ def qc(inputs, output_dir, min_length, max_length, trim_adapters, deduplicate, d
Provide the input fastq files and/or directories at the end of the command
as individual files/folders, using shell wildcards (e.g. `data/acronotus*.fq`), or both.
By default, adapters will be automatically detected and removed (can be disabled with `-a`).
Use `--deconvolve` to resolve barcode clashing that may occur by unrelated sequences having the same barcode.
The parameters are described [here](https://github.com/RolandFaure/QuickDeconvolution?tab=readme-ov-file#usage). You
can also use the `harpy deconvolve` worklfow to perform this task separately.
The input reads will be quality trimmed using:
- a sliding window from front to tail
- poly-G tail removal
- use `-a` to automatically detect and remove adapters
- use `-d` to find and remove PCR duplicates
- use `-c` to resolve barcode clashing that may occur by unrelated sequences having the same barcode
- the parameters for `-p` are described [here](https://github.com/RolandFaure/QuickDeconvolution?tab=readme-ov-file#usage).
- you can use `harpy deconvolve` to perform this task separately
"""
output_dir = output_dir.rstrip("/")
workflowdir = f"{output_dir}/workflow"
Expand Down
Loading

0 comments on commit eafe4ac

Please sign in to comment.