Build branch main with version main (1e1ffb3)

Build pipeline: vsh-ci-dev-jsbwk

Source commit: 1e1ffb315f

Source message: Merge pull request #17 from viash-hub/add_biobox_modules

- Migrate a number of components to biobox
- Fix tests
- Reduce size of test resources
- Prepare for Viash Hub
This commit is contained in:
CI
2024-09-13 07:41:13 +00:00
commit 1ebb61f1e8
557 changed files with 430700 additions and 0 deletions

View File

@@ -0,0 +1,541 @@
name: "genome_alignment_and_quant"
namespace: "workflows"
version: "main"
argument_groups:
- name: "Input"
arguments:
- type: "string"
name: "--id"
description: "ID of the sample."
info: null
example:
- "foo"
required: true
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--fastq_1"
alternatives:
- "-i"
description: "Path to the sample (or read 1 of paired end sample)."
info: null
example:
- "input.fastq.gz"
must_exist: true
create_parent: true
required: true
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--fastq_2"
description: "Path to read 2 of the sample."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--strandedness"
description: "Sample strand-specificity. Must be one of unstranded, forward, or\
\ reverse"
info: null
required: false
choices:
- "forward"
- "reverse"
- "unstranded"
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--gtf"
description: "GTF file"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--transcript_fasta"
description: "Fasta file of the reference transcriptome."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--star_index"
description: "STAR index directory."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--star_ignore_sjdbgtf"
description: "When using pre-built STAR indices do not re-extract and use splice\
\ junctions from the GTF file"
info: null
default:
- false
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--seq_platform"
description: "Sequencing platform."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--seq_center"
description: "Sequencing center."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--extra_star_align_args"
description: "Extra arguments to pass to STAR alignment command in addition to\
\ defaults defined by the pipeline."
info: null
default:
- ""
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--bam_csi_index"
description: "Create a CSI index for BAM files instead of the traditional BAI\
\ index. This will be required for genomes with larger chromosome sizes."
info: null
default:
- false
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--umi_dedup_stats"
description: "Generate output stats when running \"umi_tools dedup\"."
info: null
default:
- false
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--with_umi"
description: "Enable UMI-based read deduplication."
info: null
default:
- false
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--salmon_quant_libtype"
description: "Override Salmon library type inferred based on strandedness defined\
\ in meta object."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--extra_salmon_quant_args"
description: "Extra arguments to pass to salmon quant command in addition to defaults\
\ defined by the pipeline."
info: null
default:
- ""
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--gtf_group_features"
description: "Define the attribute type used to group features in the GTF file\
\ when running Salmon."
info: null
default:
- "gene_id"
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--gtf_extra_attributes"
description: "By default, the pipeline uses the gene_name field to obtain additional\
\ gene identifiers from the input GTF file when running Salmon."
info: null
default:
- "gene_name"
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "extra_rsem_calculate_expression_args"
description: "Extra arguments to pass to rsem-calculate-expression command in\
\ addition to defaults defined by the pipeline."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--aligner"
description: "Specifies the alignment algorithm to use - available options are\
\ 'star_salmon', 'star_rsem' and 'hisat2'."
info: null
default:
- "star_salmon"
required: false
choices:
- "star_salmon"
- "star_rsem"
- "hisat2"
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--rsem_index"
description: "Path to directory for pre-built RSEM index."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--salmon_index"
description: "Path to directory for pre-built Salmon index."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- name: "Output"
arguments:
- type: "file"
name: "--star_multiqc"
info: null
default:
- "$id.star_align.log"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--genome_bam_sorted"
info: null
default:
- "$id.genome.bam"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--genome_bam_index"
info: null
default:
- "$id.genome.bam.bai"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--genome_bam_stats"
info: null
default:
- "$id.genome.stats"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--genome_bam_flagstat"
info: null
default:
- "$id.genome.flagstat"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--genome_bam_idxstats"
info: null
default:
- "$id.genome.idxstats"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--transcriptome_bam"
info: null
default:
- "$id.transcriptome.bam"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--transcriptome_bam_index"
info: null
default:
- "$id.transcriptome.bam.bai"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--transcriptome_bam_stats"
info: null
default:
- "$id.transcriptome.stats"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--transcriptome_bam_flagstat"
info: null
default:
- "$id.transcriptome.flagstat"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--transcriptome_bam_idxstats"
info: null
default:
- "$id.transcriptome.idxstats"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--quant_out_dir"
info: null
default:
- "$id.salmon_quant"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--quant_results_file"
info: null
default:
- "$id.quant.sf"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
resources:
- type: "nextflow_script"
path: "main.nf"
is_executable: true
entrypoint: "run_wf"
description: "A viash sub-workflow for genome alignment and quantification stage of\
\ nf-core/rnaseq pipeline.\n"
info: null
status: "enabled"
requirements:
commands:
- "ps"
dependencies:
- name: "star/star_align_reads"
repository:
type: "vsh"
repo: "vsh/biobox"
- name: "samtools/samtools_sort"
repository:
type: "vsh"
repo: "vsh/biobox"
- name: "samtools/samtools_index"
repository:
type: "vsh"
repo: "vsh/biobox"
- name: "samtools/samtools_stats"
repository:
type: "vsh"
repo: "vsh/biobox"
- name: "samtools/samtools_flagstat"
repository:
type: "vsh"
repo: "vsh/biobox"
- name: "samtools/samtools_idxstats"
repository:
type: "vsh"
repo: "vsh/biobox"
- name: "umitools/umitools_dedup"
repository:
type: "local"
- name: "umitools_prepareforquant"
repository:
type: "local"
- name: "salmon/salmon_quant"
repository:
type: "vsh"
repo: "vsh/biobox"
- name: "rsem/rsem_calculate_expression"
repository:
type: "local"
repositories:
- type: "vsh"
name: "biobox"
repo: "vsh/biobox"
runners:
- type: "executable"
id: "executable"
docker_setup_strategy: "ifneedbepullelsecachedbuild"
- type: "nextflow"
id: "nextflow"
directives:
tag: "$id"
auto:
simplifyInput: true
simplifyOutput: false
transcript: false
publish: false
config:
labels:
mem1gb: "memory = 1000000000.B"
mem2gb: "memory = 2000000000.B"
mem5gb: "memory = 5000000000.B"
mem10gb: "memory = 10000000000.B"
mem20gb: "memory = 20000000000.B"
mem50gb: "memory = 50000000000.B"
mem100gb: "memory = 100000000000.B"
mem200gb: "memory = 200000000000.B"
mem500gb: "memory = 500000000000.B"
mem1tb: "memory = 1000000000000.B"
mem2tb: "memory = 2000000000000.B"
mem5tb: "memory = 5000000000000.B"
mem10tb: "memory = 10000000000000.B"
mem20tb: "memory = 20000000000000.B"
mem50tb: "memory = 50000000000000.B"
mem100tb: "memory = 100000000000000.B"
mem200tb: "memory = 200000000000000.B"
mem500tb: "memory = 500000000000000.B"
mem1gib: "memory = 1073741824.B"
mem2gib: "memory = 2147483648.B"
mem4gib: "memory = 4294967296.B"
mem8gib: "memory = 8589934592.B"
mem16gib: "memory = 17179869184.B"
mem32gib: "memory = 34359738368.B"
mem64gib: "memory = 68719476736.B"
mem128gib: "memory = 137438953472.B"
mem256gib: "memory = 274877906944.B"
mem512gib: "memory = 549755813888.B"
mem1tib: "memory = 1099511627776.B"
mem2tib: "memory = 2199023255552.B"
mem4tib: "memory = 4398046511104.B"
mem8tib: "memory = 8796093022208.B"
mem16tib: "memory = 17592186044416.B"
mem32tib: "memory = 35184372088832.B"
mem64tib: "memory = 70368744177664.B"
mem128tib: "memory = 140737488355328.B"
mem256tib: "memory = 281474976710656.B"
mem512tib: "memory = 562949953421312.B"
cpu1: "cpus = 1"
cpu2: "cpus = 2"
cpu5: "cpus = 5"
cpu10: "cpus = 10"
cpu20: "cpus = 20"
cpu50: "cpus = 50"
cpu100: "cpus = 100"
cpu200: "cpus = 200"
cpu500: "cpus = 500"
cpu1000: "cpus = 1000"
debug: false
container: "docker"
engines:
- type: "native"
id: "native"
build_info:
config: "src/workflows/genome_alignment_and_quant/config.vsh.yaml"
runner: "executable"
engine: "native"
output: "target/executable/workflows/genome_alignment_and_quant"
executable: "target/executable/workflows/genome_alignment_and_quant/genome_alignment_and_quant"
viash_version: "0.9.0"
git_commit: "1e1ffb315fefec05db2ee0c62e1c98ce4b49929c"
git_remote: "https://github.com/viash-hub/rnaseq"
dependencies:
- "target/dependencies/vsh/vsh/biobox/nextflow/star/star_align_reads"
- "target/dependencies/vsh/vsh/biobox/nextflow/samtools/samtools_sort"
- "target/dependencies/vsh/vsh/biobox/nextflow/samtools/samtools_index"
- "target/dependencies/vsh/vsh/biobox/nextflow/samtools/samtools_stats"
- "target/dependencies/vsh/vsh/biobox/nextflow/samtools/samtools_flagstat"
- "target/dependencies/vsh/vsh/biobox/nextflow/samtools/samtools_idxstats"
- "target/nextflow/umitools/umitools_dedup"
- "target/nextflow/umitools_prepareforquant"
- "target/dependencies/vsh/vsh/biobox/nextflow/salmon/salmon_quant"
- "target/nextflow/rsem/rsem_calculate_expression"
package_config:
version: "main"
info:
test_resources:
- path: "gs://viash-hub-test-data/rnaseq/v1"
dest: "testData"
viash_version: "0.9.0"
source: "src"
target: "target"
config_mods:
- ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\
\ := '$id'\n"
- ".engines += { type: \"native\" }"
- ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'"
- ".engines[.type == 'docker'].target_tag := 'main'"
organization: "vsh"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,293 @@
name: "merge_quant_results"
namespace: "workflows"
version: "main"
argument_groups:
- name: "Input"
arguments:
- type: "file"
name: "--salmon_quant_results"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: true
multiple_sep: ","
- type: "file"
name: "--kallisto_quant_results"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: true
multiple_sep: ","
- type: "file"
name: "--gtf"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--gtf_extra_attributes"
info: null
default:
- "gene_name"
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--gtf_group_features"
info: null
default:
- "gene_id"
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--quant_type"
description: "Quantification method used."
info: null
default:
- "salmon"
required: false
choices:
- "salmon"
- "kallisto"
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--versions"
info: null
must_exist: false
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- name: "Output"
arguments:
- type: "file"
name: "--tpm_gene"
info: null
example:
- "gene_tpm.tsv"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--counts_gene"
info: null
example:
- "gene_counts.tsv"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--counts_gene_length_scaled"
info: null
example:
- "gene_counts_length_scaled.tsv"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--counts_gene_scaled"
info: null
example:
- "gene_counts_scaled.tsv"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--tpm_transcript"
info: null
example:
- "transcript_tpm.tsv"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--lengths_gene"
info: null
example:
- "gene_length.tsv"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--counts_transcript"
info: null
example:
- "transcript_counts.tsv"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--lengths_transcript"
info: null
example:
- "transcript_length.tsv"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--quant_merged_summarizedexperiment"
info: null
example:
- "quant_merged_summarizedexperiment"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
resources:
- type: "nextflow_script"
path: "main.nf"
is_executable: true
entrypoint: "run_wf"
description: "A sub-workflow to merge the counts obtained from salmon quant across\
\ all samples."
info: null
status: "enabled"
requirements:
commands:
- "ps"
dependencies:
- name: "tx2gene"
repository:
type: "local"
- name: "tximport"
repository:
type: "local"
- name: "summarizedexperiment"
repository:
type: "local"
runners:
- type: "executable"
id: "executable"
docker_setup_strategy: "ifneedbepullelsecachedbuild"
- type: "nextflow"
id: "nextflow"
directives:
tag: "$id"
auto:
simplifyInput: true
simplifyOutput: false
transcript: false
publish: false
config:
labels:
mem1gb: "memory = 1000000000.B"
mem2gb: "memory = 2000000000.B"
mem5gb: "memory = 5000000000.B"
mem10gb: "memory = 10000000000.B"
mem20gb: "memory = 20000000000.B"
mem50gb: "memory = 50000000000.B"
mem100gb: "memory = 100000000000.B"
mem200gb: "memory = 200000000000.B"
mem500gb: "memory = 500000000000.B"
mem1tb: "memory = 1000000000000.B"
mem2tb: "memory = 2000000000000.B"
mem5tb: "memory = 5000000000000.B"
mem10tb: "memory = 10000000000000.B"
mem20tb: "memory = 20000000000000.B"
mem50tb: "memory = 50000000000000.B"
mem100tb: "memory = 100000000000000.B"
mem200tb: "memory = 200000000000000.B"
mem500tb: "memory = 500000000000000.B"
mem1gib: "memory = 1073741824.B"
mem2gib: "memory = 2147483648.B"
mem4gib: "memory = 4294967296.B"
mem8gib: "memory = 8589934592.B"
mem16gib: "memory = 17179869184.B"
mem32gib: "memory = 34359738368.B"
mem64gib: "memory = 68719476736.B"
mem128gib: "memory = 137438953472.B"
mem256gib: "memory = 274877906944.B"
mem512gib: "memory = 549755813888.B"
mem1tib: "memory = 1099511627776.B"
mem2tib: "memory = 2199023255552.B"
mem4tib: "memory = 4398046511104.B"
mem8tib: "memory = 8796093022208.B"
mem16tib: "memory = 17592186044416.B"
mem32tib: "memory = 35184372088832.B"
mem64tib: "memory = 70368744177664.B"
mem128tib: "memory = 140737488355328.B"
mem256tib: "memory = 281474976710656.B"
mem512tib: "memory = 562949953421312.B"
cpu1: "cpus = 1"
cpu2: "cpus = 2"
cpu5: "cpus = 5"
cpu10: "cpus = 10"
cpu20: "cpus = 20"
cpu50: "cpus = 50"
cpu100: "cpus = 100"
cpu200: "cpus = 200"
cpu500: "cpus = 500"
cpu1000: "cpus = 1000"
debug: false
container: "docker"
engines:
- type: "native"
id: "native"
build_info:
config: "src/workflows/merge_quant_results/config.vsh.yaml"
runner: "executable"
engine: "native"
output: "target/executable/workflows/merge_quant_results"
executable: "target/executable/workflows/merge_quant_results/merge_quant_results"
viash_version: "0.9.0"
git_commit: "1e1ffb315fefec05db2ee0c62e1c98ce4b49929c"
git_remote: "https://github.com/viash-hub/rnaseq"
dependencies:
- "target/nextflow/tx2gene"
- "target/nextflow/tximport"
- "target/nextflow/summarizedexperiment"
package_config:
version: "main"
info:
test_resources:
- path: "gs://viash-hub-test-data/rnaseq/v1"
dest: "testData"
viash_version: "0.9.0"
source: "src"
target: "target"
config_mods:
- ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\
\ := '$id'\n"
- ".engines += { type: \"native\" }"
- ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'"
- ".engines[.type == 'docker'].target_tag := 'main'"
organization: "vsh"

