{"action":"created","comment":{"url":"https://api.github.com/repos/ga4gh/schemas/pulls/comments/24434292","id":24434292,"diff_hunk":"@@ -1,22 +1,74 @@\n @namespace(\"org.ga4gh.models\")\n \n+/**\n+Defines types used by the GA4GH References API.\n+\n+References API servers may implement either or both of two modes: \"classic\", in\n+which all `Reference`s annotate simple linear strings, and \"graph\", in which\n+`Reference`s annotate sequences in sequence graphs. The \"graph\" mode is to be\n+prefered in new client and server implementations.\n+*/\n protocol References {\n \n+import idl \"common.avdl\";\n+\n /**\n A `Reference` is a canonical assembled contig, intended to act as a\n reference coordinate space for other genomic annotations. A single\n `Reference` might represent the human chromosome 1, for instance.\n+\n+An API server that supports the \"graph\" mode must always set the `segment`\n+field. An API server that supports the \"classic\" mode must always set the `id`\n+field. New client and server implementations should prefer the \"graph\" mode.\n+\n */\n record Reference {\n-  /** The reference ID. Unique within the repository. */\n-  string id;\n+\n+  /**\n+  The `Segment` describing this `Reference`'s sequence in the `ReferenceSet`'s\n+  sequence graph.\n+\n+  The `Segment` will generally cover the entirety of the sequence, but may be\n+  shorter if only a subrange of a sequence is to be included in the\n+  `ReferenceSet`.\n+\n+  The sequence ID of the `Segment` is equal to ID of the `Reference`. The\n+  actual sequence bases for a `Reference` are available through the\n+  `getSequence()` API call on this `Reference`'s sequence.\n+\n+  If the API server supports the \"graph\" mode, this field must not be null.\n+  */\n+  union { null, Segment } segment = null;\n+\n+  /**\n+  The reference ID. Unique within the repository. A sequence with this ID\n+  exists, containing the reference's bases. If null, `segment` must be set, and\n+  the sequence ID field from `segment` is used.\n+\n+  If the API server supports the \"classic\" mode, this field must not be null.\n+  */\n+  union { null, string } id = null;\n \n   /** The length of this reference's sequence. */\n   long length;\n \n   /**\n-  MD5 of the upper-case sequence excluding all whitespace characters\n-  (this is equivalent to SQ:M5 in SAM).\n+  The MD5 checksum uniquely representing this `Reference` and its position in\n+  the `ReferenceSet`'s sequence graph, as a lower-case hexadecimal string.\n+\n+  If `segment.startJoin` and `segment.endJoin` are both null, or `segment`\n+  itself is null, this is the MD5 of the upper-case sequence excluding all\n+  whitespace characters (this is equivalent to SQ:M5 in SAM).\n+\n+  Otherwise, this is the MD5 of the above MD5 checksum, `segment.startJoin`'s","path":"src/main/resources/avro/references.avdl","position":67,"original_position":67,"commit_id":"4737b0049c3ee6c0d80b046924d165a0ce45ba3c","original_commit_id":"4737b0049c3ee6c0d80b046924d165a0ce45ba3c","user":{"login":"adamnovak","id":5062495,"avatar_url":"https://avatars.githubusercontent.com/u/5062495?v=3","gravatar_id":"","url":"https://api.github.com/users/adamnovak","html_url":"https://github.com/adamnovak","followers_url":"https://api.github.com/users/adamnovak/followers","following_url":"https://api.github.com/users/adamnovak/following{/other_user}","gists_url":"https://api.github.com/users/adamnovak/gists{/gist_id}","starred_url":"https://api.github.com/users/adamnovak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamnovak/subscriptions","organizations_url":"https://api.github.com/users/adamnovak/orgs","repos_url":"https://api.github.com/users/adamnovak/repos","events_url":"https://api.github.com/users/adamnovak/events{/privacy}","received_events_url":"https://api.github.com/users/adamnovak/received_events","type":"User","site_admin":false},"body":"The next paragraph in the comment describes the MD5 of a `Position` (which is what `startJoin` and `endJoin` are) as the MD5 of the `md5checksum` of the `Reference` it is on, the position it is at, and the strand as \"+\" or \"-\".\r\n\r\nYou are right that there can't be circular dependencies. But it's also impossible to cause a recalculation by adding a new sequence. New sequences are only allowed to join onto existing sequences---existing sequences can't be made children of new sequences. So since a `Reference`'s `md5checksum` depends only on itself and its parents, adding new sequences won't change the `md5checksum`s of any existing `Reference`s.\r\n\r\nIf you did somehow go back and change the parent of some existing sequence, it and all its children, and all their children, and so on, would all need their `md5checksum`s recalculated.","created_at":"2015-02-10T18:03:26Z","updated_at":"2015-02-10T18:03:26Z","html_url":"https://github.com/ga4gh/schemas/pull/238#discussion_r24434292","pull_request_url":"https://api.github.com/repos/ga4gh/schemas/pulls/238","_links":{"self":{"href":"https://api.github.com/repos/ga4gh/schemas/pulls/comments/24434292"},"html":{"href":"https://github.com/ga4gh/schemas/pull/238#discussion_r24434292"},"pull_request":{"href":"https://api.github.com/repos/ga4gh/schemas/pulls/238"}}},"pull_request":{"url":"https://api.github.com/repos/ga4gh/schemas/pulls/238","id":28584284,"html_url":"https://github.com/ga4gh/schemas/pull/238","diff_url":"https://github.com/ga4gh/schemas/pull/238.diff","patch_url":"https://github.com/ga4gh/schemas/pull/238.patch","issue_url":"https://api.github.com/repos/ga4gh/schemas/issues/238","number":238,"state":"open","locked":false,"title":"Graph Support for GA4GH API","user":{"login":"adamnovak","id":5062495,"avatar_url":"https://avatars.githubusercontent.com/u/5062495?v=3","gravatar_id":"","url":"https://api.github.com/users/adamnovak","html_url":"https://github.com/adamnovak","followers_url":"https://api.github.com/users/adamnovak/followers","following_url":"https://api.github.com/users/adamnovak/following{/other_user}","gists_url":"https://api.github.com/users/adamnovak/gists{/gist_id}","starred_url":"https://api.github.com/users/adamnovak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamnovak/subscriptions","organizations_url":"https://api.github.com/users/adamnovak/orgs","repos_url":"https://api.github.com/users/adamnovak/repos","events_url":"https://api.github.com/users/adamnovak/events{/privacy}","received_events_url":"https://api.github.com/users/adamnovak/received_events","type":"User","site_admin":false},"body":"This PR adds graph support to the References, Reads, and Variant APIs in a backwards-compatible way.\r\n\r\n`common.avdl` is enhanced with `Segment` and `Path` types, as well as the notion of a sequence and a sequence graph, which is described at length at the top of the file.\r\n\r\n`Reference`s can now have associated `Segment`s, placing them in a sequence graph for the ReferenceSet.\r\n\r\nReads in the Reads API can now be aligned using `GraphAlignment`s as well as `LinearAlignment`s.\r\n\r\n`Variant`s in the Variants API can have `Allele`s defining their reference and alternate forms as paths in a sequence graph, and `Call`s can call copy numbers for individual `Allele`s as well as genotypes for `Variant`s.\r\n\r\nCloses #233 \r\n\r\n","created_at":"2015-02-03T20:08:30Z","updated_at":"2015-02-10T18:03:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7efc521a9f1211fc286099b0d51bf3a836d77ada","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ga4gh/schemas/pulls/238/commits","review_comments_url":"https://api.github.com/repos/ga4gh/schemas/pulls/238/comments","review_comment_url":"https://api.github.com/repos/ga4gh/schemas/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ga4gh/schemas/issues/238/comments","statuses_url":"https://api.github.com/repos/ga4gh/schemas/statuses/4737b0049c3ee6c0d80b046924d165a0ce45ba3c","head":{"label":"adamnovak:graphBackport","ref":"graphBackport","sha":"4737b0049c3ee6c0d80b046924d165a0ce45ba3c","user":{"login":"adamnovak","id":5062495,"avatar_url":"https://avatars.githubusercontent.com/u/5062495?v=3","gravatar_id":"","url":"https://api.github.com/users/adamnovak","html_url":"https://github.com/adamnovak","followers_url":"https://api.github.com/users/adamnovak/followers","following_url":"https://api.github.com/users/adamnovak/following{/other_user}","gists_url":"https://api.github.com/users/adamnovak/gists{/gist_id}","starred_url":"https://api.github.com/users/adamnovak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamnovak/subscriptions","organizations_url":"https://api.github.com/users/adamnovak/orgs","repos_url":"https://api.github.com/users/adamnovak/repos","events_url":"https://api.github.com/users/adamnovak/events{/privacy}","received_events_url":"https://api.github.com/users/adamnovak/received_events","type":"User","site_admin":false},"repo":{"id":19353046,"name":"schemas","full_name":"adamnovak/schemas","owner":{"login":"adamnovak","id":5062495,"avatar_url":"https://avatars.githubusercontent.com/u/5062495?v=3","gravatar_id":"","url":"https://api.github.com/users/adamnovak","html_url":"https://github.com/adamnovak","followers_url":"https://api.github.com/users/adamnovak/followers","following_url":"https://api.github.com/users/adamnovak/following{/other_user}","gists_url":"https://api.github.com/users/adamnovak/gists{/gist_id}","starred_url":"https://api.github.com/users/adamnovak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamnovak/subscriptions","organizations_url":"https://api.github.com/users/adamnovak/orgs","repos_url":"https://api.github.com/users/adamnovak/repos","events_url":"https://api.github.com/users/adamnovak/events{/privacy}","received_events_url":"https://api.github.com/users/adamnovak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adamnovak/schemas","description":"The Data Working Group concentrates on data representation, storage, and analysis, including working with platform development partners and industry leaders to develop standards that will facilitate interoperability.","fork":true,"url":"https://api.github.com/repos/adamnovak/schemas","forks_url":"https://api.github.com/repos/adamnovak/schemas/forks","keys_url":"https://api.github.com/repos/adamnovak/schemas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adamnovak/schemas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adamnovak/schemas/teams","hooks_url":"https://api.github.com/repos/adamnovak/schemas/hooks","issue_events_url":"https://api.github.com/repos/adamnovak/schemas/issues/events{/number}","events_url":"https://api.github.com/repos/adamnovak/schemas/events","assignees_url":"https://api.github.com/repos/adamnovak/schemas/assignees{/user}","branches_url":"https://api.github.com/repos/adamnovak/schemas/branches{/branch}","tags_url":"https://api.github.com/repos/adamnovak/schemas/tags","blobs_url":"https://api.github.com/repos/adamnovak/schemas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adamnovak/schemas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adamnovak/schemas/git/refs{/sha}","trees_url":"https://api.github.com/repos/adamnovak/schemas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adamnovak/schemas/statuses/{sha}","languages_url":"https://api.github.com/repos/adamnovak/schemas/languages","stargazers_url":"https://api.github.com/repos/adamnovak/schemas/stargazers","contributors_url":"https://api.github.com/repos/adamnovak/schemas/contributors","subscribers_url":"https://api.github.com/repos/adamnovak/schemas/subscribers","subscription_url":"https://api.github.com/repos/adamnovak/schemas/subscription","commits_url":"https://api.github.com/repos/adamnovak/schemas/commits{/sha}","git_commits_url":"https://api.github.com/repos/adamnovak/schemas/git/commits{/sha}","comments_url":"https://api.github.com/repos/adamnovak/schemas/comments{/number}","issue_comment_url":"https://api.github.com/repos/adamnovak/schemas/issues/comments/{number}","contents_url":"https://api.github.com/repos/adamnovak/schemas/contents/{+path}","compare_url":"https://api.github.com/repos/adamnovak/schemas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adamnovak/schemas/merges","archive_url":"https://api.github.com/repos/adamnovak/schemas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adamnovak/schemas/downloads","issues_url":"https://api.github.com/repos/adamnovak/schemas/issues{/number}","pulls_url":"https://api.github.com/repos/adamnovak/schemas/pulls{/number}","milestones_url":"https://api.github.com/repos/adamnovak/schemas/milestones{/number}","notifications_url":"https://api.github.com/repos/adamnovak/schemas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adamnovak/schemas/labels{/name}","releases_url":"https://api.github.com/repos/adamnovak/schemas/releases{/id}","created_at":"2014-05-01T18:09:26Z","updated_at":"2014-12-04T22:52:14Z","pushed_at":"2015-02-09T23:59:57Z","git_url":"git://github.com/adamnovak/schemas.git","ssh_url":"git@github.com:adamnovak/schemas.git","clone_url":"https://github.com/adamnovak/schemas.git","svn_url":"https://github.com/adamnovak/schemas","homepage":"","size":1079,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ga4gh:master","ref":"master","sha":"b010f064148f6bdd21bf7aefcd1622de65adbd09","user":{"login":"ga4gh","id":6921777,"avatar_url":"https://avatars.githubusercontent.com/u/6921777?v=3","gravatar_id":"","url":"https://api.github.com/users/ga4gh","html_url":"https://github.com/ga4gh","followers_url":"https://api.github.com/users/ga4gh/followers","following_url":"https://api.github.com/users/ga4gh/following{/other_user}","gists_url":"https://api.github.com/users/ga4gh/gists{/gist_id}","starred_url":"https://api.github.com/users/ga4gh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga4gh/subscriptions","organizations_url":"https://api.github.com/users/ga4gh/orgs","repos_url":"https://api.github.com/users/ga4gh/repos","events_url":"https://api.github.com/users/ga4gh/events{/privacy}","received_events_url":"https://api.github.com/users/ga4gh/received_events","type":"Organization","site_admin":false},"repo":{"id":17925227,"name":"schemas","full_name":"ga4gh/schemas","owner":{"login":"ga4gh","id":6921777,"avatar_url":"https://avatars.githubusercontent.com/u/6921777?v=3","gravatar_id":"","url":"https://api.github.com/users/ga4gh","html_url":"https://github.com/ga4gh","followers_url":"https://api.github.com/users/ga4gh/followers","following_url":"https://api.github.com/users/ga4gh/following{/other_user}","gists_url":"https://api.github.com/users/ga4gh/gists{/gist_id}","starred_url":"https://api.github.com/users/ga4gh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga4gh/subscriptions","organizations_url":"https://api.github.com/users/ga4gh/orgs","repos_url":"https://api.github.com/users/ga4gh/repos","events_url":"https://api.github.com/users/ga4gh/events{/privacy}","received_events_url":"https://api.github.com/users/ga4gh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ga4gh/schemas","description":"Work on data models and APIs for Genomic data.","fork":false,"url":"https://api.github.com/repos/ga4gh/schemas","forks_url":"https://api.github.com/repos/ga4gh/schemas/forks","keys_url":"https://api.github.com/repos/ga4gh/schemas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ga4gh/schemas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ga4gh/schemas/teams","hooks_url":"https://api.github.com/repos/ga4gh/schemas/hooks","issue_events_url":"https://api.github.com/repos/ga4gh/schemas/issues/events{/number}","events_url":"https://api.github.com/repos/ga4gh/schemas/events","assignees_url":"https://api.github.com/repos/ga4gh/schemas/assignees{/user}","branches_url":"https://api.github.com/repos/ga4gh/schemas/branches{/branch}","tags_url":"https://api.github.com/repos/ga4gh/schemas/tags","blobs_url":"https://api.github.com/repos/ga4gh/schemas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ga4gh/schemas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ga4gh/schemas/git/refs{/sha}","trees_url":"https://api.github.com/repos/ga4gh/schemas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ga4gh/schemas/statuses/{sha}","languages_url":"https://api.github.com/repos/ga4gh/schemas/languages","stargazers_url":"https://api.github.com/repos/ga4gh/schemas/stargazers","contributors_url":"https://api.github.com/repos/ga4gh/schemas/contributors","subscribers_url":"https://api.github.com/repos/ga4gh/schemas/subscribers","subscription_url":"https://api.github.com/repos/ga4gh/schemas/subscription","commits_url":"https://api.github.com/repos/ga4gh/schemas/commits{/sha}","git_commits_url":"https://api.github.com/repos/ga4gh/schemas/git/commits{/sha}","comments_url":"https://api.github.com/repos/ga4gh/schemas/comments{/number}","issue_comment_url":"https://api.github.com/repos/ga4gh/schemas/issues/comments/{number}","contents_url":"https://api.github.com/repos/ga4gh/schemas/contents/{+path}","compare_url":"https://api.github.com/repos/ga4gh/schemas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ga4gh/schemas/merges","archive_url":"https://api.github.com/repos/ga4gh/schemas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ga4gh/schemas/downloads","issues_url":"https://api.github.com/repos/ga4gh/schemas/issues{/number}","pulls_url":"https://api.github.com/repos/ga4gh/schemas/pulls{/number}","milestones_url":"https://api.github.com/repos/ga4gh/schemas/milestones{/number}","notifications_url":"https://api.github.com/repos/ga4gh/schemas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ga4gh/schemas/labels{/name}","releases_url":"https://api.github.com/repos/ga4gh/schemas/releases{/id}","created_at":"2014-03-20T00:13:40Z","updated_at":"2015-02-09T19:07:11Z","pushed_at":"2015-02-03T14:57:24Z","git_url":"git://github.com/ga4gh/schemas.git","ssh_url":"git@github.com:ga4gh/schemas.git","clone_url":"https://github.com/ga4gh/schemas.git","svn_url":"https://github.com/ga4gh/schemas","homepage":"http://ga4gh.org/#/api","size":2382,"stargazers_count":111,"watchers_count":111,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":54,"forks":47,"open_issues":54,"watchers":111,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ga4gh/schemas/pulls/238"},"html":{"href":"https://github.com/ga4gh/schemas/pull/238"},"issue":{"href":"https://api.github.com/repos/ga4gh/schemas/issues/238"},"comments":{"href":"https://api.github.com/repos/ga4gh/schemas/issues/238/comments"},"review_comments":{"href":"https://api.github.com/repos/ga4gh/schemas/pulls/238/comments"},"review_comment":{"href":"https://api.github.com/repos/ga4gh/schemas/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ga4gh/schemas/pulls/238/commits"},"statuses":{"href":"https://api.github.com/repos/ga4gh/schemas/statuses/4737b0049c3ee6c0d80b046924d165a0ce45ba3c"}}}}