Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nf composition #14

Merged
merged 32 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c4f8afa
initial commit
aw-watson Sep 3, 2024
a06a7cb
Prokka and RATT running
aw-watson Sep 4, 2024
56e79a0
generating plots and KEGG pathway views
aw-watson Sep 5, 2024
f4e8762
Full workflow, with explicit outputs and TODOs resolved.
aw-watson Sep 6, 2024
a4eb229
Containerized
aw-watson Sep 9, 2024
ede9fec
comments
aw-watson Sep 12, 2024
f9ad25d
Nf phage finder (#9)
aw-watson Sep 23, 2024
e4a124d
proof of concept: linked runAnnotation and phageFinder, with phageFin…
aw-watson Sep 23, 2024
7db78b1
Merge branch 'main' into nf_composition
aw-watson Sep 24, 2024
323f0f6
restructured early pipeline. added nf-test infrastructure
aw-watson Oct 22, 2024
99bae23
testing added for sra2fastq
aw-watson Oct 23, 2024
2d50a04
Testing for the first few modules
aw-watson Oct 29, 2024
4e66bb4
merged main into nf_composition to resolve conflicts
aw-watson Oct 30, 2024
46f5ede
integrated hostRemoval
aw-watson Nov 5, 2024
79219ec
runAssembly in pipeline
aw-watson Nov 6, 2024
f4abc8e
host removal testing + cleanup
aw-watson Nov 21, 2024
6472018
tests for runAssembly
aw-watson Nov 26, 2024
0fcb34a
reads to contig restructured as subworkflow. adding nf-test CI
aw-watson Dec 9, 2024
184f453
fixing JDK version for CI
aw-watson Dec 9, 2024
b11e4dc
testing Apptainer for CI
aw-watson Dec 9, 2024
eddba05
cleanup
aw-watson Dec 9, 2024
1cd85d7
updated snapshots for JDK 17
aw-watson Dec 10, 2024
d544168
adding debugging output
aw-watson Dec 10, 2024
b110dcb
more testing output for GH actions
aw-watson Dec 10, 2024
49c618e
added Git LFS to testing yml
aw-watson Dec 10, 2024
167adfc
adding sharding to tests - checking to see if this resolves space iss…
aw-watson Dec 10, 2024
76c285d
removing files from LFS
aw-watson Dec 10, 2024
46f4aa2
basic testing for runReadsToContig
aw-watson Dec 17, 2024
d587915
adding nf-test file
aw-watson Dec 17, 2024
497acdd
attempting optimized testing requirements
aw-watson Dec 17, 2024
c69b0e0
reverting testing strategy
aw-watson Dec 17, 2024
44f80bf
host removal testing accounts for inconsistent file naming
aw-watson Dec 23, 2024
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
File renamed without changes.
39 changes: 39 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI Tests

on: [push]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1, 2, 3, 4]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'

- name: Set up Apptainer 1.3.0
uses: eWaterCycle/setup-apptainer@v2
with:
apptainer-version: 1.3.0


- name: Setup Nextflow 24.10.1
uses: nf-core/setup-nextflow@v1
with:
version: "24.10.1"

- name: Install nf-test
run: |
wget -qO- https://get.nf-test.com | bash
sudo mv nf-test /usr/local/bin/