View File

@@ -0,0 +1,892 @@
#!/usr/bin/env bash
# merge_quant_results main
#
# This wrapper script is auto-generated by viash 0.9.0 and is thus a derivative
# work thereof. This software comes with ABSOLUTELY NO WARRANTY from Data
# Intuitive.
#
# The component may contain files which fall under a different license. The
# authors of this component should specify the license in the header of such
# files, or include a separate license file detailing the licenses of all included
# files.
set -e
if [ -z "$VIASH_TEMP" ]; then
VIASH_TEMP=${VIASH_TEMP:-$VIASH_TMPDIR}
VIASH_TEMP=${VIASH_TEMP:-$VIASH_TEMPDIR}
VIASH_TEMP=${VIASH_TEMP:-$VIASH_TMP}
VIASH_TEMP=${VIASH_TEMP:-$TMPDIR}
VIASH_TEMP=${VIASH_TEMP:-$TMP}
VIASH_TEMP=${VIASH_TEMP:-$TEMPDIR}
VIASH_TEMP=${VIASH_TEMP:-$TEMP}
VIASH_TEMP=${VIASH_TEMP:-/tmp}
fi
# define helper functions
# ViashQuote: put quotes around non flag values
# $1 : unquoted string
# return : possibly quoted string
# examples:
# ViashQuote --foo # returns --foo
# ViashQuote bar # returns 'bar'
# Viashquote --foo=bar # returns --foo='bar'
function ViashQuote {
if [[ "$1" =~ ^-+[a-zA-Z0-9_\-]+=.+$ ]]; then
echo "$1" | sed "s#=\(.*\)#='\1'#"
elif [[ "$1" =~ ^-+[a-zA-Z0-9_\-]+$ ]]; then
echo "$1"
else
echo "'$1'"
fi
}
# ViashRemoveFlags: Remove leading flag
# $1 : string with a possible leading flag
# return : string without possible leading flag
# examples:
# ViashRemoveFlags --foo=bar # returns bar
function ViashRemoveFlags {
echo "$1" | sed 's/^--*[a-zA-Z0-9_\-]*=//'
}
# ViashSourceDir: return the path of a bash file, following symlinks
# usage : ViashSourceDir ${BASH_SOURCE[0]}
# $1 : Should always be set to ${BASH_SOURCE[0]}
# returns : The absolute path of the bash file
function ViashSourceDir {
local source="$1"
while [ -h "$source" ]; do
local dir="$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd )"
source="$(readlink "$source")"
[[ $source != /* ]] && source="$dir/$source"
done
cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd
}
# ViashFindTargetDir: return the path of the '.build.yaml' file, following symlinks
# usage : ViashFindTargetDir 'ScriptPath'
# $1 : The location from where to start the upward search
# returns : The absolute path of the '.build.yaml' file
function ViashFindTargetDir {
local source="$1"
while [[ "$source" != "" && ! -e "$source/.build.yaml" ]]; do
source=${source%/*}
done
echo $source
}
# see https://en.wikipedia.org/wiki/Syslog#Severity_level
VIASH_LOGCODE_EMERGENCY=0
VIASH_LOGCODE_ALERT=1
VIASH_LOGCODE_CRITICAL=2
VIASH_LOGCODE_ERROR=3
VIASH_LOGCODE_WARNING=4
VIASH_LOGCODE_NOTICE=5
VIASH_LOGCODE_INFO=6
VIASH_LOGCODE_DEBUG=7
VIASH_VERBOSITY=$VIASH_LOGCODE_NOTICE
# ViashLog: Log events depending on the verbosity level
# usage: ViashLog 1 alert Oh no something went wrong!
# $1: required verbosity level
# $2: display tag
# $3+: messages to display
# stdout: Your input, prepended by '[$2] '.
function ViashLog {
local required_level="$1"
local display_tag="$2"
shift 2
if [ $VIASH_VERBOSITY -ge $required_level ]; then
>&2 echo "[$display_tag]" "$@"
fi
}
# ViashEmergency: log events when the system is unstable
# usage: ViashEmergency Oh no something went wrong.
# stdout: Your input, prepended by '[emergency] '.
function ViashEmergency {
ViashLog $VIASH_LOGCODE_EMERGENCY emergency "$@"
}
# ViashAlert: log events when actions must be taken immediately (e.g. corrupted system database)
# usage: ViashAlert Oh no something went wrong.
# stdout: Your input, prepended by '[alert] '.
function ViashAlert {
ViashLog $VIASH_LOGCODE_ALERT alert "$@"
}
# ViashCritical: log events when a critical condition occurs
# usage: ViashCritical Oh no something went wrong.
# stdout: Your input, prepended by '[critical] '.
function ViashCritical {
ViashLog $VIASH_LOGCODE_CRITICAL critical "$@"
}
# ViashError: log events when an error condition occurs
# usage: ViashError Oh no something went wrong.
# stdout: Your input, prepended by '[error] '.
function ViashError {
ViashLog $VIASH_LOGCODE_ERROR error "$@"
}
# ViashWarning: log potentially abnormal events
# usage: ViashWarning Something may have gone wrong.
# stdout: Your input, prepended by '[warning] '.
function ViashWarning {
ViashLog $VIASH_LOGCODE_WARNING warning "$@"
}
# ViashNotice: log significant but normal events
# usage: ViashNotice This just happened.
# stdout: Your input, prepended by '[notice] '.
function ViashNotice {
ViashLog $VIASH_LOGCODE_NOTICE notice "$@"
}
# ViashInfo: log normal events
# usage: ViashInfo This just happened.
# stdout: Your input, prepended by '[info] '.
function ViashInfo {
ViashLog $VIASH_LOGCODE_INFO info "$@"
}
# ViashDebug: log all events, for debugging purposes
# usage: ViashDebug This just happened.
# stdout: Your input, prepended by '[debug] '.
function ViashDebug {
ViashLog $VIASH_LOGCODE_DEBUG debug "$@"
}
# find source folder of this component
VIASH_META_RESOURCES_DIR=`ViashSourceDir ${BASH_SOURCE[0]}`
# find the root of the built components & dependencies
VIASH_TARGET_DIR=`ViashFindTargetDir $VIASH_META_RESOURCES_DIR`
# define meta fields
VIASH_META_NAME="merge_quant_results"
VIASH_META_FUNCTIONALITY_NAME="merge_quant_results"
VIASH_META_EXECUTABLE="$VIASH_META_RESOURCES_DIR/$VIASH_META_NAME"
VIASH_META_CONFIG="$VIASH_META_RESOURCES_DIR/.config.vsh.yaml"
VIASH_META_TEMP_DIR="$VIASH_TEMP"
# ViashHelp: Display helpful explanation about this executable
function ViashHelp {
echo "merge_quant_results main"
echo ""
echo "A sub-workflow to merge the counts obtained from salmon quant across all"
echo "samples."
echo ""
echo "Input:"
echo " --salmon_quant_results"
echo " type: file, multiple values allowed, file must exist"
echo ""
echo " --kallisto_quant_results"
echo " type: file, multiple values allowed, file must exist"
echo ""
echo " --gtf"
echo " type: file, file must exist"
echo ""
echo " --gtf_extra_attributes"
echo " type: string"
echo " default: gene_name"
echo ""
echo " --gtf_group_features"
echo " type: string"
echo " default: gene_id"
echo ""
echo " --quant_type"
echo " type: string"
echo " default: salmon"
echo " choices: [ salmon, kallisto ]"
echo " Quantification method used."
echo ""
echo " --versions"
echo " type: file"
echo ""
echo "Output:"
echo " --tpm_gene"
echo " type: file, output, file must exist"
echo " example: gene_tpm.tsv"
echo ""
echo " --counts_gene"
echo " type: file, output, file must exist"
echo " example: gene_counts.tsv"
echo ""
echo " --counts_gene_length_scaled"
echo " type: file, output, file must exist"
echo " example: gene_counts_length_scaled.tsv"
echo ""
echo " --counts_gene_scaled"
echo " type: file, output, file must exist"
echo " example: gene_counts_scaled.tsv"
echo ""
echo " --tpm_transcript"
echo " type: file, output, file must exist"
echo " example: transcript_tpm.tsv"
echo ""
echo " --lengths_gene"
echo " type: file, output, file must exist"
echo " example: gene_length.tsv"
echo ""
echo " --counts_transcript"
echo " type: file, output, file must exist"
echo " example: transcript_counts.tsv"
echo ""
echo " --lengths_transcript"
echo " type: file, output, file must exist"
echo " example: transcript_length.tsv"
echo ""
echo " --quant_merged_summarizedexperiment"
echo " type: file, output, file must exist"
echo " example: quant_merged_summarizedexperiment"
}
# initialise variables
VIASH_MODE='run'
VIASH_ENGINE_ID='native'
# initialise array
VIASH_POSITIONAL_ARGS=''
while [[ $# -gt 0 ]]; do
case "$1" in
-h|--help)
ViashHelp
exit
;;
---v|---verbose)
let "VIASH_VERBOSITY=VIASH_VERBOSITY+1"
shift 1
;;
---verbosity)
VIASH_VERBOSITY="$2"
shift 2
;;
---verbosity=*)
VIASH_VERBOSITY="$(ViashRemoveFlags "$1")"
shift 1
;;
--version)
echo "merge_quant_results main"
exit
;;
--salmon_quant_results)
if [ -z "$VIASH_PAR_SALMON_QUANT_RESULTS" ]; then
VIASH_PAR_SALMON_QUANT_RESULTS="$2"
else
VIASH_PAR_SALMON_QUANT_RESULTS="$VIASH_PAR_SALMON_QUANT_RESULTS,""$2"
fi
[ $# -lt 2 ] && ViashError Not enough arguments passed to --salmon_quant_results. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--salmon_quant_results=*)
if [ -z "$VIASH_PAR_SALMON_QUANT_RESULTS" ]; then
VIASH_PAR_SALMON_QUANT_RESULTS=$(ViashRemoveFlags "$1")
else
VIASH_PAR_SALMON_QUANT_RESULTS="$VIASH_PAR_SALMON_QUANT_RESULTS,"$(ViashRemoveFlags "$1")
fi
shift 1
;;
--kallisto_quant_results)
if [ -z "$VIASH_PAR_KALLISTO_QUANT_RESULTS" ]; then
VIASH_PAR_KALLISTO_QUANT_RESULTS="$2"
else
VIASH_PAR_KALLISTO_QUANT_RESULTS="$VIASH_PAR_KALLISTO_QUANT_RESULTS,""$2"
fi
[ $# -lt 2 ] && ViashError Not enough arguments passed to --kallisto_quant_results. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--kallisto_quant_results=*)
if [ -z "$VIASH_PAR_KALLISTO_QUANT_RESULTS" ]; then
VIASH_PAR_KALLISTO_QUANT_RESULTS=$(ViashRemoveFlags "$1")
else
VIASH_PAR_KALLISTO_QUANT_RESULTS="$VIASH_PAR_KALLISTO_QUANT_RESULTS,"$(ViashRemoveFlags "$1")
fi
shift 1
;;
--gtf)
[ -n "$VIASH_PAR_GTF" ] && ViashError Bad arguments for option \'--gtf\': \'$VIASH_PAR_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_GTF="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --gtf. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--gtf=*)
[ -n "$VIASH_PAR_GTF" ] && ViashError Bad arguments for option \'--gtf=*\': \'$VIASH_PAR_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_GTF=$(ViashRemoveFlags "$1")
shift 1
;;
--gtf_extra_attributes)
[ -n "$VIASH_PAR_GTF_EXTRA_ATTRIBUTES" ] && ViashError Bad arguments for option \'--gtf_extra_attributes\': \'$VIASH_PAR_GTF_EXTRA_ATTRIBUTES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_GTF_EXTRA_ATTRIBUTES="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --gtf_extra_attributes. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--gtf_extra_attributes=*)
[ -n "$VIASH_PAR_GTF_EXTRA_ATTRIBUTES" ] && ViashError Bad arguments for option \'--gtf_extra_attributes=*\': \'$VIASH_PAR_GTF_EXTRA_ATTRIBUTES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_GTF_EXTRA_ATTRIBUTES=$(ViashRemoveFlags "$1")
shift 1
;;
--gtf_group_features)
[ -n "$VIASH_PAR_GTF_GROUP_FEATURES" ] && ViashError Bad arguments for option \'--gtf_group_features\': \'$VIASH_PAR_GTF_GROUP_FEATURES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_GTF_GROUP_FEATURES="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --gtf_group_features. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--gtf_group_features=*)
[ -n "$VIASH_PAR_GTF_GROUP_FEATURES" ] && ViashError Bad arguments for option \'--gtf_group_features=*\': \'$VIASH_PAR_GTF_GROUP_FEATURES\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_GTF_GROUP_FEATURES=$(ViashRemoveFlags "$1")
shift 1
;;
--quant_type)
[ -n "$VIASH_PAR_QUANT_TYPE" ] && ViashError Bad arguments for option \'--quant_type\': \'$VIASH_PAR_QUANT_TYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_QUANT_TYPE="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --quant_type. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--quant_type=*)
[ -n "$VIASH_PAR_QUANT_TYPE" ] && ViashError Bad arguments for option \'--quant_type=*\': \'$VIASH_PAR_QUANT_TYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_QUANT_TYPE=$(ViashRemoveFlags "$1")
shift 1
;;
--versions)
[ -n "$VIASH_PAR_VERSIONS" ] && ViashError Bad arguments for option \'--versions\': \'$VIASH_PAR_VERSIONS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_VERSIONS="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --versions. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--versions=*)
[ -n "$VIASH_PAR_VERSIONS" ] && ViashError Bad arguments for option \'--versions=*\': \'$VIASH_PAR_VERSIONS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_VERSIONS=$(ViashRemoveFlags "$1")
shift 1
;;
--tpm_gene)
[ -n "$VIASH_PAR_TPM_GENE" ] && ViashError Bad arguments for option \'--tpm_gene\': \'$VIASH_PAR_TPM_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_TPM_GENE="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --tpm_gene. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--tpm_gene=*)
[ -n "$VIASH_PAR_TPM_GENE" ] && ViashError Bad arguments for option \'--tpm_gene=*\': \'$VIASH_PAR_TPM_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_TPM_GENE=$(ViashRemoveFlags "$1")
shift 1
;;
--counts_gene)
[ -n "$VIASH_PAR_COUNTS_GENE" ] && ViashError Bad arguments for option \'--counts_gene\': \'$VIASH_PAR_COUNTS_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_COUNTS_GENE="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --counts_gene. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--counts_gene=*)
[ -n "$VIASH_PAR_COUNTS_GENE" ] && ViashError Bad arguments for option \'--counts_gene=*\': \'$VIASH_PAR_COUNTS_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_COUNTS_GENE=$(ViashRemoveFlags "$1")
shift 1
;;
--counts_gene_length_scaled)
[ -n "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED" ] && ViashError Bad arguments for option \'--counts_gene_length_scaled\': \'$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_COUNTS_GENE_LENGTH_SCALED="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --counts_gene_length_scaled. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--counts_gene_length_scaled=*)
[ -n "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED" ] && ViashError Bad arguments for option \'--counts_gene_length_scaled=*\': \'$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_COUNTS_GENE_LENGTH_SCALED=$(ViashRemoveFlags "$1")
shift 1
;;
--counts_gene_scaled)
[ -n "$VIASH_PAR_COUNTS_GENE_SCALED" ] && ViashError Bad arguments for option \'--counts_gene_scaled\': \'$VIASH_PAR_COUNTS_GENE_SCALED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_COUNTS_GENE_SCALED="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --counts_gene_scaled. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--counts_gene_scaled=*)
[ -n "$VIASH_PAR_COUNTS_GENE_SCALED" ] && ViashError Bad arguments for option \'--counts_gene_scaled=*\': \'$VIASH_PAR_COUNTS_GENE_SCALED\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_COUNTS_GENE_SCALED=$(ViashRemoveFlags "$1")
shift 1
;;
--tpm_transcript)
[ -n "$VIASH_PAR_TPM_TRANSCRIPT" ] && ViashError Bad arguments for option \'--tpm_transcript\': \'$VIASH_PAR_TPM_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_TPM_TRANSCRIPT="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --tpm_transcript. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--tpm_transcript=*)
[ -n "$VIASH_PAR_TPM_TRANSCRIPT" ] && ViashError Bad arguments for option \'--tpm_transcript=*\': \'$VIASH_PAR_TPM_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_TPM_TRANSCRIPT=$(ViashRemoveFlags "$1")
shift 1
;;
--lengths_gene)
[ -n "$VIASH_PAR_LENGTHS_GENE" ] && ViashError Bad arguments for option \'--lengths_gene\': \'$VIASH_PAR_LENGTHS_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_LENGTHS_GENE="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --lengths_gene. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--lengths_gene=*)
[ -n "$VIASH_PAR_LENGTHS_GENE" ] && ViashError Bad arguments for option \'--lengths_gene=*\': \'$VIASH_PAR_LENGTHS_GENE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_LENGTHS_GENE=$(ViashRemoveFlags "$1")
shift 1
;;
--counts_transcript)
[ -n "$VIASH_PAR_COUNTS_TRANSCRIPT" ] && ViashError Bad arguments for option \'--counts_transcript\': \'$VIASH_PAR_COUNTS_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_COUNTS_TRANSCRIPT="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --counts_transcript. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--counts_transcript=*)
[ -n "$VIASH_PAR_COUNTS_TRANSCRIPT" ] && ViashError Bad arguments for option \'--counts_transcript=*\': \'$VIASH_PAR_COUNTS_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_COUNTS_TRANSCRIPT=$(ViashRemoveFlags "$1")
shift 1
;;
--lengths_transcript)
[ -n "$VIASH_PAR_LENGTHS_TRANSCRIPT" ] && ViashError Bad arguments for option \'--lengths_transcript\': \'$VIASH_PAR_LENGTHS_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_LENGTHS_TRANSCRIPT="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --lengths_transcript. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--lengths_transcript=*)
[ -n "$VIASH_PAR_LENGTHS_TRANSCRIPT" ] && ViashError Bad arguments for option \'--lengths_transcript=*\': \'$VIASH_PAR_LENGTHS_TRANSCRIPT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_LENGTHS_TRANSCRIPT=$(ViashRemoveFlags "$1")
shift 1
;;
--quant_merged_summarizedexperiment)
[ -n "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ] && ViashError Bad arguments for option \'--quant_merged_summarizedexperiment\': \'$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --quant_merged_summarizedexperiment. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--quant_merged_summarizedexperiment=*)
[ -n "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ] && ViashError Bad arguments for option \'--quant_merged_summarizedexperiment=*\': \'$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT=$(ViashRemoveFlags "$1")
shift 1
;;
---engine)
VIASH_ENGINE_ID="$2"
shift 2
;;
---engine=*)
VIASH_ENGINE_ID="$(ViashRemoveFlags "$1")"
shift 1
;;
---cpus)
[ -n "$VIASH_META_CPUS" ] && ViashError Bad arguments for option \'---cpus\': \'$VIASH_META_CPUS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_META_CPUS="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to ---cpus. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
---cpus=*)
[ -n "$VIASH_META_CPUS" ] && ViashError Bad arguments for option \'---cpus=*\': \'$VIASH_META_CPUS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_META_CPUS=$(ViashRemoveFlags "$1")
shift 1
;;
---memory)
[ -n "$VIASH_META_MEMORY" ] && ViashError Bad arguments for option \'---memory\': \'$VIASH_META_MEMORY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_META_MEMORY="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to ---memory. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
---memory=*)
[ -n "$VIASH_META_MEMORY" ] && ViashError Bad arguments for option \'---memory=*\': \'$VIASH_META_MEMORY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_META_MEMORY=$(ViashRemoveFlags "$1")
shift 1
;;
*) # positional arg or unknown option
# since the positional args will be eval'd, can we always quote, instead of using ViashQuote
VIASH_POSITIONAL_ARGS="$VIASH_POSITIONAL_ARGS '$1'"
[[ $1 == -* ]] && ViashWarning $1 looks like a parameter but is not a defined parameter and will instead be treated as a positional argument. Use "--help" to get more information on the parameters.
shift # past argument
;;
esac
done
# parse positional parameters
eval set -- $VIASH_POSITIONAL_ARGS
if [ "$VIASH_ENGINE_ID" == "native" ] ; then
VIASH_ENGINE_TYPE='native'
else
ViashError "Engine '$VIASH_ENGINE_ID' is not recognized. Options are: native."
exit 1
fi
# setting computational defaults
# helper function for parsing memory strings
function ViashMemoryAsBytes {
local memory=`echo "$1" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]'`
local memory_regex='^([0-9]+)([kmgtp]i?b?|b)$'
if [[ $memory =~ $memory_regex ]]; then
local number=${memory/[^0-9]*/}
local symbol=${memory/*[0-9]/}
case $symbol in
b) memory_b=$number ;;
kb|k) memory_b=$(( $number * 1000 )) ;;
mb|m) memory_b=$(( $number * 1000 * 1000 )) ;;
gb|g) memory_b=$(( $number * 1000 * 1000 * 1000 )) ;;
tb|t) memory_b=$(( $number * 1000 * 1000 * 1000 * 1000 )) ;;
pb|p) memory_b=$(( $number * 1000 * 1000 * 1000 * 1000 * 1000 )) ;;
kib|ki) memory_b=$(( $number * 1024 )) ;;
mib|mi) memory_b=$(( $number * 1024 * 1024 )) ;;
gib|gi) memory_b=$(( $number * 1024 * 1024 * 1024 )) ;;
tib|ti) memory_b=$(( $number * 1024 * 1024 * 1024 * 1024 )) ;;
pib|pi) memory_b=$(( $number * 1024 * 1024 * 1024 * 1024 * 1024 )) ;;
esac
echo "$memory_b"
fi
}
# compute memory in different units
if [ ! -z ${VIASH_META_MEMORY+x} ]; then
VIASH_META_MEMORY_B=`ViashMemoryAsBytes $VIASH_META_MEMORY`
# do not define other variables if memory_b is an empty string
if [ ! -z "$VIASH_META_MEMORY_B" ]; then
VIASH_META_MEMORY_KB=$(( ($VIASH_META_MEMORY_B+999) / 1000 ))
VIASH_META_MEMORY_MB=$(( ($VIASH_META_MEMORY_KB+999) / 1000 ))
VIASH_META_MEMORY_GB=$(( ($VIASH_META_MEMORY_MB+999) / 1000 ))
VIASH_META_MEMORY_TB=$(( ($VIASH_META_MEMORY_GB+999) / 1000 ))
VIASH_META_MEMORY_PB=$(( ($VIASH_META_MEMORY_TB+999) / 1000 ))
VIASH_META_MEMORY_KIB=$(( ($VIASH_META_MEMORY_B+1023) / 1024 ))
VIASH_META_MEMORY_MIB=$(( ($VIASH_META_MEMORY_KIB+1023) / 1024 ))
VIASH_META_MEMORY_GIB=$(( ($VIASH_META_MEMORY_MIB+1023) / 1024 ))
VIASH_META_MEMORY_TIB=$(( ($VIASH_META_MEMORY_GIB+1023) / 1024 ))
VIASH_META_MEMORY_PIB=$(( ($VIASH_META_MEMORY_TIB+1023) / 1024 ))
else
# unset memory if string is empty
unset $VIASH_META_MEMORY_B
fi
fi
# unset nproc if string is empty
if [ -z "$VIASH_META_CPUS" ]; then
unset $VIASH_META_CPUS
fi
# check whether required parameters exist
if [ -z ${VIASH_META_NAME+x} ]; then
ViashError 'name' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
if [ -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then
ViashError 'functionality_name' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
if [ -z ${VIASH_META_RESOURCES_DIR+x} ]; then
ViashError 'resources_dir' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
if [ -z ${VIASH_META_EXECUTABLE+x} ]; then
ViashError 'executable' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
if [ -z ${VIASH_META_CONFIG+x} ]; then
ViashError 'config' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
if [ -z ${VIASH_META_TEMP_DIR+x} ]; then
ViashError 'temp_dir' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
# filling in defaults
if [ -z ${VIASH_PAR_GTF_EXTRA_ATTRIBUTES+x} ]; then
VIASH_PAR_GTF_EXTRA_ATTRIBUTES="gene_name"
fi
if [ -z ${VIASH_PAR_GTF_GROUP_FEATURES+x} ]; then
VIASH_PAR_GTF_GROUP_FEATURES="gene_id"
fi
if [ -z ${VIASH_PAR_QUANT_TYPE+x} ]; then
VIASH_PAR_QUANT_TYPE="salmon"
fi
# check whether required files exist
if [ ! -z "$VIASH_PAR_SALMON_QUANT_RESULTS" ]; then
IFS=','
set -f
for file in $VIASH_PAR_SALMON_QUANT_RESULTS; do
unset IFS
if [ ! -e "$file" ]; then
ViashError "Input file '$file' does not exist."
exit 1
fi
done
set +f
fi
if [ ! -z "$VIASH_PAR_KALLISTO_QUANT_RESULTS" ]; then
IFS=','
set -f
for file in $VIASH_PAR_KALLISTO_QUANT_RESULTS; do
unset IFS
if [ ! -e "$file" ]; then
ViashError "Input file '$file' does not exist."
exit 1
fi
done
set +f
fi
if [ ! -z "$VIASH_PAR_GTF" ] && [ ! -e "$VIASH_PAR_GTF" ]; then
ViashError "Input file '$VIASH_PAR_GTF' does not exist."
exit 1
fi
# check whether parameters values are of the right type
if [[ -n "$VIASH_META_CPUS" ]]; then
if ! [[ "$VIASH_META_CPUS" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'cpus' has to be an integer. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_B" ]]; then
if ! [[ "$VIASH_META_MEMORY_B" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_b' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_KB" ]]; then
if ! [[ "$VIASH_META_MEMORY_KB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_kb' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_MB" ]]; then
if ! [[ "$VIASH_META_MEMORY_MB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_mb' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_GB" ]]; then
if ! [[ "$VIASH_META_MEMORY_GB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_gb' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_TB" ]]; then
if ! [[ "$VIASH_META_MEMORY_TB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_tb' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_PB" ]]; then
if ! [[ "$VIASH_META_MEMORY_PB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_pb' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_KIB" ]]; then
if ! [[ "$VIASH_META_MEMORY_KIB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_kib' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_MIB" ]]; then
if ! [[ "$VIASH_META_MEMORY_MIB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_mib' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_GIB" ]]; then
if ! [[ "$VIASH_META_MEMORY_GIB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_gib' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_TIB" ]]; then
if ! [[ "$VIASH_META_MEMORY_TIB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_tib' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_PIB" ]]; then
if ! [[ "$VIASH_META_MEMORY_PIB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_pib' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
# check whether value is belongs to a set of choices
if [ ! -z "$VIASH_PAR_QUANT_TYPE" ]; then
VIASH_PAR_QUANT_TYPE_CHOICES=("salmon;kallisto")
IFS=';'
set -f
if ! [[ ";${VIASH_PAR_QUANT_TYPE_CHOICES[*]};" =~ ";$VIASH_PAR_QUANT_TYPE;" ]]; then
ViashError '--quant_type' specified value of \'$VIASH_PAR_QUANT_TYPE\' is not in the list of allowed values. Use "--help" to get more information on the parameters.
exit 1
fi
set +f
unset IFS
fi
# create parent directories of output files, if so desired
if [ ! -z "$VIASH_PAR_TPM_GENE" ] && [ ! -d "$(dirname "$VIASH_PAR_TPM_GENE")" ]; then
mkdir -p "$(dirname "$VIASH_PAR_TPM_GENE")"
fi
if [ ! -z "$VIASH_PAR_COUNTS_GENE" ] && [ ! -d "$(dirname "$VIASH_PAR_COUNTS_GENE")" ]; then
mkdir -p "$(dirname "$VIASH_PAR_COUNTS_GENE")"
fi
if [ ! -z "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED" ] && [ ! -d "$(dirname "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED")" ]; then
mkdir -p "$(dirname "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED")"
fi
if [ ! -z "$VIASH_PAR_COUNTS_GENE_SCALED" ] && [ ! -d "$(dirname "$VIASH_PAR_COUNTS_GENE_SCALED")" ]; then
mkdir -p "$(dirname "$VIASH_PAR_COUNTS_GENE_SCALED")"
fi
if [ ! -z "$VIASH_PAR_TPM_TRANSCRIPT" ] && [ ! -d "$(dirname "$VIASH_PAR_TPM_TRANSCRIPT")" ]; then
mkdir -p "$(dirname "$VIASH_PAR_TPM_TRANSCRIPT")"
fi
if [ ! -z "$VIASH_PAR_LENGTHS_GENE" ] && [ ! -d "$(dirname "$VIASH_PAR_LENGTHS_GENE")" ]; then
mkdir -p "$(dirname "$VIASH_PAR_LENGTHS_GENE")"
fi
if [ ! -z "$VIASH_PAR_COUNTS_TRANSCRIPT" ] && [ ! -d "$(dirname "$VIASH_PAR_COUNTS_TRANSCRIPT")" ]; then
mkdir -p "$(dirname "$VIASH_PAR_COUNTS_TRANSCRIPT")"
fi
if [ ! -z "$VIASH_PAR_LENGTHS_TRANSCRIPT" ] && [ ! -d "$(dirname "$VIASH_PAR_LENGTHS_TRANSCRIPT")" ]; then
mkdir -p "$(dirname "$VIASH_PAR_LENGTHS_TRANSCRIPT")"
fi
if [ ! -z "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ] && [ ! -d "$(dirname "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT")" ]; then
mkdir -p "$(dirname "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT")"
fi
if [ "$VIASH_ENGINE_ID" == "native" ] ; then
if [ "$VIASH_MODE" == "run" ]; then
VIASH_CMD="bash"
else
ViashError "Engine '$VIASH_ENGINE_ID' does not support mode '$VIASH_MODE'."
exit 1
fi
fi
# set dependency paths
VIASH_DEP_TX2GENE="$VIASH_META_RESOURCES_DIR/../../../nextflow/tx2gene/main.nf"
VIASH_DEP_TXIMPORT="$VIASH_META_RESOURCES_DIR/../../../nextflow/tximport/main.nf"
VIASH_DEP_SUMMARIZEDEXPERIMENT="$VIASH_META_RESOURCES_DIR/../../../nextflow/summarizedexperiment/main.nf"
ViashDebug "Running command: $(echo $VIASH_CMD)"
cat << VIASHEOF | eval $VIASH_CMD
set -e
tempscript=\$(mktemp "$VIASH_META_TEMP_DIR/viash-run-merge_quant_results-XXXXXX").nf
function clean_up {
rm "\$tempscript"
}
function interrupt {
echo -e "\nCTRL-C Pressed..."
exit 1
}
trap clean_up EXIT
trap interrupt INT SIGINT
cat > "\$tempscript" << 'VIASHMAIN'
//// VIASH START
// The following code has been auto-generated by Viash.
//// VIASH END
workflow run_wf {
take:
input_ch
main:
output_ch = input_ch
| map { id, state ->
def quant_results = state.quant_type == 'kallisto' ? state.kallisto_quant_results : state.salmon_quant_results
[id, state + [quant_results: quant_results]]
}
| tx2gene.run (
fromState: [
"quant_results": "quant_results",
"gtf_extra_attributes": "gtf_extra_attributes",
"gtf": "gtf",
"gtf_group_features": "gtf_group_features",
"quant_type": "quant_type"
],
toState: [ "tx2gene_tsv": "tsv" ]
)
| tximport.run (
fromState: [
"quant_results": "quant_results",
"tx2gene_tsv": "tx2gene_tsv",
"quant_type": "quant_type"
],
toState: [
"tpm_gene": "tpm_gene",
"counts_gene": "counts_gene",
"counts_gene_length_scaled": "counts_gene_length_scaled",
"counts_gene_scaled": "counts_gene_scaled",
"tpm_transcript": "tpm_transcript",
"counts_transcript": "counts_transcript",
"length_gene": "length_gene",
"length_transcript": "length_transcript"
]
)
| summarizedexperiment.run (
fromState: [
"tpm_gene": "tpm_gene",
"counts_gene": "counts_gene",
"counts_gene_length_scaled": "counts_gene_length_scaled",
"counts_gene_scaled": "counts_gene_scaled",
"tpm_transcript": "tpm_transcript",
"counts_transcript": "counts_transcript",
"tx2gene_tsv": "tx2gene_tsv"
],
toState: [ "quant_merged_summarizedexperiment": "output" ]
)
| setState (
[ "tpm_gene": "tpm_gene",
"counts_gene": "counts_gene",
"counts_gene_length_scaled": "counts_gene_length_scaled",
"counts_gene_scaled": "counts_gene_scaled",
"tpm_transcript": "tpm_transcript",
"counts_transcript": "counts_transcript",
"quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment" ]
)
emit:
output_ch
}
VIASHMAIN
nextflow run . -main-script "\$tempscript" &
wait "\$!"
VIASHEOF
# check whether required files exist
if [ ! -z "$VIASH_PAR_TPM_GENE" ] && [ ! -e "$VIASH_PAR_TPM_GENE" ]; then
ViashError "Output file '$VIASH_PAR_TPM_GENE' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_COUNTS_GENE" ] && [ ! -e "$VIASH_PAR_COUNTS_GENE" ]; then
ViashError "Output file '$VIASH_PAR_COUNTS_GENE' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED" ] && [ ! -e "$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED" ]; then
ViashError "Output file '$VIASH_PAR_COUNTS_GENE_LENGTH_SCALED' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_COUNTS_GENE_SCALED" ] && [ ! -e "$VIASH_PAR_COUNTS_GENE_SCALED" ]; then
ViashError "Output file '$VIASH_PAR_COUNTS_GENE_SCALED' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_TPM_TRANSCRIPT" ] && [ ! -e "$VIASH_PAR_TPM_TRANSCRIPT" ]; then
ViashError "Output file '$VIASH_PAR_TPM_TRANSCRIPT' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_LENGTHS_GENE" ] && [ ! -e "$VIASH_PAR_LENGTHS_GENE" ]; then
ViashError "Output file '$VIASH_PAR_LENGTHS_GENE' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_COUNTS_TRANSCRIPT" ] && [ ! -e "$VIASH_PAR_COUNTS_TRANSCRIPT" ]; then
ViashError "Output file '$VIASH_PAR_COUNTS_TRANSCRIPT' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_LENGTHS_TRANSCRIPT" ] && [ ! -e "$VIASH_PAR_LENGTHS_TRANSCRIPT" ]; then
ViashError "Output file '$VIASH_PAR_LENGTHS_TRANSCRIPT' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ] && [ ! -e "$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT" ]; then
ViashError "Output file '$VIASH_PAR_QUANT_MERGED_SUMMARIZEDEXPERIMENT' does not exist."
exit 1
fi
exit 0

View File

@@ -0,0 +1,513 @@
name: "post_processing"
namespace: "workflows"
version: "main"
argument_groups:
- name: "Input"
arguments:
- type: "string"
name: "--id"
description: "ID of the sample."
info: null
example:
- "foo"
required: true
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--strandedness"
description: "Sample strand-specificity. Must be one of unstranded, forward, reverse\
\ or auto"
info: null
default:
- "auto"
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--paired"
description: "Paired fastq files or not?"
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--fasta"
description: "Path to FASTA genome file."
info: null
must_exist: true
create_parent: true
required: true
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--fai"
description: "Path to FASTA index"
info: null
must_exist: true
create_parent: true
required: true
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--gtf"
description: "GTF file"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--genome_bam"
description: "Genome BAM file"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--chrom_sizes"
description: "File containing chromosome lengths"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--star_multiqc"
description: "STAR align log file."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--extra_picard_args"
description: "Extra arguments to pass to picard MarkDuplicates command in addition\
\ to defaults defined by the pipeline."
info: null
default:
- ""
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--extra_stringtie_args"
description: "Extra arguments to pass to stringtie command in addition to defaults\
\ defined by the pipeline."
info: null
default:
- ""
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--stringtie_ignore_gtf"
description: "Perform reference-guided de novo assembly of transcripts using StringTie,\
\ i.e. don't restrict to those in GTF file."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--extra_bedtools_args"
description: "Extra arguments to pass to bedtools genomecov command in addition\
\ to defaults defined by the pipeline."
info: null
default:
- ""
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--bam_csi_index"
description: "Create a CSI index for BAM files instead of the traditional BAI\
\ index. This will be required for genomes with larger chromosome sizes."
info: null
default:
- false
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "integer"
name: "--min_mapped_reads"
description: "Minimum percentage of uniquely mapped reads below which samples\
\ are removed from further processing."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--with_umi"
description: "Enable UMI-based read deduplication."
info: null
default:
- false
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--skip_qc"
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--skip_markduplicates"
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--skip_stringtie"
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--skip_bigwig"
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- name: "Output"
arguments:
- type: "file"
name: "--processed_genome_bam"
info: null
default:
- "$id.markdup.sorted.bam"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--genome_bam_index"
info: null
default:
- "$id.markdup.sorted.bam"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--genome_bam_stats"
info: null
default:
- "$id.markdup.sorted.bam.stats"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--genome_bam_flagstat"
info: null
default:
- "$id.markdup.sorted.bam.flagstat"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--genome_bam_idxstats"
info: null
default:
- "$id.markdup.sorted.bam.idxstats"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--markduplicates_metrics"
info: null
default:
- "$id.markdup.sorted.MarkDuplicates.metrics.txt"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--stringtie_transcript_gtf"
info: null
default:
- "$id.stringtie.transcripts.gtf"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--stringtie_coverage_gtf"
info: null
default:
- "$id.stringtie.coverage.gtf"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--stringtie_abundance"
info: null
default:
- "$id.stringtie.gene_abundance.txt"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--stringtie_ballgown"
info: null
default:
- "$id.stringtie.ballgown"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--bedgraph_forward"
info: null
default:
- "$id.forward.bedgraph"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--bedgraph_reverse"
info: null
default:
- "$id.reverse.bedgraph"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--bigwig_forward"
info: null
default:
- "$id.forward.bigwig"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--bigwig_reverse"
info: null
default:
- "$id.reverse.bigwig"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
resources:
- type: "nextflow_script"
path: "main.nf"
is_executable: true
entrypoint: "run_wf"
description: "A viash sub-workflow for the post-processing stage of nf-core/rnaseq\
\ pipeline.\n"
info: null
status: "enabled"
requirements:
commands:
- "ps"
dependencies:
- name: "picard_markduplicates"
repository:
type: "local"
- name: "samtools/samtools_sort"
repository:
type: "vsh"
repo: "vsh/biobox"
tag: "v0.1"
- name: "samtools/samtools_index"
repository:
type: "vsh"
repo: "vsh/biobox"
tag: "v0.1"
- name: "samtools/samtools_stats"
repository:
type: "vsh"
repo: "vsh/biobox"
tag: "v0.1"
- name: "samtools/samtools_flagstat"
repository:
type: "vsh"
repo: "vsh/biobox"
tag: "v0.1"
- name: "samtools/samtools_idxstats"
repository:
type: "vsh"
repo: "vsh/biobox"
tag: "v0.1"
- name: "stringtie"
repository:
type: "local"
- name: "bedtools_genomecov"
repository:
type: "local"
- name: "ucsc/bedclip"
repository:
type: "local"
- name: "ucsc/bedgraphtobigwig"
repository:
type: "local"
repositories:
- type: "vsh"
name: "biobox"
repo: "vsh/biobox"
tag: "v0.1"
runners:
- type: "executable"
id: "executable"
docker_setup_strategy: "ifneedbepullelsecachedbuild"
- type: "nextflow"
id: "nextflow"
directives:
tag: "$id"
auto:
simplifyInput: true
simplifyOutput: false
transcript: false
publish: false
config:
labels:
mem1gb: "memory = 1000000000.B"
mem2gb: "memory = 2000000000.B"
mem5gb: "memory = 5000000000.B"
mem10gb: "memory = 10000000000.B"
mem20gb: "memory = 20000000000.B"
mem50gb: "memory = 50000000000.B"
mem100gb: "memory = 100000000000.B"
mem200gb: "memory = 200000000000.B"
mem500gb: "memory = 500000000000.B"
mem1tb: "memory = 1000000000000.B"
mem2tb: "memory = 2000000000000.B"
mem5tb: "memory = 5000000000000.B"
mem10tb: "memory = 10000000000000.B"
mem20tb: "memory = 20000000000000.B"
mem50tb: "memory = 50000000000000.B"
mem100tb: "memory = 100000000000000.B"
mem200tb: "memory = 200000000000000.B"
mem500tb: "memory = 500000000000000.B"
mem1gib: "memory = 1073741824.B"
mem2gib: "memory = 2147483648.B"
mem4gib: "memory = 4294967296.B"
mem8gib: "memory = 8589934592.B"
mem16gib: "memory = 17179869184.B"
mem32gib: "memory = 34359738368.B"
mem64gib: "memory = 68719476736.B"
mem128gib: "memory = 137438953472.B"
mem256gib: "memory = 274877906944.B"
mem512gib: "memory = 549755813888.B"
mem1tib: "memory = 1099511627776.B"
mem2tib: "memory = 2199023255552.B"
mem4tib: "memory = 4398046511104.B"
mem8tib: "memory = 8796093022208.B"
mem16tib: "memory = 17592186044416.B"
mem32tib: "memory = 35184372088832.B"
mem64tib: "memory = 70368744177664.B"
mem128tib: "memory = 140737488355328.B"
mem256tib: "memory = 281474976710656.B"
mem512tib: "memory = 562949953421312.B"
cpu1: "cpus = 1"
cpu2: "cpus = 2"
cpu5: "cpus = 5"
cpu10: "cpus = 10"
cpu20: "cpus = 20"
cpu50: "cpus = 50"
cpu100: "cpus = 100"
cpu200: "cpus = 200"
cpu500: "cpus = 500"
cpu1000: "cpus = 1000"
debug: false
container: "docker"
engines:
- type: "native"
id: "native"
build_info:
config: "src/workflows/post_processing/config.vsh.yaml"
runner: "executable"
engine: "native"
output: "target/executable/workflows/post_processing"
executable: "target/executable/workflows/post_processing/post_processing"
viash_version: "0.9.0"
git_commit: "1e1ffb315fefec05db2ee0c62e1c98ce4b49929c"
git_remote: "https://github.com/viash-hub/rnaseq"
dependencies:
- "target/nextflow/picard_markduplicates"
- "target/dependencies/vsh/vsh/biobox/v0.1/nextflow/samtools/samtools_sort"
- "target/dependencies/vsh/vsh/biobox/v0.1/nextflow/samtools/samtools_index"
- "target/dependencies/vsh/vsh/biobox/v0.1/nextflow/samtools/samtools_stats"
- "target/dependencies/vsh/vsh/biobox/v0.1/nextflow/samtools/samtools_flagstat"
- "target/dependencies/vsh/vsh/biobox/v0.1/nextflow/samtools/samtools_idxstats"
- "target/nextflow/stringtie"
- "target/nextflow/bedtools_genomecov"
- "target/nextflow/ucsc/bedclip"
- "target/nextflow/ucsc/bedgraphtobigwig"
package_config:
version: "main"
info:
test_resources:
- path: "gs://viash-hub-test-data/rnaseq/v1"
dest: "testData"
viash_version: "0.9.0"
source: "src"
target: "target"
config_mods:
- ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\
\ := '$id'\n"
- ".engines += { type: \"native\" }"
- ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'"
- ".engines[.type == 'docker'].target_tag := 'main'"
organization: "vsh"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,669 @@
name: "pre_processing"
namespace: "workflows"
version: "main"
argument_groups:
- name: "Inputs"
arguments:
- type: "string"
name: "--id"
description: "ID of the sample."
info: null
example:
- "foo"
required: true
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--fastq_1"
description: "Path to the sample (or read 1 of paired end sample)."
info: null
example:
- "input.fastq.gz"
must_exist: true
create_parent: true
required: true
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--fastq_2"
description: "Path to read 2 of the sample."
info: null
must_exist: false
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--strandedness"
description: "Sample strand-specificity. Must be one of unstranded, forward, reverse\
\ or auto"
info: null
default:
- "auto"
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--bbsplit_index"
description: "BBsplit index"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--bbsplit_fasta_list"
description: "Path to comma-separated file containing a list of reference genomes\
\ to filter reads against with BBSplit. To use BBSplit, \"--skip_bbsplit\" must\
\ be explicitly set to \"false\". The file should contain 2 (comma separated)\
\ columns - short name and full path to reference genome(s)"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--ribo_database_manifest"
description: "Text file containing paths to fasta files (one per line) that will\
\ be used to create the database for SortMeRNA."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--transcript_fasta"
description: "Path to FASTA transcriptome file."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--gtf"
description: "Path to GTF annotation file."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--salmon_index"
description: "Path to directory containing the Salmon index"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "integer"
name: "--num_trimmed_reads"
description: "Number of reads after trimming"
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- name: "Extra pipeline options"
arguments:
- type: "boolean"
name: "--skip_qc"
description: "Skip QC steps of the workflow."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- name: "FastQC options"
arguments:
- type: "boolean"
name: "--skip_fastqc"
description: "Skip FatQC step."
info: null
default:
- false
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- name: "UMI-tools options"
arguments:
- type: "boolean"
name: "--with_umi"
description: "Enable UMI-based read deduplication."
info: null
default:
- false
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--skip_umi_extract"
description: "Skip umi_tools extract step."
info: null
default:
- false
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--umitools_extract_method"
description: "UMI pattern to use."
info: null
default:
- "string"
required: false
choices:
- "string"
- "regex"
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--umitools_bc_pattern"
description: "The UMI barcode pattern to use e.g. 'NNNNNN' indicates that the\
\ first 6 nucleotides of the read are from the UMI."
info: null
default:
- ""
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--umitools_bc_pattern2"
description: "The UMI barcode pattern to use if the UMI is located in read 2."
info: null
default:
- ""
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "integer"
name: "--umi_discard_read"
description: "After UMI barcode extraction discard either R1 or R2 by setting\
\ this parameter to 1 or 2, respectively."
info: null
default:
- 0
required: false
choices:
- 0
- 1
- 2
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--umitools_umi_separator"
description: "The character that separates the UMI in the read name. Most likely\
\ a colon if you skipped the extraction with UMI-tools and used other software."
info: null
default:
- "_"
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--umitools_grouping_method"
description: "Method to use to determine read groups by subsuming those with similar\
\ UMIs. All methods start by identifying the reads with the same mapping position,\
\ but treat similar yet nonidentical UMIs differently."
info: null
default:
- "directional"
required: false
choices:
- "unique"
- "percentile"
- "cluster"
- "adjacency"
- "directional"
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--save_umi_intermeds"
description: "If this option is specified, intermediate FastQ and BAM files produced\
\ by UMI-tools are also saved in the results directory."
info: null
default:
- false
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- name: "Read trimming options"
arguments:
- type: "string"
name: "--trimmer"
description: "Specify the trimming tool to use."
info: null
default:
- "trimgalore"
required: false
choices:
- "trimgalore"
- "fastp"
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--extra_trimgalore_args"
description: "Extra arguments to pass to Trim Galore! command in addition to defaults\
\ defined by the pipeline."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "integer"
name: "--min_trimmed_reads"
description: "Minimum number of trimmed reads below which samples are removed\
\ from further processing. Some downstream steps in the pipeline will fail if\
\ this threshold is too low."
info: null
default:
- 10000
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--skip_trimming"
description: "Skip the adapter trimming step."
info: null
default:
- false
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--save_trimmed"
description: "Save the trimmed FastQ files in the results directory."
info: null
default:
- false
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- name: "Alignment options"
arguments:
- type: "string"
name: "--extra_salmon_quant_args"
description: "Extra arguments to pass to salmon quant command in addition to defaults\
\ defined by the pipeline."
info: null
default:
- ""
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- name: "Read filtering options"
arguments:
- type: "boolean"
name: "--skip_bbsplit"
description: "Skip BBSplit for removal of non-reference genome reads."
info: null
default:
- true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--remove_ribo_rna"
description: "Enable the removal of reads derived from ribosomal RNA using SortMeRNA."
info: null
default:
- false
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- name: "Other options"
arguments:
- type: "string"
name: "--extra_fq_subsample_args"
description: "Extra arguments to pass to fq subsample command in addition to defaults\
\ defined by the pipeline."
info: null
default:
- "--record-count 1000000 --seed 1"
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- name: "Output"
arguments:
- type: "file"
name: "--qc_output1"
description: "Path to output directory"
info: null
default:
- "$id.$key.read_1.fastq"
must_exist: false
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--qc_output2"
description: "Path to output directory"
info: null
default:
- "$id.$key.read_2.fastq"
must_exist: false
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--fastqc_html_1"
description: "FastQC HTML report for read 1."
info: null
default:
- "$id.read_1.fastqc.html"
must_exist: false
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--fastqc_html_2"
description: "FastQC HTML report for read 2."
info: null
default:
- "$id.read_2.fastqc.html"
must_exist: false
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--fastqc_zip_1"
description: "FastQC report archive for read 1."
info: null
default:
- "$id.read_1.fastqc.zip"
must_exist: false
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--fastqc_zip_2"
description: "FastQC report archive for read 2."
info: null
default:
- "$id.read_2.fastqc.zip"
must_exist: false
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--trim_log_1"
info: null
default:
- "$id.read_1.trimming_report.txt"
must_exist: false
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--trim_log_2"
info: null
default:
- "$id.read_2.trimming_report.txt"
must_exist: false
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--trim_html_1"
info: null
default:
- "$id.read_1.trimmed_fastqc.html"
must_exist: false
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--trim_html_2"
info: null
default:
- "$id.read_2.trimmed_fastqc.html"
must_exist: false
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--trim_zip_1"
info: null
default:
- "$id.read_1.trimmed_fastqc.zip"
must_exist: false
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--trim_zip_2"
info: null
default:
- "$id.read_2.trimmed_fastqc.zip"
must_exist: false
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--sortmerna_log"
description: "Sortmerna log file."
info: null
default:
- "$id.sortmerna.log"
must_exist: false
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--salmon_quant_output"
description: "Results from Salmon quant"
info: null
default:
- "$id.salmon_quant_output"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
resources:
- type: "nextflow_script"
path: "main.nf"
is_executable: true
entrypoint: "run_wf"
description: "A subworkflow for the pre-processing stage of the nf-core/rnaseq pipeline.\n"
info: null
status: "enabled"
requirements:
commands:
- "ps"
dependencies:
- name: "fastqc"
repository:
type: "local"
- name: "umitools/umitools_extract"
repository:
type: "local"
- name: "trimgalore"
repository:
type: "local"
- name: "bbmap_bbsplit"
repository:
type: "local"
- name: "sortmerna"
repository:
type: "local"
- name: "fastp"
repository:
type: "vsh"
repo: "vsh/biobox"
tag: "v0.1"
- name: "fq_subsample"
repository:
type: "local"
- name: "salmon/salmon_quant"
repository:
type: "vsh"
repo: "vsh/biobox"
tag: "v0.1"
repositories:
- type: "vsh"
name: "biobox"
repo: "vsh/biobox"
tag: "v0.1"
runners:
- type: "executable"
id: "executable"
docker_setup_strategy: "ifneedbepullelsecachedbuild"
- type: "nextflow"
id: "nextflow"
directives:
tag: "$id"
auto:
simplifyInput: true
simplifyOutput: false
transcript: false
publish: false
config:
labels:
mem1gb: "memory = 1000000000.B"
mem2gb: "memory = 2000000000.B"
mem5gb: "memory = 5000000000.B"
mem10gb: "memory = 10000000000.B"
mem20gb: "memory = 20000000000.B"
mem50gb: "memory = 50000000000.B"
mem100gb: "memory = 100000000000.B"
mem200gb: "memory = 200000000000.B"
mem500gb: "memory = 500000000000.B"
mem1tb: "memory = 1000000000000.B"
mem2tb: "memory = 2000000000000.B"
mem5tb: "memory = 5000000000000.B"
mem10tb: "memory = 10000000000000.B"
mem20tb: "memory = 20000000000000.B"
mem50tb: "memory = 50000000000000.B"
mem100tb: "memory = 100000000000000.B"
mem200tb: "memory = 200000000000000.B"
mem500tb: "memory = 500000000000000.B"
mem1gib: "memory = 1073741824.B"
mem2gib: "memory = 2147483648.B"
mem4gib: "memory = 4294967296.B"
mem8gib: "memory = 8589934592.B"
mem16gib: "memory = 17179869184.B"
mem32gib: "memory = 34359738368.B"
mem64gib: "memory = 68719476736.B"
mem128gib: "memory = 137438953472.B"
mem256gib: "memory = 274877906944.B"
mem512gib: "memory = 549755813888.B"
mem1tib: "memory = 1099511627776.B"
mem2tib: "memory = 2199023255552.B"
mem4tib: "memory = 4398046511104.B"
mem8tib: "memory = 8796093022208.B"
mem16tib: "memory = 17592186044416.B"
mem32tib: "memory = 35184372088832.B"
mem64tib: "memory = 70368744177664.B"
mem128tib: "memory = 140737488355328.B"
mem256tib: "memory = 281474976710656.B"
mem512tib: "memory = 562949953421312.B"
cpu1: "cpus = 1"
cpu2: "cpus = 2"
cpu5: "cpus = 5"
cpu10: "cpus = 10"
cpu20: "cpus = 20"
cpu50: "cpus = 50"
cpu100: "cpus = 100"
cpu200: "cpus = 200"
cpu500: "cpus = 500"
cpu1000: "cpus = 1000"
debug: false
container: "docker"
engines:
- type: "native"
id: "native"
build_info:
config: "src/workflows/pre_processing/config.vsh.yaml"
runner: "executable"
engine: "native"
output: "target/executable/workflows/pre_processing"
executable: "target/executable/workflows/pre_processing/pre_processing"
viash_version: "0.9.0"
git_commit: "1e1ffb315fefec05db2ee0c62e1c98ce4b49929c"
git_remote: "https://github.com/viash-hub/rnaseq"
dependencies:
- "target/nextflow/fastqc"
- "target/nextflow/umitools/umitools_extract"
- "target/nextflow/trimgalore"
- "target/nextflow/bbmap_bbsplit"
- "target/nextflow/sortmerna"
- "target/dependencies/vsh/vsh/biobox/v0.1/nextflow/fastp"
- "target/nextflow/fq_subsample"
- "target/dependencies/vsh/vsh/biobox/v0.1/nextflow/salmon/salmon_quant"
package_config:
version: "main"
info:
test_resources:
- path: "gs://viash-hub-test-data/rnaseq/v1"
dest: "testData"
viash_version: "0.9.0"
source: "src"
target: "target"
config_mods:
- ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\
\ := '$id'\n"
- ".engines += { type: \"native\" }"
- ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'"
- ".engines[.type == 'docker'].target_tag := 'main'"
organization: "vsh"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,530 @@
name: "prepare_genome"
namespace: "workflows"
version: "main"
argument_groups:
- name: "Input"
arguments:
- type: "file"
name: "--fasta"
description: "Path to FASTA genome file."
info: null
must_exist: true
create_parent: true
required: true
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--gtf"
description: "Path to GTF annotation file. This parameter is *mandatory* if --genome\
\ is not specified."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--gff"
description: "Path to GFF3 annotation file. Required if \"--gtf\" is not specified."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--additional_fasta"
description: "FASTA file to concatenate to genome FASTA file e.g. containing spike-in\
\ sequences."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--transcript_fasta"
description: "Path to FASTA transcriptome file."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--gene_bed"
description: "Path to BED file containing gene intervals. This will be created\
\ from the GTF file if not specified."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--splicesites"
description: "Splice sites file required for HISAT2."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--skip_bbsplit"
description: "Skip BBSplit for removal of non-reference genome reads."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--bbsplit_fasta_list"
description: "Path to comma-separated file containing a list of reference genomes\
\ to filter reads against with BBSplit. To use BBSplit, \"--skip_bbsplit\" must\
\ be explicitly set to \"false\". The file should contain 2 (comma separated)\
\ columns - short name and full path to reference genome(s)"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--star_index"
description: "Path to directory or tar.gz archive for pre-built STAR index."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--rsem_index"
description: "Path to directory or tar.gz archive for pre-built RSEM index."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "extra_rsem_prepare_reference_args"
description: "Extra arguments to pass to rsem-prepare-reference command in addition\
\ to defaults defined by the pipeline."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--salmon_index"
description: "Path to directory or tar.gz archive for pre-built Salmon index."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--kallisto_index"
description: "Path to directory or tar.gz archive for pre-built Kallisto index."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--bbsplit_index"
description: "Path to directory or tar.gz archive for pre-built BBSplit index."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "integer"
name: "--pseudo_aligner_kmer_size"
description: "Kmer length passed to indexing step of pseudoaligners."
info: null
default:
- 31
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--gencode"
description: "Specify if the GTF annotation is in GENCODE format."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--biotype"
description: "Biotype value to use while appending entries to GTF file when additional\
\ fasta file is provided."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "boolean"
name: "--filter_gtf"
description: "Whether to filter the GTF or not?"
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--aligner"
description: "Specifies the alignment algorithm to use - available options are\
\ 'star_salmon', 'star_rsem' and 'hisat2'."
info: null
default:
- "star_salmon"
required: false
choices:
- "star_salmon"
- "star_rsem"
- "hisat2"
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--pseudo_aligner"
description: "Specifies the pseudo aligner to use - available options are 'salmon'.\
\ Runs in addition to '--aligner'."
info: null
default:
- "salmon"
required: false
choices:
- "salmon"
- "kallisto"
direction: "input"
multiple: false
multiple_sep: ";"
- name: "Output"
arguments:
- type: "file"
name: "--fasta_uncompressed"
info: null
default:
- "reference_genome.fasta"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--gtf_uncompressed"
info: null
default:
- "gene_annotation.gtf"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--transcript_fasta_uncompressed"
info: null
default:
- "transcriptome.fasta"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--gene_bed_uncompressed"
info: null
default:
- "gene_annotation.bed"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--star_index_uncompressed"
description: "Path to STAR index."
info: null
default:
- "STAR_index"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--rsem_index_uncompressed"
description: "Path to directory or tar.gz archive for pre-built RSEM index."
info: null
default:
- "RSEM_index"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--salmon_index_uncompressed"
description: "Path to Salmon index."
info: null
default:
- "Salmon_index"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--kallisto_index_uncompressed"
description: "Path to Kallisto index."
info: null
default:
- "Kallisto_index"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--bbsplit_index_uncompressed"
description: "Path to BBSplit index."
info: null
default:
- "BBSplit_index"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--chrom_sizes"
description: "File containing chromosome lengths"
info: null
default:
- "reference_genome.fasta.sizes"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--fai"
description: "FASTA index file"
info: null
default:
- "reference_genome.fasta.fai"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
resources:
- type: "nextflow_script"
path: "main.nf"
is_executable: true
entrypoint: "run_wf"
description: "A subworkflow for preparing all the required genome references\n"
info: null
status: "enabled"
requirements:
commands:
- "ps"
dependencies:
- name: "gunzip"
repository:
type: "local"
- name: "gffread"
repository:
type: "vsh"
repo: "biobox"
tag: "main"
- name: "cat_additional_fasta"
repository:
type: "local"
- name: "gtf2bed"
repository:
type: "local"
- name: "preprocess_transcripts_fasta"
repository:
type: "local"
- name: "gtf_filter"
repository:
type: "local"
- name: "rsem/rsem_prepare_reference"
repository:
type: "vsh"
repo: "biobox"
tag: "main"
- name: "getchromsizes"
repository:
type: "local"
- name: "untar"
repository:
type: "vsh"
repo: "craftbox"
tag: "main"
- name: "star/star_genome_generate"
repository:
type: "vsh"
repo: "biobox"
tag: "main"
- name: "bbmap_bbsplit"
repository:
type: "local"
- name: "salmon/salmon_index"
repository:
type: "vsh"
repo: "biobox"
tag: "main"
- name: "kallisto/kallisto_index"
repository:
type: "local"
repositories:
- type: "vsh"
name: "biobox"
repo: "biobox"
tag: "main"
- type: "vsh"
name: "craftbox"
repo: "craftbox"
tag: "main"
runners:
- type: "executable"
id: "executable"
docker_setup_strategy: "ifneedbepullelsecachedbuild"
- type: "nextflow"
id: "nextflow"
directives:
tag: "$id"
auto:
simplifyInput: true
simplifyOutput: false
transcript: false
publish: false
config:
labels:
mem1gb: "memory = 1000000000.B"
mem2gb: "memory = 2000000000.B"
mem5gb: "memory = 5000000000.B"
mem10gb: "memory = 10000000000.B"
mem20gb: "memory = 20000000000.B"
mem50gb: "memory = 50000000000.B"
mem100gb: "memory = 100000000000.B"
mem200gb: "memory = 200000000000.B"
mem500gb: "memory = 500000000000.B"
mem1tb: "memory = 1000000000000.B"
mem2tb: "memory = 2000000000000.B"
mem5tb: "memory = 5000000000000.B"
mem10tb: "memory = 10000000000000.B"
mem20tb: "memory = 20000000000000.B"
mem50tb: "memory = 50000000000000.B"
mem100tb: "memory = 100000000000000.B"
mem200tb: "memory = 200000000000000.B"
mem500tb: "memory = 500000000000000.B"
mem1gib: "memory = 1073741824.B"
mem2gib: "memory = 2147483648.B"
mem4gib: "memory = 4294967296.B"
mem8gib: "memory = 8589934592.B"
mem16gib: "memory = 17179869184.B"
mem32gib: "memory = 34359738368.B"
mem64gib: "memory = 68719476736.B"
mem128gib: "memory = 137438953472.B"
mem256gib: "memory = 274877906944.B"
mem512gib: "memory = 549755813888.B"
mem1tib: "memory = 1099511627776.B"
mem2tib: "memory = 2199023255552.B"
mem4tib: "memory = 4398046511104.B"
mem8tib: "memory = 8796093022208.B"
mem16tib: "memory = 17592186044416.B"
mem32tib: "memory = 35184372088832.B"
mem64tib: "memory = 70368744177664.B"
mem128tib: "memory = 140737488355328.B"
mem256tib: "memory = 281474976710656.B"
mem512tib: "memory = 562949953421312.B"
cpu1: "cpus = 1"
cpu2: "cpus = 2"
cpu5: "cpus = 5"
cpu10: "cpus = 10"
cpu20: "cpus = 20"
cpu50: "cpus = 50"
cpu100: "cpus = 100"
cpu200: "cpus = 200"
cpu500: "cpus = 500"
cpu1000: "cpus = 1000"
debug: false
container: "docker"
engines:
- type: "native"
id: "native"
build_info:
config: "src/workflows/prepare_genome/config.vsh.yaml"
runner: "executable"
engine: "native"
output: "target/executable/workflows/prepare_genome"
executable: "target/executable/workflows/prepare_genome/prepare_genome"
viash_version: "0.9.0"
git_commit: "1e1ffb315fefec05db2ee0c62e1c98ce4b49929c"
git_remote: "https://github.com/viash-hub/rnaseq"
dependencies:
- "target/nextflow/gunzip"
- "target/dependencies/vsh/vsh/biobox/main/nextflow/gffread"
- "target/nextflow/cat_additional_fasta"
- "target/nextflow/gtf2bed"
- "target/nextflow/preprocess_transcripts_fasta"
- "target/nextflow/gtf_filter"
- "target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_prepare_reference"
- "target/nextflow/getchromsizes"
- "target/dependencies/vsh/vsh/craftbox/main/nextflow/untar"
- "target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_genome_generate"
- "target/nextflow/bbmap_bbsplit"
- "target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_index"
- "target/nextflow/kallisto/kallisto_index"
package_config:
version: "main"
info:
test_resources:
- path: "gs://viash-hub-test-data/rnaseq/v1"
dest: "testData"
viash_version: "0.9.0"
source: "src"
target: "target"
config_mods:
- ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\
\ := '$id'\n"
- ".engines += { type: \"native\" }"
- ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'"
- ".engines[.type == 'docker'].target_tag := 'main'"
organization: "vsh"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,304 @@
name: "pseudo_alignment_and_quant"
namespace: "workflows"
version: "main"
argument_groups:
- name: "Input"
arguments:
- type: "string"
name: "--id"
description: "ID of the sample."
info: null
example:
- "foo"
required: true
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--fastq_1"
alternatives:
- "-i"
description: "Path to the sample (or read 1 of paired end sample)."
info: null
example:
- "input.fastq.gz"
must_exist: true
create_parent: true
required: true
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--fastq_2"
description: "Path to read 2 of the sample."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--strandedness"
description: "Sample strand-specificity. Must be one of unstranded, forward, or\
\ reverse"
info: null
required: false
choices:
- "forward"
- "reverse"
- "unstranded"
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--gtf"
description: "GTF file"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--transcript_fasta"
description: "Fasta file of the reference transcriptome."
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--pseudo_aligner"
description: "Specifies the pseudo aligner to use - available options are 'salmon'.\
\ Runs in addition to '--aligner'."
info: null
default:
- "false"
required: false
choices:
- "salmon"
- "kallisto"
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--salmon_index"
description: "Salmon index"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--kallisto_index"
description: "Kallisto index"
info: null
must_exist: true
create_parent: true
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "string"
name: "--lib_type"
description: "Override library type inferred based on strandedness defined in\
\ meta object"
info: null
default:
- ""
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "integer"
name: "--kallisto_quant_fragment_length"
description: "For single-end mode only, the estimated average fragment length\
\ to use for quantification with Kallisto."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- type: "integer"
name: "--kallisto_quant_fragment_length_sd"
description: "For single-end mode only, the estimated standard deviation of the\
\ fragment length for quantification with Kallisto."
info: null
required: false
direction: "input"
multiple: false
multiple_sep: ";"
- name: "Output"
arguments:
- type: "file"
name: "--pseudo_multiqc"
info: null
default:
- "$id.quant.log"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--quant_out_dir"
info: null
default:
- "$id.salmon_quant"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--salmon_quant_results_file"
info: null
default:
- "$id.quant.sf"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
- type: "file"
name: "--kallisto_quant_results_file"
info: null
default:
- "$id.abundance.tsv"
must_exist: true
create_parent: true
required: false
direction: "output"
multiple: false
multiple_sep: ";"
resources:
- type: "nextflow_script"
path: "main.nf"
is_executable: true
entrypoint: "run_wf"
description: "A viash sub-workflow for pseudo alignment and quantification stage of\
\ nf-core/rnaseq pipeline.\n"
info: null
status: "enabled"
requirements:
commands:
- "ps"
dependencies:
- name: "salmon/salmon_quant"
repository:
type: "vsh"
repo: "vsh/biobox"
tag: "v0.1"
- name: "kallisto/kallisto_quant"
repository:
type: "local"
repositories:
- type: "vsh"
name: "biobox"
repo: "vsh/biobox"
tag: "v0.1"
runners:
- type: "executable"
id: "executable"
docker_setup_strategy: "ifneedbepullelsecachedbuild"
- type: "nextflow"
id: "nextflow"
directives:
tag: "$id"
auto:
simplifyInput: true
simplifyOutput: false
transcript: false
publish: false
config:
labels:
mem1gb: "memory = 1000000000.B"
mem2gb: "memory = 2000000000.B"
mem5gb: "memory = 5000000000.B"
mem10gb: "memory = 10000000000.B"
mem20gb: "memory = 20000000000.B"
mem50gb: "memory = 50000000000.B"
mem100gb: "memory = 100000000000.B"
mem200gb: "memory = 200000000000.B"
mem500gb: "memory = 500000000000.B"
mem1tb: "memory = 1000000000000.B"
mem2tb: "memory = 2000000000000.B"
mem5tb: "memory = 5000000000000.B"
mem10tb: "memory = 10000000000000.B"
mem20tb: "memory = 20000000000000.B"
mem50tb: "memory = 50000000000000.B"
mem100tb: "memory = 100000000000000.B"
mem200tb: "memory = 200000000000000.B"
mem500tb: "memory = 500000000000000.B"
mem1gib: "memory = 1073741824.B"
mem2gib: "memory = 2147483648.B"
mem4gib: "memory = 4294967296.B"
mem8gib: "memory = 8589934592.B"
mem16gib: "memory = 17179869184.B"
mem32gib: "memory = 34359738368.B"
mem64gib: "memory = 68719476736.B"
mem128gib: "memory = 137438953472.B"
mem256gib: "memory = 274877906944.B"
mem512gib: "memory = 549755813888.B"
mem1tib: "memory = 1099511627776.B"
mem2tib: "memory = 2199023255552.B"
mem4tib: "memory = 4398046511104.B"
mem8tib: "memory = 8796093022208.B"
mem16tib: "memory = 17592186044416.B"
mem32tib: "memory = 35184372088832.B"
mem64tib: "memory = 70368744177664.B"
mem128tib: "memory = 140737488355328.B"
mem256tib: "memory = 281474976710656.B"
mem512tib: "memory = 562949953421312.B"
cpu1: "cpus = 1"
cpu2: "cpus = 2"
cpu5: "cpus = 5"
cpu10: "cpus = 10"
cpu20: "cpus = 20"
cpu50: "cpus = 50"
cpu100: "cpus = 100"
cpu200: "cpus = 200"
cpu500: "cpus = 500"
cpu1000: "cpus = 1000"
debug: false
container: "docker"
engines:
- type: "native"
id: "native"
build_info:
config: "src/workflows/pseudo_alignment_and_quant/config.vsh.yaml"
runner: "executable"
engine: "native"
output: "target/executable/workflows/pseudo_alignment_and_quant"
executable: "target/executable/workflows/pseudo_alignment_and_quant/pseudo_alignment_and_quant"
viash_version: "0.9.0"
git_commit: "1e1ffb315fefec05db2ee0c62e1c98ce4b49929c"
git_remote: "https://github.com/viash-hub/rnaseq"
dependencies:
- "target/dependencies/vsh/vsh/biobox/v0.1/nextflow/salmon/salmon_quant"
- "target/nextflow/kallisto/kallisto_quant"
package_config:
version: "main"
info:
test_resources:
- path: "gs://viash-hub-test-data/rnaseq/v1"
dest: "testData"
viash_version: "0.9.0"
source: "src"
target: "target"
config_mods:
- ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\
\ := '$id'\n"
- ".engines += { type: \"native\" }"
- ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'"
- ".engines[.type == 'docker'].target_tag := 'main'"
organization: "vsh"

View File

@@ -0,0 +1,918 @@
#!/usr/bin/env bash
# pseudo_alignment_and_quant main
#
# This wrapper script is auto-generated by viash 0.9.0 and is thus a derivative
# work thereof. This software comes with ABSOLUTELY NO WARRANTY from Data
# Intuitive.
#
# The component may contain files which fall under a different license. The
# authors of this component should specify the license in the header of such
# files, or include a separate license file detailing the licenses of all included
# files.
set -e
if [ -z "$VIASH_TEMP" ]; then
VIASH_TEMP=${VIASH_TEMP:-$VIASH_TMPDIR}
VIASH_TEMP=${VIASH_TEMP:-$VIASH_TEMPDIR}
VIASH_TEMP=${VIASH_TEMP:-$VIASH_TMP}
VIASH_TEMP=${VIASH_TEMP:-$TMPDIR}
VIASH_TEMP=${VIASH_TEMP:-$TMP}
VIASH_TEMP=${VIASH_TEMP:-$TEMPDIR}
VIASH_TEMP=${VIASH_TEMP:-$TEMP}
VIASH_TEMP=${VIASH_TEMP:-/tmp}
fi
# define helper functions
# ViashQuote: put quotes around non flag values
# $1 : unquoted string
# return : possibly quoted string
# examples:
# ViashQuote --foo # returns --foo
# ViashQuote bar # returns 'bar'
# Viashquote --foo=bar # returns --foo='bar'
function ViashQuote {
if [[ "$1" =~ ^-+[a-zA-Z0-9_\-]+=.+$ ]]; then
echo "$1" | sed "s#=\(.*\)#='\1'#"
elif [[ "$1" =~ ^-+[a-zA-Z0-9_\-]+$ ]]; then
echo "$1"
else
echo "'$1'"
fi
}
# ViashRemoveFlags: Remove leading flag
# $1 : string with a possible leading flag
# return : string without possible leading flag
# examples:
# ViashRemoveFlags --foo=bar # returns bar
function ViashRemoveFlags {
echo "$1" | sed 's/^--*[a-zA-Z0-9_\-]*=//'
}
# ViashSourceDir: return the path of a bash file, following symlinks
# usage : ViashSourceDir ${BASH_SOURCE[0]}
# $1 : Should always be set to ${BASH_SOURCE[0]}
# returns : The absolute path of the bash file
function ViashSourceDir {
local source="$1"
while [ -h "$source" ]; do
local dir="$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd )"
source="$(readlink "$source")"
[[ $source != /* ]] && source="$dir/$source"
done
cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd
}
# ViashFindTargetDir: return the path of the '.build.yaml' file, following symlinks
# usage : ViashFindTargetDir 'ScriptPath'
# $1 : The location from where to start the upward search
# returns : The absolute path of the '.build.yaml' file
function ViashFindTargetDir {
local source="$1"
while [[ "$source" != "" && ! -e "$source/.build.yaml" ]]; do
source=${source%/*}
done
echo $source
}
# see https://en.wikipedia.org/wiki/Syslog#Severity_level
VIASH_LOGCODE_EMERGENCY=0
VIASH_LOGCODE_ALERT=1
VIASH_LOGCODE_CRITICAL=2
VIASH_LOGCODE_ERROR=3
VIASH_LOGCODE_WARNING=4
VIASH_LOGCODE_NOTICE=5
VIASH_LOGCODE_INFO=6
VIASH_LOGCODE_DEBUG=7
VIASH_VERBOSITY=$VIASH_LOGCODE_NOTICE
# ViashLog: Log events depending on the verbosity level
# usage: ViashLog 1 alert Oh no something went wrong!
# $1: required verbosity level
# $2: display tag
# $3+: messages to display
# stdout: Your input, prepended by '[$2] '.
function ViashLog {
local required_level="$1"
local display_tag="$2"
shift 2
if [ $VIASH_VERBOSITY -ge $required_level ]; then
>&2 echo "[$display_tag]" "$@"
fi
}
# ViashEmergency: log events when the system is unstable
# usage: ViashEmergency Oh no something went wrong.
# stdout: Your input, prepended by '[emergency] '.
function ViashEmergency {
ViashLog $VIASH_LOGCODE_EMERGENCY emergency "$@"
}
# ViashAlert: log events when actions must be taken immediately (e.g. corrupted system database)
# usage: ViashAlert Oh no something went wrong.
# stdout: Your input, prepended by '[alert] '.
function ViashAlert {
ViashLog $VIASH_LOGCODE_ALERT alert "$@"
}
# ViashCritical: log events when a critical condition occurs
# usage: ViashCritical Oh no something went wrong.
# stdout: Your input, prepended by '[critical] '.
function ViashCritical {
ViashLog $VIASH_LOGCODE_CRITICAL critical "$@"
}
# ViashError: log events when an error condition occurs
# usage: ViashError Oh no something went wrong.
# stdout: Your input, prepended by '[error] '.
function ViashError {
ViashLog $VIASH_LOGCODE_ERROR error "$@"
}
# ViashWarning: log potentially abnormal events
# usage: ViashWarning Something may have gone wrong.
# stdout: Your input, prepended by '[warning] '.
function ViashWarning {
ViashLog $VIASH_LOGCODE_WARNING warning "$@"
}
# ViashNotice: log significant but normal events
# usage: ViashNotice This just happened.
# stdout: Your input, prepended by '[notice] '.
function ViashNotice {
ViashLog $VIASH_LOGCODE_NOTICE notice "$@"
}
# ViashInfo: log normal events
# usage: ViashInfo This just happened.
# stdout: Your input, prepended by '[info] '.
function ViashInfo {
ViashLog $VIASH_LOGCODE_INFO info "$@"
}
# ViashDebug: log all events, for debugging purposes
# usage: ViashDebug This just happened.
# stdout: Your input, prepended by '[debug] '.
function ViashDebug {
ViashLog $VIASH_LOGCODE_DEBUG debug "$@"
}
# find source folder of this component
VIASH_META_RESOURCES_DIR=`ViashSourceDir ${BASH_SOURCE[0]}`
# find the root of the built components & dependencies
VIASH_TARGET_DIR=`ViashFindTargetDir $VIASH_META_RESOURCES_DIR`
# define meta fields
VIASH_META_NAME="pseudo_alignment_and_quant"
VIASH_META_FUNCTIONALITY_NAME="pseudo_alignment_and_quant"
VIASH_META_EXECUTABLE="$VIASH_META_RESOURCES_DIR/$VIASH_META_NAME"
VIASH_META_CONFIG="$VIASH_META_RESOURCES_DIR/.config.vsh.yaml"
VIASH_META_TEMP_DIR="$VIASH_TEMP"
# ViashHelp: Display helpful explanation about this executable
function ViashHelp {
echo "pseudo_alignment_and_quant main"
echo ""
echo "A viash sub-workflow for pseudo alignment and quantification stage of"
echo "nf-core/rnaseq pipeline."
echo ""
echo "Input:"
echo " --id"
echo " type: string, required parameter"
echo " example: foo"
echo " ID of the sample."
echo ""
echo " -i, --fastq_1"
echo " type: file, required parameter, file must exist"
echo " example: input.fastq.gz"
echo " Path to the sample (or read 1 of paired end sample)."
echo ""
echo " --fastq_2"
echo " type: file, file must exist"
echo " Path to read 2 of the sample."
echo ""
echo " --strandedness"
echo " type: string"
echo " choices: [ forward, reverse, unstranded ]"
echo " Sample strand-specificity. Must be one of unstranded, forward, or"
echo " reverse"
echo ""
echo " --gtf"
echo " type: file, file must exist"
echo " GTF file"
echo ""
echo " --transcript_fasta"
echo " type: file, file must exist"
echo " Fasta file of the reference transcriptome."
echo ""
echo " --pseudo_aligner"
echo " type: string"
echo " default: false"
echo " choices: [ salmon, kallisto ]"
echo " Specifies the pseudo aligner to use - available options are 'salmon'."
echo " Runs in addition to '--aligner'."
echo ""
echo " --salmon_index"
echo " type: file, file must exist"
echo " Salmon index"
echo ""
echo " --kallisto_index"
echo " type: file, file must exist"
echo " Kallisto index"
echo ""
echo " --lib_type"
echo " type: string"
echo " default:"
echo " Override library type inferred based on strandedness defined in meta"
echo " object"
echo ""
echo " --kallisto_quant_fragment_length"
echo " type: integer"
echo " For single-end mode only, the estimated average fragment length to use"
echo " for quantification with Kallisto."
echo ""
echo " --kallisto_quant_fragment_length_sd"
echo " type: integer"
echo " For single-end mode only, the estimated standard deviation of the"
echo " fragment length for quantification with Kallisto."
echo ""
echo "Output:"
echo " --pseudo_multiqc"
echo " type: file, output, file must exist"
echo " default: \$id.quant.log"
echo ""
echo " --quant_out_dir"
echo " type: file, output, file must exist"
echo " default: \$id.salmon_quant"
echo ""
echo " --salmon_quant_results_file"
echo " type: file, output, file must exist"
echo " default: \$id.quant.sf"
echo ""
echo " --kallisto_quant_results_file"
echo " type: file, output, file must exist"
echo " default: \$id.abundance.tsv"
}
# initialise variables
VIASH_MODE='run'
VIASH_ENGINE_ID='native'
# initialise array
VIASH_POSITIONAL_ARGS=''
while [[ $# -gt 0 ]]; do
case "$1" in
-h|--help)
ViashHelp
exit
;;
---v|---verbose)
let "VIASH_VERBOSITY=VIASH_VERBOSITY+1"
shift 1
;;
---verbosity)
VIASH_VERBOSITY="$2"
shift 2
;;
---verbosity=*)
VIASH_VERBOSITY="$(ViashRemoveFlags "$1")"
shift 1
;;
--version)
echo "pseudo_alignment_and_quant main"
exit
;;
--id)
[ -n "$VIASH_PAR_ID" ] && ViashError Bad arguments for option \'--id\': \'$VIASH_PAR_ID\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_ID="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --id. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--id=*)
[ -n "$VIASH_PAR_ID" ] && ViashError Bad arguments for option \'--id=*\': \'$VIASH_PAR_ID\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_ID=$(ViashRemoveFlags "$1")
shift 1
;;
--fastq_1)
[ -n "$VIASH_PAR_FASTQ_1" ] && ViashError Bad arguments for option \'--fastq_1\': \'$VIASH_PAR_FASTQ_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_FASTQ_1="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --fastq_1. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--fastq_1=*)
[ -n "$VIASH_PAR_FASTQ_1" ] && ViashError Bad arguments for option \'--fastq_1=*\': \'$VIASH_PAR_FASTQ_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_FASTQ_1=$(ViashRemoveFlags "$1")
shift 1
;;
-i)
[ -n "$VIASH_PAR_FASTQ_1" ] && ViashError Bad arguments for option \'-i\': \'$VIASH_PAR_FASTQ_1\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_FASTQ_1="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to -i. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--fastq_2)
[ -n "$VIASH_PAR_FASTQ_2" ] && ViashError Bad arguments for option \'--fastq_2\': \'$VIASH_PAR_FASTQ_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_FASTQ_2="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --fastq_2. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--fastq_2=*)
[ -n "$VIASH_PAR_FASTQ_2" ] && ViashError Bad arguments for option \'--fastq_2=*\': \'$VIASH_PAR_FASTQ_2\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_FASTQ_2=$(ViashRemoveFlags "$1")
shift 1
;;
--strandedness)
[ -n "$VIASH_PAR_STRANDEDNESS" ] && ViashError Bad arguments for option \'--strandedness\': \'$VIASH_PAR_STRANDEDNESS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_STRANDEDNESS="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --strandedness. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--strandedness=*)
[ -n "$VIASH_PAR_STRANDEDNESS" ] && ViashError Bad arguments for option \'--strandedness=*\': \'$VIASH_PAR_STRANDEDNESS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_STRANDEDNESS=$(ViashRemoveFlags "$1")
shift 1
;;
--gtf)
[ -n "$VIASH_PAR_GTF" ] && ViashError Bad arguments for option \'--gtf\': \'$VIASH_PAR_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_GTF="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --gtf. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--gtf=*)
[ -n "$VIASH_PAR_GTF" ] && ViashError Bad arguments for option \'--gtf=*\': \'$VIASH_PAR_GTF\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_GTF=$(ViashRemoveFlags "$1")
shift 1
;;
--transcript_fasta)
[ -n "$VIASH_PAR_TRANSCRIPT_FASTA" ] && ViashError Bad arguments for option \'--transcript_fasta\': \'$VIASH_PAR_TRANSCRIPT_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_TRANSCRIPT_FASTA="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --transcript_fasta. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--transcript_fasta=*)
[ -n "$VIASH_PAR_TRANSCRIPT_FASTA" ] && ViashError Bad arguments for option \'--transcript_fasta=*\': \'$VIASH_PAR_TRANSCRIPT_FASTA\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_TRANSCRIPT_FASTA=$(ViashRemoveFlags "$1")
shift 1
;;
--pseudo_aligner)
[ -n "$VIASH_PAR_PSEUDO_ALIGNER" ] && ViashError Bad arguments for option \'--pseudo_aligner\': \'$VIASH_PAR_PSEUDO_ALIGNER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_PSEUDO_ALIGNER="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_aligner. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--pseudo_aligner=*)
[ -n "$VIASH_PAR_PSEUDO_ALIGNER" ] && ViashError Bad arguments for option \'--pseudo_aligner=*\': \'$VIASH_PAR_PSEUDO_ALIGNER\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_PSEUDO_ALIGNER=$(ViashRemoveFlags "$1")
shift 1
;;
--salmon_index)
[ -n "$VIASH_PAR_SALMON_INDEX" ] && ViashError Bad arguments for option \'--salmon_index\': \'$VIASH_PAR_SALMON_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_SALMON_INDEX="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --salmon_index. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--salmon_index=*)
[ -n "$VIASH_PAR_SALMON_INDEX" ] && ViashError Bad arguments for option \'--salmon_index=*\': \'$VIASH_PAR_SALMON_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_SALMON_INDEX=$(ViashRemoveFlags "$1")
shift 1
;;
--kallisto_index)
[ -n "$VIASH_PAR_KALLISTO_INDEX" ] && ViashError Bad arguments for option \'--kallisto_index\': \'$VIASH_PAR_KALLISTO_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_KALLISTO_INDEX="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --kallisto_index. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--kallisto_index=*)
[ -n "$VIASH_PAR_KALLISTO_INDEX" ] && ViashError Bad arguments for option \'--kallisto_index=*\': \'$VIASH_PAR_KALLISTO_INDEX\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_KALLISTO_INDEX=$(ViashRemoveFlags "$1")
shift 1
;;
--lib_type)
[ -n "$VIASH_PAR_LIB_TYPE" ] && ViashError Bad arguments for option \'--lib_type\': \'$VIASH_PAR_LIB_TYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_LIB_TYPE="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --lib_type. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--lib_type=*)
[ -n "$VIASH_PAR_LIB_TYPE" ] && ViashError Bad arguments for option \'--lib_type=*\': \'$VIASH_PAR_LIB_TYPE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_LIB_TYPE=$(ViashRemoveFlags "$1")
shift 1
;;
--kallisto_quant_fragment_length)
[ -n "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH" ] && ViashError Bad arguments for option \'--kallisto_quant_fragment_length\': \'$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --kallisto_quant_fragment_length. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--kallisto_quant_fragment_length=*)
[ -n "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH" ] && ViashError Bad arguments for option \'--kallisto_quant_fragment_length=*\': \'$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH=$(ViashRemoveFlags "$1")
shift 1
;;
--kallisto_quant_fragment_length_sd)
[ -n "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD" ] && ViashError Bad arguments for option \'--kallisto_quant_fragment_length_sd\': \'$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --kallisto_quant_fragment_length_sd. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--kallisto_quant_fragment_length_sd=*)
[ -n "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD" ] && ViashError Bad arguments for option \'--kallisto_quant_fragment_length_sd=*\': \'$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD=$(ViashRemoveFlags "$1")
shift 1
;;
--pseudo_multiqc)
[ -n "$VIASH_PAR_PSEUDO_MULTIQC" ] && ViashError Bad arguments for option \'--pseudo_multiqc\': \'$VIASH_PAR_PSEUDO_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_PSEUDO_MULTIQC="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --pseudo_multiqc. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--pseudo_multiqc=*)
[ -n "$VIASH_PAR_PSEUDO_MULTIQC" ] && ViashError Bad arguments for option \'--pseudo_multiqc=*\': \'$VIASH_PAR_PSEUDO_MULTIQC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_PSEUDO_MULTIQC=$(ViashRemoveFlags "$1")
shift 1
;;
--quant_out_dir)
[ -n "$VIASH_PAR_QUANT_OUT_DIR" ] && ViashError Bad arguments for option \'--quant_out_dir\': \'$VIASH_PAR_QUANT_OUT_DIR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_QUANT_OUT_DIR="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --quant_out_dir. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--quant_out_dir=*)
[ -n "$VIASH_PAR_QUANT_OUT_DIR" ] && ViashError Bad arguments for option \'--quant_out_dir=*\': \'$VIASH_PAR_QUANT_OUT_DIR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_QUANT_OUT_DIR=$(ViashRemoveFlags "$1")
shift 1
;;
--salmon_quant_results_file)
[ -n "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE" ] && ViashError Bad arguments for option \'--salmon_quant_results_file\': \'$VIASH_PAR_SALMON_QUANT_RESULTS_FILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_SALMON_QUANT_RESULTS_FILE="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --salmon_quant_results_file. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--salmon_quant_results_file=*)
[ -n "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE" ] && ViashError Bad arguments for option \'--salmon_quant_results_file=*\': \'$VIASH_PAR_SALMON_QUANT_RESULTS_FILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_SALMON_QUANT_RESULTS_FILE=$(ViashRemoveFlags "$1")
shift 1
;;
--kallisto_quant_results_file)
[ -n "$VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE" ] && ViashError Bad arguments for option \'--kallisto_quant_results_file\': \'$VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to --kallisto_quant_results_file. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
--kallisto_quant_results_file=*)
[ -n "$VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE" ] && ViashError Bad arguments for option \'--kallisto_quant_results_file=*\': \'$VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE=$(ViashRemoveFlags "$1")
shift 1
;;
---engine)
VIASH_ENGINE_ID="$2"
shift 2
;;
---engine=*)
VIASH_ENGINE_ID="$(ViashRemoveFlags "$1")"
shift 1
;;
---cpus)
[ -n "$VIASH_META_CPUS" ] && ViashError Bad arguments for option \'---cpus\': \'$VIASH_META_CPUS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_META_CPUS="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to ---cpus. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
---cpus=*)
[ -n "$VIASH_META_CPUS" ] && ViashError Bad arguments for option \'---cpus=*\': \'$VIASH_META_CPUS\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_META_CPUS=$(ViashRemoveFlags "$1")
shift 1
;;
---memory)
[ -n "$VIASH_META_MEMORY" ] && ViashError Bad arguments for option \'---memory\': \'$VIASH_META_MEMORY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_META_MEMORY="$2"
[ $# -lt 2 ] && ViashError Not enough arguments passed to ---memory. Use "--help" to get more information on the parameters. && exit 1
shift 2
;;
---memory=*)
[ -n "$VIASH_META_MEMORY" ] && ViashError Bad arguments for option \'---memory=*\': \'$VIASH_META_MEMORY\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1
VIASH_META_MEMORY=$(ViashRemoveFlags "$1")
shift 1
;;
*) # positional arg or unknown option
# since the positional args will be eval'd, can we always quote, instead of using ViashQuote
VIASH_POSITIONAL_ARGS="$VIASH_POSITIONAL_ARGS '$1'"
[[ $1 == -* ]] && ViashWarning $1 looks like a parameter but is not a defined parameter and will instead be treated as a positional argument. Use "--help" to get more information on the parameters.
shift # past argument
;;
esac
done
# parse positional parameters
eval set -- $VIASH_POSITIONAL_ARGS
if [ "$VIASH_ENGINE_ID" == "native" ] ; then
VIASH_ENGINE_TYPE='native'
else
ViashError "Engine '$VIASH_ENGINE_ID' is not recognized. Options are: native."
exit 1
fi
# setting computational defaults
# helper function for parsing memory strings
function ViashMemoryAsBytes {
local memory=`echo "$1" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]'`
local memory_regex='^([0-9]+)([kmgtp]i?b?|b)$'
if [[ $memory =~ $memory_regex ]]; then
local number=${memory/[^0-9]*/}
local symbol=${memory/*[0-9]/}
case $symbol in
b) memory_b=$number ;;
kb|k) memory_b=$(( $number * 1000 )) ;;
mb|m) memory_b=$(( $number * 1000 * 1000 )) ;;
gb|g) memory_b=$(( $number * 1000 * 1000 * 1000 )) ;;
tb|t) memory_b=$(( $number * 1000 * 1000 * 1000 * 1000 )) ;;
pb|p) memory_b=$(( $number * 1000 * 1000 * 1000 * 1000 * 1000 )) ;;
kib|ki) memory_b=$(( $number * 1024 )) ;;
mib|mi) memory_b=$(( $number * 1024 * 1024 )) ;;
gib|gi) memory_b=$(( $number * 1024 * 1024 * 1024 )) ;;
tib|ti) memory_b=$(( $number * 1024 * 1024 * 1024 * 1024 )) ;;
pib|pi) memory_b=$(( $number * 1024 * 1024 * 1024 * 1024 * 1024 )) ;;
esac
echo "$memory_b"
fi
}
# compute memory in different units
if [ ! -z ${VIASH_META_MEMORY+x} ]; then
VIASH_META_MEMORY_B=`ViashMemoryAsBytes $VIASH_META_MEMORY`
# do not define other variables if memory_b is an empty string
if [ ! -z "$VIASH_META_MEMORY_B" ]; then
VIASH_META_MEMORY_KB=$(( ($VIASH_META_MEMORY_B+999) / 1000 ))
VIASH_META_MEMORY_MB=$(( ($VIASH_META_MEMORY_KB+999) / 1000 ))
VIASH_META_MEMORY_GB=$(( ($VIASH_META_MEMORY_MB+999) / 1000 ))
VIASH_META_MEMORY_TB=$(( ($VIASH_META_MEMORY_GB+999) / 1000 ))
VIASH_META_MEMORY_PB=$(( ($VIASH_META_MEMORY_TB+999) / 1000 ))
VIASH_META_MEMORY_KIB=$(( ($VIASH_META_MEMORY_B+1023) / 1024 ))
VIASH_META_MEMORY_MIB=$(( ($VIASH_META_MEMORY_KIB+1023) / 1024 ))
VIASH_META_MEMORY_GIB=$(( ($VIASH_META_MEMORY_MIB+1023) / 1024 ))
VIASH_META_MEMORY_TIB=$(( ($VIASH_META_MEMORY_GIB+1023) / 1024 ))
VIASH_META_MEMORY_PIB=$(( ($VIASH_META_MEMORY_TIB+1023) / 1024 ))
else
# unset memory if string is empty
unset $VIASH_META_MEMORY_B
fi
fi
# unset nproc if string is empty
if [ -z "$VIASH_META_CPUS" ]; then
unset $VIASH_META_CPUS
fi
# check whether required parameters exist
if [ -z ${VIASH_PAR_ID+x} ]; then
ViashError '--id' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
if [ -z ${VIASH_PAR_FASTQ_1+x} ]; then
ViashError '--fastq_1' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
if [ -z ${VIASH_META_NAME+x} ]; then
ViashError 'name' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
if [ -z ${VIASH_META_FUNCTIONALITY_NAME+x} ]; then
ViashError 'functionality_name' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
if [ -z ${VIASH_META_RESOURCES_DIR+x} ]; then
ViashError 'resources_dir' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
if [ -z ${VIASH_META_EXECUTABLE+x} ]; then
ViashError 'executable' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
if [ -z ${VIASH_META_CONFIG+x} ]; then
ViashError 'config' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
if [ -z ${VIASH_META_TEMP_DIR+x} ]; then
ViashError 'temp_dir' is a required argument. Use "--help" to get more information on the parameters.
exit 1
fi
# filling in defaults
if [ -z ${VIASH_PAR_PSEUDO_ALIGNER+x} ]; then
VIASH_PAR_PSEUDO_ALIGNER="false"
fi
if [ -z ${VIASH_PAR_LIB_TYPE+x} ]; then
VIASH_PAR_LIB_TYPE=""
fi
if [ -z ${VIASH_PAR_PSEUDO_MULTIQC+x} ]; then
VIASH_PAR_PSEUDO_MULTIQC="\$id.quant.log"
fi
if [ -z ${VIASH_PAR_QUANT_OUT_DIR+x} ]; then
VIASH_PAR_QUANT_OUT_DIR="\$id.salmon_quant"
fi
if [ -z ${VIASH_PAR_SALMON_QUANT_RESULTS_FILE+x} ]; then
VIASH_PAR_SALMON_QUANT_RESULTS_FILE="\$id.quant.sf"
fi
if [ -z ${VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE+x} ]; then
VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE="\$id.abundance.tsv"
fi
# check whether required files exist
if [ ! -z "$VIASH_PAR_FASTQ_1" ] && [ ! -e "$VIASH_PAR_FASTQ_1" ]; then
ViashError "Input file '$VIASH_PAR_FASTQ_1' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_FASTQ_2" ] && [ ! -e "$VIASH_PAR_FASTQ_2" ]; then
ViashError "Input file '$VIASH_PAR_FASTQ_2' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_GTF" ] && [ ! -e "$VIASH_PAR_GTF" ]; then
ViashError "Input file '$VIASH_PAR_GTF' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_TRANSCRIPT_FASTA" ] && [ ! -e "$VIASH_PAR_TRANSCRIPT_FASTA" ]; then
ViashError "Input file '$VIASH_PAR_TRANSCRIPT_FASTA' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_SALMON_INDEX" ] && [ ! -e "$VIASH_PAR_SALMON_INDEX" ]; then
ViashError "Input file '$VIASH_PAR_SALMON_INDEX' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_KALLISTO_INDEX" ] && [ ! -e "$VIASH_PAR_KALLISTO_INDEX" ]; then
ViashError "Input file '$VIASH_PAR_KALLISTO_INDEX' does not exist."
exit 1
fi
# check whether parameters values are of the right type
if [[ -n "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH" ]]; then
if ! [[ "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH" =~ ^[-+]?[0-9]+$ ]]; then
ViashError '--kallisto_quant_fragment_length' has to be an integer. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD" ]]; then
if ! [[ "$VIASH_PAR_KALLISTO_QUANT_FRAGMENT_LENGTH_SD" =~ ^[-+]?[0-9]+$ ]]; then
ViashError '--kallisto_quant_fragment_length_sd' has to be an integer. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_CPUS" ]]; then
if ! [[ "$VIASH_META_CPUS" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'cpus' has to be an integer. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_B" ]]; then
if ! [[ "$VIASH_META_MEMORY_B" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_b' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_KB" ]]; then
if ! [[ "$VIASH_META_MEMORY_KB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_kb' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_MB" ]]; then
if ! [[ "$VIASH_META_MEMORY_MB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_mb' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_GB" ]]; then
if ! [[ "$VIASH_META_MEMORY_GB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_gb' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_TB" ]]; then
if ! [[ "$VIASH_META_MEMORY_TB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_tb' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_PB" ]]; then
if ! [[ "$VIASH_META_MEMORY_PB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_pb' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_KIB" ]]; then
if ! [[ "$VIASH_META_MEMORY_KIB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_kib' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_MIB" ]]; then
if ! [[ "$VIASH_META_MEMORY_MIB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_mib' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_GIB" ]]; then
if ! [[ "$VIASH_META_MEMORY_GIB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_gib' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_TIB" ]]; then
if ! [[ "$VIASH_META_MEMORY_TIB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_tib' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
if [[ -n "$VIASH_META_MEMORY_PIB" ]]; then
if ! [[ "$VIASH_META_MEMORY_PIB" =~ ^[-+]?[0-9]+$ ]]; then
ViashError 'memory_pib' has to be a long. Use "--help" to get more information on the parameters.
exit 1
fi
fi
# check whether value is belongs to a set of choices
if [ ! -z "$VIASH_PAR_STRANDEDNESS" ]; then
VIASH_PAR_STRANDEDNESS_CHOICES=("forward;reverse;unstranded")
IFS=';'
set -f
if ! [[ ";${VIASH_PAR_STRANDEDNESS_CHOICES[*]};" =~ ";$VIASH_PAR_STRANDEDNESS;" ]]; then
ViashError '--strandedness' specified value of \'$VIASH_PAR_STRANDEDNESS\' is not in the list of allowed values. Use "--help" to get more information on the parameters.
exit 1
fi
set +f
unset IFS
fi
if [ ! -z "$VIASH_PAR_PSEUDO_ALIGNER" ]; then
VIASH_PAR_PSEUDO_ALIGNER_CHOICES=("salmon;kallisto")
IFS=';'
set -f
if ! [[ ";${VIASH_PAR_PSEUDO_ALIGNER_CHOICES[*]};" =~ ";$VIASH_PAR_PSEUDO_ALIGNER;" ]]; then
ViashError '--pseudo_aligner' specified value of \'$VIASH_PAR_PSEUDO_ALIGNER\' is not in the list of allowed values. Use "--help" to get more information on the parameters.
exit 1
fi
set +f
unset IFS
fi
# create parent directories of output files, if so desired
if [ ! -z "$VIASH_PAR_PSEUDO_MULTIQC" ] && [ ! -d "$(dirname "$VIASH_PAR_PSEUDO_MULTIQC")" ]; then
mkdir -p "$(dirname "$VIASH_PAR_PSEUDO_MULTIQC")"
fi
if [ ! -z "$VIASH_PAR_QUANT_OUT_DIR" ] && [ ! -d "$(dirname "$VIASH_PAR_QUANT_OUT_DIR")" ]; then
mkdir -p "$(dirname "$VIASH_PAR_QUANT_OUT_DIR")"
fi
if [ ! -z "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE" ] && [ ! -d "$(dirname "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE")" ]; then
mkdir -p "$(dirname "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE")"
fi
if [ ! -z "$VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE" ] && [ ! -d "$(dirname "$VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE")" ]; then
mkdir -p "$(dirname "$VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE")"
fi
if [ "$VIASH_ENGINE_ID" == "native" ] ; then
if [ "$VIASH_MODE" == "run" ]; then
VIASH_CMD="bash"
else
ViashError "Engine '$VIASH_ENGINE_ID' does not support mode '$VIASH_MODE'."
exit 1
fi
fi
# set dependency paths
VIASH_DEP_KALLISTO_KALLISTO_QUANT="$VIASH_META_RESOURCES_DIR/../../../nextflow/kallisto/kallisto_quant/main.nf"
VIASH_DEP_SALMON_SALMON_QUANT="$VIASH_TARGET_DIR/dependencies/vsh/vsh/biobox/v0.1/nextflow/salmon/salmon_quant/main.nf"
ViashDebug "Running command: $(echo $VIASH_CMD)"
cat << VIASHEOF | eval $VIASH_CMD
set -e
tempscript=\$(mktemp "$VIASH_META_TEMP_DIR/viash-run-pseudo_alignment_and_quant-XXXXXX").nf
function clean_up {
rm "\$tempscript"
}
function interrupt {
echo -e "\nCTRL-C Pressed..."
exit 1
}
trap clean_up EXIT
trap interrupt INT SIGINT
cat > "\$tempscript" << 'VIASHMAIN'
//// VIASH START
// The following code has been auto-generated by Viash.
//// VIASH END
workflow run_wf {
take:
input_ch
main:
output_ch = input_ch
| map { id, state ->
def input = state.fastq_2 ? [ state.fastq_1, state.fastq_2 ] : [ state.fastq_1 ]
def paired = input.size() == 2
[ id, state + [ paired: paired, input: input ] ]
}
// Infer lib-type for salmon quant
| map { id, state ->
def lib_type = (state.paired) ?
(
(state.strandedness == "forward") ?
"ISF" :
(
(state.strandedness == "reverse") ? "ISR" : "IU"
)
)
: (
(state.strandedness == "forward") ?
"SF" :
(
(state.strandedness == "reverse") ? "SR" : "U"
)
)
[ id, state + [lib_type: lib_type] ]
}
// Count reads from BAM alignments using Salmon
| salmon_quant.run (
runIf: { id, state -> state.pseudo_aligner == 'salmon' },
fromState: { id, state ->
def unmated_reads = !state.paired ? state.fastq_1 : null
def mates1 = state.paired ? state.fastq_1 : null
def mates2 = state.paired ? state.fastq_2 : null
[ unmated_reads: unmated_reads,
mates1: mates1,
mates2: mates2,
gene_map: state.gtf,
index: state.salmon_index,
lib_type: state.lib_type ]
},
toState: [
"quant_results_dir": "output",
"salmon_quant_results_file": "quant_results"
]
)
| kallisto_quant.run (
runIf: { id, state -> state.pseudo_aligner == 'kallisto'},
fromState: [
"input": "input",
"paired": "paired",
"gtf": "gtf",
"index": "kallisto_index",
"fragment_length": "kallisto_quant_fragment_length",
"fragment_length_sd": "kallisto_quant_fragment_length_sd"
],
toState: [
"quant_out_dir": "output",
"kallisto_quant_results_file": "quant_results_file",
"pseudo_multiqc": "log"
]
)
| map { id, state ->
def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() }
[ id, mod_state ]
}
| setState (
[ "pseudo_multiqc": "quant_results",
"quant_out_dir": "quant_out_dir",
"salmon_quant_results_file": "salmon_quant_results_file",
"kallisto_quant_results_file": "kallisto_quant_results_file" ]
)
emit:
output_ch
}
VIASHMAIN
nextflow run . -main-script "\$tempscript" &
wait "\$!"
VIASHEOF
# check whether required files exist
if [ ! -z "$VIASH_PAR_PSEUDO_MULTIQC" ] && [ ! -e "$VIASH_PAR_PSEUDO_MULTIQC" ]; then
ViashError "Output file '$VIASH_PAR_PSEUDO_MULTIQC' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_QUANT_OUT_DIR" ] && [ ! -e "$VIASH_PAR_QUANT_OUT_DIR" ]; then
ViashError "Output file '$VIASH_PAR_QUANT_OUT_DIR' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE" ] && [ ! -e "$VIASH_PAR_SALMON_QUANT_RESULTS_FILE" ]; then
ViashError "Output file '$VIASH_PAR_SALMON_QUANT_RESULTS_FILE' does not exist."
exit 1
fi
if [ ! -z "$VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE" ] && [ ! -e "$VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE" ]; then
ViashError "Output file '$VIASH_PAR_KALLISTO_QUANT_RESULTS_FILE' does not exist."
exit 1
fi
exit 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff