Skip to content

Commit

Permalink
add locus selection to rnaseq workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ggabernet committed Jul 17, 2024
1 parent 5e6e1a9 commit b8dc66e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,14 @@ process {
]
}

withName: CHANGEO_PARSEDB_SELECT_LOCUS {
publishDir = [
path: { "${params.outdir}/vdj_annotation/select-locus/${meta.id}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: CHANGEO_PARSEDB_SPLIT {
publishDir = [
path: { "${params.outdir}/vdj_annotation/04-select-productive/${meta.id}" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process CHANGEO_PARSEDB_SELECT {
process CHANGEO_PARSEDB_SELECT_LOCUS {
tag "$meta.id"
label 'process_low'
label 'immcantation'
Expand All @@ -18,25 +18,21 @@ process CHANGEO_PARSEDB_SELECT {
path "versions.yml" , emit: versions

script:
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
if (meta.locus.toUpperCase() == 'IG'){
"""
ParseDb.py select -d $tab $args --outname ${meta.id} > ${meta.id}_select_command_log.txt
ParseDb.py select -d $tab -f locus -u "IG[HKL]" --regex --outname ${meta.id} > ${meta.id}_select_command_log.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" )
changeo: \$( ParseDb.py --version | awk -F' ' '{print \$2}' )
END_VERSIONS
"""
} else if (meta.locus.toUpperCase() == 'TR'){
"""
ParseDb.py select -d $tab $args2 --outname ${meta.id} > "${meta.id}_command_log.txt"
ParseDb.py select -d $tab -f locus -u "TR[ABDG]" --regex --outname ${meta.id} > "${meta.id}_command_log.txt"
cat <<-END_VERSIONS > versions.yml
"${task.process}":
igblastn: \$( igblastn -version | grep -o "igblast[0-9\\. ]\\+" | grep -o "[0-9\\. ]\\+" )
changeo: \$( ParseDb.py --version | awk -F' ' '{print \$2}' )
END_VERSIONS
"""
Expand Down
6 changes: 5 additions & 1 deletion subworkflows/local/rnaseq_input.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include { PREPARE_TRUST4_REFERENCE } from '../../modules/local/prepare_trust4_reference'
include { TRUST4 } from '../../modules/nf-core/trust4/main'
include { FASTQ_INPUT_CHECK } from '../../subworkflows/local/fastq_input_check'
include { CHANGEO_PARSEDB_SELECT_LOCUS } from '../../modules/local/changeo/changeo_parsedb_select_locus'
include { CHANGEO_CONVERTDB_FASTA as CHANGEO_CONVERTDB_FASTA_FROM_AIRR } from '../../modules/local/changeo/changeo_convertdb_fasta'
include { FASTP } from '../../modules/nf-core/fastp/main'
include { RENAME_FASTQ as RENAME_FASTQ_TRUST4 } from '../../modules/local/rename_fastq'
Expand Down Expand Up @@ -106,10 +107,13 @@ workflow RNASEQ_INPUT {
// create channel with airr file
ch_trust4_airr_file.bulk.mix ( ch_trust4_airr_file.sc ).set { ch_trust4_airr }

// select only provided locus
CHANGEO_PARSEDB_SELECT_LOCUS(ch_trust4_airr)


// convert airr tsv to fasta
CHANGEO_CONVERTDB_FASTA_FROM_AIRR(
ch_trust4_airr
CHANGEO_PARSEDB_SELECT_LOCUS.out.tab
)

ch_fasta = CHANGEO_CONVERTDB_FASTA_FROM_AIRR.out.fasta
Expand Down

0 comments on commit b8dc66e

Please sign in to comment.