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

Added 2FAST2Q module #7318

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9e7f287
Added 2FAST2Q module
afombravo Jan 16, 2025
11263b5
added tests to 2fast2q
afombravo Jan 19, 2025
28620cc
added tests to 2fast2q
afombravo Jan 19, 2025
6327252
added tests to 2fast2q
afombravo Jan 19, 2025
f505542
fixed tests to 2fast2q
afombravo Jan 19, 2025
323062a
fixed tests to 2fast2q
afombravo Jan 19, 2025
eec55df
Merge branch 'master' into 2FAST2Q
SPPearce Jan 19, 2025
eafe98e
Update modules/nf-core/fast2q/tests/main.nf.test
afombravo Jan 19, 2025
48a87b5
Update modules/nf-core/fast2q/tests/main.nf.test
afombravo Jan 19, 2025
96dd572
added optional input - hope it is being parsed correctly
afombravo Jan 19, 2025
d9982e3
added optional input - hope it is being parsed correctly
afombravo Jan 19, 2025
00ed681
fix
afombravo Jan 19, 2025
9de9c4c
fix lack of optional input on tests
afombravo Jan 19, 2025
210bba4
fixing in progree
afombravo Jan 19, 2025
749ccf7
fixing in progress
afombravo Jan 19, 2025
b4a4e3f
fixing in progress
afombravo Jan 19, 2025
88e6c4a
fixing in progress
afombravo Jan 19, 2025
01132cc
I changed the test data to 2FAST2Q repo data, NOT NF-CORE test data, …
afombravo Jan 19, 2025
c976063
I changed the test data to 2FAST2Q repo data, NOT NF-CORE test data, …
afombravo Jan 19, 2025
3eadb4f
I changed the test data to 2FAST2Q repo data, NOT NF-CORE test data, …
afombravo Jan 19, 2025
1f6b509
I changed the test data to 2FAST2Q repo data, NOT NF-CORE test data, …
afombravo Jan 19, 2025
e32bbb0
testing if it works with just fastq
afombravo Jan 19, 2025
106ae2f
Update modules/nf-core/fast2q/main.nf
afombravo Jan 20, 2025
725bc16
added test data and fixed several output issues
afombravo Jan 20, 2025
f2f64c9
Merge branch 'master' into 2FAST2Q
afombravo Jan 20, 2025
6363e33
fixed the nf.test
afombravo Jan 20, 2025
4cfe166
fixed the nf.test
afombravo Jan 20, 2025
13278d6
fixed the module
afombravo Jan 20, 2025
bc8b153
moved test data up
afombravo Jan 20, 2025
6acdde0
direct link to a test data
afombravo Jan 20, 2025
24e6b89
Merge branch 'master' into 2FAST2Q
afombravo Jan 20, 2025
1e4002c
Merge branch 'master' into 2FAST2Q
afombravo Jan 20, 2025
8c89fea
changed paths to tests
afombravo Jan 20, 2025
c6744ac
Update modules/nf-core/fast2q/tests/nextflow.config
afombravo Jan 22, 2025
1127665
Update modules/nf-core/fast2q/tests/main.nf.test
afombravo Jan 22, 2025
b9a3da1
Update modules/nf-core/fast2q/tests/main.nf.test
afombravo Jan 22, 2025
27df973
Update modules/nf-core/fast2q/tests/main.nf.test
afombravo Jan 22, 2025
b74a003
changed assertions in test
afombravo Jan 23, 2025
82fea39
Merge branch 'master' into 2FAST2Q
afombravo Jan 23, 2025
4949199
removed indentation on main 2fast2q cmd as it was not being recognized
afombravo Jan 23, 2025
7abae13
Merge branch '2FAST2Q' of https://github.com/afombravo/modules into 2…
afombravo Jan 23, 2025
0a9fd26
everything working locally
afombravo Jan 23, 2025
731702a
everything working locally
afombravo Jan 23, 2025
198dd26
everything working locally
afombravo Jan 23, 2025
d50ee04
everything working locally
afombravo Jan 23, 2025
e598c43
everything working locally
afombravo Jan 23, 2025
06bf8d5
everything working locally
afombravo Jan 23, 2025
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
5 changes: 5 additions & 0 deletions modules/nf-core/fast2q/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::fast2q=2.7.2
38 changes: 38 additions & 0 deletions modules/nf-core/fast2q/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
process FAST2Q {

tag "2FAST2Q"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/fast2q' :
'biocontainers/2.7.2--pyh7e72e81_0' }"

input:
tuple val(meta1), path(fastq)
tuple val(meta2), path(library)

