-
Notifications
You must be signed in to change notification settings - Fork 7
/
reformat_split_disc_make_input.sh
70 lines (59 loc) · 1.99 KB
/
reformat_split_disc_make_input.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
##########################################################################
#
# Platform: NCI Gadi HPC
# Usage: reformat_split_disc_make_input.sh <cohort prefix>
# Version: 2.0
#
# For more details see: https://github.com/Sydney-Informatics-Hub/Fastq-to-BAM
#
# If you use this script towards a publication, please acknowledge the
# Sydney Informatics Hub (or co-authorship, where appropriate).
#
# Suggested acknowledgement:
# The authors acknowledge the support provided by the Sydney Informatics Hub,
# a Core Research Facility of the University of Sydney. This research/project
# was undertaken with the assistance of resources and services from the National
# Computational Infrastructure (NCI), which is supported by the Australian
# Government, and the Australian BioCommons which is enabled by NCRIS via
# Bioplatforms Australia funding.
#
##########################################################################
cohort=../$1
group=false
t_input=./Inputs/reformat_split_disc.inputs-tumour
n_input=./Inputs/reformat_split_disc.inputs-normal
input=./Inputs/reformat_split_disc.inputs
rm -f $t_input
rm -f $n_input
rm -f $input
awk 'NR>1' ${cohort}.config | while read CONFIG
do
labSampleID=`echo $CONFIG | cut -d ' ' -f 2`
if [[ $group = true ]]
then
if [[ $labSampleID = *-N ]]
then
printf "${labSampleID}\n" >> $n_input
else
printf "${labSampleID}\n" >> $t_input
fi
else
printf "${labSampleID}\n" >> $input
fi
done
if [ -f $input ]
then
tasks=`wc -l < $input`
printf "Number of reformat split/disc tasks to run: ${tasks}\n"
fi
if [ -f $n_input ]
then
tasks=`wc -l < $n_input`
printf "Number of reformat split/disc normal sample tasks to run: ${tasks}\n"
fi
if [ -f $t_input ]
then
tasks=`wc -l < $t_input`
printf "Number of reformat split/disc tumour sample tasks to run: ${tasks}\n"
fi