Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions modules/local/UMICollapse/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
process UMICOLLAPSE {
tag "$meta.id"
label "process_high"

container 'elly1502/umicollapse:latest'

input:
tuple val(meta), path(bam), path(bai)

output:
tuple val(meta), path("*.bam") , emit: bam
tuple val(meta), path("*.log") , emit: log
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
java -jar /UMICollapse/umicollapse.jar \\
bam \\
-i $bam \\
-o ${prefix}.bam \\
$args

mv .command.log ${prefix}_UMICollapse.log

cat <<-END_VERSIONS > versions.yml
"${task.process}":
umicollapse: NA
END_VERSIONS
"""
}

Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: umitools_dedup
name: umicollapse
description: Deduplicate reads based on the mapping co-ordinate and the UMI attached to the read.
keywords:
- umitools
- umicollapse
- deduplication
tools:
- umi_tools:
- umicollapse:
description: >
UMI-tools contains tools for dealing with Unique Molecular Identifiers (UMIs)/Random Molecular Tags (RMTs)
and single cell RNA-Seq cell barcodes
documentation: https://umi-tools.readthedocs.io/en/latest/
UMICollapse contains tools for dealing with Unique Molecular Identifiers (UMIs)/Random Molecular Tags (RMTs).
documentation: https://github.com/Daniel-Liu-c0deb0t/UMICollapse
license: ["MIT"]
input:
- meta:
Expand Down Expand Up @@ -36,28 +35,11 @@ output:
type: file
description: BAM file with deduplicated UMIs.
pattern: "*.{bam}"
- tsv_edit_distance:
type: file
description: Reports the (binned) average edit distance between the UMIs at each position.
pattern: "*edit_distance.tsv"
- tsv_per_umi:
type: file
description: UMI-level summary statistics.
pattern: "*per_umi.tsv"
- tsv_umi_per_position:
type: file
description: Tabulates the counts for unique combinations of UMI and position.
pattern: "*per_position.tsv"
- log:
type: file
description: Log file
pattern: "*.log"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@drpatelh"
- "@grst"
- "@klkeys"
- "@Daniel-Liu-c0deb0t"
- "@CharlotteAnne"
11 changes: 6 additions & 5 deletions modules/local/clipqc/templates/clipqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,19 @@

with open(dedup_log, 'r') as logfile:

exp = re.sub('.log', '', os.path.basename(dedup_log))
exp = re.sub('_UMICollapse.log', '', os.path.basename(dedup_log))

lines = logfile.readlines()

input_reads = [i for i in lines if 'INFO Reads: Input Reads:' in i]
input_reads = [i for i in lines if 'Number of input reads' in i]
input_reads = int(re.findall(r'\\d+', input_reads[0])[-1])

output_reads = [i for i in lines if 'Number of reads out:' in i]
output_reads = [i for i in lines if 'Number of reads after deduplicating' in i]
output_reads = int(re.findall(r'\\d+', output_reads[0])[-1])

mean_umis = [i for i in lines if 'Mean number of unique UMIs per position:' in i]
mean_umis = float(re.findall(r'\\d+', mean_umis[0])[-1])
mean_umis = [i for i in lines if 'Average number of UMIs per alignment position' in i]
mean_umis = float(re.findall(r'\\d+\\.*\\d*', mean_umis[0])[-1])
mean_umis = np.round(mean_umis, 2)

dedup['exp'].append(exp)
dedup['input_reads'].append(input_reads)
Expand Down
20 changes: 0 additions & 20 deletions modules/local/du/main.nf

This file was deleted.

25 changes: 0 additions & 25 deletions modules/local/du/meta.yml

This file was deleted.

33 changes: 0 additions & 33 deletions modules/local/get_umi_length/main.nf

This file was deleted.

39 changes: 0 additions & 39 deletions modules/local/get_umi_length/meta.yml

This file was deleted.

41 changes: 0 additions & 41 deletions modules/local/umitools_dedup/main.nf

This file was deleted.

4 changes: 2 additions & 2 deletions subworkflows/clipqualitycheck.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ workflow CLIP_QUALITY_CHECK {
trimgalore_log
bowtie_align_log
star_align_log_final
umitools_dedup_log
umicollapse_log
crosslinks
icount_peaks
paraclu_peaks
Expand All @@ -26,7 +26,7 @@ workflow CLIP_QUALITY_CHECK {
CLIPQC (
bowtie_align_log.map(strip_meta).collect(),
star_align_log_final.map(strip_meta).collect(),
umitools_dedup_log.map(strip_meta).collect(),
umicollapse_log.map(strip_meta).collect(),
crosslinks.map(strip_meta).collect(),
icount_peaks.map(strip_meta).collect(),
paraclu_peaks.map(strip_meta).collect(),
Expand Down
14 changes: 5 additions & 9 deletions subworkflows/primaryclipanalysis.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
includeConfig '../conf/base.config'

def umi_separator = params.containsKey("umi_separator") ? params.umi_separator : "rbc"
def umi_separator = params.containsKey("umi_separator") ? params.umi_separator : "rbc:"

process {
withName: "TRIMGALORE" {
Expand All @@ -15,15 +15,11 @@ process {
ext.args = "--readFilesCommand zcat --outSAMtype BAM SortedByCoordinate --quantMode TranscriptomeSAM --outFilterMultimapNmax 1 --outFilterMultimapScoreRange 1 --outSAMattributes All --alignSJoverhangMin 8 --alignSJDBoverhangMin 1 --outFilterType BySJout --alignIntronMin 20 --alignIntronMax 1000000 --outFilterScoreMin 10 --alignEndsType Extend5pOfRead1 --twopassMode Basic"
}

withName: "UMITOOLS_DEDUP" {
ext.args = "--umi-separator='${umi_separator}:'"
withName: "UMICOLLAPSE" {
ext.args = "--umi-sep '${umi_separator}' --two-pass"
}

withName: "TOME_UMITOOLS_DEDUP" {
ext.args = "--umi-separator='${umi_separator}:'"
}

withName: "GET_UMI_LENGTH" {
ext.args = "${umi_separator}:"
withName: "TOME_UMICOLLAPSE" {
ext.args = "--umi-sep '${umi_separator}' --two-pass"
}
}
2 changes: 1 addition & 1 deletion subworkflows/primaryclipanalysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"format": "text",
"required": false,
"default": "rbc",
"description": "Separator used in UMI-tools Dedup."
"description": "Separator used in UMICollapse."
}
}
}
Expand Down
Loading