Skip to content

Commit

Permalink
Follow the lead, Timmy
Browse files Browse the repository at this point in the history
  • Loading branch information
apeltzer committed Jan 11, 2024
1 parent cd69374 commit e1b232f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 107 deletions.
8 changes: 4 additions & 4 deletions subworkflows/local/umi_dedup.nf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//
//
// Deduplicate the UMI reads by mapping them to the complete genome.
//

include { INDEX_GENOME } from '../../modules/local/bowtie_genome'
include { BOWTIE_MAP_SEQ as UMI_MAP_GENOME } from '../../modules/local/bowtie_map_mirna'
include { BAM_SORT_SAMTOOLS } from '../../subworkflows/nf-core/bam_sort_samtools'
include { BAM_SORT_STATS_SAMTOOLS } from '../../subworkflows/nf-core/bam_sort_stats_samtools'
include { UMITOOLS_DEDUP } from '../../modules/nf-core/modules/umitools/dedup/main'
include { SAMTOOLS_BAM2FQ } from '../../modules/nf-core/modules/samtools/bam2fq/main'
include { CAT_CAT } from '../../modules/nf-core/modules/cat/cat/main'
Expand All @@ -31,7 +31,7 @@ workflow DEDUPLICATE_UMIS {
}

if (bt_index){

UMI_MAP_GENOME ( reads, bt_index.collect() )
ch_versions = ch_versions.mix(UMI_MAP_GENOME.out.versions)

Expand All @@ -54,7 +54,7 @@ workflow DEDUPLICATE_UMIS {
.join(UMI_MAP_GENOME.out.unmapped)
.map { meta, file1, file2 -> [meta, [file1, file2]]}
.set { ch_cat }

CAT_CAT ( ch_cat )
ch_dedup_reads = CAT_CAT.out.file_out
}
Expand Down
78 changes: 0 additions & 78 deletions subworkflows/nf-core/fastqc_umitools_trimgalore.nf

This file was deleted.

40 changes: 15 additions & 25 deletions workflows/smrnaseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ if (!params.mirgenedb) {
if (params.mirgenedb_gff) { mirna_gtf = file(params.mirgenedb_gff, checkIfExists: true) } else { exit 1, "MirGeneDB gff file not found: ${params.mirgenedb_gff}"}
}

include { INPUT_CHECK } from '../subworkflows/local/input_check'
include { FASTQC_UMITOOLS_FASTP } from '../subworkflows/nf-core/fastqc_umitools_trimgalore'
include { DEDUPLICATE_UMIS } from '../subworkflows/local/umi_dedup'
include { CONTAMINANT_FILTER } from '../subworkflows/local/contaminant_filter'
include { MIRNA_QUANT } from '../subworkflows/local/mirna_quant'
include { GENOME_QUANT } from '../subworkflows/local/genome_quant'
include { MIRTRACE } from '../subworkflows/local/mirtrace'
include { MIRDEEP2 } from '../subworkflows/local/mirdeep2'
include { INPUT_CHECK } from '../subworkflows/local/input_check'
include { FASTQ_FASTQC_UMITOOLS_FASTP } from '../subworkflows/nf-core/fastq_fastqc_umitools_fastp'
include { DEDUPLICATE_UMIS } from '../subworkflows/local/umi_dedup'
include { CONTAMINANT_FILTER } from '../subworkflows/local/contaminant_filter'
include { MIRNA_QUANT } from '../subworkflows/local/mirna_quant'
include { GENOME_QUANT } from '../subworkflows/local/genome_quant'
include { MIRTRACE } from '../subworkflows/local/mirtrace'
include { MIRDEEP2 } from '../subworkflows/local/mirdeep2'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -132,22 +132,19 @@ workflow SMRNASEQ {
ch_versions = ch_versions.mix(CAT_FASTQ.out.versions.first().ifEmpty(null))

//
// SUBWORKFLOW: Read QC and trim adapters
// SUBWORKFLOW: Read QC, extract UMI and trim adapters & dedup UMIs if necessary / desired by the user
//

//
// SUBWORKFLOW: Read QC, extract UMI and trim adapters
//
FASTQC_UMITOOLS_FASTP (
FASTQ_FASTQC_UMITOOLS_FASTP (
ch_cat_fastq,
params.skip_fastqc || params.skip_qc,
params.with_umi,
params.skip_trimming,
params.umi_discard_read
)
ch_versions = ch_versions.mix(FASTQC_UMITOOLS_FASTP.out.versions)
ch_versions = ch_versions.mix(FASTQ_FASTQC_UMITOOLS_FASTP.out.versions)

reads_for_mirna = FASTQC_UMITOOLS_FASTP.out.reads
reads_for_mirna = FASTQ_FASTQC_UMITOOLS_FASTP.out.reads

//
// SUBWORKFLOW: Deduplicate UMIs by mapping them to the genome
Expand All @@ -156,27 +153,20 @@ workflow SMRNASEQ {
if (fasta){
fasta_ch = file(fasta)
DEDUPLICATE_UMIS (
fasta_ch,
bt_index,
fasta_ch,
bt_index,
FASTQC_UMITOOLS_FASTP.out.reads
)
reads_for_mirna = DEDUPLICATE_UMIS.out.reads
ch_versions = ch_versions.mix(DEDUPLICATE_UMIS.out.versions)
}
}

FASTQC_UMITOOLS_FASTP (
ch_cat_fastq,
ch_fastp_adapters,
false,
false
)
ch_versions = ch_versions.mix(FASTQC_FASTP.out.versions)

//
// SUBWORKFLOW: mirtrace QC
//
FASTQC_FASTP.out.adapterseq
FASTQ_FASTQC_UMITOOLS_FASTP.out.adapterseq
.join( FASTQC_FASTP.out.reads )
.map { meta, adapterseq, reads -> [adapterseq, meta.id, reads] }
.groupTuple()
Expand Down

0 comments on commit e1b232f

Please sign in to comment.