winnowmap/winnowmap_align
Description
Map long reads to a reference genome using Winnowmap, a long-read aligner
optimised for repetitive regions such as centromeres and segmental duplications.
Winnowmap extends the minimap2 framework with weighted minimizers, which
down-weight frequently occurring k-mers so that mappings in repeat-rich regions
are more accurate. K-mer frequencies are pre-computed with
meryl; if no pre-computed file is provided
this component will run meryl automatically, in which case --kmer_size must
be given (meryl has no default k, and winnowmap's -k has to match it).
By default the component outputs alignments in SAM format. Use --bam to
produce a coordinate-sorted, indexed BAM file; samtools is bundled in the
engine image, so no extra setup is needed.
Two winnowmap options are deliberately not exposed: -a (SAM output) is always
passed, which makes the PAF-only -c meaningless, and -d (dump index and
exit) is an index-building mode rather than an alignment mode.
Inputs
Name | Type & Properties | Description |
|---|---|---|
--reference | file required | Reference genome in FASTA format. Used both for k-mer frequency counting (meryl) and for read alignment (winnowmap). |
--query -q | file required | Query sequences in FASTQ or FASTA format. Compressed files (`.gz`) are supported. **Supported formats:** - FASTQ (`.fastq`, `.fq`, `.fastq.gz`, `.fq.gz`) - FASTA (`.fasta`, `.fa`, `.fasta.gz`, `.fa.gz`) |
--repetitive_kmers -W | file | Pre-computed repetitive k-mers file generated by `meryl`. If omitted, this component will run the following meryl commands automatically, and `--kmer_size` then becomes required: ```bash meryl count k=<kmer_size> output merylDB <reference> meryl print greater-than distinct=0.9998 merylDB > repetitive_kmers.txt ``` The `distinct=0.9998` threshold (top 0.02% most frequent k-mers) is the one prescribed by [Winnowmap's own documentation](https://github.com/marbl/Winnowmap#usage). Providing a pre-computed file avoids repeated meryl runs when aligning multiple query files against the same reference. |
Outputs
Name | Type & Properties | Description |
|---|---|---|
--bam | boolean_true | Output a coordinate-sorted and indexed BAM file instead of SAM. When enabled the component pipes winnowmap output through `samtools sort` and then runs `samtools index` to create a `.bai` index. `samtools` ships in the engine image, so this needs no extra setup. Use `--output_index` to control where the index is written. The output is written as BAM regardless of the `--output` file extension. |
--output -o | file required output | Path for the output alignment file. - SAM format (default): e.g. `alignment.sam` - BAM format (with `--bam`): e.g. `alignment.bam` |
--output_index | file output | Path for the BAM index. Only produced together with `--bam`; ignored otherwise. If omitted, the index is written next to `--output` as `<output>.bai`. Declaring it explicitly is what makes the index a tracked output, so it is published by the Nextflow runner instead of being left behind in the work directory. |
Preset
Name | Type & Properties | Description |
|---|---|---|
--preset -x | string | Alignment preset for the sequencing technology, passed to winnowmap `-x`. | Preset | Technology | |---|---| | `map-ont` | Oxford Nanopore genomic reads | | `map-pb` | PacBio HiFi / CCS genomic reads | | `map-pb-clr` | PacBio CLR genomic reads (sets `--sv-off`) | | `splice` | Long-read spliced alignment (sets `--sv-off`) | | `splice:hq` | PacBio CCS spliced alignment (sets `--sv-off`) | | `asm5` | Assembly-to-reference; ~0.1% divergence | | `asm10` | Assembly-to-reference; ~1% divergence | | `asm20` | Assembly-to-reference; ~5% divergence | Winnowmap's preset names are **not** identical to minimap2's: there is no `map-hifi` (HiFi reads use `map-pb`, which winnowmap's own help documents as "hifi-to-ref"), CLR reads use `map-pb-clr`, and there is no short-read `sr` preset. Like winnowmap itself, no preset is applied by default. The asm presets set their own k (19). Any option set explicitly on this component still wins over the preset's value for it, so `--kmer_size` stays in step with the `-W` k-mer list whichever preset is chosen. |
Indexing options
Name | Type & Properties | Description |
|---|---|---|
--kmer_size -k | integer | K-mer size, no larger than 28. Winnowmap's own default is 15. **Required when `--repetitive_kmers` is not given**: the component then builds the k-mer list with `meryl`, which needs an explicit k, and the same k is passed to winnowmap's `-k`. Winnowmap refuses to run when the `-W` list was built with a different k than it is using (`input list of k-mers and winnowmap parameter k are inconsistent`). When passing a pre-computed `--repetitive_kmers` file, set this to the k that file was built with. If left unset there, winnowmap applies its own default k and validates the list against it. |
--window_size -w | integer | Minimizer window size. Default is 50. |
--homopolymer_compressed -H | boolean_true | Use homopolymer-compressed k-mers. |
--split_index -I | string | Split the index for every ~NUM input bases. Default is `4G`. |
Mapping options
Name | Type & Properties | Description |
|---|---|---|
--filter_fraction -f | double | Filter out the top FLOAT (<1) fraction of repetitive minimizers. Default is 0.0, since winnowmap down-weights repetitive minimizers via `-W` rather than discarding them. |
--max_chain_gap -g | integer | Stop chain elongation if there are no minimizers within this many bp. Default is 5000. |
--max_intron_length -G | string | Maximum intron length, effective with `--preset splice`; changes `--bandwidth`. Default is `200k`. |
--max_fragment_length -F | string | Maximum fragment length in fragment mode. Default is `800`. |
--bandwidth -r | integer | Bandwidth used in chaining and DP-based alignment. Default is 500. |
--min_minimizers -n | integer | Minimal number of minimizers on a chain. Default is 3. |
--min_chaining_score -m | integer | Minimal chaining score, matching bases minus the log gap penalty. Default is 40. |
--skip_self_dual -X | boolean_true | Skip self and dual mappings, for the all-vs-all mode. |
--secondary_ratio -p | double | Minimal secondary-to-primary score ratio. Default is 0.8. |
--sv_off | boolean_true | Turn off SV-aware mode (`--sv-off`). Some presets set this themselves, see `--preset`. |
Alignment options
Name | Type & Properties | Description |
|---|---|---|
--match_score -A | integer | Matching score. Default is 2. |
--mismatch_penalty -B | integer | Mismatch penalty. Default is 4. |
--gap_open_penalty -O | string | Gap open penalty, as `INT` or `INT,INT` for the two-piece affine gap cost. Default is `4,24`. |
--gap_extension_penalty -E | string | Gap extension penalty, as `INT` or `INT,INT`. A k-long gap costs `min{O1+k*E1,O2+k*E2}`. Default is `2,1`. |
--zdrop -z | string | Z-drop score and inversion Z-drop score, as `INT` or `INT,INT`. Default is `400,200`. |
--min_peak_score -s | integer | Minimal peak DP alignment score. Default is 80. |
--splice_strand -u | string | How to find GT-AG splice sites. | Value | Meaning | |---|---| | `f` | Transcript strand | | `b` | Both strands | | `n` | Do not match GT-AG (default) | |
Input/output options
Name | Type & Properties | Description |
|---|---|---|
--read_group -R | string | SAM read group line, in a format like `'@RG\tID:foo\tSM:bar'`. Required by most downstream variant callers. |
--cigar_bam -L | boolean_true | Write CIGARs with more than 65535 operations to the `CG` tag. BAM's `n_cigar_op` field is 16 bit, so without this flag long reads spanning centromeric or segmental-duplication repeats can produce alignments that cannot be converted to BAM (`CIGAR has more than 65535 operations`). |
--md_tag | boolean_true | Output the `MD` tag (`--MD`). |
--cs_tag | string | Output the `cs` tag in the given form (`--cs`). Not emitted by default. |
--eqx | boolean_true | Write `=`/`X` CIGAR operators instead of `M` (`--eqx`). |
--soft_clipping -Y | boolean_true | Use soft clipping for supplementary alignments. |
--minibatch_size -K | string | Minibatch size for mapping. Default is `1000M`. |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
output: "$id.$key.output.sam"
output_index: "$id.$key.output_index.bai"
id: "run"
publish_dir: "output/"
EOM
nextflow run https://packages.viash-hub.com/vsh/biobox.git \
-revision v0.5.0 \
-main-script target/nextflow/winnowmap/winnowmap_align/main.nf \
-params-file params.yaml Relationships
Used by
No components use this component.
Current component
Uses
No component dependencies found.