Conversation
| ---------------------------------------------------------------------------------------- | ||
| */ | ||
|
|
||
| nextflow.enable.moduleBinaries = true |
There was a problem hiding this comment.
Not sure if this is the best config file for this?
| label 'process_medium' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container 'community.wave.seqera.io/library/duckdb-cli:1.0.0--a85d12a2a9de17c9' |
There was a problem hiding this comment.
This should be updated to a more recent version (1.1.3 is current in conda, latest version is 1.2.1)
|
|
||
| script: | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def sql = "INSTALL parquet; LOAD parquet; COPY (WITH p AS (SELECT * FROM read_parquet('${parquet}/*.parquet')), s AS (SELECT unnest(string_to_array(sequence, '')) AS aa FROM p), h AS (SELECT unnest(map_entries(histogram(aa))) AS kv FROM s), e AS (SELECT * from read_csv_auto('amino_acid_properties.tsv')) SELECT h.kv['key'] AS amino_acid, h.kv['value'] AS count, e.* FROM h JOIN e ON h.kv['key'] = e.one_letter_symbol) TO '${prefix}.histogram.tsv' (HEADER, DELIMITER '\t')" |
There was a problem hiding this comment.
I would really like it if this SQL query could be stored external to main.nf, ideally in a SQL file with templated variable substitution
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def sql = "INSTALL parquet; LOAD parquet; COPY (WITH p AS (SELECT * FROM read_parquet('${parquet}/*.parquet')), s AS (SELECT unnest(string_to_array(sequence, '')) AS aa FROM p), h AS (SELECT unnest(map_entries(histogram(aa))) AS kv FROM s), e AS (SELECT * from read_csv_auto('amino_acid_properties.tsv')) SELECT h.kv['key'] AS amino_acid, h.kv['value'] AS count, e.* FROM h JOIN e ON h.kv['key'] = e.one_letter_symbol) TO '${prefix}.histogram.tsv' (HEADER, DELIMITER '\t')" | ||
| """ | ||
| create_amino_acid_properties.sh |
There was a problem hiding this comment.
This is really dumb, but I can't find a way to stage a static file (i.e. amino_acid_properties.tsv) within a module
There was a problem hiding this comment.
Why not stage it as an input?
There was a problem hiding this comment.
Maybe? What would that look like?
| # | ||
| # See https://en.wikipedia.org/wiki/Amino_acid | ||
|
|
||
| cat <<END_PROPERTIES > amino_acid_properties.tsv |
206d78a to
7e19196
Compare
|
Rebased and force-pushed |
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def amino_acid_properties = file("${moduleDir}/assets/amino_acid_properties.tsv") | ||
| def query_template = file("${moduleDir}/assets/query_template.sql") |
There was a problem hiding this comment.
These do not stage when running with -profile docker
|
Hello, checking in here. I'm grateful for your work! This PR hasn't had any changes since March 27 (~3 months ago), is this still in progress or do you mind if someone else takes over? Thank you so much! |
PR checklist
nf-core pipelines lint).nextflow run . -profile test,docker --outdir <OUTDIR>).nextflow run . -profile debug,test,docker --outdir <OUTDIR>).docs/usage.mdis updated.docs/output.mdis updated.CHANGELOG.mdis updated.README.mdis updated (including new tool citations and authors/contributors).