{"action":"created","issue":{"url":"https://api.github.com/repos/SynBioDex/libSBOLj/issues/332","repository_url":"https://api.github.com/repos/SynBioDex/libSBOLj","labels_url":"https://api.github.com/repos/SynBioDex/libSBOLj/issues/332/labels{/name}","comments_url":"https://api.github.com/repos/SynBioDex/libSBOLj/issues/332/comments","events_url":"https://api.github.com/repos/SynBioDex/libSBOLj/issues/332/events","html_url":"https://github.com/SynBioDex/libSBOLj/issues/332","id":150709923,"number":332,"title":"Complemented join/order in GenBank conversion","user":{"login":"cjmyers","id":3507191,"avatar_url":"https://avatars.githubusercontent.com/u/3507191?v=3","gravatar_id":"","url":"https://api.github.com/users/cjmyers","html_url":"https://github.com/cjmyers","followers_url":"https://api.github.com/users/cjmyers/followers","following_url":"https://api.github.com/users/cjmyers/following{/other_user}","gists_url":"https://api.github.com/users/cjmyers/gists{/gist_id}","starred_url":"https://api.github.com/users/cjmyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjmyers/subscriptions","organizations_url":"https://api.github.com/users/cjmyers/orgs","repos_url":"https://api.github.com/users/cjmyers/repos","events_url":"https://api.github.com/users/cjmyers/events{/privacy}","received_events_url":"https://api.github.com/users/cjmyers/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SynBioDex/libSBOLj/labels/change","name":"change","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"cjmyers","id":3507191,"avatar_url":"https://avatars.githubusercontent.com/u/3507191?v=3","gravatar_id":"","url":"https://api.github.com/users/cjmyers","html_url":"https://github.com/cjmyers","followers_url":"https://api.github.com/users/cjmyers/followers","following_url":"https://api.github.com/users/cjmyers/following{/other_user}","gists_url":"https://api.github.com/users/cjmyers/gists{/gist_id}","starred_url":"https://api.github.com/users/cjmyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjmyers/subscriptions","organizations_url":"https://api.github.com/users/cjmyers/orgs","repos_url":"https://api.github.com/users/cjmyers/repos","events_url":"https://api.github.com/users/cjmyers/events{/privacy}","received_events_url":"https://api.github.com/users/cjmyers/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/SynBioDex/libSBOLj/milestones/3","html_url":"https://github.com/SynBioDex/libSBOLj/milestones/SBOL%202.1","labels_url":"https://api.github.com/repos/SynBioDex/libSBOLj/milestones/3/labels","id":1409072,"number":3,"title":"SBOL 2.1","description":"","creator":{"login":"cjmyers","id":3507191,"avatar_url":"https://avatars.githubusercontent.com/u/3507191?v=3","gravatar_id":"","url":"https://api.github.com/users/cjmyers","html_url":"https://github.com/cjmyers","followers_url":"https://api.github.com/users/cjmyers/followers","following_url":"https://api.github.com/users/cjmyers/following{/other_user}","gists_url":"https://api.github.com/users/cjmyers/gists{/gist_id}","starred_url":"https://api.github.com/users/cjmyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjmyers/subscriptions","organizations_url":"https://api.github.com/users/cjmyers/orgs","repos_url":"https://api.github.com/users/cjmyers/repos","events_url":"https://api.github.com/users/cjmyers/events{/privacy}","received_events_url":"https://api.github.com/users/cjmyers/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":61,"state":"open","created_at":"2015-11-12T19:22:12Z","updated_at":"2016-04-28T23:39:20Z","due_on":"2016-04-30T06:00:00Z","closed_at":null},"comments":1,"created_at":"2016-04-24T22:49:47Z","updated_at":"2016-04-29T19:12:20Z","closed_at":null,"body":"In the GenBank documentation (http://www.ddbj.nig.ac.jp/FT/full_index.html), it says the following:\r\n\r\nNote : location operator \"complement\" can be used in combination with either \"\r\njoin\" or \"order\" within the same location; combinations of \"join\" and \"order\" \r\nwithin the same location (nested operators) are illegal.\r\n\r\ncomplement(join(2691..4571,4918..5163))\r\n                          Joins regions 2691 to 4571 and 4918 to 5163, then \r\n                          complements the joined segments (the feature is on the \r\n                          strand complementary to the presented strand) \r\n\r\njoin(complement(4918..5163),complement(2691..4571))\r\n                          Complements regions 4918 to 5163 and 2691 to 4571, then \r\n                          joins the complemented segments (the feature is on the \r\n                          strand complementary to the presented strand)\r\n\r\nThe later one is not too difficult to support in SBOL 2.0, since we now allow a SequenceAnnotation (SA) to have a list of locations, and each location in this list is allowed to have its own orientation.  However, the former is tricky, since it is essentially saying that each range is “inline” but the set of ranges is “reverseComplement”.  We do not have an orientation field on an SA though.  One solution I can think of would be to add a level of hierarchy to complement the joined range.  For example, assume the feature is defined in “originalCompDef” and the id of the top-level CD is “foo”, \r\n\r\nCD foo\r\n\tComponent complement \r\n\t\tDefinition -> complementDef\r\n  \tSA complementSA\r\n\t\tcomponent -> complement\r\n\t\tGenericLocation \r\n\t\t\tOrientation -> reverseComplement\r\nCD complementDef\r\n\tComponent originalComp\r\n\t\tDefinition -> originalCompDef\r\n\tSA originalSA\r\n\t\tcomponent -> originalComp\r\n\t\tRange \r\n\t\t\tStart -> 2691\r\n\t\t\tEnd -> 4571\r\n\t\t\tOrientation -> inline\r\n\t\tRange\r\n\t\t\tStart -> 4918\r\n\t\t\tEnd -> 5163\r\n\t\t\tOrientation -> inline\r\n\r\nA simpler solution without hierarchy would be to simply add an annotation to the SA that indicates that the set of ranges should be complemented.  "},"comment":{"url":"https://api.github.com/repos/SynBioDex/libSBOLj/issues/comments/215851865","html_url":"https://github.com/SynBioDex/libSBOLj/issues/332#issuecomment-215851865","issue_url":"https://api.github.com/repos/SynBioDex/libSBOLj/issues/332","id":215851865,"user":{"login":"cjmyers","id":3507191,"avatar_url":"https://avatars.githubusercontent.com/u/3507191?v=3","gravatar_id":"","url":"https://api.github.com/users/cjmyers","html_url":"https://github.com/cjmyers","followers_url":"https://api.github.com/users/cjmyers/followers","following_url":"https://api.github.com/users/cjmyers/following{/other_user}","gists_url":"https://api.github.com/users/cjmyers/gists{/gist_id}","starred_url":"https://api.github.com/users/cjmyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjmyers/subscriptions","organizations_url":"https://api.github.com/users/cjmyers/orgs","repos_url":"https://api.github.com/users/cjmyers/repos","events_url":"https://api.github.com/users/cjmyers/events{/privacy}","received_events_url":"https://api.github.com/users/cjmyers/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T19:12:20Z","updated_at":"2016-04-29T19:12:20Z","body":"I’ve been trying to better understand the semantics of join in GenBank for our converter.  Jake pointed me to the following discussion:\r\n\r\nhttps://github.com/biopython/biopython/issues/570\r\n\r\nIn this discussion, there is the following statement:\r\n\r\nIf it helps, join(complement(A..B),complement(C..D)) is the same as complement(join(C..D,A..B))although the former is no longer widely used in the INSDC tables.\r\n\r\nThis sort of makes sense, but it puts a bit more semantics on join than our set of Locations.  Namely, there is an order to the elements in join.  For example, consider we get complement(join(C..D,A..B)) and swap it with join(complement(A..B),complement(C..D)), then this would convert to:\r\n\r\nSequenceAnnotation\r\n\tRange\r\n\t\tStart A\r\n\t\tEnd B\r\n\t\tOrientation reverseComplement\r\n\tRange\r\n\t\tStart C\r\n\t\tEnd D\r\n\t\tOrientation reverseComplement\r\n\r\nIf this is written back to GenBank, assuming that C < A, then this gets written out as:\r\n\r\n\tjoin(complement(C..D),complement(A..B))\r\n\r\nwhich is equivalent to:\r\n\r\n\tcomplement(join(A..B,C..D))\r\n\r\nThis is not the same as we started with.  The only solution I see is to add an custom GenBank annotation to each range that indicates the position that it appeared in the join (or order).  However, it opens the question if this is a shortcoming of our data model or not.  For now, I will take the custom annotation approach, but I just wanted to highlight this issue to see if anyone else had any opinions on this one.\r\n\r\nChris\r\n"}}