-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbsv-R1-S10_bqsr_merge_make_input.sh
executable file
·78 lines (66 loc) · 2.19 KB
/
bsv-R1-S10_bqsr_merge_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
71
72
73
74
75
76
77
78
#!/bin/bash
#########################################################
#
# Platform: NCI Gadi HPC
# Description: create input lists for merging recalibrated split
# BAM files into a final BAM per sample
# Details:
# Run tumour and normal as separate jobs re ~ double
# walltime for tumour. If no binomial grouping is required,
# change group=true to group=false. When group=true, assumes
# normal samples end with 'N' and all other phenotype IDs
# are assigned to tumour
# Author: Cali Willet
# cali.willet@sydney.edu.au
# Date last modified: 14/10/2020
#
# 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 scientific and technical assistance
# <or e.g. bioinformatics assistance of <PERSON>> of Sydney Informatics
# Hub and resources and services from the National Computational
# Infrastructure (NCI), which is supported by the Australian Government
# with access facilitated by the University of Sydney.
#
#########################################################
cohort=<cohort>
config=${cohort}.config
group=false # Devils have a low cov and high cov group, but this is not detectable from the config like it is for T/N. Perhaps we need to reassess config format - add a column for grouping?
t_input=./Inputs/bqsr_merge.inputs-tumour
n_input=./Inputs/bqsr_merge.inputs-normal
input=./Inputs/bqsr_merge.inputs
rm -f $t_input
rm -f $n_input
rm -f $input
awk 'NR>1' ${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 BQSR merge tasks to run: ${tasks}\n"
fi
if [ -f $n_input ]
then
tasks=`wc -l < $n_input`
printf "Number of BQSR merge normal sample tasks to run: ${tasks}\n"
fi
if [ -f $t_input ]
then
tasks=`wc -l < $t_input`
printf "Number of BQSR merge tumour sample tasks to run: ${tasks}\n"
fi