Rollup before java debug

This commit is contained in:
2024-08-23 14:39:16 -04:00
parent 3098a9dda5
commit b25dfb70b4
3 changed files with 167 additions and 57 deletions

View File

@@ -1296,6 +1296,7 @@ qhtcp() {
# Run R interactions script on all studies
calculate_interaction_zscores \
&& join_interaction_zscores \
&& remc \
&& gtf \
&& gta
@@ -1316,7 +1317,6 @@ remc() {
# If any wrappers fail the rest will not run, this is fundamental to module design
# Remove leading && to run regardless
#r_join_interactions \
java_extract \
&& r_add_shift_values \
&& r_create_heat_maps \
@@ -1522,7 +1522,50 @@ calculate_interaction_zscores() {
"${EXP_PATHS_AND_NAMES[@]}"
[[ -f "$out_path/zscores_interaction.csv" ]] || (echo "$out_path/zscores_interaction.csv does not exist"; return 1)
((DEBUG)) && declare -p && exit # when the going gets rough
}
wrapper join_interaction_zscores
# shellcheck disable=SC2120
# @description JoinInteractExps3dev.R creates REMcRdy_lm_only.csv and Shift_only.csv
#
# TODO
#
# * Needs more loops to reduce verbosity
#
# INPUT
#
# * /out/PROJECT/STUDY/exp#/zscores/zscores_interaction.csv
#
# OUTPUT
#
# * combined_zscores.csv (REMcRdy_lm_only.csv)
# * combined_summary_stats (Shift_only.csv)
# * final_combined_report (parameters.csv)
#
# @arg $1 string output directory
# @arg $2 string sd value (default: 2)
# @arg $3 array pairs of experiment paths and names
join_interaction_zscores() {
debug "Running: ${FUNCNAME[0]} $*"
declare script="$APPS_DIR/r/join_interaction_zscores.R"
declare -a out_files=(
"${1:-$STUDY_RESULTS_DIR}/combined_zscores.csv"
"${1:-$STUDY_RESULTS_DIR}/combined_summary_stats.csv"
"${1:-$STUDY_RESULTS_DIR}/final_combined_report.csv"
)
# ((DEBUG)) && declare -p # when the going gets tough
execute "$RSCRIPT" "$script" \
"${1:-$STUDY_RESULTS_DIR}" \
"${2:-2}" \
"${@:3:}" \
"${EXP_PATHS_AND_NAMES[@]}"
for f in "${out_files[@]}"; do
[[ -f $f ]] || (echo "$f does not exist"; return 1)
done
}
@@ -1671,52 +1714,6 @@ r_gta_heatmaps() {
}
# wrapper r_join_interactions
# # shellcheck disable=SC2120
# # @description JoinInteractExps3dev.R creates REMcRdy_lm_only.csv and Shift_only.csv
# #
# # TODO
# #
# # * Needs more loops to reduce verbosity
# #
# # INPUT
# #
# # * study info file
# # * /out/PROJECT/STUDY/exp#/zscores/zscores_interaction.csv
# #
# # OUTPUT
# #
# # * REMcRdy_lm_only.csv
# # * Shift_only.csv
# # * parameters.csv
# #
# # @arg $1 string output directory (required)
# # @arg $2 string sd value (default: 2) (required)
# # @arg $3 string study info file (required)
# # @arg $4 array studies (required)
# r_join_interactions() {
# debug "Running: ${FUNCNAME[0]} $*"
# declare script="$APPS_DIR/r/joinInteractExps.R"
# declare -a out_files=(
# "${1:-$STUDY_RESULTS_DIR}/REMcRdy_lm_only.csv"
# "${1:-$STUDY_RESULTS_DIR}/Shift_only.csv"
# "${1:-$STUDY_RESULTS_DIR}/parameters.csv"
# )
# # ((DEBUG)) && declare -p # when the going gets tough
# execute "$RSCRIPT" "$script" \
# "${1:-$STUDY_RESULTS_DIR}" \
# "${2:-2}" \
# "${3:-$STUDY_INFO_FILE}" \
# "${@:4:-${EXP_PATHS[@]}}"
# for f in "${out_files[@]}"; do
# [[ -f $f ]] || (echo "$f does not exist"; return 1)
# done
# }
wrapper java_extract
# shellcheck disable=SC2120
# @description Jingyu's REMc java utility
@@ -1727,14 +1724,14 @@ wrapper java_extract
#
# INPUT
#
# * REMcRdy_lm_only.csv
# * study_dir/combined_zscores.csv (REMcRdy_lm_only.csv)
#
# OUTPUT
#
# * REMcRdy_lm_only.csv-finalTable.csv
# * study_dir/combined_zscores_final.csv (REMcRdy_lm_only.csv-finalTable.csv)
#
# @arg $1 string output directory
# @arg $2 string REMcRdy_lm_only.csv
# @arg $2 string combined_zscores.csv
# @arg $3 string GeneByGOAttributeMatrix_nofiltering-2009Dec07.tab
# @arg $4 string ORF_List_Without_DAmPs.txt
# @exitcode 0 if expected output file exists
@@ -1743,14 +1740,14 @@ java_extract() {
debug "Running: ${FUNCNAME[0]}"
classpath="$APPS_DIR/java/weka-clustering/weka-clustering.jar"
output_file="${1:-$STUDY_RESULTS_DIR}/REMcRdy_lm_only.csv-finalTable.csv"
output_file="${1:-$STUDY_RESULTS_DIR}/combined_zscores_final.csv"
[[ -f $output_file ]] && backup "$output_file"
java_cmd=(
"$JAVA" -Xms512m -Xmx2048m -Dfile.encoding=UTF-8
-classpath "$classpath" ExecMain
"${2:-"$STUDY_RESULTS_DIR/REMcRdy_lm_only.csv"}"
"${2:-"$STUDY_RESULTS_DIR/combined_zscores.csv"}"
"${3:-"$APPS_DIR/java/GeneByGOAttributeMatrix_nofiltering-2009Dec07.tab"}"
"${4:-"$APPS_DIR/java/ORF_List_Without_DAmPs.txt"}"
1
@@ -2297,9 +2294,9 @@ main() {
# Sanitize wrappers
for i in "${!WRAPPERS[@]}"; do
IFS=',' read -ra args <<< "$wrapper" # load the wrapper and args
IFS=',' read -ra args <<< "${WRAPPERS[$i]}" # load the wrapper and args
if ! [[ " ${ALL_WRAPPERS[*]} " =~ [[:space:]]${args[0]}[[:space:]] ]]; then
echo "Wrapper ${WRAPPERS[$i]} is not available, removing"
echo "Wrapper ${args[0]} is not available, removing"
unset "WRAPPERS[$i]"
fi
done