- name: Run Tests (Shard ${{ matrix.shard }}/${{ strategy.job-total }})
run: nf-test test --ci --shard ${{ matrix.shard }}/${{ strategy.job-total }}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
**/__pycache__/*
.nextflow*
*/work/*
**/work/**
*/logs/*
**/ec_info/*
**/ec_info/*
.nf-test*
173 changes: 0 additions & 173 deletions hostRemoval/hostRemoval.nf

This file was deleted.

25 changes: 0 additions & 25 deletions hostRemoval/nextflow.config

This file was deleted.

6 changes: 0 additions & 6 deletions hostRemoval/test_files/parameters/hostRemoval_basic.json

This file was deleted.

7 changes: 0 additions & 7 deletions hostRemoval/test_files/parameters/hostRemoval_options.json

This file was deleted.

6 changes: 0 additions & 6 deletions hostRemoval/test_files/parameters/hostRemoval_unpaired.json

This file was deleted.

53 changes: 53 additions & 0 deletions main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env nextflow

include {SRA2FASTQ} from './modules/sra2fastq/sra2fastq.nf'
include {COUNTFASTQ} from './modules/countFastq/countFastq.nf'
include {FAQCS} from './modules/runFaQCs/runFaQCs.nf'
include {HOSTREMOVAL} from './modules/hostRemoval/hostRemoval.nf'
include {ASSEMBLY} from './modules/runAssembly/runAssembly.nf'
include {READSTOCONTIGS} from './modules/runReadsToContig/runReadsToContig.nf'

workflow {

//input specification

pairedFiles = channel.fromPath(params.pairedFiles, checkIfExists:true)
unpairedFiles = channel.fromPath(params.unpairedFiles, checkIfExists:true)
contigs = channel.empty()
if(params.r2c.useAssembledContigs) {
contigs = channel.fromPath(params.inputContigs, checkIfExists:true)
}

if(params.modules.sra2fastq) {
SRA2FASTQ(params.sra2fastq.plus(params.shared))
pairedFiles = pairedFiles.concat(SRA2FASTQ.out.paired).flatten()
unpairedFiles = unpairedFiles.concat(SRA2FASTQ.out.unpaired).flatten()
}

COUNTFASTQ(pairedFiles.collect(), unpairedFiles.collect())

avgLen = COUNTFASTQ.out.avgReadLen
paired = COUNTFASTQ.out.paired.ifEmpty(params.pairedFiles)
unpaired = COUNTFASTQ.out.unpaired.ifEmpty(params.unpairedFiles)


if(params.modules.faqcs) {
FAQCS(params.faqcs.plus(params.shared),paired,unpaired,avgLen)
paired = FAQCS.out.paired.ifEmpty(params.pairedFiles)
unpaired = FAQCS.out.unpaired.ifEmpty(params.unpairedFiles)
}

if(params.modules.hostRemoval) {
HOSTREMOVAL(params.hostRemoval.plus(params.shared),paired,unpaired)
paired = HOSTREMOVAL.out.paired.ifEmpty(params.pairedFiles)
unpaired = HOSTREMOVAL.out.unpaired.ifEmpty(params.unpairedFiles)
}

if(params.modules.runAssembly && !params.r2c.useAssembledContigs) {
ASSEMBLY(params.assembly.plus(params.shared), paired, unpaired, avgLen)
contigs = ASSEMBLY.out.outContigs
READSTOCONTIGS(params.r2c.plus(params.shared), paired, unpaired, contigs)
}


}
37 changes: 37 additions & 0 deletions modules/countFastq/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# syntax=docker/dockerfile:1
FROM continuumio/miniconda3:24.5.0-0 AS build

ENV container=docker

# add conda channels
RUN conda config --add channels conda-forge \
&& conda config --add channels bioconda

RUN conda init bash \
&& . ~/.bashrc \
&& conda create --name countFastq \
&& conda activate countFastq

RUN conda install -n countFastq -c conda-forge perl

RUN conda install -c conda-forge conda-pack

#add scripts from this project to bin
ADD bin/* /opt/conda/envs/countFastq/bin

#pack environment for runtime image
RUN conda-pack -n countFastq -o /tmp/env.tar && \
mkdir /venv && cd /venv && tar xf /tmp/env.tar && \
rm /tmp/env.tar

RUN /venv/bin/conda-unpack

FROM debian:latest AS runtime

COPY --from=build /venv /venv

ENV PATH=/venv/bin:$PATH
RUN apt-get update && apt-get install procps -y && apt-get clean

SHELL ["/bin/bash", "-c"]
CMD /bin/bash
File renamed without changes.
Loading
Loading