Skip to content

Module for running Red repeat detector - #41

Open
markquintontulloch wants to merge 3 commits into
mainfrom
ENSGENOMIO-27_nf
Open

Module for running Red repeat detector#41
markquintontulloch wants to merge 3 commits into
mainfrom
ENSGENOMIO-27_nf

Conversation

@markquintontulloch

Copy link
Copy Markdown
Contributor

No description provided.

@JAlvarezJarreta JAlvarezJarreta left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great, just a few comments.


output:
tuple val(meta), path("rpt/*.bed"), emit: bed
tuple val("${task.process}"), val('red'), eval("conda list red --json | python -c 'import sys,json; print(json.load(sys.stdin)[0][\"version\"])' || echo 2.0"), emit: versions_red, topic: versions

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
tuple val("${task.process}"), val('red'), eval("conda list red --json | python -c 'import sys,json; print(json.load(sys.stdin)[0][\"version\"])' || echo 2.0"), emit: versions_red, topic: versions
tuple val("${task.process}"), val('red'), eval("conda list red --json | jq -r '.version' || echo 2.0"), emit: versions_red, topic: versions

Not sure if this will work, but sounds less overkilling than loading Python to just extract the version.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Having looked into this, we could maybe use jq -r '.[0].version' but I think I'm inclined to stick with Python unless you strongly feel otherwise. From what I can gather, many nf-core modules use small Python one-liners to parse JSON since it is considered part of the expected runtime environment, whereas jq is not. Therefore, this seems like the more portable option.

Comment thread modules/ensembl/features/red/main.nf Outdated
mkdir -p genome rpt

# Red only scans .fa files in the genome directory
cp ${fasta} genome/${meta.id}.fa

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
cp ${fasta} genome/${meta.id}.fa
ln -snf ${fasta} genome/${meta.id}.fa

If its only scanning, and given these can be large files, should we create a symlink instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea, although needed to use ln -snf \$(realpath "${fasta}") genome/${meta.id}.fa

- red:
type: string
description: The tool name
- conda list red --json | python -c 'import sys,json; print(json.load(sys.stdin)[0]["version"])' || echo 2.0:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as above if it works.

- red:
type: string
description: The tool name
- conda list red --json | python -c 'import sys,json; print(json.load(sys.stdin)[0]["version"])' || echo 2.0:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as above if it works.

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.

2 participants