Skip to content

Commit 4957dc2

Browse files
authored
Nf composition (#14)
* initial commit * Prokka and RATT running * generating plots and KEGG pathway views * Full workflow, with explicit outputs and TODOs resolved. * Containerized * comments * Nf phage finder (#9) Merging two workflows with related functionality. * proof of concept: linked runAnnotation and phageFinder, with phageFinder able to be turned on or off * restructured early pipeline. added nf-test infrastructure * testing added for sra2fastq * Testing for the first few modules * integrated hostRemoval * runAssembly in pipeline * host removal testing + cleanup * tests for runAssembly * reads to contig restructured as subworkflow. adding nf-test CI * fixing JDK version for CI * testing Apptainer for CI * cleanup * updated snapshots for JDK 17 * adding debugging output * more testing output for GH actions * added Git LFS to testing yml * adding sharding to tests - checking to see if this resolves space issues with the runner * removing files from LFS * basic testing for runReadsToContig * adding nf-test file * attempting optimized testing requirements * reverting testing strategy * host removal testing accounts for inconsistent file naming
1 parent 05305c5 commit 4957dc2

File tree

125 files changed

+665107
-1328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+665107
-1328
lines changed
File renamed without changes.

.github/workflows/ci-tests.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI Tests
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
shard: [1, 2, 3, 4]
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Set up JDK 17
17+
uses: actions/setup-java@v2
18+
with:
19+
java-version: '17'
20+
distribution: 'adopt'
21+
22+
- name: Set up Apptainer 1.3.0
23+
uses: eWaterCycle/setup-apptainer@v2
24+
with:
25+
apptainer-version: 1.3.0
26+
27+
28+
- name: Setup Nextflow 24.10.1
29+
uses: nf-core/setup-nextflow@v1
30+
with:
31+
version: "24.10.1"
32+
33+
- name: Install nf-test
34+
run: |
35+
wget -qO- https://get.nf-test.com | bash
36+
sudo mv nf-test /usr/local/bin/
37+
38+
- name: Run Tests (Shard ${{ matrix.shard }}/${{ strategy.job-total }})
39+
run: nf-test test --ci --shard ${{ matrix.shard }}/${{ strategy.job-total }}

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
**/__pycache__/*
22
.nextflow*
3-
*/work/*
3+
**/work/**
44
*/logs/*
5-
**/ec_info/*
5+
**/ec_info/*
6+
.nf-test*

hostRemoval/hostRemoval.nf

-173
This file was deleted.

hostRemoval/nextflow.config

-25
This file was deleted.

hostRemoval/test_files/parameters/hostRemoval_basic.json

-6
This file was deleted.

hostRemoval/test_files/parameters/hostRemoval_options.json

-7
This file was deleted.

hostRemoval/test_files/parameters/hostRemoval_unpaired.json

-6
This file was deleted.

main.nf

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env nextflow
2+
3+
include {SRA2FASTQ} from './modules/sra2fastq/sra2fastq.nf'
4+
include {COUNTFASTQ} from './modules/countFastq/countFastq.nf'
5+
include {FAQCS} from './modules/runFaQCs/runFaQCs.nf'
6+
include {HOSTREMOVAL} from './modules/hostRemoval/hostRemoval.nf'
7+
include {ASSEMBLY} from './modules/runAssembly/runAssembly.nf'
8+
include {READSTOCONTIGS} from './modules/runReadsToContig/runReadsToContig.nf'
9+
10+
workflow {
11+
12+
//input specification
13+
14+
pairedFiles = channel.fromPath(params.pairedFiles, checkIfExists:true)
15+
unpairedFiles = channel.fromPath(params.unpairedFiles, checkIfExists:true)
16+
contigs = channel.empty()
17+
if(params.r2c.useAssembledContigs) {
18+
contigs = channel.fromPath(params.inputContigs, checkIfExists:true)
19+
}
20+
21+
if(params.modules.sra2fastq) {
22+
SRA2FASTQ(params.sra2fastq.plus(params.shared))
23+
pairedFiles = pairedFiles.concat(SRA2FASTQ.out.paired).flatten()
24+
unpairedFiles = unpairedFiles.concat(SRA2FASTQ.out.unpaired).flatten()
25+
}
26+
27+
COUNTFASTQ(pairedFiles.collect(), unpairedFiles.collect())
28+
29+
avgLen = COUNTFASTQ.out.avgReadLen
30+
paired = COUNTFASTQ.out.paired.ifEmpty(params.pairedFiles)
31+
unpaired = COUNTFASTQ.out.unpaired.ifEmpty(params.unpairedFiles)
32+
33+
34+
if(params.modules.faqcs) {
35+
FAQCS(params.faqcs.plus(params.shared),paired,unpaired,avgLen)
36+
paired = FAQCS.out.paired.ifEmpty(params.pairedFiles)
37+
unpaired = FAQCS.out.unpaired.ifEmpty(params.unpairedFiles)
38+
}
39+
40+
if(params.modules.hostRemoval) {
41+
HOSTREMOVAL(params.hostRemoval.plus(params.shared),paired,unpaired)
42+
paired = HOSTREMOVAL.out.paired.ifEmpty(params.pairedFiles)
43+
unpaired = HOSTREMOVAL.out.unpaired.ifEmpty(params.unpairedFiles)
44+
}
45+
46+
if(params.modules.runAssembly && !params.r2c.useAssembledContigs) {
47+
ASSEMBLY(params.assembly.plus(params.shared), paired, unpaired, avgLen)
48+
contigs = ASSEMBLY.out.outContigs
49+
READSTOCONTIGS(params.r2c.plus(params.shared), paired, unpaired, contigs)
50+
}
51+
52+
53+
}

modules/countFastq/Dockerfile

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# syntax=docker/dockerfile:1
2+
FROM continuumio/miniconda3:24.5.0-0 AS build
3+
4+
ENV container=docker
5+
6+
# add conda channels
7+
RUN conda config --add channels conda-forge \
8+
&& conda config --add channels bioconda
9+
10+
RUN conda init bash \
11+
&& . ~/.bashrc \
12+
&& conda create --name countFastq \
13+
&& conda activate countFastq
14+
15+
RUN conda install -n countFastq -c conda-forge perl
16+
17+
RUN conda install -c conda-forge conda-pack
18+
19+
#add scripts from this project to bin
20+
ADD bin/* /opt/conda/envs/countFastq/bin
21+
22+
#pack environment for runtime image
23+
RUN conda-pack -n countFastq -o /tmp/env.tar && \
24+
mkdir /venv && cd /venv && tar xf /tmp/env.tar && \
25+
rm /tmp/env.tar
26+
27+
RUN /venv/bin/conda-unpack
28+
29+
FROM debian:latest AS runtime
30+
31+
COPY --from=build /venv /venv
32+
33+
ENV PATH=/venv/bin:$PATH
34+
RUN apt-get update && apt-get install procps -y && apt-get clean
35+
36+
SHELL ["/bin/bash", "-c"]
37+
CMD /bin/bash
File renamed without changes.

0 commit comments

Comments
 (0)