Skip to content

Commit

Permalink
Merge branch 'dev' into simonleandergrimm-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
harmonbhasin authored Jan 13, 2025
2 parents 215281a + a07746e commit eb3fa31
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 47 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v2.6.1.0
- Replace Trimmomatic with Atria

# v2.6.0.0
- Updated verison to reflect the new versioning scheme, which is described in `docs/version_schema.md`.

# v2.5.3
- Added new LOAD_SAMPLESHEET subworkflow to centralize samplesheet processing
- Updated tags to prevent inappropriate S3 auto-cleanup
Expand Down
3 changes: 3 additions & 0 deletions configs/containers.config
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,7 @@ process {
withLabel: fastp {
container = "staphb/fastp:0.23.4"
}
withLabel: atria {
container = "harmonb/atria:latest"
}
}
50 changes: 50 additions & 0 deletions docker/atria.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Use Ubuntu as the base image
FROM ubuntu:22.04

# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive

# Install essential dependencies, R, and system libraries needed for R packages
RUN apt-get update && apt-get install -y \
wget \
pigz \
pbzip2 \
r-base \
r-base-dev \
libcurl4-openssl-dev \
libssl-dev \
libxml2-dev \
libfontconfig1-dev \
libharfbuzz-dev \
libfribidi-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev \
libcairo2-dev \
&& rm -rf /var/lib/apt/lists/*

# Install pacman first, then use it to install other packages
RUN R -e "install.packages('pacman', repos='https://cran.rstudio.com/')" && \
R -e "pacman::p_load(argparse, plotly, ggsci, tidyverse)"

# Set working directory
WORKDIR /opt

# Install Atria
RUN wget https://github.com/cihga39871/Atria/releases/download/v4.1.0/atria-4.1.0-linux-ubuntu22.tar.gz && \
tar -zxf atria-4.1.0-linux-ubuntu22.tar.gz && \
rm atria-4.1.0-linux-ubuntu22.tar.gz

# Create symbolic link
RUN chmod +x /opt/atria-4.1.0/bin/atria && \
ln -s /opt/atria-4.1.0/bin/atria /usr/local/bin/atria

# Set environment variables
ENV PATH="/usr/local/bin:/opt/atria-4.1.0/bin:$PATH"

# Verify installations
RUN which atria && \
atria --version && \
Rscript --version && \
R -e "pacman::p_loaded()"
16 changes: 16 additions & 0 deletions modules/local/atria/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
process ATRIA {
label "atria"
label "large"
input:
// reads is a list of two files: forward/reverse reads
tuple val(sample), path(reads)
val(adapters_ch)
output:
tuple val(sample), path("*{1,2}.atria.fastq.gz"), emit: reads
shell:
'''
par="--adapter1 !{adapters_ch.join(' ')} --adapter2 !{adapters_ch.join(' ')} --kmer-tolerance 2 --kmer-n-match 9 --trim-score-pe 10.0 --quality-kmer 4 --quality-score 15 --length-range 20:999999 --no-consensus"
in="--read1 !{reads[0]} --read2 !{reads[1]}"
atria ${par} ${in}
'''
}
38 changes: 0 additions & 38 deletions modules/local/trimmomatic/main.nf

This file was deleted.

16 changes: 13 additions & 3 deletions subworkflows/local/extractViralReads/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

include { BBDUK_HITS } from "../../../modules/local/bbduk"
include { CUTADAPT } from "../../../modules/local/cutadapt"
include { TRIMMOMATIC } from "../../../modules/local/trimmomatic"
include { ATRIA } from "../../../modules/local/atria"
include { BOWTIE2 as BOWTIE2_VIRUS } from "../../../modules/local/bowtie2"
include { BOWTIE2 as BOWTIE2_HUMAN } from "../../../modules/local/bowtie2"
include { BOWTIE2 as BOWTIE2_OTHER } from "../../../modules/local/bowtie2"
Expand Down Expand Up @@ -63,11 +63,21 @@ workflow EXTRACT_VIRAL_READS {
bbm_human_index_path = "${ref_dir}/results/bbm-human-index"
bbm_other_index_path = "${ref_dir}/results/bbm-other-index"
virus_db_path = "${ref_dir}/results/total-virus-db-annotated.tsv.gz"
// Run initial screen against viral genomes with BBDuk

// Read adapter file and create a channel containing just the adapter sequences
adapters_ch = Channel
.fromPath(adapter_path)
.splitFasta(record: [seqString: true])
.map { it.seqString }
.collect()

// Run initial screen against viral genomes with BBDuk
bbduk_ch = BBDUK_HITS(reads_ch, viral_genome_path, min_kmer_hits, k, bbduk_suffix)
// Carry out stringent adapter removal with Cutadapt and Trimmomatic
adapt_ch = CUTADAPT(bbduk_ch.fail, adapter_path)
trim_ch = TRIMMOMATIC(adapt_ch.reads, adapter_path, encoding)
// trim_ch = TRIMMOMATIC(adapt_ch.reads, adapter_path, encoding)
atria_ch = ATRIA(adapt_ch.reads, adapters_ch)
trim_ch = atria_ch
// Grouping for deduplication
if (grouping) {
// Join samplesheet with trimmed_reads and update fastq files
Expand Down
Binary file modified test-data/gold-standard-results/blast_hits_paired.tsv.gz
Binary file not shown.
Binary file modified test-data/gold-standard-results/virus_clade_counts.tsv.gz
Binary file not shown.
Binary file modified test-data/gold-standard-results/virus_hits_1.fasta.gz
Binary file not shown.
Binary file modified test-data/gold-standard-results/virus_hits_2.fasta.gz
Binary file not shown.
Binary file modified test-data/gold-standard-results/virus_hits_db.tsv.gz
Binary file not shown.
12 changes: 6 additions & 6 deletions tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
"qc_basic_stats.tsv.gz:md5,fd1a20ad7bb06eecaaa9cc51b81efa8d",
"qc_quality_base_stats.tsv.gz:md5,1e75fe721479280f83d7e2f8c9fa975b",
"qc_quality_sequence_stats.tsv.gz:md5,0d835c1d9417df961b4aadd7ac42137d",
"virus_clade_counts.tsv.gz:md5,3fcf57def952c95bf43cad8cfb268926",
"virus_hits_db.tsv.gz:md5,2232a0cfa4a2812621bb852c276ef9a1",
"blast_hits_paired.tsv.gz:md5,f2d110487d36ca58b1232f6d02aa69af",
"virus_hits_1.fasta.gz:md5,6024105b15a879de8616e54cb2dc3bb0",
"virus_hits_2.fasta.gz:md5,a08a14e81a6277d56ec16d04f3be7b8e"
"virus_clade_counts.tsv.gz:md5,89f68c2cc7912f37b22745168b2fc7e4",
"virus_hits_db.tsv.gz:md5,72e692fb3d168dc5199ab97ac4c58426",
"blast_hits_paired.tsv.gz:md5,6dce9cbf1aa6397a9145c9752aa4c723",
"virus_hits_1.fasta.gz:md5,941487995f144f88df4c2994f2fc551c",
"virus_hits_2.fasta.gz:md5,e285ccfb350fed7f0e73e29aaa1f10c1"
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.1"
},
"timestamp": "2024-12-20T21:16:59.561007756"
"timestamp": "2025-01-10T16:29:00.730413741"
}
}

0 comments on commit eb3fa31

Please sign in to comment.