lecaluke.sh 1.84 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#
# LECA Bash library
#
# The LECA bash library provides a set of function used for helping
# development of bash script mainly to write job script on the luke
# cluster
#
# The files from the LECA Bash library must be sourced from your main script
#
#
# Provides a set of variables relative to the LECA environement
# =============================================================
#
# The lecaluke module provides a set of variable defining emplacement
# where LECA ressources are stored on the LUKE cluster.

17 18 19
include logging
logdebug "Load lecaluke package"

Eric Coissac's avatar
Eric Coissac committed
20
include tempdir
21

Eric Coissac's avatar
Eric Coissac committed
22
if onluke; then
23

Eric Coissac's avatar
Eric Coissac committed
24
	logdebug Script run on the LUKE cluster
25

Eric Coissac's avatar
Eric Coissac committed
26 27 28
	# Register scratch_dir as place where to create temp directory
	registertmpdir $LOCAL_SCRATCH_DIR
	registertmpdir $SHARED_SCRATCH_DIR
29

Eric Coissac's avatar
Eric Coissac committed
30 31
	# Where is located the LECA_ENVIRONEMENT
	LECA_ENVIRONEMENT=/nfs_scratch/LECA_ENVIRONEMENT
32

Eric Coissac's avatar
Eric Coissac committed
33 34
	# Load the LECA envoronement
	. ${LECA_ENVIRONEMENT}/etc/bashrc
Eric Coissac's avatar
Eric Coissac committed
35

Eric Coissac's avatar
Eric Coissac committed
36 37
	# Lock files are stored in a common place
	LOCK_DIR="${LECA_ENVIRONEMENT}/locks"
Eric Coissac's avatar
Eric Coissac committed
38

Eric Coissac's avatar
Eric Coissac committed
39 40
	# All the data shared among users can be stored here
	DATA_DIR="${LECA_ENVIRONEMENT}/data"
41

Eric Coissac's avatar
Eric Coissac committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
	# All the molecular public databases downloaded for users on the luke cluster
	# will be downloaded here
	BIODATA_DIR="${DATA_DIR}/biodatabase"

	# Main directory for the NCBI taxonomy
	TAXONOMY_DIR="${BIODATA_DIR}/taxonomy"

	TREMBL_DIR="${BIODATA_DIR}/trembl"

	SWISSPROT_DIR="${BIODATA_DIR}/swissprot"

	function latest_taxonomy() {
	  echo "${TAXONOMY_DIR}/$(ls -ltr "${BIODATA_DIR}/taxonomy" | awk '/^d/ {print $NF}' | tail -1)"
	}

else
58

Eric Coissac's avatar
Eric Coissac committed
59
	logwarning Script is not running on the LUKE cluster
60
	
Eric Coissac's avatar
Eric Coissac committed
61 62 63 64 65 66 67 68 69
	if onfroggy ; then
		logdebug Script run on the FROGGY cluster
		# Register scratch_dir as place where to create temp directory
		registertmpdir $LOCAL_SCRATCH_DIR
		registertmpdir $SHARED_SCRATCH_DIR
	else
		logwarning Script is not running on the FROGGY cluster
	fi
fi