mdciao.flare.circle_plot_residues

mdciao.flare.circle_plot_residues(fragments, fontsize=None, colors=True, markersize=None, r=1, panelsize=4, angle_offset=0, padding=[1, 1, 1], center=[0, 0], ss_array=None, fragment_names=None, iax=None, textlabels=True, shortenAAs=True, highlight_residxs=None, aa_offset=0, top=None, aura=None)

Circular background that serves as background for flare-plots. Is independent of the curves that will later be plotted onto it.

Parameters
  • fragments (list) – List of iterables of residue idxs defining how the residues are split into fragments. If no textlabels are provided, the idxs themselves become the labels

  • fontsize (float, default is None) – Currently, the fontsize is internally computed as a function of the dotsize, since the space available for the labels is determined by the dotsize. There’s plans for user control in the future, but until then NotImplementedError will be thrown

  • colors (can be of different types) –

    • False or None

      All returned colors will be the default color

    • True

      All returned colors will differ by fragment

    • string (anything matplotlib can understand as color)

      Use this color for all residues

    • iterable (array or list, not dict)

      len(colors) has to be either len(fragments) or sum([len(frag) for frag in fragments) In the first case, it’s expanded to assign each residue in fragment the same color In the second case, since each residue in the fragments (apparently) has already a color, nothing happens

    • iterable (dict)

      Has to be of len(residxs_as_fragments)

  • markersize (float, default is None) – The size of the dots. It is internally optimized to have adjacent dots fill the available space without overlapping among them. There’s plans for user control in the future, but until then NotImplementedError will be thrown

  • r (scalar) – The radius of the circle, in axis inuts

  • panelsize (float, default is 4) – The panelsize, in inches. Only has effect if iax is None and a new figure is created

  • angle_offset (scalar) – Where the circle starts, in degrees. 0 means 3 o’clock, 90 12 o’clock etc. It’s the phi of polar coordinates

  • padding (list, default is [1,1,1]) –

    • first integer : Put this many empty positions before the first dot

    • second integer: Put this many empty positions between fragments

    • third integer : Put this many empty positions after the last dot

  • center (pair of floats) – where the circle is centered, in axis units

  • ss_array (dict, list or array) – One-letter codes (H,B,E,C) denoting secondary structure. Has to be indexable by whatever indices are on fragments

  • fragment_names (list) – The names of the fragments

  • iax (Axes, default is None) – An axis to draw the dots on. It’s parent figure has to have a tight_layout=True attribute. If no axis is passed, one will be created.

  • textlabels (bool or array_like, default is True) –

    How to label the residue dots
    • True: the dots representing the residues will get a label automatically, either their serial index or the residue name, e.g. GLU30, if a top was passed.

    • False: no labeling

    • array_like : will be passed as replacement_labels to mdciao.flare.add_fragmented_residue_labels. These labels act as replacement and can cover all or just some residue, e.g. a mutated residue that you want to show as R38A instead of just A38, or use e.g. GPCR or CGN consensus labels.

  • shortenAAs (boolean, default is True) – If top is not None, use “E50” rather than “GLU50”

  • highlight_residxs (iterable of ints, default is None) – In case you don’t want to construct a whole color list for colors, you can simply input a subset of res_idxs here and they will be shown in red.

  • aa_offset (int, default is 0) – Add this number to the resSeq value

  • top (mdtraj.Topology, default is None) – If provided, residue labels wil be auto-generated from here

  • aura (iterable, default is None) – Scalar array, indexed with residue indices, e.g. RMSF, SASA, conv. degree… It will be drawn as an aura around the flareplot.

Returns

  • iax, xy, outdict

  • outdict (dict) – Contains matplotlib objects like the dots and their labels: “fragment_labels”, “dot_labels”, “dots”, “SS_labels”, “r”,