1 """@namespace IMP.pmi.io.xltable
2 Tools to plot a contact map overlaid with cross-links.
5 from __future__
import print_function
7 from scipy.spatial.distance
import cdist
9 import matplotlib
as mpl
11 import matplotlib.cm
as cm
12 import matplotlib.pyplot
as plt
14 from collections
import defaultdict
30 """ class to read, analyze, and plot xlink data on contact maps
31 Canonical way to read the data:
32 1) load sequences and name them
33 2) load coordinates for those sequences from PDB file
39 def __init__(self,contact_threshold):
41 self.cross_link_db =
None
42 self.residue_pair_list = []
43 self.distance_maps = []
44 self.contact_freqs =
None
47 self.index_dict = defaultdict(list)
48 self.contact_threshold = contact_threshold
55 def _colormap_distance(self, dist, threshold=35, tolerance=0):
56 if dist < threshold - tolerance:
58 elif dist >= threshold + tolerance:
63 def _colormap_satisfaction(self, sat, threshold=0.5, tolerance=0.1):
64 if sat >= threshold + tolerance:
67 elif sat < threshold + tolerance
and sat >= threshold - tolerance :
74 def _get_percentage_satisfaction(self,r1,c1,r2,c2,threshold=35):
76 idx1=self.index_dict[c1][r1]
80 idx2=self.index_dict[c2][r2]
84 for dists
in self.dist_maps:
86 if dist<threshold: nsatisfied+=1
87 return float(nsatisfied)/len(self.dist_maps)
89 def _get_distance(self,r1,c1,r2,c2):
90 if self.index_dict
is not None:
92 idx1=self.index_dict[c1][r1]
96 idx2=self.index_dict[c2][r2]
99 return self.av_dist_map[idx1,idx2]
101 if (r1,c1,r2,c2)
not in self.stored_dists.keys():
103 selpart=sel.get_selected_particles()
104 selpart_res_one=list(set(self.particles_resolution_one) & set(selpart))
105 if len(selpart_res_one)>1:
return None
106 if len(selpart_res_one)==0:
return None
107 selpart_res_one_1=selpart_res_one[0]
109 selpart=sel.get_selected_particles()
110 selpart_res_one=list(set(self.particles_resolution_one) & set(selpart))
111 if len(selpart_res_one)>1:
return None
112 if len(selpart_res_one)==0:
return None
113 selpart_res_one_2=selpart_res_one[0]
117 self.stored_dists[(r1,c1,r2,c2)]=dist
119 dist=self.stored_dists[(r1,c1,r2,c2)]
125 def _internal_load_maps(self,maps_fn):
126 npzfile = np.load(maps_fn)
127 cname_array=npzfile[
'cname_array']
128 idx_array=npzfile[
'idx_array']
130 for cname,idxs
in zip(cname_array,idx_array):
133 index_dict[cname]=tmp[0:tmp.index(-1)]
135 index_dict[cname]=tmp
136 av_dist_map = npzfile[
'av_dist_map']
137 contact_map = npzfile[
'contact_map']
138 return index_dict,av_dist_map,contact_map
141 """ read sequence. structures are displayed in the same order as sequences are read.
142 fasta_file: file to read
143 id_in_fasta_file: id of desired sequence
144 protein_name: identifier for this sequence (use same name when handling coordinates)
145 can provide the fasta name (for retrieval) and the protein name (for storage) """
148 if id_in_fasta_file
is None:
149 id_in_fasta_file = name
150 if id_in_fasta_file
not in record_dict:
151 raise KeyError(
"id %s not found in fasta file" % id_in_fasta_file)
152 length = len(record_dict[id_in_fasta_file])
154 self.sequence_dict[protein_name] = str(record_dict[id_in_fasta_file])
157 """ read coordinates from a pdb file. also appends to distance maps
158 @param pdbfile file for reading coords
159 @param chain_to_name_map correspond chain ID with protein name (will ONLY read these chains)
160 Key: PDB chain ID. Value: Protein name (set in sequence reading)
161 \note This function returns an error if the sequence for each chain has NOT been read
164 total_len = sum(len(self.sequence_dict[s])
for s
in self.sequence_dict)
165 coords = np.ones((total_len,3)) * 1e5
167 for cid
in chain_to_name_map:
168 cname = chain_to_name_map[cid]
169 if cname
not in self.sequence_dict:
170 print(
"ERROR: chain",cname,
'has not been read or has a naming mismatch')
173 self.index_dict[cname]=range(prev_stop,prev_stop+len(self.sequence_dict[cname]))
175 for p
in sel.get_selected_particles():
177 coords[rnum+prev_stop-1,:] = list(
IMP.core.XYZ(p).get_coordinates())
178 prev_stop+=len(self.sequence_dict[cname])
179 dists = cdist(coords, coords)
180 binary_dists = np.where((dists <= self.contact_threshold) & (dists >= 1.0), 1.0, 0.0)
182 self.dist_maps= [dists]
183 self.av_dist_map = dists
184 self.contact_freqs = binary_dists
187 self.dist_maps.append(dists)
188 self.av_dist_map += dists
189 self.contact_freqs += binary_dists
195 """ read coordinates from a rmf file. It needs IMP to run.
196 rmf has been created using IMP.pmi conventions. It gets the
197 highest resolution automatically. Also appends to distance maps
198 @param rmf_name file for reading coords
199 @param rmf_frame_index frame index from the rmf
200 @param nomap Default False, if True it will not calculate the contact map
202 (particles_resolution_one, prots)=self._get_rmf_structure(rmf_name,rmf_frame_index)
204 total_len = sum(len(self.sequence_dict[s])
for s
in self.sequence_dict)
205 print(self.sequence_dict,total_len)
207 coords = np.ones((total_len,3)) * 1e6
209 sorted_particles=IMP.pmi.tools.sort_by_residues(particles_resolution_one)
212 self.particles_resolution_one=particles_resolution_one
217 for cname
in chain_names:
220 self.index_dict[cname]=range(prev_stop,prev_stop+len(self.sequence_dict[cname]))
221 rindexes=range(1,len(self.sequence_dict[cname])+1)
222 for rnum
in rindexes:
224 selpart=sel.get_selected_particles()
225 selpart_res_one=list(set(particles_resolution_one) & set(selpart))
226 if len(selpart_res_one)>1:
continue
227 if len(selpart_res_one)==0:
continue
228 selpart_res_one=selpart_res_one[0]
230 coords[rnum+prev_stop-1,:]=
IMP.core.XYZ(selpart_res_one).get_coordinates()
232 print(
"Error: exceed max size",prev_stop,total_len,cname,rnum)
234 prev_stop+=len(self.sequence_dict[cname])
235 dists = cdist(coords, coords)
236 binary_dists = np.where((dists <= self.contact_threshold) & (dists >= 1.0), 1.0, 0.0)
238 self.dist_maps= [dists]
239 self.av_dist_map = dists
240 self.contact_freqs = binary_dists
243 self.dist_maps.append(dists)
244 self.av_dist_map += dists
245 self.contact_freqs += binary_dists
249 def _get_rmf_structure(self,rmf_name,rmf_frame_index):
250 rh= RMF.open_rmf_file_read_only(rmf_name)
253 print(
"getting coordinates for frame %i rmf file %s" % (rmf_frame_index, rmf_name))
258 protein_names=particle_dict.keys()
259 particles_resolution_one=[]
260 for k
in particle_dict:
261 particles_resolution_one+=(particle_dict[k])
263 return particles_resolution_one, prots
266 def save_maps(self,maps_fn):
267 maxlen=max(len(self.index_dict[key])
for key
in self.index_dict)
270 for cname,idx
in self.index_dict.iteritems():
272 idxs.append(idx+[-1]*(maxlen-len(idx)))
273 idx_array=np.array(idxs)
274 cname_array=np.array(cnames)
276 cname_array=cname_array,
278 av_dist_map=self.av_dist_map,
279 contact_map=self.contact_freqs)
281 def load_maps(self,maps_fn):
282 self.index_dict,self.av_dist_map,self.contact_freqs=self._internal_load_maps(maps_fn)
285 """ read crosslinks from a CSV file.
286 provide a CrossLinkDataBaseKeywordsConverter to explain the columns
287 @distance_field is the optional keyword for the distance to be read form the file.
288 This can skip the rmf reading to calculate the distance of cross-links if
289 already provided in the csv file."""
290 if type(CrossLinkDataBase)
is not IMP.pmi.io.crosslink.CrossLinkDataBase:
291 raise TypeError(
"Crosslink database must be a IMP.pmi.io.CrossLinkDataBase type")
292 self.cross_link_db=CrossLinkDataBase
293 if distance_field
is not None:
294 total_len = sum(len(self.sequence_dict[s])
for s
in self.sequence_dict)
295 zeros = np.zeros((total_len,3))
296 self.av_dist_map = cdist(zeros,zeros)
297 for xl
in self.cross_link_db:
298 c1=xl[self.cross_link_db.protein1_key]
299 c2=xl[self.cross_link_db.protein2_key]
300 r1=xl[self.cross_link_db.residue1_key]
301 r2=xl[self.cross_link_db.residue2_key]
303 self.stored_dists[(r1,c1,r2,c2)]=float(xl[distance_field])
304 self.stored_dists[(r2,c2,r1,c1)]=float(xl[distance_field])
306 self.stored_dists[(r1,c1,r2,c2)]=10e6
307 self.stored_dists[(r2,c2,r1,c1)]=10e6
309 for xl
in self.cross_link_db:
310 c1=xl[self.cross_link_db.protein1_key]
311 c2=xl[self.cross_link_db.protein2_key]
312 r1=xl[self.cross_link_db.residue1_key]
313 r2=xl[self.cross_link_db.residue2_key]
314 self.stored_dists[(r1,c1,r2,c2)]=self._get_distance(r1,c1,r2,c2)
315 self.stored_dists[(r2,c2,r1,c1)]=self._get_distance(r2,c2,r1,c1)
318 """ select the atom names of residue pairs to plot on the contact map
319 list of residues types must be single letter code
320 e.g. residue_type_pair=("K","K")
322 rtp=sorted(residue_type_pair)
323 for prot1
in self.sequence_dict:
324 seq1=self.sequence_dict[prot1]
325 for nres1,res1
in enumerate(seq1):
326 for prot2
in self.sequence_dict:
327 seq2=self.sequence_dict[prot2]
328 for nres2,res2
in enumerate(seq2):
329 if sorted((res1,res2))==rtp:
330 self.residue_pair_list.append((nres1+1,prot1,nres2+1,prot2))
333 """ loop through each distance map and get frequency of contacts
335 if self.num_pdbs!=0
and self.num_rmfs==0:
336 self.av_dist_map = 1.0/self.num_pdbs * self.av_dist_map
337 self.contact_freqs = 1.0/self.num_pdbs * self.contact_freqs
338 if self.num_pdbs==0
and self.num_rmfs!=0:
339 self.av_dist_map = 1.0/self.num_rmfs * self.av_dist_map
340 self.contact_freqs = 1.0/self.num_rmfs * self.contact_freqs
342 def setup_difference_map(self,maps_fn1,maps_fn2,thresh):
343 idx1,av1,contact1=self._internal_load_maps(maps_fn1)
344 idx2,av2,contact2=self._internal_load_maps(maps_fn2)
346 print(
"UH OH: index dictionaries do not match!")
354 elif c1>thresh
and c2<thresh:
356 elif c1<thresh
and c2>thresh:
360 f = np.vectorize(logic,otypes=[np.int])
361 print(
'computing contact map')
362 self.contact_freqs = f(contact1,contact2)
367 def spring_layout(self,ax,plt,data, annotations, iterations = 100, k=1):
369 import networkx
as nx
377 Author: G. Bouvier, Pasteur Institute, Paris
378 Website: http://bloggb.fr/2015/10/19/spring_layout_for_annotating_plot_in_matplotlib.html
379 - data: coordinates of your points [(x1,y1), (x2,y2), ..., (xn,yn)]
380 - annotations: text for your annotation ['str_1', 'str_2', ..., 'str_n']
381 - iterations: number of iterations for spring layout
382 - k: optimal distance between nodes
386 x, y = [e[0]
for e
in data], [e[1]
for e
in data]
387 xmin, xmax = min(x), max(x)
388 ymin, ymax = min(y), max(y)
397 for i,xy
in enumerate(data):
424 ps = particles.values()+particles_fixed.values()
431 rs.add_restraint(evr)
435 #G.add_edge(xy, text)
438 delTri = scipy.spatial.Delaunay(data)
439 #plt.scatter([e[0] for e in data], [e[1] for e in data])
440 # create a set for edges that are indexes of the points
442 # for each Delaunay triangle
443 for n in xrange(delTri.nsimplex):
444 # for each edge of the triangle
446 # (sorting avoids duplicated edges being added to the set)
447 # and add to the edges set
448 edge = sorted([delTri.vertices[n,0], delTri.vertices[n,1]])
449 edges.add((edge[0], edge[1]))
450 edge = sorted([delTri.vertices[n,0], delTri.vertices[n,2]])
451 edges.add((edge[0], edge[1]))
452 edge = sorted([delTri.vertices[n,1], delTri.vertices[n,2]])
453 edges.add((edge[0], edge[1]))
457 G.add_edge(e[0],e[1])
459 d1=IMP.core.XYZ(particles[e[0]])
460 d2=IMP.core.XYZ(particles[e[1]])
461 dist=IMP.core.get_distance(d1,d2)
462 ts1 = IMP.core.Harmonic(dist+150, 0.001)
464 IMP.core.DistanceRestraint(m, ts1,
472 mc.set_scoring_function(rs)
473 mc.set_return_best(
False)
479 pos = nx.spring_layout(G ,pos=init_pos)
482 for i,xy in enumerate(data):
483 xynew = pos[i] * [xmax-xmin, ymax-ymin] + [xmin, ymin]
484 plt.plot((xy[0],xynew[0]), (xy[1],xynew[1]), 'k-')
485 x_list.append(xynew[0])
486 y_list.append(xynew[1])
487 #plt.annotate(name, xy, size=5, xycoords='data', xytext=xytext, textcoords='data', bbox=dict(boxstyle='round,pad=0.2', fc='yellow', alpha=0.3),\
488 # arrowprops=dict(arrowstyle="-", connectionstyle="arc3", color='gray'))
490 points=ax.scatter(x_list,y_list,alpha=1)
491 #pos*=[numpy.ptp([e[0] for e in data]), numpy.ptp([e[1] for e in data])]
497 mc.optimize(1000*len(particles.keys())*2)
498 print(rs.evaluate(
False))
501 for i,xy
in enumerate(data):
504 xynew = (coord[0],coord[1])
505 plt.plot((xy[0],xynew[0]), (xy[1],xynew[1]),
'k-')
506 x_list.append(xynew[0])
507 y_list.append(xynew[1])
508 points=ax.scatter(x_list,y_list,alpha=1,facecolors=
'none', edgecolors=
'k')
513 def show_mpld3(self,fig,ax,points,xl_list,xl_labels):
515 from mpld3
import plugins
522 border-collapse: collapse;
527 background-color: #ffffff;
531 background-color: #cccccc;
535 font-family:Arial, Helvetica, sans-serif;
536 border: 1px solid black;
541 df = pd.DataFrame(index=xl_labels)
543 sorted_keys=sorted(xl_list[0].keys())
545 for k
in sorted_keys:
546 df[k] = np.array([xl[k]
for xl
in xl_list])
549 for i
in range(len(xl_labels)):
550 label = df.ix[[i], :].T
552 labels.append(str(label.to_html()))
554 tooltip = plugins.PointHTMLTooltip(points, labels,
555 voffset=10, hoffset=10, css=css)
556 plugins.connect(fig, tooltip)
557 mpld3.save_html(fig,
"output.html")
560 def get_residue_contacts(self,prot_listx,prot_listy):
561 for px
in prot_listx:
562 for py
in prot_listy:
563 indexes_x = self.index_dict[px]
564 minx = min(indexes_x)
565 maxx = max(indexes_x)
566 indexes_y = self.index_dict[py]
567 miny = min(indexes_y)
568 maxy = max(indexes_y)
569 array = self.contact_freqs[minx:maxx,miny:maxy]
570 (xresidues,yresidues)=np.where(array>0)
571 for n,xr
in enumerate(xresidues):
572 print(xr,yresidues[n],px,py,array[xr,yresidues[n]])
578 confidence_info=
False,
580 display_residue_pairs=
False,
583 confidence_classes=
None,
585 scale_symbol_size=1.0,
586 gap_between_components=0,
587 dictionary_of_gaps={},
589 crosslink_threshold=
None,
594 color_crosslinks_by_distance=
True):
595 """ plot the xlink table with optional contact map.
596 prot_listx: list of protein names on the x-axis
597 prot_listy: list of protein names on the y-axis
598 no_dist_info: plot only the cross-links as grey spots
600 filter: list of tuples to filter on. each one contains:
601 keyword in the database to be filtered on
602 relationship ">","==","<"
604 example ("ID_Score",">",40)
605 display_residue_pairs: display all pairs defined in self.residue_pair_list
606 contactmap: display the contact map
607 filename: save to file (adds .pdf extension)
610 scale_symbol_size: rescale the symbol for the crosslink
611 gap_between_components: the numbeber of residues to leave blannk between each component
612 dictionary_of_gaps: add extra space after the given protein. dictionary_of_gaps={prot_name:extra_gap}
617 fig = plt.figure(figsize=(100, 100))
618 ax = fig.add_subplot(111)
622 if cbar_labels
is not None:
623 if len(cbar_labels)!=4:
624 print(
"to provide cbar labels, give 3 fields (first=first input file, last=last input) in oppose order of input contact maps")
627 if prot_listx
is None:
628 prot_listx = self.sequence_dict.keys()
630 nresx = gap_between_components + \
631 sum([len(self.sequence_dict[name])
632 + gap_between_components
for name
in prot_listx]) + \
633 sum([dictionary_of_gaps[prot]
for prot
in dictionary_of_gaps.keys()])
636 if prot_listy
is None:
637 prot_listy = self.sequence_dict.keys()
639 nresy = gap_between_components + \
640 sum([len(self.sequence_dict[name])
641 + gap_between_components
for name
in prot_listy]) + \
642 sum([dictionary_of_gaps[prot]
for prot
in dictionary_of_gaps.keys()])
647 res = gap_between_components
648 for prot
in prot_listx:
649 resoffsetx[prot] = res
650 res += len(self.sequence_dict[prot])
652 res += gap_between_components
653 if prot
in dictionary_of_gaps.keys(): res+= dictionary_of_gaps[prot]
657 res = gap_between_components
658 for prot
in prot_listy:
659 resoffsety[prot] = res
660 res += len(self.sequence_dict[prot])
662 res += gap_between_components
663 if prot
in dictionary_of_gaps.keys(): res+= dictionary_of_gaps[prot]
665 resoffsetdiagonal = {}
666 res = gap_between_components
667 for prot
in IMP.pmi.io.utilities.OrderedSet(prot_listx + prot_listy):
668 resoffsetdiagonal[prot] = res
669 res += len(self.sequence_dict[prot])
670 res += gap_between_components
671 if prot
in dictionary_of_gaps.keys(): res+= dictionary_of_gaps[prot]
676 for n, prot
in enumerate(prot_listx):
677 res = resoffsetx[prot]
679 for proty
in prot_listy:
680 resy = resoffsety[proty]
681 endy = resendy[proty]
682 ax.plot([res, res], [resy, endy], linestyle=
'-',color=
'gray', lw=0.4)
683 ax.plot([end, end], [resy, endy], linestyle=
'-',color=
'gray', lw=0.4)
684 xticks.append((float(res) + float(end)) / 2)
689 for n, prot
in enumerate(prot_listy):
690 res = resoffsety[prot]
692 for protx
in prot_listx:
693 resx = resoffsetx[protx]
694 endx = resendx[protx]
695 ax.plot([resx, endx], [res, res], linestyle=
'-',color=
'gray', lw=0.4)
696 ax.plot([resx, endx], [end, end], linestyle=
'-',color=
'gray', lw=0.4)
697 yticks.append((float(res) + float(end)) / 2)
702 tmp_array = np.zeros((nresx, nresy))
703 for px
in prot_listx:
704 for py
in prot_listy:
705 resx = resoffsetx[px]
706 lengx = resendx[px] - 1
707 resy = resoffsety[py]
708 lengy = resendy[py] - 1
709 indexes_x = self.index_dict[px]
710 minx = min(indexes_x)
711 maxx = max(indexes_x)
712 indexes_y = self.index_dict[py]
713 miny = min(indexes_y)
714 maxy = max(indexes_y)
715 tmp_array[resx:lengx,resy:lengy] = self.contact_freqs[minx:maxx,miny:maxy]
717 cax = ax.imshow(tmp_array,
722 interpolation=
'nearest')
724 ax.set_xticks(xticks)
725 ax.set_xticklabels(xlabels, rotation=90)
726 ax.set_yticks(yticks)
727 ax.set_yticklabels(ylabels)
728 plt.setp(ax.get_xticklabels(), fontsize=6)
729 plt.setp(ax.get_yticklabels(), fontsize=6)
732 already_added_xls = []
733 xl_coordinates_tuple_list = []
740 markersize = 5 * scale_symbol_size
741 if self.cross_link_db:
742 for xl
in self.cross_link_db:
744 (c1,c2,r1,r2)=IMP.pmi.io.crosslink._ProteinsResiduesArray(xl)
745 label=xl[self.cross_link_db.unique_sub_id_key]
746 if color_crosslinks_by_distance:
749 mdist=self._get_distance(r1,c1,r2,c2)
750 if mdist
is None:
continue
751 color = self._colormap_distance(mdist,threshold=crosslink_threshold)
758 ps=self._get_percentage_satisfaction(r1,c1,r2,c2)
759 if ps
is None:
continue
760 color = self._colormap_satisfaction(ps,threshold=0.2,tolerance=0.1)
765 pos1 = r1 + resoffsetx[c1]
769 pos2 = r2 + resoffsety[c2]
776 pos_for_diagonal1 = r1 + resoffsetdiagonal[c1]
777 pos_for_diagonal2 = r2 + resoffsetdiagonal[c2]
779 if confidence ==
'0.01':
780 markersize = 14 * scale_symbol_size
781 elif confidence ==
'0.05':
782 markersize = 9 * scale_symbol_size
783 elif confidence ==
'0.1':
784 markersize = 6 * scale_symbol_size
786 markersize = 15 * scale_symbol_size
788 markersize = 5 * scale_symbol_size
795 markersize=markersize)
802 markersize=markersize)
808 color_list.append(color)
809 color_list.append(color)
814 xl_labels.append(label)
815 xl_coordinates_tuple_list.append((float(pos1),float(pos2)))
816 xl_labels.append(label+
"*")
817 xl_coordinates_tuple_list.append((float(pos2),float(pos1)))
819 points=ax.scatter(x_list,y_list,s=markersize,c=color_list,alpha=alphablend)
822 if display_residue_pairs:
823 for rp
in self.residue_pair_list:
830 dist=self._get_distance(r1,c1,r2,c2)
837 pos1 = r1 + resoffsetx[c1]
841 pos2 = r2 + resoffsety[c2]
850 markersize=markersize)
853 fig.set_size_inches(0.002 * nresx, 0.002 * nresy)
854 [i.set_linewidth(2.0)
for i
in ax.spines.itervalues()]
855 if cbar_labels
is not None:
856 cbar = fig.colorbar(cax, ticks=[0.5,1.5,2.5,3.5])
857 cbar.ax.set_yticklabels(cbar_labels)
861 points=self.spring_layout(ax,plt,xl_coordinates_tuple_list, xl_labels)
865 plt.savefig(filename, dpi=300,transparent=
"False")
869 self.show_mpld3(fig,ax,points,xl_list,xl_labels)
Utility classes and functions for IO.
atom::Hierarchies create_hierarchies(RMF::FileConstHandle fh, Model *m)
Set of python classes to create a multi-state, multi-resolution IMP hierarchy.
Upper bound harmonic function (non-zero when feature > mean)
class to read, analyze, and plot xlink data on contact maps Canonical way to read the data: 1) load s...
static XYZR setup_particle(Model *m, ParticleIndex pi)
Utility classes and functions for reading and storing PMI files.
def plot_table
plot the xlink table with optional contact map.
def load_rmf_coordinates
read coordinates from a rmf file.
Handles cross-link data sets.
Return all close unordered pairs of particles taken from the SingletonContainer.
def load_pdb_coordinates
read coordinates from a pdb file.
Distance restraint between two particles.
double get_distance(XYZR a, XYZR b)
Compute the sphere distance between a and b.
void read_pdb(TextInput input, int model, Hierarchy h)
Object used to hold a set of restraints.
def setup_contact_map
loop through each distance map and get frequency of contacts
Class for storing model, its restraints, constraints, and particles.
def load_sequence_from_fasta_file
read sequence.
ParticleIndexPairs get_indexes(const ParticlePairsTemp &ps)
def set_residue_pairs_to_display
select the atom names of residue pairs to plot on the contact map list of residues types must be sing...
Ints get_index(const ParticlesTemp &particles, const Subset &subset, const Subsets &excluded)
Store a list of ParticleIndexes.
A decorator for a particle representing an atom.
def load_crosslinks
read crosslinks from a CSV file.
void load_frame(RMF::FileConstHandle file, RMF::FrameID frame)
Load the given RMF frame into the state of the linked objects.
A decorator for a particle with x,y,z coordinates.
def get_particles_at_resolution_one
Get particles at res 1, or any beads, based on the name.
Tools for clustering and cluster analysis.
Modify a set of continuous variables using a normal distribution.
def deprecated_object
Python decorator to mark a class as deprecated.
Residue get_residue(Atom d, bool nothrow=false)
Return the Residue containing this atom.
Class to handle individual particles of a Model object.
Select all CA ATOM records.
static const FloatKeys & get_xyz_keys()
Get a vector containing the keys for x,y,z.
Python classes to represent, score, sample and analyze models.
A dictionary-like wrapper for reading and storing sequence data.
Functionality for loading, creating, manipulating and scoring atomic structures.
Select hierarchy particles identified by the biological name.
Support for the RMF file format for storing hierarchical molecular data and markup.
Applies a list of movers one at a time.
Applies a PairScore to each Pair in a list.
Perform more efficient close pair finding when rigid bodies are involved.
A decorator for a particle with x,y,z coordinates and a radius.