output:
tuple val(meta), path("./2FAST2Q_output/*.*") , emit: processed
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def input_file = "--s ${fastq}" ?: ''
afombravo marked this conversation as resolved.
Show resolved Hide resolved
def library_file = (library instanceof Path && library.exists()) ? "--g ${library}" : ''

"""
mkdir -p ./2FAST2Q_output
afombravo marked this conversation as resolved.
Show resolved Hide resolved

2fast2q -c --o ./2FAST2Q_output/ $input_file $library_file $args
afombravo marked this conversation as resolved.
Show resolved Hide resolved

cat <<-END_VERSIONS > versions.yml
${task.process}:
python: \$(python --version | sed 's/Python //g')
2FAST2Q version: \$(2fast2q -v | grep 'Version:' | sed 's/Version: //g')
END_VERSIONS
"""
}
63 changes: 63 additions & 0 deletions modules/nf-core/fast2q/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: fast2q
description: A program that counts sequence occurrences in FASTQ files.
keywords:
- CRISPRi
- FASTQ
- genomics
tools:
- 2FAST2Q:
description: |
2FAST2Q is ideal for CRISPRi-Seq, and for extracting and counting any kind of information from reads in the fastq format, such as barcodes in Bar-seq experiments.
2FAST2Q can work with sequence mismatches, Phred-score, and be used to find and extract unknown sequences delimited by known sequences.
2FAST2Q can extract multiple features per read using either fixed positions or delimiting search sequences.
homepage: https://github.com/afombravo/2FAST2Q
doi: 10.7717/peerj.14041
licence: ["GPL-3.0-or-later"]
identifier: ''

input:
- - meta1:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- fastq:
type: file
description: FASTQ file
pattern: "*.{fastq,gz}"

- - meta2:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- library:
type: file
description: library file
pattern: "*.csv"

output:
- processed:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:true ]
pattern: "./2FAST2Q_output/*.*"

- ./2FAST2Q_output/*.*:
type: map
description: |
Folder containing all the processed data
pattern: "./2FAST2Q_output/*.*"

- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@afombravo"
maintainers:
- "@afombravo"
104 changes: 104 additions & 0 deletions modules/nf-core/fast2q/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
nextflow_process {

name "Test Process 2FAST2Q"
script "../main.nf"
process "FAST2Q"

tag "modules"
tag "modules_nfcore"
tag "fast2q"

config './nextflow.config'

afombravo marked this conversation as resolved.
Show resolved Hide resolved
test("Extracting all features at position=0 with default length of 20bp from a FASTQ file (without optional library.csv)") {

when {

params {
module_args = '--mo EC'
}

process {
"""
input[0] = [
[ id:'test1', single_end:true ], // meta map
file(params.modules_testdata_base_path + '/SRR8983579.small.fastq.gz', checkIfExists: true) // FASTQ file
]
input[1] = [
[ id:'test2', single_end:true ], // meta map for second input
[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert path(process.out.processed).exists() } // Check processed output exists
{ assert path(process.out.versions).readLines().join("\n").contains("2FAST2Q version") } // Verify version output
)
}

}

test("2FAST2Q self-test") {

when {

params {
module_args = '-t'
}

process {
"""
input[0] = [
[ id:'test1', single_end:true ], // meta map
file(params.modules_testdata_base_path + '/SRR8983579.small.fastq.gz', checkIfExists: true) // FASTQ file
]
input[1] = [
[ id:'test2', single_end:true ], // meta map for second input
[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert path(process.out.processed).exists() } // Check processed output exists
{ assert path(process.out.versions).readLines().join("\n").contains("2FAST2Q version") } // Verify version output
)
}

}

/* test("FASTQ file with optional library") {

when {

process {
"""
input[0] = [
[ id:'test1', single_end:true ], // meta map
file(params.modules_testdata_base_path + '/SRR8983579.small.fastq.gz', checkIfExists: true) // FASTQ file
]
input[1] = [
[ id:'test2', single_end:true ], // meta map for second input
file(params.modules_testdata_base_path + '/D39V_guides.csv', checkIfExists: true) // library file
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert path(process.out.processed).exists() } // Check processed output exists
{ assert path(process.out.versions).readLines().join("\n").contains("2FAST2Q version") } // Verify version output
afombravo marked this conversation as resolved.
Show resolved Hide resolved
)
}
} */

}
10 changes: 10 additions & 0 deletions modules/nf-core/fast2q/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
params {
modules_testdata_base_path = "https://github.com/nf-core/test-datasets/tree/crisprseq/testdata"
module_args = '' // Default to an empty string
}

process {
withName: 'FAST2Q' {
ext.args = params.module_args
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/fast2q/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fast2q:
- "modules/nf-core/fast2q/**"
Loading