bindview 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. bindview/__init__.py +88 -0
  2. bindview/__main__.py +6 -0
  3. bindview/align.py +493 -0
  4. bindview/arrange.js +347 -0
  5. bindview/arrange.py +248 -0
  6. bindview/backends.py +290 -0
  7. bindview/basepairs.py +1711 -0
  8. bindview/chains.py +264 -0
  9. bindview/chem.py +57 -0
  10. bindview/clearance.py +123 -0
  11. bindview/cli.py +990 -0
  12. bindview/compare.py +1854 -0
  13. bindview/confidence.py +531 -0
  14. bindview/consensus.py +303 -0
  15. bindview/covalent.py +220 -0
  16. bindview/depict.py +790 -0
  17. bindview/detect.py +378 -0
  18. bindview/diagram.py +1891 -0
  19. bindview/distance_table.py +589 -0
  20. bindview/ensemble.py +787 -0
  21. bindview/errors.py +47 -0
  22. bindview/exposure.py +207 -0
  23. bindview/features.py +179 -0
  24. bindview/fingerprint.py +469 -0
  25. bindview/fragments.py +304 -0
  26. bindview/geometry.py +482 -0
  27. bindview/graph.py +611 -0
  28. bindview/graphbuild.py +431 -0
  29. bindview/interactions.py +418 -0
  30. bindview/interactive.py +334 -0
  31. bindview/interface.py +1329 -0
  32. bindview/ions.py +155 -0
  33. bindview/layout/__init__.py +15 -0
  34. bindview/layout/body.py +421 -0
  35. bindview/layout/engine.py +1084 -0
  36. bindview/layout/field.py +261 -0
  37. bindview/ligand.py +583 -0
  38. bindview/near.py +67 -0
  39. bindview/options.py +92 -0
  40. bindview/pae.py +991 -0
  41. bindview/peptide.py +610 -0
  42. bindview/plane.py +320 -0
  43. bindview/polymer.py +678 -0
  44. bindview/py.typed +0 -0
  45. bindview/report.py +1407 -0
  46. bindview/residues.py +296 -0
  47. bindview/resolve.py +493 -0
  48. bindview/scene.py +239 -0
  49. bindview/solvent.py +254 -0
  50. bindview/structure.py +1145 -0
  51. bindview/styles/__init__.py +2 -0
  52. bindview/styles/absence.py +180 -0
  53. bindview/styles/base.py +2128 -0
  54. bindview/styles/closeup.py +146 -0
  55. bindview/styles/detailed.py +690 -0
  56. bindview/styles/ligand_draw.py +289 -0
  57. bindview/styles/mixed.py +70 -0
  58. bindview/styles/polymer_draw.py +354 -0
  59. bindview/styles/rings.py +75 -0
  60. bindview/styles/schematic.py +311 -0
  61. bindview/styles/summary.py +147 -0
  62. bindview/svg.py +310 -0
  63. bindview/textmetrics.py +64 -0
  64. bindview/theme.py +317 -0
  65. bindview-0.1.0.dist-info/METADATA +270 -0
  66. bindview-0.1.0.dist-info/RECORD +70 -0
  67. bindview-0.1.0.dist-info/WHEEL +4 -0
  68. bindview-0.1.0.dist-info/entry_points.txt +2 -0
  69. bindview-0.1.0.dist-info/licenses/LICENSE +21 -0
  70. bindview-0.1.0.dist-info/licenses/NOTICE +48 -0
