Skip to content

Commit

Permalink
Add a --dotplot_filter option to remove isolated alignments.
Browse files Browse the repository at this point in the history
Closes nf-core#35
  • Loading branch information
charles-plessy committed Feb 5, 2025
1 parent 228778f commit 6e403ed
Show file tree
Hide file tree
Showing 9 changed files with 190 additions and 28 deletions.
16 changes: 16 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@ process {
ext.prefix = { "${meta.id}.m2m_plt" }
}

withName: 'ALIGNMENT_DOTPLOT_O2O_F' {
ext.prefix = { "${meta.id}.o2o_plt_filtered" }
}

withName: 'ALIGNMENT_DOTPLOT_M2O_F' {
ext.prefix = { "${meta.id}.m2o_plt_filtered" }
}

withName: 'ALIGNMENT_DOTPLOT_O2M_F' {
ext.prefix = { "${meta.id}.o2m_plt_filtered" }
}

withName: 'ALIGNMENT_DOTPLOT_M2M_F' {
ext.prefix = { "${meta.id}.m2m_plt_filtered" }
}

withName: 'MULTIQC' {
ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' }
publishDir = [
Expand Down
6 changes: 5 additions & 1 deletion modules/nf-core/last/dotplot/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions modules/nf-core/last/dotplot/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions modules/nf-core/last/dotplot/tests/main.nf.test

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions modules/nf-core/last/dotplot/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ params {
skip_dotplot_o2m = false
skip_dotplot_o2o = false
dotplot_font_size = 14 // last-dotplot default
dotplot_filter = false
dotplot_height = 10000 // To allow scaling according to target genome
dotplot_options = ''
dotplot_width = 1000 // last-dotplot default
Expand Down
16 changes: 11 additions & 5 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,24 @@
"description": "Customise dot-plots or skip them.",
"default": "",
"properties": {
"dotplot_width": {
"type": "integer",
"default": 1000,
"description": "Maximum width of the dot plots, in pixels.",
"fa_icon": "fas fa-arrows-alt-h"
"dotplot_filter": {
"type": "boolean",
"description": "Remove isolated alignments with the `maf-filter` tool.",
"help_text": "The filter often removes noise in the plots, but in some cases can also remove too much alignments. Be careful when interpreting the results.",
"fa_icon": "fas fa-filter"
},
"dotplot_font_size": {
"type": "integer",
"default": 14,
"description": "Font size of the sequence names on the dot plots.",
"fa_icon": "fas fa-text-width"
},
"dotplot_width": {
"type": "integer",
"default": 1000,
"description": "Maximum width of the dot plots, in pixels.",
"fa_icon": "fas fa-arrows-alt-h"
},
"dotplot_height": {
"type": "integer",
"default": 10000,
Expand Down
68 changes: 54 additions & 14 deletions subworkflows/local/pairalign_m2m/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_M2O } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_M2M } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_O2O } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_O2M } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_LASTAL as ALIGNMENT_LASTAL_M2M } from '../../../modules/nf-core/last/lastal/main'
include { LAST_LASTDB as ALIGNMENT_LASTDB } from '../../../modules/nf-core/last/lastdb/main'
include { LAST_SPLIT as ALIGNMENT_SPLIT_M2O } from '../../../modules/nf-core/last/split/main'
include { LAST_SPLIT as ALIGNMENT_SPLIT_O2O } from '../../../modules/nf-core/last/split/main'
include { LAST_SPLIT as ALIGNMENT_SPLIT_O2M } from '../../../modules/nf-core/last/split/main'
include { LAST_TRAIN as ALIGNMENT_TRAIN } from '../../../modules/nf-core/last/train/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_M2O } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_M2M } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_O2O } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_O2M } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_M2O_F } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_M2M_F } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_O2O_F } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_O2M_F } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_LASTAL as ALIGNMENT_LASTAL_M2M } from '../../../modules/nf-core/last/lastal/main'
include { LAST_LASTDB as ALIGNMENT_LASTDB } from '../../../modules/nf-core/last/lastdb/main'
include { LAST_SPLIT as ALIGNMENT_SPLIT_M2O } from '../../../modules/nf-core/last/split/main'
include { LAST_SPLIT as ALIGNMENT_SPLIT_O2O } from '../../../modules/nf-core/last/split/main'
include { LAST_SPLIT as ALIGNMENT_SPLIT_O2M } from '../../../modules/nf-core/last/split/main'
include { LAST_TRAIN as ALIGNMENT_TRAIN } from '../../../modules/nf-core/last/train/main'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -64,8 +68,17 @@ workflow PAIRALIGN_M2M {
ALIGNMENT_DOTPLOT_M2M (
ALIGNMENT_LASTAL_M2M.out.maf.join(ch_queries_bed),
ch_target_bed,
'png'
'png',
false
)
if ( params.dotplot_filter ) {
ALIGNMENT_DOTPLOT_M2M_F (
ALIGNMENT_LASTAL_M2M.out.maf.join(ch_queries_bed),
ch_target_bed,
'png',
true
)
}
}

// Compute the one-to-many alignment and optionally plot it
Expand All @@ -77,8 +90,17 @@ workflow PAIRALIGN_M2M {
ALIGNMENT_DOTPLOT_O2M (
ALIGNMENT_SPLIT_O2M.out.maf.join(ch_queries_bed),
ch_target_bed,
'png'
'png',
false
)
if ( params.dotplot_filter ) {
ALIGNMENT_DOTPLOT_O2M_F (
ALIGNMENT_SPLIT_O2M.out.maf.join(ch_queries_bed),
ch_target_bed,
'png',
true
)
}
}

// Compute the many-to-one alignment and optionally plot it
Expand All @@ -90,8 +112,17 @@ workflow PAIRALIGN_M2M {
ALIGNMENT_DOTPLOT_M2O (
ALIGNMENT_SPLIT_M2O.out.maf.join(ch_queries_bed),
ch_target_bed,
'png'
'png',
false
)
if ( params.dotplot_filter ) {
ALIGNMENT_DOTPLOT_M2O_F (
ALIGNMENT_SPLIT_M2O.out.maf.join(ch_queries_bed),
ch_target_bed,
'png',
true
)
}
}

// Compute the one-to-one alignment and optionally plot it
Expand All @@ -103,8 +134,17 @@ workflow PAIRALIGN_M2M {
ALIGNMENT_DOTPLOT_O2O (
ALIGNMENT_SPLIT_O2O.out.maf.join(ch_queries_bed),
ch_target_bed,
'png'
'png',
false
)
if ( params.dotplot_filter ) {
ALIGNMENT_DOTPLOT_O2O_F (
ALIGNMENT_SPLIT_O2O.out.maf.join(ch_queries_bed),
ch_target_bed,
'png',
true
)
}
}

emit:
Expand Down
36 changes: 28 additions & 8 deletions subworkflows/local/pairalign_m2o/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_M2O } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_O2O } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_LASTAL as ALIGNMENT_LASTAL_M2O } from '../../../modules/nf-core/last/lastal/main'
include { LAST_LASTDB as ALIGNMENT_LASTDB } from '../../../modules/nf-core/last/lastdb/main'
include { LAST_SPLIT as ALIGNMENT_SPLIT_O2O } from '../../../modules/nf-core/last/split/main'
include { LAST_TRAIN as ALIGNMENT_TRAIN } from '../../../modules/nf-core/last/train/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_M2O } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_M2O_F } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_O2O } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_O2O_F } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_LASTAL as ALIGNMENT_LASTAL_M2O } from '../../../modules/nf-core/last/lastal/main'
include { LAST_LASTDB as ALIGNMENT_LASTDB } from '../../../modules/nf-core/last/lastdb/main'
include { LAST_SPLIT as ALIGNMENT_SPLIT_O2O } from '../../../modules/nf-core/last/split/main'
include { LAST_TRAIN as ALIGNMENT_TRAIN } from '../../../modules/nf-core/last/train/main'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -61,8 +63,17 @@ workflow PAIRALIGN_M2O {
ALIGNMENT_DOTPLOT_M2O (
ALIGNMENT_LASTAL_M2O.out.maf.join(ch_queries_bed),
ch_target_bed,
'png'
'png',
false
)
if ( params.dotplot_filter ) {
ALIGNMENT_DOTPLOT_M2O_F (
ALIGNMENT_LASTAL_M2O.out.maf.join(ch_queries_bed),
ch_target_bed,
'png',
true
)
}
}

// Compute the one-to-one alignment and optionally plot it
Expand All @@ -74,8 +85,17 @@ workflow PAIRALIGN_M2O {
ALIGNMENT_DOTPLOT_O2O (
ALIGNMENT_SPLIT_O2O.out.maf.join(ch_queries_bed),
ch_target_bed,
'png'
'png',
false
)
if (params.dotplot_filter) {
ALIGNMENT_DOTPLOT_O2O_F (
ALIGNMENT_SPLIT_O2O.out.maf.join(ch_queries_bed),
ch_target_bed,
'png',
true
)
}
}

emit:
Expand Down

0 comments on commit 6e403ed

Please sign in to comment.