-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCHOLAR_GUI.sh
More file actions
119 lines (80 loc) · 3.3 KB
/
CHOLAR_GUI.sh
File metadata and controls
119 lines (80 loc) · 3.3 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/bash
#
# Script Name: CHOLAR_GUI.sh
# Author: Haneesh J
# Date: September 23, 2021
#
# Description: The following script is for GUI implemented in the zenity tool.
#
#
# Input type: NA
# Output: NA
#
#
# Storing the error information of in the output directory passed as an argument
description=$(zenity --forms --title="Identification of LncRNA" \
--text="Input names without (_1/_2) and other underscore ("_")" --add-entry="SAMPLE NAMES
(sep by ',')
[Samplel,Sample2,Sample3,Sample4]" --add-entry="SAMPLE TYPES (sep by ',')
{ add condion in same order as sample } [cntrl,cntrl,treat,treat]")
[[ $? != 0 ]] && exit 1
snames=$(echo $description | cut -d'|' -f1)
stype=$(echo $description | cut -d'|' -f2)
[[ $? != 0 ]] && exit 1
array=$(echo $snames | tr "," "\n")
arr=($array)
array2=$(echo $stype | tr "," "\n")
arr2=($array2)
zenity --info --title="Annotation GTF file" --text="Select Annotation GTF file" --ok-label="OK"
[[ $? != 0 ]] && exit 1
GTF=$(zenity --file-selection --filename $HOME/C_files/genome/human/hg38/annotation/gencode.v40.chr_patch_hapl_scaff.annotation.gtf \
--title="***Annotation GTF file***" --text="Select Annoatation GTF file")
[[ $? != 0 ]] && exit 1
zenity --info --title="Splice Site file" --text="Select Splice Site file" --ok-label="OK"
[[ $? != 0 ]] && exit 1
SS=$(zenity --file-selection --filename $HOME/C_files/genome/human/hg38/annotation/gencode.v40.splicesite.annotation.ss \
--title="***Splice Site file***" --text="Select Splice Site file")
[[ $? != 0 ]] && exit 1
zenity --info --title="Reference genome" --text="Select reference genome" --ok-label="OK"
[[ $? != 0 ]] && exit 1
REF=$(zenity --file-selection --filename $HOME/C_files/genome/human/hg38/ref_gen/hg38.fa \
--title="***Reference genome***" --text="Select reference genome")
[[ $? != 0 ]] && exit 1
zenity --info --title="Script path" --text="Select script directory" --ok-label="OK"
[[ $? != 0 ]] && exit 1
R=$(zenity --file-selection --directory --filename $PWD --title="***Script path***" \
--text="Select script directory")
[[ $? != 0 ]] && exit 1
zenity --info --title="Input files directory" --text="Select Input files directory" --ok-label="OK"
[[ $? != 0 ]] && exit 1
IN=$(zenity --file-selection --directory --title="***Input Files directory***" \
--text="Select Input files directory")
[[ $? != 0 ]] && exit 1
zenity --info --title="Log directory" --text="Select log directory" --ok-label="OK"
[[ $? != 0 ]] && exit 1
LOGF=$(zenity --file-selection --directory --filename $IN --title="***Log directory***" \
--text="Select log directory")
[[ $? != 0 ]] && exit 1
len=${#arr[@]}
for (( idx = 0; idx < len; idx++ ));
do
echo "${arr[idx]} ${arr2[idx]}" >> $IN/map.txt
done
bash $R/source/name_change.sh $IN $IN/map.txt
rm $IN/map.txt
th=$(nproc --all)
th=$(($th-2))
threads=$(zenity --scale --title="Threads" --text="For faster analysis, select more no of threads" --max-value=$th)
[[ $? != 0 ]] && exit 1
echo "
sample_names = "$snames"
sample_types = "$stype"
GTF_file = "$GTF"
reference_genome = "$REF"
script_directory = "$R"
input_directory = "$IN"
log_directory = "$LOGF"
threads = "$threads | zenity --text-info --title="Summary" --width=700 --height=600 --ok-label="OK" --cancel-label="Cancel"
if [ "$?" -eq "0" ]; then
bash $R/source/master_script.sh $REF $threads $GTF $SS $IN $R
fi