Skip to content

Commit

Permalink
default output
Browse files Browse the repository at this point in the history
  • Loading branch information
sumanm99 committed Aug 21, 2024
1 parent 3123cd8 commit 3b67261
Show file tree
Hide file tree
Showing 7 changed files with 65,853 additions and 71 deletions.
37 changes: 17 additions & 20 deletions src/nanoplot/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ argument_groups:
- name: --fastq
type: file
description: Data is in one or more default fastq file(s).
default: "src/nanoplot/test_data/test1.fastq"
# default: "src/nanoplot/test_data/test1.fastq"
example: read.fq
direction: input
multiple: true
Expand Down Expand Up @@ -96,44 +96,45 @@ argument_groups:
type: file
description: Statistical summary from NanoPlot.
direction: output
example: output/*.txt
default: output/*.txt
- name: --nanoplots
type: file
description: Plots generated by NanoPlot.
direction: output
example: output/*.png
default: output/*.png
- name: --html
type: file
description: NanoPlot report and HTML files.
direction: output
example: output/*.html
default: output/*.html
- name: --log
type: file
description: Output Log file.
direction: output
example: output/*.log
default: output/*.log
- name: Options
arguments:
- name: --threads
alternatives: [-t]
type: integer
description: Set the allowed number of threads to be used by the script.
example: 2
# - name: --threads
# alternatives: [-t]
# type: integer
# description: Set the allowed number of threads to be used by the script.
# example: 2
- name: --verbose
type: boolean_true
description: Write log messages also to terminal
- name: --store
type: boolean_true
description: Store the extracted data in a pickle file for future plotting.
# direction: output
# default: output/*.pickle
- name: --raw
type: boolean_true
description: Store the extracted data in tab separated file.
- name: --huge
type: boolean_true
description: Input data is one very large file.
- name: --no_static
# type: boolean_false
type: boolean_true
type: boolean_false
description: Do not make static (png) plots.
- name: --prefix
alternatives: [-p]
Expand All @@ -157,8 +158,7 @@ argument_groups:
type: integer
description: Drop reads shorter than length specified.
- name: --drop_outliers
# type: boolean_false
type: boolean_true
type: boolean_false
description: Drop outlier reads with extreme long length.
- name: --downsample
type: integer
Expand Down Expand Up @@ -187,8 +187,7 @@ argument_groups:
type: boolean_true
description: Use if you want to split the summary file by barcode.
- name: --no_supplementary
# type: boolean_false
type: boolean_true
type: boolean_false
description: Use if you want to remove supplementary alignments.
- name: Customizing plots
arguments:
Expand Down Expand Up @@ -223,8 +222,7 @@ argument_groups:
type: boolean_true
description: List the colormaps which are available for plotting and exit.
- name: --no_N50
# type: boolean_false
type: boolean_true
type: boolean_false
description: Hide the N50 mark in the read length histogram.
- name: --N50
type: boolean_true
Expand All @@ -239,8 +237,7 @@ argument_groups:
type: integer
description: Set the dpi for saving images.
- name: --hide_stats
# type: boolean_false
type: boolean_true
type: boolean_false
description: Not adding Pearson R stats in some bivariate plots.
# Arguments not taken into account:
# -o, --outdir Specify directory in which output has to be created.
Expand Down
30 changes: 16 additions & 14 deletions src/nanoplot/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,31 @@ set -eo pipefail

## Default output directory
# Search for biobox directory starting from the current working directory
file_path=$(find "$(pwd)" -name "biobox" -type d)
par_output="$file_path//target/result/"

# file_path=$(find "$(pwd)" -name "biobox" -type d)
# par_output="$file_path//target/result/"
# par_output="output"

# Unset flags
[[ "$par_verbose" == "false" ]] && unset par_verbose
[[ "$par_store" == "false" ]] && unset par_store
[[ "$par_raw" == "false" ]] && unset par_raw
[[ "$par_huge" == "false" ]] && unset par_huge
[[ "$par_no_static" == "false" ]] && unset par_no_static
[[ "$par_no_static" == "true" ]] && unset par_no_static
[[ "$par_tsv_stats" == "false" ]] && unset par_tsv_stats
[[ "$par_only_report" == "false" ]] && unset par_only_report
[[ "$par_info_in_report" == "false" ]] && unset par_info_in_report
[[ "$par_drop_outliers" == "false" ]] && unset par_drop_outliers
[[ "$par_drop_outliers" == "true" ]] && unset par_drop_outliers
[[ "$par_loglength" == "false" ]] && unset par_loglength
[[ "$par_percentqual" == "false" ]] && unset par_percentqual
[[ "$par_alength" == "false" ]] && unset par_alength
[[ "$par_barcoded" == "false" ]] && unset par_barcoded
[[ "$par_no_supplementary" == "false" ]] && unset par_no_supplementary
[[ "$par_no_supplementary" == "true" ]] && unset par_no_supplementary
[[ "$par_listcolors" == "false" ]] && unset par_listcolors
[[ "$par_listcolormaps" == "false" ]] && unset par_listcolormaps
[[ "$par_no_N50" == "false" ]] && unset par_no_N50
[[ "$par_no_N50" == "true" ]] && unset par_no_N50
[[ "$par_N50" == "false" ]] && unset par_N50
[[ "$par_hide_stats" == "false" ]] && unset par_hide_stats
[[ "$par_hide_stats" == "true" ]] && unset par_hide_stats

# Multiple inputs - replace ';' with ' ' (space)
par_fastq=$(echo $par_fastq | tr ';' ' ')
Expand All @@ -55,8 +57,7 @@ NanoPlot \
${par_cram:+--cram "$par_cram"} \
${par_pickle:+--pickle "$par_pickle"} \
${par_feather:+--feather "$par_feather"} \
${par_threads:+--threads "$par_threads"} \
# ${meta_cpus:+--threads "${meta_cpus}"} \
# ${par_threads:+--threads "$par_threads"} \
${par_verbose:+--verbose} \
${par_store:+--store} \
${par_raw:+--raw} \
Expand Down Expand Up @@ -90,7 +91,8 @@ NanoPlot \
${par_title:+--title "$par_title"} \
${par_font_scale:+--font_scale "$par_font_scale"} \
${par_dpi:+--dpi "$par_dpi"} \
${par_hide_stats:+--hide_stats}
${par_hide_stats:+--hide_stats} \
# -o output

## Move output to output directory ##
# Move NanoPlot summary file
Expand All @@ -100,10 +102,10 @@ if [[ -n "$par_statsum" ]]; then
base_name=$(echo "$par_statsum" | sed 's/\*.*//')
# Make a folder with the extracted string as the name
mkdir -p "$base_name"
mv *.txt "$base_name"
else
mkdir -p "$par_output"
mv *.txt "$par_output"
mv "$par_temp"/*.txt "$base_name"
# else
# mkdir -p "$par_output"
# mv *.txt "$par_output"
fi

# Move NanoPlot plots
Expand Down
1 change: 0 additions & 1 deletion src/nanoplot/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ echo "Test 2 succeeded."
echo "> Run Test 3: multiple options"
"$meta_executable" \
--fastq "$meta_resources_dir/test_data/test1.fastq" \
-t 2 \
--maxlength 40000 \
--format jpg \
--prefix biobox_ \
Expand Down
14 changes: 12 additions & 2 deletions src/nanoplot/test_data/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,19 @@ done

#########################################################################################

## Bam file ##
## Fasta file ##
# Dowload test data from snakemake wrapper
if [ ! -d /tmp/snakemake-wrappers ]; then
git clone --depth 1 --single-branch --branch master https://github.com/snakemake/snakemake-wrappers /tmp/snakemake-wrappers
fi

cp -r /tmp/snakemake-wrappers/bio/arriba/test/A.bam src/nanoplot/test_data/test.bam
cp -r /tmp/snakemake-wrappers/bio/assembly-stats/test/*.fasta src/nanoplot/test_data/test.fasta

#########################################################################################

## Bam file ##
cp -r /tmp/snakemake-wrappers/bio/arriba/test/A.bam src/nanoplot/test_data/test.bam

#########

## Cram file ##
Loading

0 comments on commit 3b67261

Please sign in to comment.