Mercurial > repos > rnateam > graphclust_cmfinder
comparison cmFinder.py @ 0:78772eedd780 draft
planemo upload for repository https://github.com/eteriSokhoyan/galaxytools/tree/branchForIterations/tools/GraphClust/CMFinder commit 21aaee40723b5341b4236edeb0e72995c2054053
author | rnateam |
---|---|
date | Fri, 16 Dec 2016 07:34:34 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:78772eedd780 |
---|---|
1 import os | |
2 import sys | |
3 from shutil import copyfile | |
4 from os import system | |
5 | |
6 | |
7 def sh(script): | |
8 system("bash -c '%s'" % script) | |
9 | |
10 | |
11 model_tree_stk = sys.argv[1] | |
12 cmfinder_fa = sys.argv[2] | |
13 path = sys.argv[3] | |
14 | |
15 gapCmd = "" | |
16 gapVal = "" | |
17 if len(sys.argv) > 4: | |
18 gapCmd = sys.argv[4] | |
19 gapVal = sys.argv[5] | |
20 | |
21 | |
22 cmd = " cp -f %s model.cmfinder.stk" % (model_tree_stk) | |
23 sh(cmd) | |
24 | |
25 alifoldCmd = "%salifold.pl -file %s" % (path, model_tree_stk) | |
26 # alifoldCmd = "perl " + path + "/alifold.pl -file " + model_tree_stk | |
27 sh(alifoldCmd) | |
28 | |
29 cmd_stk = "%smloc2stockholm.pl -file model.cmfinder.stk -split_input yes --con_struct %s.alifold" % (path, model_tree_stk) | |
30 # cmd_stk = "perl " + path + "/mloc2stockholm.pl -file model.cmfinder.stk -split_input yes --con_struct " + model_tree_stk + ".alifold" | |
31 sh(cmd_stk) | |
32 | |
33 model_tree_stk_sth = "model.cmfinder.stk.sth" | |
34 x = "cat " + model_tree_stk_sth | |
35 sh("mv model.cmfinder.stk.sth model.tree.stk") | |
36 | |
37 sh("cmfinder %s %s -a model.tree.stk %s output > model.cmfinder.stk" % (gapCmd, gapVal, cmfinder_fa)) | |
38 # sh("cmfinder " + gapCmd + " " + gapVal + " -a model.tree.stk" + " " + cmfinder_fa + " " + " output > model.cmfinder.stk") | |
39 | |
40 if os.path.isfile('output'): | |
41 sh("rm output") | |
42 else: | |
43 copyfile("model.tree.stk", "model.cmfinder.stk") |