{"action":"created","issue":{"url":"https://api.github.com/repos/SynBioDex/SEPs/issues/6","repository_url":"https://api.github.com/repos/SynBioDex/SEPs","labels_url":"https://api.github.com/repos/SynBioDex/SEPs/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/SynBioDex/SEPs/issues/6/comments","events_url":"https://api.github.com/repos/SynBioDex/SEPs/issues/6/events","html_url":"https://github.com/SynBioDex/SEPs/issues/6","id":133280940,"number":6,"title":"SEP 006 -- Length locations","user":{"login":"drdozer","id":583516,"avatar_url":"https://avatars.githubusercontent.com/u/583516?v=3","gravatar_id":"","url":"https://api.github.com/users/drdozer","html_url":"https://github.com/drdozer","followers_url":"https://api.github.com/users/drdozer/followers","following_url":"https://api.github.com/users/drdozer/following{/other_user}","gists_url":"https://api.github.com/users/drdozer/gists{/gist_id}","starred_url":"https://api.github.com/users/drdozer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drdozer/subscriptions","organizations_url":"https://api.github.com/users/drdozer/orgs","repos_url":"https://api.github.com/users/drdozer/repos","events_url":"https://api.github.com/users/drdozer/events{/privacy}","received_events_url":"https://api.github.com/users/drdozer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SynBioDex/SEPs/labels/Draft","name":"Draft","color":"fbca04"},{"url":"https://api.github.com/repos/SynBioDex/SEPs/labels/Type:%20Data%20Model","name":"Type: Data Model","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2016-02-12T16:18:05Z","updated_at":"2016-03-12T14:22:16Z","closed_at":null,"body":"SEP | 006\r\n------------ | -------------\r\nTitle | Length Locations\r\nAuthors | Matthew Pocock (turingatemyhamster@gmail.com)\r\nType | Data model\r\nStatus | Draft\r\nCreated | 12-Feb-2016\r\nCreated | 12-Feb-2016\r\n\r\n# Abstract\r\n\r\nThis document defines Length locations, intended for use in iterative refinement of constraint-based designs.\r\n\r\n# Rationale\r\n\r\nThe current SBOL `Location` data model contains a number of classes to represent locations within stranded and unstranded biopolymers. This includes regions defined by a beginning and ending index into the biopolymer. During constraint-based iterative design, it is sometimes known what length a region will have but not what the beginning and ending indexes will be. In these situations it would be useful to be able to capture this length within the `ComponentDefinition`.\r\n\r\nAn example use-case would be in the design of a primer. It may be required to be 22 nt in length, and to be placed somewhere within a particular 50nt target region. The location of the target region can be specified as `Range`. The placement of the primer within the target region can be captured as a constraint. But currently there's no simple way to specify the primer length.\r\n\r\n# Possible Implementations\r\n\r\nThere are two relatively low impact ways to address this need by modifying the locations class hierarchy.\r\n\r\n## Introduce a Length location class\r\n\r\n```scala\r\ncase class Length(len: Int) extends Location\r\n```\r\n\r\n```java\r\npublic class Length extends Location {\r\n  private int len;\r\n  public Length(int len) { this.len = len }\r\n  public int getLength() { return len }\r\n  public void setLength(int len) { this.len = len }\r\n}\r\n```\r\n\r\nIf a `SequenceAnnotation` has associated `Range`s, the length should be consistent with these. In the case of one range, the length should correspond to `end - start + 1`. In the case of multiple ranges, it is not clear how to uniquely define the length.\r\n\r\n## Modify the Range location type to include a length\r\n\r\n``` scala\r\ncase class Range(\r\n    start: Optional[Int],\r\n    end: Optional[Int],\r\n    length: Optional[Int],\r\n    orientation: Optional[Orientation])\r\n```\r\n\r\nThe range class is modified to include an optional length field. The start and end fields are also made optional. At least one of start, end, length or orientation must be specified.\r\n\r\nThis allows `GenericLocation` to be retired, as it is the same as a `Range` with only the orientation field set.\r\n\r\nThe `start`, `end` and `length` fields, if specified, must conform to the constraint `length = end - start + 1`. If any two are specified, the third can be inferred using this relation, but there is no requirement to 'fill in' missing values that were not specified by the data author.\r\n\r\n# Discussion\r\n\r\nThe first option to introduce a Length class is the quickest to implement. However, the alternative to extend `Range` seems to have less ambiguity about what the length actually refers to (the length of that region), and allow the unification of a number of different corner cases in the current data model (including `GenericComponent`).\r\n\r\nIt is technically possible to simulate a length constraint by associating a `SequenceAnnotation` with a `Component` that points to a `ComponentDefinition` with an associated `Sequence` with a known length. However, this involves inventing a whole chain of instances, purely to specify a length. "},"comment":{"url":"https://api.github.com/repos/SynBioDex/SEPs/issues/comments/195749695","html_url":"https://github.com/SynBioDex/SEPs/issues/6#issuecomment-195749695","issue_url":"https://api.github.com/repos/SynBioDex/SEPs/issues/6","id":195749695,"user":{"login":"drdozer","id":583516,"avatar_url":"https://avatars.githubusercontent.com/u/583516?v=3","gravatar_id":"","url":"https://api.github.com/users/drdozer","html_url":"https://github.com/drdozer","followers_url":"https://api.github.com/users/drdozer/followers","following_url":"https://api.github.com/users/drdozer/following{/other_user}","gists_url":"https://api.github.com/users/drdozer/gists{/gist_id}","starred_url":"https://api.github.com/users/drdozer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drdozer/subscriptions","organizations_url":"https://api.github.com/users/drdozer/orgs","repos_url":"https://api.github.com/users/drdozer/repos","events_url":"https://api.github.com/users/drdozer/events{/privacy}","received_events_url":"https://api.github.com/users/drdozer/received_events","type":"User","site_admin":false},"created_at":"2016-03-12T14:22:16Z","updated_at":"2016-03-12T14:22:16Z","body":"@jakebeal  do I edit the top comment directly? Or is there some procedure where it lives in GIT with a log of commits?"}}