lecaluke.sh 1.99 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 committed
20
include tempdir
21

Eric Coissac committed
22
if onluke; then
23

24 25 26 27 28
	logdebug "Script run on the LUKE cluster"
    
    # Source the ciment & leca environment:
    . /nfs_scratch/LECA_ENVIRONEMENT/env.bash
    
Eric Coissac committed
29
	# Register scratch_dir as place where to create temp directory
30 31 32 33 34 35
	
	if [[ ! -z "$LOCAL_SCRATCH_DIR" ]] ; then
		registertmpdir $LOCAL_SCRATCH_DIR
		registertmpdir $SHARED_SCRATCH_DIR
	fi
	
Eric Coissac committed
36 37
	# Where is located the LECA_ENVIRONEMENT
	LECA_ENVIRONEMENT=/nfs_scratch/LECA_ENVIRONEMENT
38

Eric Coissac committed
39 40
	# Load the LECA envoronement
	. ${LECA_ENVIRONEMENT}/etc/bashrc
Eric Coissac committed
41

Eric Coissac committed
42 43
	# Lock files are stored in a common place
	LOCK_DIR="${LECA_ENVIRONEMENT}/locks"
Eric Coissac committed
44

Eric Coissac committed
45 46
	# All the data shared among users can be stored here
	DATA_DIR="${LECA_ENVIRONEMENT}/data"
47

Eric Coissac committed
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
	# 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
64

Eric Coissac committed
65
	logwarning Script is not running on the LUKE cluster
66
	
Eric Coissac committed
67 68 69 70 71 72 73 74 75
	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