refua 0.0.1__tar.gz

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 (246) hide show
  1. refua-0.0.1/LICENSE +23 -0
  2. refua-0.0.1/PKG-INFO +187 -0
  3. refua-0.0.1/README.md +94 -0
  4. refua-0.0.1/pyproject.toml +182 -0
  5. refua-0.0.1/src/refua/__init__.py +13 -0
  6. refua-0.0.1/src/refua/api.py +235 -0
  7. refua-0.0.1/src/refua/boltz/__init__.py +14 -0
  8. refua-0.0.1/src/refua/boltz/api.py +1646 -0
  9. refua-0.0.1/src/refua/boltz/data/__init__.py +0 -0
  10. refua-0.0.1/src/refua/boltz/data/const.py +1184 -0
  11. refua-0.0.1/src/refua/boltz/data/crop/__init__.py +0 -0
  12. refua-0.0.1/src/refua/boltz/data/crop/affinity.py +162 -0
  13. refua-0.0.1/src/refua/boltz/data/crop/boltz.py +294 -0
  14. refua-0.0.1/src/refua/boltz/data/crop/cropper.py +43 -0
  15. refua-0.0.1/src/refua/boltz/data/feature/__init__.py +0 -0
  16. refua-0.0.1/src/refua/boltz/data/feature/featurizer.py +1224 -0
  17. refua-0.0.1/src/refua/boltz/data/feature/featurizerv2.py +2345 -0
  18. refua-0.0.1/src/refua/boltz/data/feature/symmetry.py +600 -0
  19. refua-0.0.1/src/refua/boltz/data/filter/__init__.py +0 -0
  20. refua-0.0.1/src/refua/boltz/data/filter/dynamic/__init__.py +0 -0
  21. refua-0.0.1/src/refua/boltz/data/filter/dynamic/date.py +76 -0
  22. refua-0.0.1/src/refua/boltz/data/filter/dynamic/filter.py +24 -0
  23. refua-0.0.1/src/refua/boltz/data/filter/dynamic/max_residues.py +37 -0
  24. refua-0.0.1/src/refua/boltz/data/filter/dynamic/resolution.py +34 -0
  25. refua-0.0.1/src/refua/boltz/data/filter/dynamic/size.py +38 -0
  26. refua-0.0.1/src/refua/boltz/data/filter/dynamic/subset.py +42 -0
  27. refua-0.0.1/src/refua/boltz/data/filter/static/__init__.py +0 -0
  28. refua-0.0.1/src/refua/boltz/data/filter/static/filter.py +25 -0
  29. refua-0.0.1/src/refua/boltz/data/filter/static/ligand.py +36 -0
  30. refua-0.0.1/src/refua/boltz/data/filter/static/polymer.py +298 -0
  31. refua-0.0.1/src/refua/boltz/data/module/__init__.py +0 -0
  32. refua-0.0.1/src/refua/boltz/data/module/inference.py +308 -0
  33. refua-0.0.1/src/refua/boltz/data/module/inferencev2.py +431 -0
  34. refua-0.0.1/src/refua/boltz/data/module/training.py +685 -0
  35. refua-0.0.1/src/refua/boltz/data/module/trainingv2.py +658 -0
  36. refua-0.0.1/src/refua/boltz/data/mol.py +897 -0
  37. refua-0.0.1/src/refua/boltz/data/msa/__init__.py +0 -0
  38. refua-0.0.1/src/refua/boltz/data/msa/mmseqs2.py +285 -0
  39. refua-0.0.1/src/refua/boltz/data/pad.py +84 -0
  40. refua-0.0.1/src/refua/boltz/data/parse/__init__.py +0 -0
  41. refua-0.0.1/src/refua/boltz/data/parse/a3m.py +133 -0
  42. refua-0.0.1/src/refua/boltz/data/parse/csv.py +117 -0
  43. refua-0.0.1/src/refua/boltz/data/parse/fasta.py +137 -0
  44. refua-0.0.1/src/refua/boltz/data/parse/mmcif.py +1237 -0
  45. refua-0.0.1/src/refua/boltz/data/parse/mmcif_with_constraints.py +1605 -0
  46. refua-0.0.1/src/refua/boltz/data/parse/pdb.py +40 -0
  47. refua-0.0.1/src/refua/boltz/data/parse/schema.py +1864 -0
  48. refua-0.0.1/src/refua/boltz/data/parse/yaml.py +67 -0
  49. refua-0.0.1/src/refua/boltz/data/sample/__init__.py +0 -0
  50. refua-0.0.1/src/refua/boltz/data/sample/cluster.py +282 -0
  51. refua-0.0.1/src/refua/boltz/data/sample/distillation.py +56 -0
  52. refua-0.0.1/src/refua/boltz/data/sample/random.py +38 -0
  53. refua-0.0.1/src/refua/boltz/data/sample/sampler.py +48 -0
  54. refua-0.0.1/src/refua/boltz/data/tokenize/__init__.py +0 -0
  55. refua-0.0.1/src/refua/boltz/data/tokenize/boltz.py +216 -0
  56. refua-0.0.1/src/refua/boltz/data/tokenize/boltz2.py +424 -0
  57. refua-0.0.1/src/refua/boltz/data/tokenize/tokenizer.py +24 -0
  58. refua-0.0.1/src/refua/boltz/data/types.py +779 -0
  59. refua-0.0.1/src/refua/boltz/data/write/__init__.py +0 -0
  60. refua-0.0.1/src/refua/boltz/data/write/mmcif.py +304 -0
  61. refua-0.0.1/src/refua/boltz/data/write/pdb.py +170 -0
  62. refua-0.0.1/src/refua/boltz/data/write/utils.py +23 -0
  63. refua-0.0.1/src/refua/boltz/data/write/writer.py +328 -0
  64. refua-0.0.1/src/refua/boltz/main.py +1414 -0
  65. refua-0.0.1/src/refua/boltz/model/__init__.py +0 -0
  66. refua-0.0.1/src/refua/boltz/model/layers/__init__.py +0 -0
  67. refua-0.0.1/src/refua/boltz/model/layers/attention.py +131 -0
  68. refua-0.0.1/src/refua/boltz/model/layers/attentionv2.py +109 -0
  69. refua-0.0.1/src/refua/boltz/model/layers/confidence_utils.py +230 -0
  70. refua-0.0.1/src/refua/boltz/model/layers/dropout.py +34 -0
  71. refua-0.0.1/src/refua/boltz/model/layers/initialize.py +100 -0
  72. refua-0.0.1/src/refua/boltz/model/layers/outer_product_mean.py +96 -0
  73. refua-0.0.1/src/refua/boltz/model/layers/pair_averaging.py +133 -0
  74. refua-0.0.1/src/refua/boltz/model/layers/pairformer.py +333 -0
  75. refua-0.0.1/src/refua/boltz/model/layers/relative.py +58 -0
  76. refua-0.0.1/src/refua/boltz/model/layers/transition.py +75 -0
  77. refua-0.0.1/src/refua/boltz/model/layers/triangular_attention/__init__.py +0 -0
  78. refua-0.0.1/src/refua/boltz/model/layers/triangular_attention/attention.py +187 -0
  79. refua-0.0.1/src/refua/boltz/model/layers/triangular_attention/primitives.py +407 -0
  80. refua-0.0.1/src/refua/boltz/model/layers/triangular_attention/utils.py +380 -0
  81. refua-0.0.1/src/refua/boltz/model/layers/triangular_mult.py +211 -0
  82. refua-0.0.1/src/refua/boltz/model/loss/__init__.py +0 -0
  83. refua-0.0.1/src/refua/boltz/model/loss/bfactor.py +49 -0
  84. refua-0.0.1/src/refua/boltz/model/loss/confidence.py +585 -0
  85. refua-0.0.1/src/refua/boltz/model/loss/confidencev2.py +619 -0
  86. refua-0.0.1/src/refua/boltz/model/loss/diffusion.py +171 -0
  87. refua-0.0.1/src/refua/boltz/model/loss/diffusionv2.py +138 -0
  88. refua-0.0.1/src/refua/boltz/model/loss/distogram.py +48 -0
  89. refua-0.0.1/src/refua/boltz/model/loss/distogramv2.py +105 -0
  90. refua-0.0.1/src/refua/boltz/model/loss/validation.py +1024 -0
  91. refua-0.0.1/src/refua/boltz/model/model.py +5 -0
  92. refua-0.0.1/src/refua/boltz/model/models/__init__.py +0 -0
  93. refua-0.0.1/src/refua/boltz/model/models/boltz1.py +1286 -0
  94. refua-0.0.1/src/refua/boltz/model/models/boltz2.py +1259 -0
  95. refua-0.0.1/src/refua/boltz/model/modules/__init__.py +0 -0
  96. refua-0.0.1/src/refua/boltz/model/modules/affinity.py +221 -0
  97. refua-0.0.1/src/refua/boltz/model/modules/confidence.py +479 -0
  98. refua-0.0.1/src/refua/boltz/model/modules/confidence_utils.py +180 -0
  99. refua-0.0.1/src/refua/boltz/model/modules/confidencev2.py +494 -0
  100. refua-0.0.1/src/refua/boltz/model/modules/diffusion.py +860 -0
  101. refua-0.0.1/src/refua/boltz/model/modules/diffusion_conditioning.py +115 -0
  102. refua-0.0.1/src/refua/boltz/model/modules/diffusionv2.py +692 -0
  103. refua-0.0.1/src/refua/boltz/model/modules/encoders.py +638 -0
  104. refua-0.0.1/src/refua/boltz/model/modules/encodersv2.py +564 -0
  105. refua-0.0.1/src/refua/boltz/model/modules/transformers.py +322 -0
  106. refua-0.0.1/src/refua/boltz/model/modules/transformersv2.py +261 -0
  107. refua-0.0.1/src/refua/boltz/model/modules/trunk.py +686 -0
  108. refua-0.0.1/src/refua/boltz/model/modules/trunkv2.py +827 -0
  109. refua-0.0.1/src/refua/boltz/model/modules/utils.py +307 -0
  110. refua-0.0.1/src/refua/boltz/model/optim/__init__.py +0 -0
  111. refua-0.0.1/src/refua/boltz/model/optim/ema.py +389 -0
  112. refua-0.0.1/src/refua/boltz/model/optim/scheduler.py +99 -0
  113. refua-0.0.1/src/refua/boltz/model/potentials/__init__.py +0 -0
  114. refua-0.0.1/src/refua/boltz/model/potentials/potentials.py +783 -0
  115. refua-0.0.1/src/refua/boltz/model/potentials/schedules.py +36 -0
  116. refua-0.0.1/src/refua/boltzgen/__init__.py +14 -0
  117. refua-0.0.1/src/refua/boltzgen/api.py +913 -0
  118. refua-0.0.1/src/refua/boltzgen/cli/__init__.py +0 -0
  119. refua-0.0.1/src/refua/boltzgen/cli/boltzgen.py +1718 -0
  120. refua-0.0.1/src/refua/boltzgen/data/__init__.py +0 -0
  121. refua-0.0.1/src/refua/boltzgen/data/const.py +3575 -0
  122. refua-0.0.1/src/refua/boltzgen/data/crop/__init__.py +0 -0
  123. refua-0.0.1/src/refua/boltzgen/data/crop/cropper.py +39 -0
  124. refua-0.0.1/src/refua/boltzgen/data/crop/multimer.py +407 -0
  125. refua-0.0.1/src/refua/boltzgen/data/data.py +2085 -0
  126. refua-0.0.1/src/refua/boltzgen/data/feature/__init__.py +0 -0
  127. refua-0.0.1/src/refua/boltzgen/data/feature/featurizer.py +2185 -0
  128. refua-0.0.1/src/refua/boltzgen/data/filter/__init__.py +0 -0
  129. refua-0.0.1/src/refua/boltzgen/data/filter/dynamic/__init__.py +0 -0
  130. refua-0.0.1/src/refua/boltzgen/data/filter/dynamic/confidence.py +76 -0
  131. refua-0.0.1/src/refua/boltzgen/data/filter/dynamic/date.py +78 -0
  132. refua-0.0.1/src/refua/boltzgen/data/filter/dynamic/error.py +26 -0
  133. refua-0.0.1/src/refua/boltzgen/data/filter/dynamic/filter.py +24 -0
  134. refua-0.0.1/src/refua/boltzgen/data/filter/dynamic/max_residues.py +37 -0
  135. refua-0.0.1/src/refua/boltzgen/data/filter/dynamic/min_protein_residues.py +42 -0
  136. refua-0.0.1/src/refua/boltzgen/data/filter/dynamic/pdb_id_txtfile.py +48 -0
  137. refua-0.0.1/src/refua/boltzgen/data/filter/dynamic/resolution.py +37 -0
  138. refua-0.0.1/src/refua/boltzgen/data/filter/dynamic/size.py +38 -0
  139. refua-0.0.1/src/refua/boltzgen/data/filter/static/__init__.py +0 -0
  140. refua-0.0.1/src/refua/boltzgen/data/filter/static/filter.py +25 -0
  141. refua-0.0.1/src/refua/boltzgen/data/filter/static/ligand.py +36 -0
  142. refua-0.0.1/src/refua/boltzgen/data/filter/static/polymer.py +298 -0
  143. refua-0.0.1/src/refua/boltzgen/data/mol.py +1139 -0
  144. refua-0.0.1/src/refua/boltzgen/data/pad.py +79 -0
  145. refua-0.0.1/src/refua/boltzgen/data/parse/__init__.py +0 -0
  146. refua-0.0.1/src/refua/boltzgen/data/parse/a3m.py +135 -0
  147. refua-0.0.1/src/refua/boltzgen/data/parse/mmcif.py +1460 -0
  148. refua-0.0.1/src/refua/boltzgen/data/parse/pdb_parser.py +141 -0
  149. refua-0.0.1/src/refua/boltzgen/data/parse/schema.py +2169 -0
  150. refua-0.0.1/src/refua/boltzgen/data/rmsd_computation.py +117 -0
  151. refua-0.0.1/src/refua/boltzgen/data/sample/__init__.py +0 -0
  152. refua-0.0.1/src/refua/boltzgen/data/sample/cluster.py +288 -0
  153. refua-0.0.1/src/refua/boltzgen/data/sample/sampler.py +45 -0
  154. refua-0.0.1/src/refua/boltzgen/data/select/__init__.py +0 -0
  155. refua-0.0.1/src/refua/boltzgen/data/select/protein.py +722 -0
  156. refua-0.0.1/src/refua/boltzgen/data/select/selector.py +33 -0
  157. refua-0.0.1/src/refua/boltzgen/data/template/__init__.py +0 -0
  158. refua-0.0.1/src/refua/boltzgen/data/template/features.py +36 -0
  159. refua-0.0.1/src/refua/boltzgen/data/tokenize/__init__.py +0 -0
  160. refua-0.0.1/src/refua/boltzgen/data/tokenize/tokenizer.py +428 -0
  161. refua-0.0.1/src/refua/boltzgen/data/write/__init__.py +0 -0
  162. refua-0.0.1/src/refua/boltzgen/data/write/mmcif.py +450 -0
  163. refua-0.0.1/src/refua/boltzgen/data/write/pdb.py +137 -0
  164. refua-0.0.1/src/refua/boltzgen/model/__init__.py +0 -0
  165. refua-0.0.1/src/refua/boltzgen/model/layers/__init__.py +0 -0
  166. refua-0.0.1/src/refua/boltzgen/model/layers/attention.py +133 -0
  167. refua-0.0.1/src/refua/boltzgen/model/layers/confidence_utils.py +360 -0
  168. refua-0.0.1/src/refua/boltzgen/model/layers/dropout.py +95 -0
  169. refua-0.0.1/src/refua/boltzgen/model/layers/initialize.py +85 -0
  170. refua-0.0.1/src/refua/boltzgen/model/layers/miniformer.py +208 -0
  171. refua-0.0.1/src/refua/boltzgen/model/layers/outer_product_mean.py +108 -0
  172. refua-0.0.1/src/refua/boltzgen/model/layers/pair_averaging.py +118 -0
  173. refua-0.0.1/src/refua/boltzgen/model/layers/pairformer.py +318 -0
  174. refua-0.0.1/src/refua/boltzgen/model/layers/relative.py +58 -0
  175. refua-0.0.1/src/refua/boltzgen/model/layers/transition.py +71 -0
  176. refua-0.0.1/src/refua/boltzgen/model/layers/triangular.py +305 -0
  177. refua-0.0.1/src/refua/boltzgen/model/layers/triangular_attention/__init__.py +0 -0
  178. refua-0.0.1/src/refua/boltzgen/model/layers/triangular_attention/attention.py +187 -0
  179. refua-0.0.1/src/refua/boltzgen/model/layers/triangular_attention/primitives.py +415 -0
  180. refua-0.0.1/src/refua/boltzgen/model/layers/triangular_attention/utils.py +379 -0
  181. refua-0.0.1/src/refua/boltzgen/model/loss/__init__.py +0 -0
  182. refua-0.0.1/src/refua/boltzgen/model/loss/bfactor.py +49 -0
  183. refua-0.0.1/src/refua/boltzgen/model/loss/confidence.py +605 -0
  184. refua-0.0.1/src/refua/boltzgen/model/loss/diffusion.py +192 -0
  185. refua-0.0.1/src/refua/boltzgen/model/loss/distogram.py +108 -0
  186. refua-0.0.1/src/refua/boltzgen/model/loss/res_type.py +55 -0
  187. refua-0.0.1/src/refua/boltzgen/model/loss/validation.py +1810 -0
  188. refua-0.0.1/src/refua/boltzgen/model/models/__init__.py +0 -0
  189. refua-0.0.1/src/refua/boltzgen/model/models/boltz.py +1546 -0
  190. refua-0.0.1/src/refua/boltzgen/model/modules/__init__.py +0 -0
  191. refua-0.0.1/src/refua/boltzgen/model/modules/affinity.py +221 -0
  192. refua-0.0.1/src/refua/boltzgen/model/modules/confidence.py +610 -0
  193. refua-0.0.1/src/refua/boltzgen/model/modules/diffusion.py +853 -0
  194. refua-0.0.1/src/refua/boltzgen/model/modules/diffusion_conditioning.py +116 -0
  195. refua-0.0.1/src/refua/boltzgen/model/modules/encoders.py +740 -0
  196. refua-0.0.1/src/refua/boltzgen/model/modules/inverse_fold.py +632 -0
  197. refua-0.0.1/src/refua/boltzgen/model/modules/masker.py +249 -0
  198. refua-0.0.1/src/refua/boltzgen/model/modules/scatter_utils.py +143 -0
  199. refua-0.0.1/src/refua/boltzgen/model/modules/transformers.py +262 -0
  200. refua-0.0.1/src/refua/boltzgen/model/modules/trunk.py +850 -0
  201. refua-0.0.1/src/refua/boltzgen/model/modules/utils.py +231 -0
  202. refua-0.0.1/src/refua/boltzgen/model/optim/__init__.py +0 -0
  203. refua-0.0.1/src/refua/boltzgen/model/optim/ema.py +391 -0
  204. refua-0.0.1/src/refua/boltzgen/model/optim/scheduler.py +79 -0
  205. refua-0.0.1/src/refua/boltzgen/model/validation/design.py +350 -0
  206. refua-0.0.1/src/refua/boltzgen/model/validation/rcsb.py +56 -0
  207. refua-0.0.1/src/refua/boltzgen/model/validation/refolding.py +365 -0
  208. refua-0.0.1/src/refua/boltzgen/model/validation/validator.py +621 -0
  209. refua-0.0.1/src/refua/boltzgen/resources/config/affinity.yaml +53 -0
  210. refua-0.0.1/src/refua/boltzgen/resources/config/analysis.yaml +64 -0
  211. refua-0.0.1/src/refua/boltzgen/resources/config/design.yaml +99 -0
  212. refua-0.0.1/src/refua/boltzgen/resources/config/filtering.yaml +16 -0
  213. refua-0.0.1/src/refua/boltzgen/resources/config/fold.yaml +54 -0
  214. refua-0.0.1/src/refua/boltzgen/resources/config/inverse_fold.yaml +98 -0
  215. refua-0.0.1/src/refua/boltzgen/resources/config/inverse_fold_only.yaml +89 -0
  216. refua-0.0.1/src/refua/boltzgen/resources/config/train/boltzgen.no_distillation.yaml +484 -0
  217. refua-0.0.1/src/refua/boltzgen/resources/config/train/boltzgen.yaml +578 -0
  218. refua-0.0.1/src/refua/boltzgen/resources/config/train/boltzgen_small.yaml +346 -0
  219. refua-0.0.1/src/refua/boltzgen/resources/config/train/inverse_folding.yaml +376 -0
  220. refua-0.0.1/src/refua/boltzgen/resources/main.py +52 -0
  221. refua-0.0.1/src/refua/boltzgen/resources/metrics_normalization.json +38 -0
  222. refua-0.0.1/src/refua/boltzgen/resources/splits/val_ccd_pdb_pairs_boltzgen.txt +101 -0
  223. refua-0.0.1/src/refua/boltzgen/resources/splits/val_monomers_boltzgen_min50_max220.txt +110 -0
  224. refua-0.0.1/src/refua/boltzgen/resources/splits/validation_ids_boltz2_all.txt +398 -0
  225. refua-0.0.1/src/refua/boltzgen/task/__init__.py +0 -0
  226. refua-0.0.1/src/refua/boltzgen/task/analyze/analyze.py +1466 -0
  227. refua-0.0.1/src/refua/boltzgen/task/analyze/analyze_utils.py +1254 -0
  228. refua-0.0.1/src/refua/boltzgen/task/filter/__init__.py +0 -0
  229. refua-0.0.1/src/refua/boltzgen/task/filter/filter.py +1364 -0
  230. refua-0.0.1/src/refua/boltzgen/task/filter/seqplot_utils.py +501 -0
  231. refua-0.0.1/src/refua/boltzgen/task/predict/__init__.py +0 -0
  232. refua-0.0.1/src/refua/boltzgen/task/predict/data_from_generated.py +846 -0
  233. refua-0.0.1/src/refua/boltzgen/task/predict/data_from_yaml.py +443 -0
  234. refua-0.0.1/src/refua/boltzgen/task/predict/data_ligands.py +407 -0
  235. refua-0.0.1/src/refua/boltzgen/task/predict/data_protein_binder.py +606 -0
  236. refua-0.0.1/src/refua/boltzgen/task/predict/loading_utils.py +45 -0
  237. refua-0.0.1/src/refua/boltzgen/task/predict/predict.py +191 -0
  238. refua-0.0.1/src/refua/boltzgen/task/predict/writer.py +536 -0
  239. refua-0.0.1/src/refua/boltzgen/task/task.py +19 -0
  240. refua-0.0.1/src/refua/boltzgen/task/train/__init__.py +0 -0
  241. refua-0.0.1/src/refua/boltzgen/task/train/data.py +1261 -0
  242. refua-0.0.1/src/refua/boltzgen/task/train/train.py +249 -0
  243. refua-0.0.1/src/refua/boltzgen/utils/__init__.py +0 -0
  244. refua-0.0.1/src/refua/boltzgen/utils/pipeline_progress_bar.py +182 -0
  245. refua-0.0.1/src/refua/boltzgen/utils/quiet.py +18 -0
  246. refua-0.0.1/src/refua/boltzgen/utils/resources.py +59 -0
