|
@@ 911-925 (lines=15) @@
|
| 908 |
|
|
| 909 |
|
cmd.extend('edges', edges) |
| 910 |
|
|
| 911 |
|
def fr(selection): |
| 912 |
|
"""Save selection into a file in a temp folder and run rna_draw_edges.py on it and load it into this session""" |
| 913 |
|
my_view = cmd.get_view() |
| 914 |
|
f = tempfile.TemporaryDirectory() |
| 915 |
|
tmpf = f.name + os.sep + strip_selection_name(selection) + '.pdb' |
| 916 |
|
outf = f.name + '/output.py' |
| 917 |
|
cmd.save(tmpf, selection) |
| 918 |
|
path = "/Users/magnus/work/src/rna-tools/rna_tools/tools/PyMOL4RNA/" |
| 919 |
|
cmdline = path + 'rna_draw_frames.py --name %s %s > %s' % (strip_selection_name(selection), tmpf, outf) |
| 920 |
|
print(cmdline) |
| 921 |
|
out, err = exe(cmdline) |
| 922 |
|
if err: |
| 923 |
|
print(err) |
| 924 |
|
cmd.load(outf) |
| 925 |
|
cmd.set_view(my_view) |
| 926 |
|
|
| 927 |
|
cmd.extend('fr', fr) |
| 928 |
|
|
|
@@ 894-907 (lines=14) @@
|
| 891 |
|
return selection_name.replace('(', '').replace(')', '') |
| 892 |
|
|
| 893 |
|
|
| 894 |
|
def edges(selection): |
| 895 |
|
"""Save selection into a file in a temp folder and run rna_draw_edges.py on it and load it into this session""" |
| 896 |
|
my_view = cmd.get_view() |
| 897 |
|
f = tempfile.TemporaryDirectory() |
| 898 |
|
tmpf = f.name + os.sep + strip_selection_name(selection) + '.pdb' |
| 899 |
|
outf = f.name + '/output.py' |
| 900 |
|
cmd.save(tmpf, selection) |
| 901 |
|
cmdline = '/Users/magnus/miniconda3/bin/rna_draw_edges.py --name %s %s > %s' % (strip_selection_name(selection), tmpf, outf) |
| 902 |
|
print(cmdline) |
| 903 |
|
out, err = exe(cmdline) |
| 904 |
|
if err: |
| 905 |
|
print(err) |
| 906 |
|
cmd.load(outf) |
| 907 |
|
cmd.set_view(my_view) |
| 908 |
|
|
| 909 |
|
cmd.extend('edges', edges) |
| 910 |
|
|