-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcreate_nf_samplesheet.sh
executable file
·50 lines (43 loc) · 1.22 KB
/
create_nf_samplesheet.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/bash
PROJ="$1"
ANALYSISPATH="$2"
DATAPATH="$3"
ENVPATH="$4"
PIPELINE="$5"
if [[ $# -ne 5 ]]
then
echo
echo " This script requires the parameters <project name> <analysis path> <data path> <environment path> <pipeline>"
echo
echo " example:"
echo " $ create_nf_samplesheet.sh \\"
echo " AB-1234 \\"
echo " /proj/ngi2016001/nobackup/NGI/ANALYSIS \\"
echo " /proj/ngi2016001/nobackup/NGI/DATA \\"
echo " /vulpes/ngi/production/latest \\"
echo " rnaseq"
echo
exit 1
fi
PROJDIR="$ANALYSISPATH/$PROJ"
DATADIR="$DATAPATH/$PROJ"
FQDIR="${PROJDIR}/fastqs"
mkdir -p ${FQDIR}
find "${DATADIR}" -name "*.fastq.gz" -exec ln -s {} "${FQDIR}/" \;
if [[ $PIPELINE == "rnaseq" || $PIPELINE == "methylseq" ]]
then
python "$(find "$ENVPATH/sw/rnaseq" -name "fastq_dir_to_samplesheet.py" -print -quit)" \
--sanitise_name \
--sanitise_name_index=1 \
--strandedness=reverse \
"${FQDIR}" \
"${PROJDIR}/${PROJ}.SampleSheet.csv"
elif [[ $PIPELINE == "sarek" ]]
then
python create_sarek_samplesheet.py \
"${FQDIR}" \
"${PROJDIR}/${PROJ}.SampleSheet.csv"
else
echo "Pipeline ${PIPELINE} not supported."
exit 1
fi