Skip to content

Commit

Permalink
improving prerequisite checking
Browse files Browse the repository at this point in the history
  • Loading branch information
SHuang-Broad committed Jun 28, 2018
1 parent 17ac3b1 commit f14af73
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions scripts/sv/evaluation/general/misc_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ else
exit 1
fi

command -v bedtools >/dev/null 2>&1 || { echo >&2 "I require bedtools for interval intersection analysis but it's not installed. Aborting."; exit 1; }
command -v R >/dev/null 2>&1 || { echo >&2 "I require R but it's not installed. Aborting."; exit 1; }
temp=$(Rscript -e 'packages <-c("stringr", "plyr"); uninstalled <- packages[ which(packages %in% installed.packages()[, "Package"]==F) ]; uninstalled')if [[ $ALL_RPACK_INSTALLED == "FALSE" ]]; then
if [[ $temp != "character(0)" ]]; then echo "Required R package(s) $temp not installed; Aborting."; exit 1; fi

########## get primary contigs pattern given requested assembly version (must be 19 or 38)
function get_primary_contigs_pattern() {
PRIMARY_CONTIGS_PATTERN=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ echo " Delegating to R for producing plots"
echo

CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Rscript "$CURR_DIR/plotInsDelSizes.R" "$ANALYSIS_DIR_MASTER" "$MANTA_AND_PACBIO_PREANALYSIS_DIR"
Rscript "$CURR_DIR/plotInsDelSizes.R" "$ANALYSIS_DIR_FEATURE" "$MANTA_AND_PACBIO_PREANALYSIS_DIR"
Rscript "$CURR_DIR/plotInsDelSizes.R" "$ANALYSIS_DIR_MASTER" "$MANTA_AND_PACBIO_PREANALYSIS_DIR" "$SCRIPT_DIR"
Rscript "$CURR_DIR/plotInsDelSizes.R" "$ANALYSIS_DIR_FEATURE" "$MANTA_AND_PACBIO_PREANALYSIS_DIR" "$SCRIPT_DIR"

echo
echo " Done producing plots"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# and deletion calls

#########################################################################
source("../../general/AccountingAndPrep/func_collectSizes.R")

args<-commandArgs(TRUE)
wd <- args[1]
Expand All @@ -12,6 +11,10 @@ print(paste("working in directory", wd))

mantaAndPacBioDir <- args[2]

scriptDir <- args[3]
helperPath <- paste0(scriptDir, "AccountingAndPrep/func_collectSizes.R")
source( helperPath )

sizesCollection <- collectSizes(paste0(mantaAndPacBioDir, "/mantaExactCleanDeletionSizes.txt"),
paste0(mantaAndPacBioDir, "/mantaExactCleanInsertionSizes.txt"),
paste0(mantaAndPacBioDir, "/mantaExactCleanTandupSizes.txt"),
Expand Down

0 comments on commit f14af73

Please sign in to comment.