Skip to content

Commit 5380305

Browse files
author
Peter Kerpedjiev
committed
Add a pseudonode to the external links
1 parent dbed383 commit 5380305

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

forna.py

+7
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,13 @@ def create_loop_node(ds, res_list, node_id):
223223
create_loop_node(loop_elems, residue_list, num_nodes + counter)
224224
counter += 1
225225

226+
# create a common node for the external loop
227+
eloops = bg.find_external_loops()
228+
if len(eloops) > 0:
229+
all_residues = it.chain(*[bg.define_residue_num_iterator(e, adjacent=True) for e in eloops])
230+
fud.pv('all_residues')
231+
create_loop_node(eloops, sorted(all_residues), len(struct["nodes"]))
232+
226233
# link the nodes that are in stems
227234
for i in range(0, bg.seq_length - 2):
228235
if i + 1 in pseudoknotted or i + 2 in pseudoknotted or i + 3 in pseudoknotted:

htdocs/js/force.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,16 @@ function Graph() {
160160
.charge(function(d) { if (d.node_type == 'pseudo')
161161
return -200;
162162
else
163-
return -40;})
163+
return -80;})
164164
.linkDistance(function(d) { return 15 * d.value; })
165165
.linkStrength(function(d) { if (d.link_type == 'pseudoknot')
166-
{ return 0.001; }
166+
{ return 0.0; }
167167
else
168168
{ return 8; } })
169169
.gravity(0.002)
170170
.nodes(graph.nodes)
171171
.links(graph.links)
172-
.chargeDistance(100)
172+
.chargeDistance(110)
173173
.friction(0.950)
174174
.size([w, h]);
175175

0 commit comments

Comments
 (0)