Skip to content

Commit

Permalink
Merge pull request #89 from nf-core/wfmash_power_up
Browse files Browse the repository at this point in the history
 update wfmash for better short/medium sequence alignment
  • Loading branch information
subwaystation authored Sep 23, 2022
2 parents 4d94b22 + ae292d7 commit a9003c0
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 26 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ jobs:
# Remember that you can parallelise this by using strategy.matrix
# We also test basic visualization and reporting options here
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_mappings 11
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_mappings 11 --no_viz --no_layout
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_mappings 11 --smoothxg consensus_spec 10,100,1000
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_mappings 11 --vcf_spec "gi|568815561:#,gi|568815567:#"
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_mappings 11 --smoothxg_write_maf
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_mappings 11 --wfmash_chunks 2
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_mappings 11 --wfmash_only
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_haplotypes 12
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_haplotypes 12 --no_viz --no_layout
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_haplotypes 12 --smoothxg consensus_spec 10,100,1000
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_haplotypes 12 --vcf_spec "gi|568815561:#,gi|568815567:#"
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_haplotypes 12 --smoothxg_write_maf
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_haplotypes 12 --wfmash_chunks 2
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --n_haplotypes 12 --wfmash_only
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/pangenome/pggb:2022092217355879ede8
FROM ghcr.io/pangenome/pggb:20220923074038f629fc
LABEL authors="Simon Heumos, Michael Heuer, Lukas Heumos, Erik Garrison, Andrea Guarracino" \
description="Docker image containing all software requirements for the nf-core/pangenome pipeline"

Expand Down
14 changes: 7 additions & 7 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ if (params.input == null) {
exit 1
}

if (params.n_mappings == null) {
if (params.n_haplotypes == null) {
log.info"""
Mandatory argument --n_mappings missing! For more details run with --help.
Mandatory argument --n_haplotypes missing! For more details run with --help.
""".stripIndent()

Expand All @@ -42,8 +42,8 @@ ch_multiqc_config = file("$projectDir/assets/multiqc_config.yaml", checkIfExists

// We can't change global parameters inside this scope, so we build the ones we need locally
def n_haps = 0
if (!params.smoothxg_num_haps) {
n_haps = params.n_mappings
if (!params.smoothxg_haplotypes_smooth) {
n_haps = params.n_haplotypes
}

def wfmash_merge_cmd = params.wfmash_merge_segments ? "-M" : ""
Expand All @@ -52,7 +52,7 @@ def wfmash_split_cmd = params.wfmash_no_splits ? "-N" : ""
def wfmash_block_length_cmd = params.wfmash_block_length ? "-l${params.wfmash_block_length}" : ""
def wfmash_mash_kmer_cmd = params.wfmash_mash_kmer ? "-k${params.wfmash_mash_kmer}" : ""
def wfmash_kmer_thres_cmd = params.wfmash_mash_kmer_thres ? "-H${params.wfmash_kmer_thres}" : ""
def wfmash_n_mappings_minus_1 = params.n_mappings - 1
def wfmash_n_mappings_minus_1 = params.n_haplotypes - 1
def wfmash_sparse_map_cmd = ""
if (params.wfmash_sparse_map == "auto") {
n = n_haps
Expand Down Expand Up @@ -612,7 +612,7 @@ def helpMessage() {
Mandatory arguments:
--input [file] Path to bgzipped input FASTA (must be surrounded with quotes)
-- n_mappings [int] Number of mappings to retain for each segment.
-- n_haplotypes [int] Number of mappings to retain for each segment.
-profile [str] Configuration profile to use. Can use multiple (comma separated)
Available: conda, docker, singularity, test, awsbatch, <institute> and more
PAF options:
Expand All @@ -639,7 +639,7 @@ def helpMessage() {
--seqwish_temp_dir [str] directory for temporary files
Smoothxg options:
--smoothxg_num_haps [n] number of haplotypes in the given FASTA [default: wfmash_n_mappings]
--smoothxg_haplotypes-smooth [n]number of haplotypes if different than set with --n_haplotypes [default: n_haplotypes]
--smoothxg_max_path_jump [n] maximum path jump to include in block [default: 0]
--smoothxg_max_edge_jump [n] maximum edge jump before breaking [default: 0]
--smoothxg_poa_length [n] maximum sequence length to put into POA, can be a comma-separated list;
Expand Down
4 changes: 2 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ params {
// FASTA
input = null
// number of mappings
n_mappings = null // default could be the number of input sequences, but then I would have to add another process
n_haplotypes = null // default could be the number of input sequences, but then I would have to add another process

// Optional PAF input
paf = null
Expand Down Expand Up @@ -50,7 +50,7 @@ params {
seqwish_temp_dir = null

// Smoothxg options
smoothxg_num_haps = null
smoothxg_haplotypes_smooth = null
smoothxg_max_path_jump = 0
smoothxg_max_edge_jump = 0
smoothxg_poa_length = "700,900,1100"
Expand Down
17 changes: 8 additions & 9 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": "Define where the pipeline should find input data and save output data.",
"required": [
"input",
"n_mappings"
"n_haplotypes"
],
"properties": {
"input": {
Expand All @@ -21,10 +21,10 @@
"description": "Input FASTA file.",
"help_text": "Use this to specify the location of your input FASTA file. For example:\n\n```bash\n--input 'path/to/data/input.fa.gz'\n```\n\n."
},
"n_mappings": {
"type": "integer",
"fa_icon": "fas fa-dna",
"description": "Number of mappings to retain for each segment."
"n_haplotypes": {
"type": "string",
"default": null,
"fa_icon": "fas fa-dna"
},
"outdir": {
"type": "string",
Expand Down Expand Up @@ -148,10 +148,9 @@
"description": "Options for graph smoothing phase.",
"default": "",
"properties": {
"smoothxg_num_haps": {
"type": "integer",
"default": 0,
"description": "number of haplotypes in the given FASTA"
"smoothxg_haplotypes_smooth": {
"type": "string",
"default": null
},
"smoothxg_max_path_jump": {
"type": "integer",
Expand Down

0 comments on commit a9003c0

Please sign in to comment.