-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
executable file
·233 lines (192 loc) · 4.93 KB
/
.bashrc
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
## only do if interactive shell
[[ $- == *i* ]] || return 0
export PATH=$(pwd)/score-client-5.8.1/bin:$PATH
# Source global definitions
# if [ -f /etc/bashrc ]; then
# . /etc/bashrc
# fi
# set -a
stty -ixon -ixoff
export PS1='\n\s:\!:\H:\n\w\n \$ '
# module load gcc/8.2.0 ## only for rstan
module load gcc/9.2.0 ## only for rstan
module load jags/4.3.0
module unload samtools
module load samtools/1.3.1
module load bcftools
module load vcftools
module load mpi
module load openmpi/2.0.2
module load bedops
module load tabix
module load java/1.8
# module load vim
if [ $( grep 'CentOS Linux release 7' /etc/redhat-release | wc -l ) -eq "1" ]
then
module load bedtools/2.27.1 ## centos 7 version
module remove python/2.7.8 # default load, python/3.5.1
module load python/3.5.1 # default load, python/3.5.1
module unload R
# module load R/3.6.1
module load R/4.0.2
else
module unload R
fi
alias jupyter_run="xvfb-run jupyter notebook --notebook-dir=~/notebooks"
alias mskilab="ssh mskilab"
alias picard="java -jar ~/modules/BWAMem/picard.jar"
alias lsh="ls -lh"
alias lss="ls -lSrh"
alias lst="ls -lhrt"
alias lsd="ls -ld */"
alias duh="du -h --max-depth 1"
alias wcmc="ssh -Y [email protected]"
alias penn="ssh pennstation"
alias harlem="ssh harlem"
alias sr="screen -r -d"
alias sd="screen -d -r"
alias rf="readlink -f"
alias TIME="~/Software/time/time -v"
alias igv='java -Xmx4g -jar ~/software/IGV_2.3.25/igv.jar'
alias vncspawn="vncserver -geometry 2560x1440"
alias vnckill="vncserver -kill"
alias ec="emacsclient -nw"
# alias ecs="emacsclient -nw -s"
alias ew="emacs -nw"
# alias ewd="emacs -nw --daemon=\"daemon\""
alias getip="ifconfig | grep \"inet \" | grep -Fv 127.0.0.1 | awk '{print \$2}'"
alias p3="source ~/scripts/module_load_python3"
alias p2="source ~/scripts/module_load_python2"
########## functions
get_ext() {
filename=$(basename -- "${1}")
extension="${filename##*.}"
# filename="${filename%.*}"
# echo 'vcf_ext=${extension}'
echo ${extension}
}
get_fn_noext() {
# filename=$(basename -- "${1}")
filename="${1}"
filename="${filename%.*}"
echo ${filename}
}
# get_fn_noext() {
# filename=$(basename -- "${1}")
# # extension="${filename##*.}"
# filename="${filename%.*}"
# # echo 'vcf_ext=${extension}'
# echo ${filename}
# }
get_fn() {
fn=`readlink -f $1`
filename=$(basename -- "$1")
echo "`dirname "${fn}"`/${filename}"
}
tolower() {
echo $1 | tr '[:upper:]' '[:lower:]'
}
get_time() {
date +%Y%m%d_%H%M%S
}
lsa() {
ls -alh $@
}
gcom() {
git commit -a -m "$@"
}
gitcommit() {
git commit -a -m "$@"
}
parse() {
echo "$@" | xargs | xargs
}
gitremote() {
git remote -v
}
gitseturl() {
# git remote set-url $1 $2
git remote set-url $@
}
gitsetremote() {
git remote set-url $@
}
lsat() {
ls -alhrt $@
}
gitsetupstream() {
git push --set-upstream $@
}
getallgitbranches() {
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
}
gitgetbranches() {
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
}
gitfastforward() {
if [ $# -eq 0 ]; then
BRANCH="master"
else
BRANCH="$1"
fi
git merge --ff-only origin/${BRANCH}
}
trimspaces() {
echo $1 | sed 's/[[:space:]]\{2,\}\|[ ]\+/ /g'
}
trimspaces2() {
echo $1 | sed 's/\\[[:space:]]\+/ /g' | sed "s/[[:space:]]\{2,\}\|[$(printf '\t')]\+/ /g"
}
## git remote set-url origin https://hostname/USERNAME/REPOSITORY.git
# echo $(printf '%(%Y%m%d%H%M%S)T\n' -1)
chmodv() {
per=$1; shift
chmod -v ${per} $@
}
scp_hop() {
local_path=$1
jump_host=$2
host=$3
destination_path=$4
# scp -o ProxyCommand="ssh $1
set -x
scp -o ProxyCommand="ssh $jump_host nc $host 22" $local_path $host:$destination_path
set +x
}
export -f parse
export -f get_ext
export -f get_fn
export -f lsa
export -f gcom
export -f get_time
export -f tolower
export -f gitseturl
export -f gitremote
export -f gitsetremote
export -f gitcommit
export -f lsat
export -f get_fn_noext
export -f getallgitbranches
export -f gitgetbranches
export -f gitsetupstream
export -f gitfastforward
export -f trimspaces
export -f trimspaces2
export -f scp_hop
export -f chmodv
# # >>> conda initialize >>>
# # !! Contents within this block are managed by 'conda init' !!
# __conda_setup="$('/gpfs/commons/groups/imielinski_lab/Software/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
# if [ $? -eq 0 ]; then
# eval "$__conda_setup"
# else
# if [ -f "/gpfs/commons/groups/imielinski_lab/Software/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/gpfs/commons/groups/imielinski_lab/Software/anaconda3/etc/profile.d/conda.sh"
# else
# export PATH="/gpfs/commons/groups/imielinski_lab/Software/anaconda3/bin:$PATH"
# fi
# fi
# unset __conda_setup
# # <<< conda initialize <<<[w