refua-0.0.1/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Jeremy Wohlwend, Gabriele Corso, Saro Passaro
4
+ Copyright (c) 2025 Hannes Stärk
5
+ Copyright (c) 2026 TensorSpace, Inc.
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
refua-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,187 @@
1
+ Metadata-Version: 2.4
2
+ Name: refua
3
+ Version: 0.0.1
4
+ Summary: Unified drug discovery ML toolkit
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Keywords: drug discovery,machine learning,protein design,structure prediction,generative design
8
+ Author: JJ Ben-Joseph
9
+ Author-email: jj@tensorspace.ai
10
+ Requires-Python: >=3.11,<3.15
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
20
+ Provides-Extra: analysis
21
+ Provides-Extra: cuda
22
+ Provides-Extra: dev
23
+ Provides-Extra: doc
24
+ Provides-Extra: lint
25
+ Provides-Extra: process
26
+ Provides-Extra: test
27
+ Provides-Extra: train
28
+ Requires-Dist: biopython (>=1.84)
29
+ Requires-Dist: biotite
30
+ Requires-Dist: chembl_structure_pipeline (>=1.2.2)
31
+ Requires-Dist: click (>=8.1.7)
32
+ Requires-Dist: cuequivariance_ops_cu12 (>=0.5.0) ; extra == "cuda"
33
+ Requires-Dist: cuequivariance_ops_torch_cu12 (>=0.5.0) ; extra == "cuda"
34
+ Requires-Dist: cuequivariance_torch (>=0.5.0) ; extra == "cuda"
35
+ Requires-Dist: dm-tree (>=0.1.8)
36
+ Requires-Dist: einops (>=0.8.0)
37
+ Requires-Dist: einx (>=0.3.0)
38
+ Requires-Dist: fairscale (>=0.4.13)
39
+ Requires-Dist: furo (>=2024.1.29) ; extra == "dev"
40
+ Requires-Dist: furo (>=2024.1.29) ; extra == "doc"
41
+ Requires-Dist: gemmi (>=0.6.5)
42
+ Requires-Dist: huggingface_hub
43
+ Requires-Dist: hydra-core (>=1.3.2)
44
+ Requires-Dist: hydride ; extra == "analysis"
45
+ Requires-Dist: logomaker
46
+ Requires-Dist: logomaker ; extra == "analysis"
47
+ Requires-Dist: mashumaro (>=3.14)
48
+ Requires-Dist: matplotlib
49
+ Requires-Dist: matplotlib ; extra == "analysis"
50
+ Requires-Dist: matplotlib ; extra == "train"
51
+ Requires-Dist: modelcif (>=1.2)
52
+ Requires-Dist: myst-parser (>=2.0.0) ; extra == "dev"
53
+ Requires-Dist: myst-parser (>=2.0.0) ; extra == "doc"
54
+ Requires-Dist: numba (>=0.61.0)
55
+ Requires-Dist: numpy (>=1.26,<2.0)
56
+ Requires-Dist: nvidia-ml-py (>=12.535.133) ; extra == "cuda"
57
+ Requires-Dist: p_tqdm ; extra == "process"
58
+ Requires-Dist: pandas (>=2.2.2)
59
+ Requires-Dist: pandas (>=2.2.2) ; extra == "analysis"
60
+ Requires-Dist: pandas (>=2.2.2) ; extra == "dev"
61
+ Requires-Dist: pandas (>=2.2.2) ; extra == "test"
62
+ Requires-Dist: pandas (>=2.2.2) ; extra == "train"
63
+ Requires-Dist: pdbeccdutils ; extra == "process"
64
+ Requires-Dist: pre-commit ; extra == "dev"
65
+ Requires-Dist: pydssp
66
+ Requires-Dist: pytest ; extra == "dev"
67
+ Requires-Dist: pytest ; extra == "test"
68
+ Requires-Dist: pytorch-lightning (>=2.5.0)
69
+ Requires-Dist: pyyaml (>=6.0.2)
70
+ Requires-Dist: rdkit (>=2024.3.2)
71
+ Requires-Dist: redis ; extra == "dev"
72
+ Requires-Dist: redis ; extra == "process"
73
+ Requires-Dist: requests (>=2.32.3)
74
+ Requires-Dist: requests ; extra == "dev"
75
+ Requires-Dist: requests ; extra == "test"
76
+ Requires-Dist: ruff ; extra == "dev"
77
+ Requires-Dist: ruff ; extra == "lint"
78
+ Requires-Dist: scikit-learn (>=1.6.1)
79
+ Requires-Dist: scipy (>=1.13.1)
80
+ Requires-Dist: sphinx (>=7) ; extra == "dev"
81
+ Requires-Dist: sphinx (>=7) ; extra == "doc"
82
+ Requires-Dist: sphinx-autodoc-typehints (>=1.25.2) ; extra == "dev"
83
+ Requires-Dist: sphinx-autodoc-typehints (>=1.25.2) ; extra == "doc"
84
+ Requires-Dist: torch (>=2.4.1)
85
+ Requires-Dist: tqdm
86
+ Requires-Dist: types-requests (>=2.32.4) ; extra == "dev"
87
+ Requires-Dist: wandb (>=0.18.7) ; extra == "dev"
88
+ Requires-Dist: wandb (>=0.18.7) ; extra == "train"
89
+ Project-URL: Homepage, https://tensorspace.ai/
90
+ Project-URL: Repository, https://github.com/tensorspace-ai/refua
91
+ Description-Content-Type: text/markdown
92
+
93
+ # Refua
94
+
95
+ Refua is a general drug discovery ML toolkit that brings together structure prediction, affinity modeling, and generative design in one package. It unifies the Boltz inference stack with the BoltzGen design pipeline so you can move from target definition to candidate generation using a shared, programmatic API.
96
+
97
+ ## Why use Refua?
98
+
99
+ - **Fluent Python API:** Build specs, run predictions, and post-process results with a readable, composable
100
+ API—no need to stitch together CLI calls, YAML, or intermediate files.
101
+ - **No per-call model reload:** Keep a predictor/model instance alive and run many inferences in a loop
102
+ without paying initialization and checkpoint-loading cost each time.
103
+ - **All-in-memory workflows:** Prepare inputs, run inference, and perform analysis entirely in memory
104
+ (e.g., passing objects/arrays between steps) without writing temporary files to disk.
105
+ - **Improved build:** We are able to support more up to date dependencies. Over time we expect to widen this support.
106
+
107
+ ## Quickstart
108
+
109
+ Install:
110
+
111
+ ```bash
112
+ pip install refua
113
+ ```
114
+
115
+ Install with NVIDIA GPU support:
116
+
117
+ ```bash
118
+ pip install "refua[cuda]"
119
+ ```
120
+
121
+ Boltz-2 API:
122
+
123
+ ```python
124
+ from pathlib import Path
125
+
126
+ from refua import Boltz2
127
+
128
+ model = Boltz2()
129
+
130
+ complex_spec = (
131
+ model.fold_complex()
132
+ .protein("A", "MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQ")
133
+ .ligand("L", "CCO")
134
+ )
135
+
136
+ Path("complex.bcif").write_bytes(complex_spec.to_bcif())
137
+ affinity = complex_spec.get_affinity()
138
+ print(affinity.ic50, affinity.binding_probability)
139
+ ```
140
+
141
+ BoltzGen API:
142
+
143
+ ```python
144
+ from refua import BoltzGen
145
+
146
+ gen = BoltzGen()
147
+ design = (
148
+ gen.design("simple_design")
149
+ .protein("A", "12")
150
+ .total_length(8, 20)
151
+ )
152
+
153
+ features = design.to_features()
154
+ print(sorted(features.keys())[:6])
155
+ ```
156
+
157
+ BoltzGen defaults to the bundled molecule library in the Hugging Face cache. Set `BOLTZGEN_MOLDIR` or pass `mol_dir` to override.
158
+
159
+ CLI entrypoints are still available:
160
+
161
+ ```bash
162
+ boltz --help
163
+ boltzgen --help
164
+ ```
165
+
166
+ ## Documentation
167
+
168
+ - Boltz docs live in `docs/boltz`.
169
+ - BoltzGen docs live in `docs/boltzgen`.
170
+ - API reference source lives in `docs/api` (build with `sphinx-build -b html docs/api docs/api/_build/html`).
171
+
172
+ ## Examples
173
+
174
+ - `examples/antibody_design.py` shows a minimal BoltzGen antibody design spec.
175
+ - `examples/protein_ligand_affinity.py` shows a Boltz protein-ligand affinity spec.
176
+ - `examples/boltz2_kras_mrtx1133.py` folds KRAS G12D with the MRTX-1133 inhibitor and prints affinity.
177
+ - `examples/boltzgen_peptide_binder.py` shows a BoltzGen peptide binder spec with optional cyclic peptides.
178
+ - `examples/boltz_constraints.py` shows a Boltz complex with pocket/contact constraints and an optional MSA.
179
+ - `examples/boltz_multichain_msa.py` shows multi-chain MSAs with cross-chain constraints.
180
+ - `examples/boltzgen_template_insertions.py` shows template structure groups and design insertions.
181
+ - `examples/boltz_multi_pocket_complex.py` shows multi-ligand pocket constraints with contacts.
182
+ - `examples/boltzgen_template_masks.py` shows template masks with design/not-design ranges and structure groups.
183
+
184
+ ## Notes
185
+
186
+ This repository consolidates the two stacks into a single build and dependency set. If you need the legacy standalone documentation, it has been preserved under `docs/`.
187
+
refua-0.0.1/README.md ADDED
@@ -0,0 +1,94 @@
1
+ # Refua
2
+
3
+ Refua is a general drug discovery ML toolkit that brings together structure prediction, affinity modeling, and generative design in one package. It unifies the Boltz inference stack with the BoltzGen design pipeline so you can move from target definition to candidate generation using a shared, programmatic API.
4
+
5
+ ## Why use Refua?
6
+
7
+ - **Fluent Python API:** Build specs, run predictions, and post-process results with a readable, composable
8
+ API—no need to stitch together CLI calls, YAML, or intermediate files.
9
+ - **No per-call model reload:** Keep a predictor/model instance alive and run many inferences in a loop
10
+ without paying initialization and checkpoint-loading cost each time.
11
+ - **All-in-memory workflows:** Prepare inputs, run inference, and perform analysis entirely in memory
12
+ (e.g., passing objects/arrays between steps) without writing temporary files to disk.
13
+ - **Improved build:** We are able to support more up to date dependencies. Over time we expect to widen this support.
14
+
15
+ ## Quickstart
16
+
17
+ Install:
18
+
19
+ ```bash
20
+ pip install refua
21
+ ```
22
+
23
+ Install with NVIDIA GPU support:
24
+
25
+ ```bash
26
+ pip install "refua[cuda]"
27
+ ```
28
+
29
+ Boltz-2 API:
30
+
31
+ ```python
32
+ from pathlib import Path
33
+
34
+ from refua import Boltz2
35
+
36
+ model = Boltz2()
37
+
38
+ complex_spec = (
39
+ model.fold_complex()
40
+ .protein("A", "MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQ")
41
+ .ligand("L", "CCO")
42
+ )
43
+
44
+ Path("complex.bcif").write_bytes(complex_spec.to_bcif())
45
+ affinity = complex_spec.get_affinity()
46
+ print(affinity.ic50, affinity.binding_probability)
47
+ ```
48
+
49
+ BoltzGen API:
50
+
51
+ ```python
52
+ from refua import BoltzGen
53
+
54
+ gen = BoltzGen()
55
+ design = (
56
+ gen.design("simple_design")
57
+ .protein("A", "12")
58
+ .total_length(8, 20)
59
+ )
60
+
61
+ features = design.to_features()
62
+ print(sorted(features.keys())[:6])
63
+ ```
64
+
65
+ BoltzGen defaults to the bundled molecule library in the Hugging Face cache. Set `BOLTZGEN_MOLDIR` or pass `mol_dir` to override.
66
+
67
+ CLI entrypoints are still available:
68
+
69
+ ```bash
70
+ boltz --help
71
+ boltzgen --help
72
+ ```
73
+
74
+ ## Documentation
75
+
76
+ - Boltz docs live in `docs/boltz`.
77
+ - BoltzGen docs live in `docs/boltzgen`.
78
+ - API reference source lives in `docs/api` (build with `sphinx-build -b html docs/api docs/api/_build/html`).
79
+
80
+ ## Examples
81
+
82
+ - `examples/antibody_design.py` shows a minimal BoltzGen antibody design spec.
83
+ - `examples/protein_ligand_affinity.py` shows a Boltz protein-ligand affinity spec.
84
+ - `examples/boltz2_kras_mrtx1133.py` folds KRAS G12D with the MRTX-1133 inhibitor and prints affinity.
85
+ - `examples/boltzgen_peptide_binder.py` shows a BoltzGen peptide binder spec with optional cyclic peptides.
86
+ - `examples/boltz_constraints.py` shows a Boltz complex with pocket/contact constraints and an optional MSA.
87
+ - `examples/boltz_multichain_msa.py` shows multi-chain MSAs with cross-chain constraints.
88
+ - `examples/boltzgen_template_insertions.py` shows template structure groups and design insertions.
89
+ - `examples/boltz_multi_pocket_complex.py` shows multi-ligand pocket constraints with contacts.
90
+ - `examples/boltzgen_template_masks.py` shows template masks with design/not-design ranges and structure groups.
91
+
92
+ ## Notes
93
+
94
+ This repository consolidates the two stacks into a single build and dependency set. If you need the legacy standalone documentation, it has been preserved under `docs/`.
@@ -0,0 +1,182 @@
1
+ [build-system]
2
+ requires = ["poetry-core>=1.9.0"]
3
+ build-backend = "poetry.core.masonry.api"
4
+
5
+ [project]
6
+ name = "refua"
7
+ version = "0.0.1"
8
+ requires-python = ">=3.11,<3.15"
9
+ description = "Unified drug discovery ML toolkit"
10
+ readme = "README.md"
11
+ license = "MIT"
12
+ authors = [{name = "JJ Ben-Joseph", email = "jj@tensorspace.ai"}]
13
+ keywords = [
14
+ "drug discovery",
15
+ "machine learning",
16
+ "protein design",
17
+ "structure prediction",
18
+ "generative design",
19
+ ]
20
+ classifiers = [
21
+ "Development Status :: 3 - Alpha",
22
+ "Intended Audience :: Science/Research",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: 3.13",
27
+ "Programming Language :: Python :: 3.14",
28
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
29
+ "Topic :: Scientific/Engineering :: Bio-Informatics",
30
+ ]
31
+ dependencies = [
32
+ "torch>=2.4.1",
33
+ "numpy>=1.26,<2.0",
34
+ "hydra-core>=1.3.2",
35
+ "pytorch-lightning>=2.5.0",
36
+ "rdkit>=2024.3.2",
37
+ "dm-tree>=0.1.8",
38
+ "requests>=2.32.3",
39
+ "einops>=0.8.0",
40
+ "einx>=0.3.0",
41
+ "fairscale>=0.4.13",
42
+ "mashumaro>=3.14",
43
+ "modelcif>=1.2",
44
+ "click>=8.1.7",
45
+ "pyyaml>=6.0.2",
46
+ "biopython>=1.84",
47
+ "scipy>=1.13.1",
48
+ "numba>=0.61.0",
49
+ "gemmi>=0.6.5",
50
+ "scikit-learn>=1.6.1",
51
+ "chembl_structure_pipeline>=1.2.2",
52
+ "biotite",
53
+ "pydssp",
54
+ "huggingface_hub",
55
+ "pandas>=2.2.2",
56
+ "matplotlib",
57
+ "logomaker",
58
+ "tqdm",
59
+ ]
60
+
61
+ [project.urls]
62
+ Homepage = "https://tensorspace.ai/"
63
+ Repository = "https://github.com/tensorspace-ai/refua"
64
+
65
+ [project.scripts]
66
+ boltz = "refua.boltz.main:cli"
67
+ boltzgen = "refua.boltzgen.cli.boltzgen:main"
68
+
69
+ [project.optional-dependencies]
70
+ lint = ["ruff"]
71
+ test = ["pytest", "requests", "pandas>=2.2.2"]
72
+ doc = [
73
+ "sphinx>=7",
74
+ "furo>=2024.1.29",
75
+ "myst-parser>=2.0.0",
76
+ "sphinx-autodoc-typehints>=1.25.2",
77
+ ]
78
+ cuda = [
79
+ "cuequivariance_ops_cu12>=0.5.0",
80
+ "cuequivariance_ops_torch_cu12>=0.5.0",
81
+ "cuequivariance_torch>=0.5.0",
82
+ "nvidia-ml-py>=12.535.133",
83
+ ]
84
+ analysis = [
85
+ "pandas>=2.2.2",
86
+ "matplotlib",
87
+ "logomaker",
88
+ "hydride",
89
+ ]
90
+ train = [
91
+ "wandb>=0.18.7",
92
+ "pandas>=2.2.2",
93
+ "matplotlib",
94
+ ]
95
+ process = [
96
+ "pdbeccdutils",
97
+ "p_tqdm",
98
+ "redis",
99
+ ]
100
+ dev = [
101
+ "ruff",
102
+ "pre-commit",
103
+ "pytest",
104
+ "requests",
105
+ "types-requests>=2.32.4",
106
+ "pandas>=2.2.2",
107
+ "redis",
108
+ "wandb>=0.18.7",
109
+ "sphinx>=7",
110
+ "furo>=2024.1.29",
111
+ "myst-parser>=2.0.0",
112
+ "sphinx-autodoc-typehints>=1.25.2",
113
+ ]
114
+
115
+ [tool.setuptools]
116
+ package-dir = {"" = "src"}
117
+ include-package-data = true
118
+
119
+ [tool.setuptools.packages.find]
120
+ where = ["src"]
121
+
122
+ [tool.setuptools.package-data]
123
+ refua.boltzgen = ["resources/**/*"]
124
+
125
+ [tool.ruff]
126
+ src = ["src"]
127
+ extend-exclude = ["conf.py"]
128
+ target-version = "py311"
129
+ lint.select = ["ALL"]
130
+ lint.ignore = [
131
+ "COM812", # Conflicts with the formatter
132
+ "ISC001", # Conflicts with the formatter
133
+ "RET504", # Unnecessary assignment to `x` before `return` statement
134
+ "S101", # Use of `assert` detected
135
+ "D100", # Missing docstring in public module
136
+ "D104", # Missing docstring in public package
137
+ "PT001", # https://github.com/astral-sh/ruff/issues/8796#issuecomment-1825907715
138
+ "PT023", # https://github.com/astral-sh/ruff/issues/8796#issuecomment-1825907715
139
+ "FBT001",
140
+ "FBT002",
141
+ "PLR0913", # Too many arguments to init (> 5)
142
+ "TRY003", # Exception messages
143
+ "EM101", # Exception messages
144
+ "FA102", # typing
145
+ "T201", # Print statements
146
+ ]
147
+
148
+ [tool.ruff.lint.per-file-ignores]
149
+ "**/__init__.py" = [
150
+ "F401", # Imported but unused
151
+ "F403", # Wildcard imports
152
+ ]
153
+ "docs/**" = [
154
+ "INP001", # Requires __init__.py but folder is not a package.
155
+ ]
156
+ "scripts/**" = [
157
+ "INP001", # Requires __init__.py but folder is not a package.
158
+ ]
159
+ "tests/**" = [
160
+ "S101", # Use of `assert` detected
161
+ "D103", # Missing docstring in public function
162
+ ]
163
+
164
+ [tool.ruff.lint.pyupgrade]
165
+ # Preserve types, even if a file imports `from __future__ import annotations`
166
+ keep-runtime-typing = true
167
+
168
+ [tool.ruff.lint.pydocstyle]
169
+ convention = "numpy"
170
+
171
+ [tool.pytest.ini_options]
172
+ markers = [
173
+ "slow: marks tests as slow (deselect with '-m \"not slow\"')",
174
+ "regression",
175
+ ]
176
+ pythonpath = ["src"]
177
+
178
+ [tool.mypy]
179
+ # Functions need to be annotated
180
+ disallow_untyped_defs = true
181
+ warn_unused_ignores = true
182
+ exclude = ["configs/", "build/", "dist/", "docs/", "tests/"]
@@ -0,0 +1,13 @@
1
+ from importlib.metadata import PackageNotFoundError, version
2
+
3
+ from refua.api import download_assets
4
+ from refua.boltz.api import Boltz2
5
+ from refua.boltzgen.api import BoltzGen
6
+
7
+ try: # noqa: SIM105
8
+ __version__ = version("refua")
9
+ except PackageNotFoundError:
10
+ # package is not installed
11
+ pass
12
+
13
+ __all__ = ["Boltz2", "BoltzGen", "download_assets"]