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

add modules for sra-human-scrubber #2694

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

rpetit3
Copy link
Contributor

@rpetit3 rpetit3 commented Dec 23, 2022

PR checklist

Closes #2693

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the module conventions in the contribution docs
  • If necessary, include test data in your PR.
  • Remove all TODO statements.
  • Emit the versions.yml file.
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label
  • Use BioConda and BioContainers if possible to fulfil software requirements.
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • PROFILE=docker pytest --tag <MODULE> --symlink --keep-workflow-wd --git-aware
    • PROFILE=singularity pytest --tag <MODULE> --symlink --keep-workflow-wd --git-aware
    • PROFILE=conda pytest --tag <MODULE> --symlink --keep-workflow-wd --git-aware

SRA Human Scrubber uses a >1gb database, so I went with stub runs for the tests.

@edmundmiller edmundmiller requested a review from a team as a code owner October 19, 2023 16:26
@SPPearce
Copy link
Contributor

SPPearce commented May 9, 2024

@rpetit3 , it looks like the version naming structure for the database has changed:
https://ftp.ncbi.nlm.nih.gov/sra/dbs/human_filter/README.txt

container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/sra-human-scrubber:2.0.0--hdfd78af_0':
'quay.io/biocontainers/sra-human-scrubber:2.0.0--hdfd78af_0' }"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No input 😱

Comment on lines +19 to +20
DBVERSION=\$(curl "https://ftp.ncbi.nlm.nih.gov/sra/dbs/human_filter/current/version.txt")
curl -f "https://ftp.ncbi.nlm.nih.gov/sra/dbs/human_filter/human_filter.db.\${DBVERSION}" -o "\${DBVERSION}.human_filter.db"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably be done outside of a process? I mean Channel.fromPath("https://ftp.ncbi.nlm.nih.gov/sra/dbs/human_filter/human_filter.db.\${DBVERSION}" -o "\${DBVERSION}.human_filter.db") will achieve much the same thing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This process is currently looking up what the most recent version is, and downloading that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely think you can do a GET and make a channel it will achieve the same thing and not require a full process?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that is true. I'm just trying to get PRs to a point where they can be merged in (or potentially to be closed if they aren't necessary).
One option would be to just add the scrubber module in, and leave the database fetching to be external (potentially via a local module). Otherwise this is going to change the md5sum any time the external database is changed anyway.


input:
tuple val(meta), path(reads)
path db
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
path db
tuple val(meta2), path(db)

Comment on lines +24 to +45
def VERSION = '2.0.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
if (meta.single_end) {
"""
zcat ${reads} | scrub.sh -d $db | gzip > ${prefix}.scrubbed.fastq.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
sra-human-scrubber: $VERSION
END_VERSIONS
"""
} else {
"""
zcat ${reads[0]} | scrub.sh -d $db | gzip > ${prefix}_R1.scrubbed.fastq.gz
zcat ${reads[1]} | scrub.sh -d $db | gzip > ${prefix}_R2.scrubbed.fastq.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
sra-human-scrubber: $VERSION
sra-human-scrubber-db: \$DBVERSION
END_VERSIONS
"""
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to not use meta.single_end, although I know I'm in the minority. Instead I prefer to test the number of FASTQs explicitly.

Suggested change
def VERSION = '2.0.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
if (meta.single_end) {
"""
zcat ${reads} | scrub.sh -d $db | gzip > ${prefix}.scrubbed.fastq.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
sra-human-scrubber: $VERSION
END_VERSIONS
"""
} else {
"""
zcat ${reads[0]} | scrub.sh -d $db | gzip > ${prefix}_R1.scrubbed.fastq.gz
zcat ${reads[1]} | scrub.sh -d $db | gzip > ${prefix}_R2.scrubbed.fastq.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
sra-human-scrubber: $VERSION
sra-human-scrubber-db: \$DBVERSION
END_VERSIONS
"""
}
def VERSION = '2.0.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
def num_fastq = reads instanceof List ? reads.size() : 1
if (num_fastq == 1) {
"""
zcat ${reads} | scrub.sh -d $db | gzip > ${prefix}.scrubbed.fastq.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
sra-human-scrubber: $VERSION
END_VERSIONS
"""
} else {
// Could handle it better here but you get the idea
"""
zcat ${reads[0]} | scrub.sh -d $db | gzip > ${prefix}_R1.scrubbed.fastq.gz
zcat ${reads[1]} | scrub.sh -d $db | gzip > ${prefix}_R2.scrubbed.fastq.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
sra-human-scrubber: $VERSION
sra-human-scrubber-db: \$DBVERSION
END_VERSIONS
"""
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also find the single-end modules a bit odd, have noticed that in trying to get these old PRs across the line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shocked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new module: sra-human-scrubber
3 participants