bindview/options.py ADDED
@@ -0,0 +1,92 @@
1
+ """Every keyword of ``render``, by what it is for: ``bindview.options()``.
2
+
3
+ One line for each, with its default. ``options("colour")`` gives those that have a word in their name or their line. The same
4
+ table is the help of :class:`~bindview.styles.base.RenderOptions` and the list of ``docs/api.md``; the comments on the fields of
5
+ that class say more of each.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import dataclasses
11
+
12
+ from .styles.base import RenderOptions
13
+
14
+ __all__ = ["options", "GROUPS"]
15
+
16
+ #: ``(what they are for, ((keyword, what it does), ...))``: every field of ``RenderOptions`` once.
17
+ GROUPS: tuple[tuple[str, tuple[tuple[str, str], ...]], ...] = (
18
+ ("How the residues and contacts are drawn", (
19
+ ("residues", '"atoms", "bubbles" or "names", or residue by residue: {"Gln712": "atoms", "*": "bubbles"}; None: the style\'s'),
20
+ ("lines", 'the colours and dashes of the contact lines: "detailed" or "schematic"; None: the style\'s'),
21
+ ("lining", 'the wall of the pocket: "contacts", "nearest" or "none"; None: the style\'s'),
22
+ ("exposure", "grey halos on the ligand's atoms that are open to solvent; None: the style's"),
23
+ ("charge_halos", "shade the charged group that a salt bridge or a pi-cation contact is made with"),
24
+ ("charge_key", "name that shading in the key"),
25
+ ("break_lines", "break a line where it runs over a word that is not its own"),
26
+ ("atom_labels", 'what is written on an atom of a residue: "elements" (N, O), or "names", as in the file (NZ, OE1)'),
27
+ ("distance_labels", 'the lengths written on lines: "auto" (hydrogen and halogen bonds, metals), "all" or "none"'),
28
+ ("show_chain", 'name residues with their chain: "auto" (where there are several), "always" or "never"'),
29
+ ("interactive", "the figure answers the pointer in a browser, and data-active on its root (a style sheet, no script)"),
30
+ ("stylesheet", 'in a page with several figures: "inline", "scoped" (colours for this one alone) or "external" (result.css)'),
31
+ )),
32
+ ("Compared with another protein", (
33
+ ("absent", "the residues the other one does not have (numbers or names); those in contact are marked and counted"),
34
+ ("absent_label", "its name, for the key and the sentence under it"),
35
+ ("absent_style", '"marked" (a stroke of a marker pen) or "faint"'),
36
+ )),
37
+ ("Colours and words", (
38
+ ("colors", 'the colour scheme: "standard", or "contrast"; the theme picks its light or dark palette'),
39
+ ("background", "False: no background, transparent"),
40
+ ("title", "a title above the figure"),
41
+ ("subtitle", "a line under the title"),
42
+ ("legend", "the key"),
43
+ ("caption", "the sentences under the key"),
44
+ ("notes", "of those, the ones on the ligand's own quirks"),
45
+ ("bare", "the drawing and its key and no words; they are in result.notes"),
46
+ )),
47
+ ("The confidence of a predicted model", (
48
+ ("confidence", "draw the model's confidence, where the diagram has it"),
49
+ ("plddt_colors", 'pLDDT in AlphaFold\'s colours and not by weight: True (behind the atoms) or "bonds"'),
50
+ ("plddt_by_atom", "each atom drawn of a residue at its own pLDDT, where the model gives one for each"),
51
+ ("pae_colors", "the predicted aligned error of a contact as a glow behind its line; None: for a ligand, not for an interface"),
52
+ )),
53
+ ("The pocket and an ensemble", (
54
+ ("burial", "the ligand's buried fraction under the title"),
55
+ ("solvent_sites", "predict waters that could bridge ligand and protein, and draw them, marked as predicted"),
56
+ ("solvent_mark", 'how a predicted water stands on its line: "glow", "filled" or "outline"'),
57
+ ("occupancy_style", 'the share of an ensemble: "steps" (three weights, with the number) or "continuous" (weight alone)'),
58
+ ("occupancy_labels", 'where the number stands: "all" (every contact) or "partial" (lines that fewer than all models make)'),
59
+ )),
60
+ ("Size and legibility", (
61
+ ("figure_width_mm", "the width of the page the figure is for"),
62
+ ("figure_height_mm", "its height"),
63
+ ("min_font_pt", "the smallest text that counts as legible on it"),
64
+ ("on_unreadable", 'a figure that is not legible: "summary" (a table), "render" (drawn all the same) or "none"'),
65
+ ("effort", 'for a peptide drawn as a chain: "full", or "quick" (one that is far too crowded is given up early)'),
66
+ ("bond_length", "the scale, in page units for a bond; None: the largest that fits the page"),
67
+ ("coords", 'how the ligand is laid out in two dimensions: "auto" (CoordGen unless its atoms clash), "coordgen" or "rdkit"'),
68
+ )),
69
+ )
70
+
71
+
72
+ class _Text(str):
73
+ """Text that shows itself as it is when it is asked for at the prompt."""
74
+
75
+ def __repr__(self) -> str:
76
+ return str(self)
77
+
78
+
79
+ def options(word: str = "") -> str:
80
+ """The keywords of ``render``, one line each, by what they are for; with ``word`` those that mention it."""
81
+ defaults = {f.name: f.default for f in dataclasses.fields(RenderOptions)}
82
+ wanted = word.strip().lower()
83
+ out = []
84
+ for title, rows in GROUPS:
85
+ hits = [(name, line) for name, line in rows if wanted in name.lower() or wanted in line.lower()]
86
+ if hits:
87
+ out.append(f"{title}\n" + "\n".join(f" {name + '=' + repr(defaults[name]):<28}{line}" for name, line in hits))
88
+ return _Text("\n\n".join(out) if out else f"no keyword of render mentions {word!r}")
89
+
90
+
91
+ RenderOptions.__doc__ = ("Every keyword of ``render`` beside ``style``, ``theme``, ``metrics`` and ``graph``.\n\n"
92
+ + "\n".join(" " + line if line else "" for line in options().split("\n")) + "\n")