forked from singleron-RD/CeleScope
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease_local.py
executable file
·65 lines (54 loc) · 1.71 KB
/
release_local.py
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
import subprocess
from celescope.__init__ import __version__
from celescope.tools.utils import add_log
ENV_NAME = f'celescope{__version__}'
CONDA_ROOT = '/SGRNJ/Public/Software/conda_env/'
@add_log
def create_conda():
cmd = f"""
set -e
conda create -n {ENV_NAME}
source activate {ENV_NAME}
conda install --file conda_pkgs.txt --channel conda-forge --channel bioconda --channel r --channel imperial-college-research-computing
pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ celescope
python setup.py install
ln -s /SGRNJ/Database/script/soft/gatk-4.1.8.1/gatk {CONDA_ROOT}/{ENV_NAME}/bin/gatk
"""
print(cmd)
subprocess.check_call(cmd, shell=True)
@add_log
def lint_code():
cmd = """
set -e
celescope -h
pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ pylint
# lint
# W1618 (no-absolute-import)
# E1101 (no-member)
# W1633 (round-builtin)
# W1619 (old-division)
# W0105 (String statement has no effect)
# W0511 TODO!
# E1130 bad operand type for unary ~: _isnan (invalid-unary-operand-type)
pylint --disable=all --enable=E,W --disable=W1618,E1101,W1633,W1619,W0105,W0511,E1130 celescope
"""
print(cmd)
subprocess.check_call(cmd, shell=True)
@add_log
def zip_wdl():
cmd = "cd wdl/ && zip -r wdl.zip ./*"
print(cmd)
subprocess.check_call(cmd, shell=True)
@add_log
def test_wdl():
cmd = (
"cd /SGRNJ03/randd/user/zhouyiqi/temp/wdl; "
"sh /SGRNJ/Database/script/pipe/develop/dev_CeleScope/wdl/rna/local/run.sh "
)
print(cmd)
subprocess.check_call(cmd, shell=True)
if __name__ == '__main__':
lint_code()
zip_wdl()
test_wdl()
create_conda()