Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into bugfix/inferred-ce…
Browse files Browse the repository at this point in the history
…ll-type-field-not-in-sdrf-breaks-experiment-design

# Conflicts:
#	bin/add_exps_to_collection.sh
#	bin/create_collection.sh
#	bin/delete_collection.sh
#	bin/delete_exp_from_collection.sh
#	bin/get_experiment_info.sh
#	bin/load_db_scxa_analytics.sh
#	bin/load_db_scxa_analytics_pg9.sh
#	bin/load_db_scxa_cell_clusters.sh
#	bin/load_db_scxa_dimred.sh
#	bin/load_db_scxa_marker_genes.sh
#	bin/load_exp_design.sh
#	bin/modify_collection.sh
  • Loading branch information
alfonsomunozpomer committed Oct 10, 2023
2 parents a4ed9a9 + 6326500 commit e2f2cc4
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion bin/add_exps_to_collection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )

dbConnection=${dbConnection:-$1}
COLL_ID=${COLL_ID:-$2}
Expand Down
2 changes: 1 addition & 1 deletion bin/create_collection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )
source $scriptDir/common_routines.sh

dbConnection=${dbConnection:-$1}
Expand Down
2 changes: 1 addition & 1 deletion bin/delete_collection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )

dbConnection=${dbConnection:-$1}
COLL_ID=${COLL_ID:-$2}
Expand Down
2 changes: 1 addition & 1 deletion bin/delete_exp_from_collection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )
source $scriptDir/common_routines.sh

dbConnection=${dbConnection:-$1}
Expand Down
2 changes: 1 addition & 1 deletion bin/get_experiment_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )

postgres_scripts_dir=$scriptDir/../postgres_routines

Expand Down
2 changes: 1 addition & 1 deletion bin/load_db_scxa_analytics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# - Postprocess table and attach it to the main scxa-analytics table.
set -e

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )
source $scriptDir/common_routines.sh

postgres_scripts_dir=$scriptDir/../postgres_routines
Expand Down
2 changes: 1 addition & 1 deletion bin/load_db_scxa_analytics_pg9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# PG10, which loads each experiment into a different partition.
set -e

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )
source $scriptDir/common_routines.sh

dbConnection=${dbConnection:-$1}
Expand Down
2 changes: 1 addition & 1 deletion bin/load_db_scxa_cell_clusters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# scxa_cell_group_membership table of AtlasProd.
set -e

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )
source $scriptDir/common_routines.sh

dbConnection=${dbConnection:-$1}
Expand Down
4 changes: 2 additions & 2 deletions bin/load_db_scxa_dimred.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
# parameterisations, and loads it into the scxa_coords table of AtlasProd.
set -e

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )
source $scriptDir/common_routines.sh

dbConnection=${dbConnection:-$1}
EXP_ID=${EXP_ID:-$2}
DIMRED_TYPE=${DIMRED_TYPE:-$3}
DIMRED_FILE_PATH=${DIMRED_FILE_PATH:-$4}
DIMRED_PARAM_JSON=${DIMRED_PARAM_JSON:-$5}
SCRATCH_DIR=${SCRATCH_DIR:-"$(dirname ${DIMRED_FILE_PATH})"}
SCRATCH_DIR=${SCRATCH_DIR:-"$DIMRED_FILE_PATH"}

# Check that necessary environment variables are defined.
[ -n ${dbConnection+x} ] || (echo "Env var dbConnection for the database connection needs to be defined. This includes the database name." && exit 1)
Expand Down
2 changes: 1 addition & 1 deletion bin/load_db_scxa_marker_genes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# scxa_cell_groups_marker_genes table of AtlasProd.
set -e

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )
source $scriptDir/common_routines.sh

dbConnection=${dbConnection:-$1}
Expand Down
2 changes: 1 addition & 1 deletion bin/load_experiment_web_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

jar_dir=$CONDA_PREFIX/share/atlas-cli

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )
source $scriptDir/common_routines.sh

echo "CONDA_PREFIX: $CONDA_PREFIX"
Expand Down
2 changes: 1 addition & 1 deletion bin/modify_collection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )

dbConnection=${dbConnection:-$1}
COLL_ID=${COLL_ID:-$2}
Expand Down
2 changes: 1 addition & 1 deletion bin/update_experiment_web_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

jar_dir=$CONDA_PREFIX/share/atlas-cli

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )
source $scriptDir/common_routines.sh

echo "CONDA_PREFIX: $CONDA_PREFIX"
Expand Down
2 changes: 1 addition & 1 deletion fixtures/generate-fixtures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# https://stackoverflow.com/questions/59895/how-can-i-get-the-source-directory-of-a-bash-script-from-within-the-script-itsel
# https://stackoverflow.com/a/246128
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )"

export POSTGRES_HOST=${POSTGRES_HOST:-localhost}
export POSTGRES_PORT=${POSTGRES_PORT:-5432}
Expand Down
2 changes: 1 addition & 1 deletion fixtures/generate-tsv-fixture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# We choose 100 genes that are expressed in those cells via analytics table

set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )"

source ${SCRIPT_DIR}/utils.sh

Expand Down
4 changes: 2 additions & 2 deletions tests/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
scriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )
export testsDir=$scriptDir
export PATH=$scriptDir/../bin:$scriptDir/../tests:$PATH

Expand Down Expand Up @@ -33,7 +33,7 @@ export EXPERIMENT_DESIGN_FILES=$SCRATCH_DIR


if [ "$#" -eq 0 ]; then
bats --tap "$(dirname "${BASH_SOURCE[0]}")"
bats --tap "$(dirname "${BASH_SOURCE[0]:-$0}")"
else
bats random-data-set.bats
fi
4 changes: 2 additions & 2 deletions tests/test_dimred_load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ delete_db_scxa_dimred.sh
# do it just for testing

ls ${EXPERIMENT_DIMRED_PATH}/${EXP_ID}.tsne*.tsv | while read -r l; do
export DIMRED_TYPE=tsne
export DIMRED_TYPE=t-SNE
export DIMRED_FILE_PATH=$l
paramval=$(echo "$l" | sed 's/.*[^0-9]\([0-9]*\).tsv/\1/g')
export DIMRED_PARAM_JSON='[{"perplexity": '$paramval'}]'
load_db_scxa_dimred.sh
done

ls ${EXPERIMENT_DIMRED_PATH}/${EXP_ID}.umap*.tsv | while read -r l; do
export DIMRED_TYPE=umap
export DIMRED_TYPE=UMAP
export DIMRED_FILE_PATH=$l
paramval=$(echo "$l" | sed 's/.*[^0-9]\([0-9]*\).tsv/\1/g')
export DIMRED_PARAM_JSON='[{"n_neighbors": '$paramval'}]'
Expand Down

0 comments on commit e2f2cc4

Please sign in to comment.