From 557f540bde27b49891afcc34b7382d394977a249 Mon Sep 17 00:00:00 2001 From: dorien-er Date: Tue, 30 Jan 2024 18:46:14 +0100 Subject: [PATCH] add outputs --- src/busco/busco/config.vsh.yaml | 39 +++++++++++++++++++++++++-------- src/busco/busco/script.sh | 28 +++++++++++++++++------ 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/src/busco/busco/config.vsh.yaml b/src/busco/busco/config.vsh.yaml index 142f1b13..11189536 100644 --- a/src/busco/busco/config.vsh.yaml +++ b/src/busco/busco/config.vsh.yaml @@ -39,20 +39,41 @@ functionality: - name: Outputs arguments: - - name: --output_dir - alternatives: ["-o"] - required: true + - name: --short_summary_json + required: false direction: output type: file + example: short_summary.json description: | - Path to output directory for publishing BUSCO results - example: output - - name: --output_prefix - type: string + Output file for short summary in JSON format. + - name: --short_summary_txt + required: false + direction: output + type: file + example: short_summary.txt + description: | + Output file for short summary in TXT format. + - name: --full_table required: false + direction: output + type: file + example: full_table.tsv + description: | + Full table output in TSV format. + - name: --missing_busco_list + required: false + direction: output + type: file + example: missing_list.tsv + description: | + Missing list output in TSV format. + - name: --output_dir + required: false + direction: output + type: file + example: output_dir/ description: | - Name of the analysis run, output folders and files will be labeled with this name. if not specified the output will be the input file name." - example: busco_protein + The full output directory, if so desired. - name: Resource and Run Settings arguments: diff --git a/src/busco/busco/script.sh b/src/busco/busco/script.sh index b79eb285..95e16c1a 100644 --- a/src/busco/busco/script.sh +++ b/src/busco/busco/script.sh @@ -18,16 +18,15 @@ [[ "$par_scaffold_composition" == "false" ]] && unset par_scaffold_composition [[ "$par_miniprot" == "false" ]] && unset par_miniprot -if [[ -n "$par_output_prefix" ]]; then - prefix="$par_output_prefix" -else - prefix="$(basename -- $par_input)" -fi + +tmp_dir=$(mktemp -d -p "$meta_temp_dir" busco_XXXXXXXXX) +prefix=$(openssl rand -hex 8) busco \ --in "$par_input" \ --mode "$par_mode" \ --out "$prefix" \ + --out_path "$tmp_dir" \ ${meta_cpus:+--cpu "${meta_cpus}"} \ ${par_lineage_dataset:+--lineage_dataset "$par_lineage_dataset"} \ ${par_augustus:+--augustus} \ @@ -55,6 +54,21 @@ busco \ ${par_download_path:+--download_path "$par_download_path"} \ ${par_download:+--download "$par_download"} -mkdir $par_output_dir -mv $prefix/* $par_output_dir + + +if [[ -n "$par_short_summary_json" ]]; then + find "$tmp_dir/$prefix" -maxdepth 1 -type d -name 'run_*' -exec cp {}/short_summary.json "$par_short_summary_json" \; +fi +if [[ -n "$par_short_summary_txt" ]]; then + find "$tmp_dir/$prefix" -maxdepth 1 -type d -name 'run_*' -exec cp {}/short_summary.txt "$par_short_summary_txt" \; +fi +if [[ -n "$par_full_table" ]]; then + find "$tmp_dir/$prefix" -maxdepth 1 -type d -name 'run_*' -exec cp {}/full_table.tsv "$par_full_table" \; +fi +if [[ -n "$par_missing_busco_list" ]]; then + find "$tmp_dir/$prefix" -maxdepth 1 -type d -name 'run_*' -exec cp {}/missing_busco_list.txt "$par_missing_busco_list" \; +fi +if [[ -n "$par_output_dir" ]]; then + cp -r $tmp_dir/$prefix/run_* $par_output_dir +fi