macromolecules.rst 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. **************
  2. Macromolecules
  3. **************
  4. Initial comments
  5. ================
  6. MCell's current (2009-04-24) implementation of macromolecules is a fairly
  7. restricted model, though one which is useful for a number of different
  8. applications. First, a few terms as they are used in this document.
  9. macromolecule
  10. A macromolecule is a specially defined molecular species. When placed in
  11. the world, a macromolecule is a collection of a fixed number of *subunits*,
  12. each of which is a normal (albeit stationary) volume or surface molecule.
  13. The term *complex* may be used interchangeably with *macromolecule* in this
  14. document.
  15. complex
  16. Synonymous with macromolecule.
  17. subunit
  18. A subunit is any molecular species when it is used as a part of a
  19. macromolecule. At present, a macromolecule must be composed either
  20. entirely of surface molecule species, or of volume molecule species.
  21. volume macromolecule
  22. A volume macromolecule is a macromolecule whose subunits are of volume
  23. molecule species.
  24. surface macromolecule
  25. A surface macromolecule is a macromolecule whose subunits are of surface
  26. molecule species.
  27. macromolecular reaction
  28. A macromolecular reaction is a reaction with one of the subunits of a
  29. macromolecule, whose rate may or may not be affected by the states of the
  30. other subunits in the macromolecule.
  31. complex reaction rate
  32. A complex reaction rate is a reaction rate which depends on the states of
  33. one or more subunits in the macromolecule.
  34. reference subunit
  35. The "reference" subunit will refer to the subunit undergoing a reaction, as
  36. opposed to all of the other subunits in the macromolecule.
  37. related subunits
  38. The "related" subunits will refer to the set of all subunits which are
  39. reachable from the reference subunit by one or more of the relations
  40. defined in the macromolecule.
  41. inverse-related subunits
  42. The "inverse-related" subunits will refer to the set of all subunits from
  43. which the reference subunit is reachable by one or more of the relations
  44. defined in the macromolecule. In the motivating example I've provided, the
  45. set of related subunits for any given reference subunit is exactly equal to
  46. the set of inverse-related subunits, but this is only because the set of
  47. relations defined in this example are complete under inversion.
  48. unrelated subunits
  49. "Unrelated" subunits will refer to the set of all subunits which are
  50. neither the reference subunit, a related subunit, or an inverse-related
  51. subunit.
  52. Logically, a macromolecule's subunits are a n-dimensional collection. This
  53. does not imply anything about the physical layout of the macromolecule, only
  54. the logical topology. The motivating example I will present in this document
  55. is a 2-dimensional macromolecule which is a 2x6 collection of subunits which
  56. are logically a 6-ring of dimer pairs.
  57. Presently, macromolecules must be stationary. Once they have been placed, they
  58. will not diffuse or move under any circumstances. At some point, we may
  59. undertake to implement diffusion of macromolecules, but there are no such plans
  60. at present.
  61. In addition to the subunits, macromolecules will show up in certain types of
  62. output. They are a species like any other and can be displayed in
  63. visualization and count output. The major difference is that the macromolecule
  64. species may not itself undergo reactions, and if it is a surface molecule, it
  65. will not occupy a tile.
  66. Motivating example
  67. ==================
  68. Here is an excerpt from an MCell macromolecules test case which omits
  69. everything not related to macromolecules. Briefly, it describes a
  70. macromolecule called ``my_complex`` which has 12 subunits which may be in an
  71. unbound (``subunitU``) or a bound (``subunitB``) state. The 12 subunits are
  72. arranged into 6 dimers, and *cooperativity* is exhibited, in that binding rates
  73. are higher for subunits whose dimer partner is bound, and unbinding rates are
  74. lower for doubly-bound dimer pairs::
  75. /* Define subunit types */
  76. DEFINE_MOLECULES {
  77. subunitU { DIFFUSION_CONSTANT_3D = 0 } /* unbound */
  78. subunitB { DIFFUSION_CONSTANT_3D = 0 } /* bound */
  79. Lig { DIFFUSION_CONSTANT_3D = 2e-6 }
  80. }
  81. /* Define the complex type */
  82. DEFINE_COMPLEX_MOLECULE my_complex {
  83. /* Define the dimensionality: 2x6 */
  84. NUMBER_OF_SUBUNITS = [2, 6]
  85. /* Set the initial states of all subunits. */
  86. SUBUNIT[1:2, 1:6] = subunitU
  87. /* Set the physical layout of the macromolecule */
  88. SHAPE {
  89. SUBUNIT[1, 1] = [-.10, .0000, .05]
  90. SUBUNIT[1, 2] = [-.05, .0866, .05]
  91. SUBUNIT[1, 3] = [ .05, .0866, .05]
  92. SUBUNIT[1, 4] = [ .10, .0000, .05]
  93. SUBUNIT[1, 5] = [ .05, -.0866, .05]
  94. SUBUNIT[1, 6] = [-.05, -.0866, .05]
  95. SUBUNIT[2, 1] = [-.10, .0000, -.05]
  96. SUBUNIT[2, 2] = [-.05, .0866, -.05]
  97. SUBUNIT[2, 3] = [ .05, .0866, -.05]
  98. SUBUNIT[2, 4] = [ .10, .0000, -.05]
  99. SUBUNIT[2, 5] = [ .05, -.0866, -.05]
  100. SUBUNIT[2, 6] = [-.05, -.0866, -.05]
  101. }
  102. /* Specify the relationships between the subunits */
  103. SUBUNIT_RELATIONSHIPS {
  104. ring_negative = [ 0, -1]
  105. ring_positive = [ 0, +1]
  106. dimer_partner = [+1, 0]
  107. }
  108. /* Specify the rules for reaction rates. */
  109. RATE_RULES {
  110. binding {
  111. dimer_partner != subunitU : fw_rate * TMP_spec_F
  112. DEFAULT : fw_rate
  113. }
  114. unbinding {
  115. dimer_partner != subunitU : bw_rate * TMP_spec_B
  116. DEFAULT : bw_rate
  117. }
  118. /* Unused example of multiple clauses */
  119. triplet {
  120. ring_positive != subunitU &
  121. ring_negative != subunitU : 1e7
  122. DEFAULT : 1e6
  123. }
  124. }
  125. }
  126. DEFINE_REACTIONS {
  127. (subunitU) + Lig <-> (subunitB) [> COMPLEX_RATE my_complex binding,
  128. < COMPLEX_RATE my_complex unbinding]
  129. }
  130. REACTION_DATA_OUTPUT
  131. {
  132. OUTPUT_BUFFER_SIZE = 1000
  133. STEP = 1e-5
  134. HEADER = "# "
  135. {
  136. COUNT[subunitU, WORLD] : "us",
  137. COUNT[subunitB, WORLD] : "bs",
  138. COUNT[SUBUNIT{
  139. my_complex : subunitU [
  140. dimer_partner == subunitU
  141. ]}, WORLD] : "00",
  142. COUNT[SUBUNIT{
  143. my_complex : subunitU [
  144. dimer_partner != subunitU
  145. ]}, WORLD] : "01",
  146. COUNT[SUBUNIT{
  147. my_complex : subunitB [
  148. dimer_partner == subunitU
  149. ]}, WORLD] : "10",
  150. COUNT[SUBUNIT{
  151. my_complex : subunitB [
  152. dimer_partner != subunitU
  153. ]}, WORLD] : "11",
  154. COUNT[SUBUNIT{
  155. my_complex : subunitB [
  156. ring_negative != subunitU &
  157. ring_positive != subunitU
  158. ]}, WORLD] : "triple",
  159. COUNT[Lig, WORLD] : "Lig"
  160. } => countdir & "counts.dat"
  161. }
  162. In English, this example describe a macromolecule which consists of a 6-ring of
  163. dimer pairs. Each subunit in the molecule is initially of species
  164. ``subunitU``. Because the subunits are volume molecules, the macromolecule as
  165. a whole is a volume macromolecule. The physical layout of the subunits is that
  166. of two stacked hexagonal rings. Only one (bidirectional) reaction is defined
  167. for the subunits of the macromolecule -- a "binding" reaction which binds
  168. ``Lig`` to turn ``subunitU`` into ``subunitB``. An essential feature of this
  169. reaction is *cooperativity*, meaning that if one subunit in a dimer pair is
  170. bound, the binding rate increases for the other subunit. Similarly, the
  171. binding rate is decreased for doubly-bound dimer pairs. Finally, the reaction
  172. output from the simulation is specified to give counts of:
  173. * The number of unbound subunits in the entire world
  174. * The number of bound subunits in the entire world
  175. * The number of doubly unbound dimer pairs
  176. * The number of unbound subunits whose partners are bound
  177. * The number of bound subunits whose partners are unbound
  178. * The number of doubly bound dimer pairs
  179. * The number of ``Lig`` molecules in the world
  180. The syntax
  181. ==========
  182. Now, a quick walk through the syntax. I won't bother explaining the bits of
  183. syntax which are unrelated to macromolecules, such as the declaration of
  184. species for the subunits, which is indistinct from declaration of species for
  185. non-macromolecules.
  186. First up is the structure of a macromolecule declaration::
  187. DEFINE_COMPLEX_MOLECULE my_complex {
  188. /* Topology */
  189. /* Initial states */
  190. /* Physical layout */
  191. /* Relationships */
  192. /* Rate rules */
  193. }
  194. All of the sections listed above are currently required in a macromolecule, and
  195. they MUST occur in order at present. This may be relaxed in the future, but in
  196. order to properly error check the macromolecules, this ordering is currently
  197. required.
  198. Topology
  199. --------
  200. The topology is defined by the ``NUMBER_OF_SUBUNITS`` keyword::
  201. /* Define the dimensionality: 2x6 */
  202. NUMBER_OF_SUBUNITS = [2, 6]
  203. This defines a 2x6 macromolecule (i.e. with 12 subunits). The topology may be
  204. a list of any length >= 1. One could, for instance, define a macromolecule
  205. which has only a single subunit, as any of the following::
  206. NUMBER_OF_SUBUNITS = [1]
  207. NUMBER_OF_SUBUNITS = [1, 1]
  208. NUMBER_OF_SUBUNITS = [1, 1, 1, 1, 1, 1]
  209. Obviously, there isn't much point to a unimolecular macromolecule, so it's more
  210. common for macromolecules to have at least 2 subunits. The order of the
  211. dimensions does not have any significance other than determining the required
  212. order of the coordinates used to select macromolecules. Topologically, the
  213. "coordinates" in each dimension wrap. In the above [2, 6] case, the following
  214. coordinate pairs are "adjacent", in the sense that they differ by exactly one
  215. in exactly one coordinate. This adjacency is not relevant to the functional
  216. attributes of the macromolecule, but it's important to understand the topology
  217. in order to understand the subunit relations, which will be discussed later::
  218. * [x, 1] and [x, 2]
  219. * [x, 2] and [x, 3]
  220. * [x, 3] and [x, 4]
  221. * [x, 4] and [x, 5]
  222. * [x, 5] and [x, 6]
  223. * [x, 6] and [x, 1]
  224. * [1, y] and [2, y]
  225. Initial states
  226. --------------
  227. The initial states of the subunits are set via one or more
  228. ``SUBUNIT[c1, c2, ..., cN] = species`` statements::
  229. SUBUNIT[1:2, 1:6] = subunitU
  230. The array of 2x6 subunits need an initial state, consisting of a species and,
  231. for surface macromolecules only, an orientation, which is always measured
  232. relative to the orientation of the macromolecule itself. Note that, as with
  233. normal surface molecule placement, surface subunits may be given an orientation
  234. of 0, meaning that each subunit with an orientation of 0 will be randomly
  235. oriented with respect to the macromolecule itself (and with respect to each
  236. other). There will be more on orientation later, in case this isn't clear
  237. enough.
  238. The notation for setting initial states of subunits allows setting several
  239. subunits' initial states at once, as long as the region is a cartesian product
  240. of ranges. For an n-dimensional macromolecule, we need n coordinate ranges for
  241. each ``SUBUNIT[c1, c2, ..., cn] = species`` statement, and can have an
  242. arbitrary number of such statements, which are processed in the order they are
  243. seen in the file. This way, we can set them all to some default species (such
  244. as ``subunitU``), and then change only selected items::
  245. SUBUNIT[1:2, 1:6] = subunitU
  246. SUBUNIT[1:1, 2:4] = subunitB
  247. SUBUNIT[2, 1:2] = subunitB
  248. SUBUNIT[1:2, 6 ] = subunitB
  249. Each coordinate range is in the form ``low:high`` or just ``n`` which is
  250. equivalent to ``n:n``. The coordinate ranges are inclusive of both endpoints.
  251. So, the above example follows the following procedure:
  252. #. Set all 2x6 subunits to ``subunitU``
  253. #. Set [1, 2], [1, 3], and [1, 4] to ``subunitB``
  254. #. Set [2, 1], and [2, 2] to ``subunitB``
  255. #. Set [1, 6], and [2, 6] to ``subunitB``
  256. The end result of this is that [1, 5], and [2, 3:5] are initialized to
  257. ``subunitU`` and the rest are initialized to the bound state.
  258. Physical layout
  259. ---------------
  260. The physical layout is contained in a single ``SHAPE { }`` section::
  261. SHAPE {
  262. SUBUNIT[1, 1] = [-.10, .0000, .05]
  263. SUBUNIT[1, 2] = [-.05, .0866, .05]
  264. SUBUNIT[1, 3] = [ .05, .0866, .05]
  265. SUBUNIT[1, 4] = [ .10, .0000, .05]
  266. SUBUNIT[1, 5] = [ .05, -.0866, .05]
  267. SUBUNIT[1, 6] = [-.05, -.0866, .05]
  268. SUBUNIT[2, 1] = [-.10, .0000, -.05]
  269. SUBUNIT[2, 2] = [-.05, .0866, -.05]
  270. SUBUNIT[2, 3] = [ .05, .0866, -.05]
  271. SUBUNIT[2, 4] = [ .10, .0000, -.05]
  272. SUBUNIT[2, 5] = [ .05, -.0866, -.05]
  273. SUBUNIT[2, 6] = [-.05, -.0866, -.05]
  274. }
  275. Unlike in the initial states, the coordinates must be set for each subunit
  276. individually, and each subunit may be specified only once, though their
  277. specification may be in any order. MCell will yield an error if any
  278. coordinates are duplicated or omitted, or if any out-of-range coordinates are
  279. specified. The format here is fairly simple. Each subunit gets a vector which
  280. is its relative displacement from the *origin* of the macromolecule -- its
  281. location of placement. Note that these displacements are subject to various
  282. rotations. For a surface molecule, the displacements are 2-D displacements,
  283. ignoring the Z component, and the displacements are, after being randomly
  284. rotated around the surface normal, wrapped to the surface, akin to the wrapping
  285. that occurs for a 2-D diffusion step which crosses wall boundaries.
  286. Relationships
  287. -------------
  288. The relationships will require a little more explanation, though they are,
  289. syntactically fairly simple::
  290. SUBUNIT_RELATIONSHIPS {
  291. ring_negative = [ 0, -1]
  292. ring_positive = [ 0, +1]
  293. dimer_partner = [+1, 0]
  294. }
  295. This defines three relationships between subunits on the macromolecule. We
  296. only use one of these relationships in the example above (``dimer_partner``).
  297. Essentially, the relationships should describe "how to get to" any subunit from
  298. any other subunit to the degree that you need to reference the other subunit in
  299. rules or count statements. In the example above, the only molecule that can
  300. affect any given subunit (in regard to the reaction rates or counting) is the
  301. dimer partner. The other 10 molecules are irrelevant. Each relation defines
  302. an additive offset which is applied to a subunit's "coordinates" within the
  303. macromolecule to find the related subunit. Again, these coordinates wrap, so
  304. addition is done modulo the size of each dimension. For instance, for the
  305. subunit at [1, 4], ``ring_negative`` is [1, 3], ``ring_positive`` is [1, 5] and
  306. ``dimer_partner`` is [2, 4], whereas for [2, 6], ``ring_negative`` is [2, 5],
  307. ``ring_positive`` is [2, 1], and ``dimer_partner`` is [1, 6].
  308. A quick note about relationships: It *may* be beneficial to performance to keep
  309. the number of relationships as small as is consistent with the desired
  310. semantics. For this example model, it is possible I should remove
  311. ``ring_negative`` and ``ring_positive`` if performance is an issue. (I keep
  312. them in for didactic purposes and to increase the coverage of the testing.)
  313. The reason for this is that when the reference subunit changes state, all
  314. inverse-related molecules will have their unimolecular reaction times
  315. recomputed if they may undergo unimolecular reactions which have
  316. *complex rates*, whether or not the particular rates depend on each particular
  317. relation. So, for this example, when the molecule [1, 4] changes state, even
  318. though only [2, 4] could have a changed unimolecular rate, any of [2, 4],
  319. [1, 3], and [1, 5] may have their reaction rates recomputed if they can undergo
  320. unimolecular reactions. The performance impact of this has not been carefully
  321. studied. Numerically, it is valid, because the unimolecular events are
  322. Poisson.
  323. Rate rules
  324. ----------
  325. Rate rules are tables, not tied to any particular reaction, which allow
  326. specification of reaction rates based on the states of related subunits. Note
  327. as you read this that the rate rules do not mention the reference subunit. The
  328. reference subunit is only present in the reaction definition. This allows us
  329. to use the same reaction rate table for several different reactions. The
  330. reaction rate rules are converted into a table which is scanned one row at a
  331. time until a matching row is found. The implication is that the ordering of
  332. rules is critically important::
  333. RATE_RULES {
  334. binding {
  335. dimer_partner != subunitU : fw_rate * TMP_spec_F
  336. DEFAULT : fw_rate
  337. }
  338. unbinding {
  339. dimer_partner != subunitU : bw_rate * TMP_spec_B
  340. DEFAULT : bw_rate
  341. }
  342. /* Unused example of multiple clauses */
  343. triplet {
  344. ring_positive != subunitU &
  345. ring_negative != subunitU : 1e7
  346. DEFAULT : 1e6
  347. }
  348. }
  349. ``binding`` will look first at the ``dimer_partner`` of the reference subunit.
  350. If the partner is not in the ``subunit`` state, it will pick the first reaction
  351. rate, which is ``fw_rate * TMP_spec_F``. Otherwise, it will proceed to the
  352. next rule. ``DEFAULT`` always matches, so no rule after the ``DEFAULT`` rule
  353. can ever be matched. ``unbinding`` is similarly straightforward. ``triplet``
  354. demonstrates a rate rule which depends upon the states of multiple subunits at
  355. once, though this rule is never used.
  356. One minor twist is worth mentioning for oriented subunits. For ``==`` rules,
  357. the matching is straightforward. That is, each of:
  358. * ``relation == species,``
  359. * ``relation == species'``
  360. * ``relation == species;``
  361. will work as expected. ``!=`` will match if either the species or orientation
  362. does not match. That is, ``relation != species,`` will match if either the
  363. ``relation`` is not of species ``species``, or if the orientatation of
  364. ``relation`` is not negative. This is logical but easy to overlook. Thus, if
  365. the goal is to check only the orientation, it must be done in two steps:
  366. #. ``relation != species;`` (check if the species does not match)
  367. #. ``relation != species,`` (check if the orientation does not match)
  368. Reactions
  369. ---------
  370. Macromolecule reactions are just like any other MCell reactions except for the
  371. fact that exactly one reactant and exactly one product **must** be specified as
  372. subunits. This is done by surrounding the reactant or product (orientation and
  373. all) with parentheses::
  374. DEFINE_REACTIONS {
  375. (subunitU) + Lig <-> (subunitB) [> COMPLEX_RATE my_complex binding,
  376. < COMPLEX_RATE my_complex unbinding]
  377. }
  378. In the above, ``subunitU`` and ``subunitB`` are subunits. Furthermore, in a
  379. macromolecular reaction, the rate may be specified as in a normal reaction --
  380. either as a fixed rate or a time-varying tabular rate to be loaded from a file,
  381. but it may also be specified as a complex rate. Either or both of the forward
  382. and reverse rates may be specified as complex. The syntax for a complex rate
  383. specification is::
  384. COMPLEX_RATE <complex> <rate_table>
  385. where ``<complex>`` gives the name of the complex species, and ``<rate_table>``
  386. gives the name of the specific rate table within the complex.
  387. Counting
  388. --------
  389. Counting uses the familiar syntax from the rate rule tables, but each count
  390. statement stands on its own, and thus, the ordering effects which are possible
  391. with rate tables are not possible for counting. As with rate rules, each
  392. related subunit may appear at most once::
  393. REACTION_DATA_OUTPUT
  394. {
  395. OUTPUT_BUFFER_SIZE = 1000
  396. STEP = 1e-5
  397. HEADER = "# "
  398. {
  399. COUNT[subunitU, WORLD] : "us",
  400. COUNT[subunitB, WORLD] : "bs",
  401. COUNT[SUBUNIT{
  402. my_complex : subunitU [
  403. dimer_partner == subunitU
  404. ]}, WORLD] : "00",
  405. COUNT[SUBUNIT{
  406. my_complex : subunitU [
  407. dimer_partner != subunitU
  408. ]}, WORLD] : "01",
  409. COUNT[SUBUNIT{
  410. my_complex : subunitB [
  411. dimer_partner == subunitU
  412. ]}, WORLD] : "10",
  413. COUNT[SUBUNIT{
  414. my_complex : subunitB [
  415. dimer_partner != subunitU
  416. ]}, WORLD] : "11",
  417. COUNT[SUBUNIT{
  418. my_complex : subunitB [
  419. ring_negative != subunitU &
  420. ring_positive != subunitU
  421. ]}, WORLD] : "triple",
  422. COUNT[Lig, WORLD] : "Lig"
  423. } => countdir & "counts.dat"
  424. }
  425. The syntax of a macromolecular count is::
  426. COUNT[SUBUNIT{<complex> : <refsubunit> [<rules>]}, <location>]
  427. where:
  428. * ``<complex>`` is the name of the complex species to which this count
  429. applies [#f1]_
  430. * ``<refsubunit>`` is the molecular species for the reference
  431. subunit for this count
  432. * ``<rules>`` are a series of clauses, just as in the rate rules tables, which
  433. specify the required states of each related subunit.
  434. At least one rule must be specified if macromolecular counting is used [#f2]_.
  435. The macromolecular counts above (``00``, ``01``, ``10``, ``11``, and
  436. ``triple``) count, respectively:
  437. 00
  438. The number of unbound subunits whose dimer partner is unbound (i.e. twice
  439. the number of doubly-unbound dimer pairs).
  440. 01
  441. The number of unbound subunits whose dimer partner is bound
  442. 10
  443. The number of bound subunits whose dimer partner is unbound (== 01)
  444. 11
  445. The number of bound subunits whose dimer partner is bound (i.e. twice the
  446. number of doubly-bound dimer pairs).
  447. triple
  448. The number of bound subunits whose neighbors along the 6-ring are both
  449. bound.
  450. Surface molecules
  451. -----------------
  452. Beyond the syntax details listed above, there are a few details worth
  453. mentioning for surface molecules.
  454. #. Placement: Each macromolecule subunit will occupy its own tile, and the tile
  455. will be found by tracing a path along the surface, wrapping across edges
  456. just as surface diffusion does.
  457. Obviously, surface macromolecule placement may fail if the search radius is
  458. too small and the phyical layout of the macromolecule is not much larger
  459. than (or is smaller than) the size of a tile.
  460. #. Surface class: Macromolecules may not be placed on a surface via
  461. ``SURFACE_CLASS`` statements at present. There are some mildly confusing
  462. semantic issues to work through here.
  463. #. Orientation: Surface macromolecule orientation is relative to the surface
  464. upon which it is placed. Surface macromolecule subunit orientation is
  465. relative to the orientation of the macromolecule to which it belongs. Thus,
  466. when a surface macromolecule is placed, if it is placed with "negative"
  467. orientation, the orientations of all of its subunits *with respect to the
  468. surface* will be inverted. This may benefit from a little explanation.
  469. The release statement in the following code block will cause the placement
  470. of roughly 500 ``example'`` macromolecules, and roughly 500 ``example,``
  471. macromolecules upon the surface of ``world.box``. Each ``example'``
  472. macromolecule will have subunits ``[1:2, 1:3]`` oriented outward with
  473. respect to the surface, and ``[1:2, 4:6]`` oriented inward with respect to
  474. the surface. Each ``example,`` macromolecule will have exactly the opposite
  475. situation. The end result is that each macromolecule will have 6 outwards
  476. and 6 inwards subunits, and we will always have exactly 6*1000 subunits
  477. facing outwards and exactly 6*1000 facing inwards, even though the
  478. macromolecules themselves are randomly oriented with respect to the surface::
  479. DEFINE_COMPLEX_MOLECULE example {
  480. // ..
  481. SUBUNITS[1:2, 1:3] = subunitU'
  482. SUBUNITS[1:2, 4:6] = subunitU,
  483. // ..
  484. }
  485. INSTANTIATE world OBJECT {
  486. box BOX {
  487. CORNERS = [0, 0, 0], [0.5, 0.5, 0.5]
  488. }
  489. rs RELEASE_SITE {
  490. SHAPE = world.box[ALL]
  491. MOLECULE = example;
  492. NUMBER_TO_RELEASE = 1000
  493. }
  494. }
  495. .. rubric:: Footnotes
  496. .. [#f1] If more than one macromolecule type incorporates the same subunit
  497. species, the count will NOT include all of the subunits which belong
  498. to the other macromolecule species.
  499. .. [#f2] This restriction may be loosened in the future, if it seems
  500. worthwhile.