Skip to content

Commit

Permalink
implement maskprimers align umi
Browse files Browse the repository at this point in the history
  • Loading branch information
ggabernet committed Sep 27, 2024
1 parent b0afe90 commit 0432de0
Show file tree
Hide file tree
Showing 10 changed files with 179 additions and 57 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ jobs:
"test_nebnext_umi",
"test_rnaseq_bulk",
"test_rnaseq_sc",
"test_maskprimers_extract"
"test_maskprimers_extract",
"test_maskprimers_align",
]
fail-fast: false
steps:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- [#344](https://github.com/nf-core/airrflow/pull/344) Simplified pRESTO Maskprimers score and Maskprimers extract processes.
- [#344](https://github.com/nf-core/airrflow/pull/344) Fix clustersets approach, consider both reads clusters annotation.
- [#344](https://github.com/nf-core/airrflow/pull/344) Allow for partial alignments in MakeDB for mouse TCR data, to bypass junction check for TRAV germlines with additional positions (e.g. 84A).
- [#344](https://github.com/nf-core/airrflow/pull/344) Allow for maskprimers align with UMI on both V gene and C gene primers.

### `Dependencies`

Expand Down
2 changes: 1 addition & 1 deletion conf/clontech_umi_bcr.config
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ params {


// Mask primer options
maskprimers_align = true
maskprimers_align_race = true
primer_r2_extract_len = 7
primer_r1_mask_mode = 'cut'
primer_r2_mask_mode = 'cut'
Expand Down
2 changes: 1 addition & 1 deletion conf/clontech_umi_tcr.config
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ params {


// Mask primer options
maskprimers_align = true
maskprimers_align_race = true
primer_r2_extract_len = 7
primer_r1_mask_mode = 'cut'
primer_r2_mask_mode = 'cut'
Expand Down
9 changes: 4 additions & 5 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ process {
ext.args2 = '-f ID PRIMER ERROR'
}

withName: PRESTO_MASKPRIMERS_ALIGN {
withName: PRESTO_ALIGN_PRIMERS {
publishDir = [
path: { "${params.outdir}/presto/02-maskprimers/${meta.id}" },
mode: params.publish_dir_mode,
Expand Down Expand Up @@ -177,7 +177,7 @@ process {
ext.args2 = '-f ID PRIMER ERROR PRSTART'
}

withName: 'PRESTO_MASKPRIMERS_EXTRACT_R1' {
withName: 'PRESTO_MASKPRIMERS_ALIGN_UMI_R1' {
publishDir = [
path: { "${params.outdir}/presto/02-maskprimers/${meta.id}" },
mode: params.publish_dir_mode,
Expand All @@ -186,13 +186,12 @@ process {
ext.args2 = '-f ID PRIMER ERROR PRSTART'
}

withName: 'PRESTO_MASKPRIMERS_EXTRACT_R2' {
withName: 'PRESTO_MASKPRIMERS_ALIGN_UMI_R2' {
publishDir = [
path: { "${params.outdir}/presto/02-maskprimers/${meta.id}" },
mode: params.publish_dir_mode,
pattern: "*{txt,log,tab}"
]
ext.args = '--pf EXTRACT_PRIMER'
ext.args2 = '-f ID PRIMER ERROR PRSTART'
}

Expand Down Expand Up @@ -326,7 +325,7 @@ process {
ext.args3 = '-f ID BARCODE SEQCOUNT PRIMER PRCOUNT PRCONS PRFREQ CONSCOUNT ERROR'
}

withName: PRESTO_BUILDCONSENSUS_ALIGN {
withName: PRESTO_BUILDCONSENSUS_ALIGN_RACE {
publishDir = [
path: { "${params.outdir}/presto/06-build-consensus/${meta.id}" },
mode: params.publish_dir_mode,
Expand Down
39 changes: 39 additions & 0 deletions conf/test_maskprimers_align.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running minimal tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines input files and everything required to run a fast and simple pipeline test.
Use as follows:
nextflow run nf-core/airrflow -profile test_maskprimers_align,<docker/singularity> --outdir <OUTDIR>
----------------------------------------------------------------------------------------
*/

params {
config_profile_name = 'Test profile'
config_profile_description = 'Minimal test dataset to check pipeline function'

// Limit resources so that this can run on GitHub Actions
max_cpus = 2
max_memory = '6.GB'
max_time = '6.h'

// Input data
input = pipelines_testdata_base_path + 'testdata-bcr/Metadata_test_airr.tsv'
cprimers = pipelines_testdata_base_path + 'testdata-bcr/C_primers.fasta'
vprimers = pipelines_testdata_base_path + 'testdata-bcr/V_primers.fasta'
reference_fasta = pipelines_testdata_base_path + 'database-cache/imgtdb_base.zip'
reference_igblast = pipelines_testdata_base_path + 'database-cache/igblast_base.zip'

mode = 'fastq'

library_generation_method = 'specific_pcr_umi'
cprimer_position = 'R1'
umi_length = 8
umi_start = 6
umi_position = 'R1'
index_file = true
isotype_column = 'c_primer'
maskprimers_align = true
}
5 changes: 5 additions & 0 deletions modules/local/presto/presto_maskprimers_align.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ process PRESTO_MASKPRIMERS_ALIGN {
tuple val(meta), path(R1)
path(primers)
val(max_len)
val(barcode)
val(max_error)
val(mask_mode)
val(reverse_primers)
val(suffix)

output:
Expand All @@ -23,6 +25,8 @@ process PRESTO_MASKPRIMERS_ALIGN {
path "versions.yml" , emit: versions

script:
def barcode = barcode ? '--barcode' : ''
def revpr = reverse_primers ? '--revpr' : ''
def args = task.ext.args?: ''
def args2 = task.ext.args2?: ''
"""
Expand All @@ -32,6 +36,7 @@ process PRESTO_MASKPRIMERS_ALIGN {
--maxlen ${max_len} \\
--maxerror ${max_error} \\
--mode ${mask_mode} \\
$barcode \\
$args \\
--outname ${meta.id}_${suffix} \\
--log ${meta.id}_${suffix}.log > ${meta.id}_command_log_${suffix}.txt
Expand Down
2 changes: 2 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ params {
primer_r2_maxerror = 0.2
primer_r1_mask_mode = 'cut'
primer_r2_mask_mode = 'cut'
maskprimers_align_race = false
maskprimers_align = false
maskprimers_extract = false
primer_r1_extract_len = 0
Expand Down Expand Up @@ -315,6 +316,7 @@ profiles {
test_10x_sc { includeConfig 'conf/test_10x_sc.config' }
test_clontech_umi { includeConfig 'conf/test_clontech_umi.config' }
test_maskprimers_extract { includeConfig 'conf/test_maskprimers_extract.config' }
test_maskprimers_align {includeConfig 'conf/test_maskprimers_align.config' }
test_nebnext_umi { includeConfig 'conf/test_nebnext_umi.config' }
test_rnaseq_bulk { includeConfig 'conf/test_rnaseq_bulk.config' }
test_rnaseq_sc { includeConfig 'conf/test_rnaseq_sc.config' }
Expand Down
Loading

0 comments on commit 0432de0

Please sign in to comment.