{"action":"created","comment":{"url":"https://api.github.com/repos/seqan/seqan3/pulls/comments/219435681","pull_request_review_id":157609005,"id":219435681,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTQzNTY4MQ==","diff_hunk":"@@ -98,75 +99,148 @@ struct alignment_coordinate\n     size_t seq2_pos;\n };\n \n-/*!\\brief Compute the trace from a trace matrix\n+/*!\\brief Compute the begin coordinate.\n  * \\ingroup alignment_matrix\n- * \\tparam    database_t     The type of the database sequence.\n- * \\tparam    query_t        The type of the query sequence.\n  * \\tparam    trace_matrix_t The type of the trace matrix.\n- * \\param[in] database       The database sequence.\n- * \\param[in] query          The query sequence.\n  * \\param[in] matrix         The trace matrix.\n  * \\param[in] end_coordinate Where the trace in the matrix ends.\n  */\n+ template <typename trace_matrix_t>\n+ //!\\cond\n+     requires matrix_concept<remove_cvref_t<trace_matrix_t>> &&\n+              std::Same<typename remove_cvref_t<trace_matrix_t>::entry_type, trace_directions>\n+ //!\\endcond\n+inline alignment_coordinate\n+alignment_begin_coordinate(trace_matrix_t && matrix, alignment_coordinate const end_coordinate)\n+{\n+    using signed_size_t = std::make_signed_t<size_t>;\n+\n+    constexpr auto N = trace_directions::none;\n+    constexpr auto D = trace_directions::diagonal;\n+    constexpr auto L = trace_directions::left;\n+    constexpr auto U = trace_directions::up;\n+    signed_size_t row = end_coordinate.seq2_pos + 1;\n+    signed_size_t col = end_coordinate.seq1_pos + 1;\n+\n+    assert(row < matrix.rows());\n+    assert(col < matrix.cols());\n+\n+    while(true)\n+    {\n+        trace_directions dir = matrix.at(row, col);\n+        if ((dir & L) == L)\n+        {\n+            col = std::max<signed_size_t>(col - 1, 0);\n+        }\n+        else if ((dir & U) == U)\n+        {\n+            row = std::max<signed_size_t>(row - 1, 0);\n+        }\n+        else if ((dir & D) == D)\n+        {\n+            row = std::max<signed_size_t>(row - 1, 0);\n+            col = std::max<signed_size_t>(col - 1, 0);\n+        }\n+        else\n+        {\n+            if (row == 0 || col == 0)\n+                break;\n+            throw std::logic_error{\"Trace not found\"};\n+        }\n+    }\n+    return\n+    {\n+        std::max<signed_size_t>(col - 1, 0),\n+        std::max<signed_size_t>(row - 1, 0)\n+    };\n+}\n+\n+/*!\\brief Compute the trace from a trace matrix.\n+ * \\ingroup alignment_matrix\n+ * \\tparam    database_t                 The type of the database sequence.\n+ * \\tparam    query_t                    The type of the query sequence.\n+ * \\tparam    trace_matrix_t             The type of the trace matrix.\n+ * \\cond DEV\n+ * \\tparam    gapped_database_alphabet_t The alphabet type of the gapped database sequence.\n+ * \\tparam    gapped_query_alphabet_t    The alphabet type of the gapped query sequence.\n+ * \\endcond\n+ * \\param[in] database                   The database sequence.\n+ * \\param[in] query                      The query sequence.\n+ * \\param[in] matrix                     The trace matrix.\n+ * \\param[in] end_coordinate             Where the trace in the matrix ends.","path":"include/seqan3/alignment/matrix/alignment_trace_matrix.hpp","position":92,"original_position":92,"commit_id":"4e4bb5f452f5421ee610a2da244042d2a7115978","original_commit_id":"4e4bb5f452f5421ee610a2da244042d2a7115978","user":{"login":"rrahn","id":1529364,"node_id":"MDQ6VXNlcjE1MjkzNjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1529364?v=4","gravatar_id":"","url":"https://api.github.com/users/rrahn","html_url":"https://github.com/rrahn","followers_url":"https://api.github.com/users/rrahn/followers","following_url":"https://api.github.com/users/rrahn/following{/other_user}","gists_url":"https://api.github.com/users/rrahn/gists{/gist_id}","starred_url":"https://api.github.com/users/rrahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrahn/subscriptions","organizations_url":"https://api.github.com/users/rrahn/orgs","repos_url":"https://api.github.com/users/rrahn/repos","events_url":"https://api.github.com/users/rrahn/events{/privacy}","received_events_url":"https://api.github.com/users/rrahn/received_events","type":"User","site_admin":false},"body":"return parameter.","created_at":"2018-09-21T09:22:38Z","updated_at":"2018-09-21T09:29:41Z","html_url":"https://github.com/seqan/seqan3/pull/454#discussion_r219435681","pull_request_url":"https://api.github.com/repos/seqan/seqan3/pulls/454","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/seqan/seqan3/pulls/comments/219435681"},"html":{"href":"https://github.com/seqan/seqan3/pull/454#discussion_r219435681"},"pull_request":{"href":"https://api.github.com/repos/seqan/seqan3/pulls/454"}}},"pull_request":{"url":"https://api.github.com/repos/seqan/seqan3/pulls/454","id":216370168,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2MzcwMTY4","html_url":"https://github.com/seqan/seqan3/pull/454","diff_url":"https://github.com/seqan/seqan3/pull/454.diff","patch_url":"https://github.com/seqan/seqan3/pull/454.patch","issue_url":"https://api.github.com/repos/seqan/seqan3/issues/454","number":454,"state":"open","locked":false,"title":"edit_distance now computes begin position","user":{"login":"marehr","id":103778,"node_id":"MDQ6VXNlcjEwMzc3OA==","avatar_url":"https://avatars1.githubusercontent.com/u/103778?v=4","gravatar_id":"","url":"https://api.github.com/users/marehr","html_url":"https://github.com/marehr","followers_url":"https://api.github.com/users/marehr/followers","following_url":"https://api.github.com/users/marehr/following{/other_user}","gists_url":"https://api.github.com/users/marehr/gists{/gist_id}","starred_url":"https://api.github.com/users/marehr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marehr/subscriptions","organizations_url":"https://api.github.com/users/marehr/orgs","repos_url":"https://api.github.com/users/marehr/repos","events_url":"https://api.github.com/users/marehr/events{/privacy}","received_events_url":"https://api.github.com/users/marehr/received_events","type":"User","site_admin":false},"body":"Changes:\r\n* computes begin_position\r\n* `edit_distance{}(result_type)` supports now all `result_type` modes and properly sets the return values\r\n* `align_result` expects now the `alignment_coordinate` type\r\n* `alignment_trace` won't use `lists` anymore","created_at":"2018-09-18T16:30:21Z","updated_at":"2018-09-21T09:29:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7c3f9fbd1994b4dd0e933ccd77679fa33c85188","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/seqan/seqan3/pulls/454/commits","review_comments_url":"https://api.github.com/repos/seqan/seqan3/pulls/454/comments","review_comment_url":"https://api.github.com/repos/seqan/seqan3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/seqan/seqan3/issues/454/comments","statuses_url":"https://api.github.com/repos/seqan/seqan3/statuses/4e4bb5f452f5421ee610a2da244042d2a7115978","head":{"label":"marehr:edit_distance_begin_position","ref":"edit_distance_begin_position","sha":"4e4bb5f452f5421ee610a2da244042d2a7115978","user":{"login":"marehr","id":103778,"node_id":"MDQ6VXNlcjEwMzc3OA==","avatar_url":"https://avatars1.githubusercontent.com/u/103778?v=4","gravatar_id":"","url":"https://api.github.com/users/marehr","html_url":"https://github.com/marehr","followers_url":"https://api.github.com/users/marehr/followers","following_url":"https://api.github.com/users/marehr/following{/other_user}","gists_url":"https://api.github.com/users/marehr/gists{/gist_id}","starred_url":"https://api.github.com/users/marehr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marehr/subscriptions","organizations_url":"https://api.github.com/users/marehr/orgs","repos_url":"https://api.github.com/users/marehr/repos","events_url":"https://api.github.com/users/marehr/events{/privacy}","received_events_url":"https://api.github.com/users/marehr/received_events","type":"User","site_admin":false},"repo":{"id":85842097,"node_id":"MDEwOlJlcG9zaXRvcnk4NTg0MjA5Nw==","name":"seqan3","full_name":"marehr/seqan3","private":false,"owner":{"login":"marehr","id":103778,"node_id":"MDQ6VXNlcjEwMzc3OA==","avatar_url":"https://avatars1.githubusercontent.com/u/103778?v=4","gravatar_id":"","url":"https://api.github.com/users/marehr","html_url":"https://github.com/marehr","followers_url":"https://api.github.com/users/marehr/followers","following_url":"https://api.github.com/users/marehr/following{/other_user}","gists_url":"https://api.github.com/users/marehr/gists{/gist_id}","starred_url":"https://api.github.com/users/marehr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marehr/subscriptions","organizations_url":"https://api.github.com/users/marehr/orgs","repos_url":"https://api.github.com/users/marehr/repos","events_url":"https://api.github.com/users/marehr/events{/privacy}","received_events_url":"https://api.github.com/users/marehr/received_events","type":"User","site_admin":false},"html_url":"https://github.com/marehr/seqan3","description":"The modern C++ library for sequence analysis. Contains version 3 of the library and API docs.","fork":true,"url":"https://api.github.com/repos/marehr/seqan3","forks_url":"https://api.github.com/repos/marehr/seqan3/forks","keys_url":"https://api.github.com/repos/marehr/seqan3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marehr/seqan3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marehr/seqan3/teams","hooks_url":"https://api.github.com/repos/marehr/seqan3/hooks","issue_events_url":"https://api.github.com/repos/marehr/seqan3/issues/events{/number}","events_url":"https://api.github.com/repos/marehr/seqan3/events","assignees_url":"https://api.github.com/repos/marehr/seqan3/assignees{/user}","branches_url":"https://api.github.com/repos/marehr/seqan3/branches{/branch}","tags_url":"https://api.github.com/repos/marehr/seqan3/tags","blobs_url":"https://api.github.com/repos/marehr/seqan3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marehr/seqan3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marehr/seqan3/git/refs{/sha}","trees_url":"https://api.github.com/repos/marehr/seqan3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marehr/seqan3/statuses/{sha}","languages_url":"https://api.github.com/repos/marehr/seqan3/languages","stargazers_url":"https://api.github.com/repos/marehr/seqan3/stargazers","contributors_url":"https://api.github.com/repos/marehr/seqan3/contributors","subscribers_url":"https://api.github.com/repos/marehr/seqan3/subscribers","subscription_url":"https://api.github.com/repos/marehr/seqan3/subscription","commits_url":"https://api.github.com/repos/marehr/seqan3/commits{/sha}","git_commits_url":"https://api.github.com/repos/marehr/seqan3/git/commits{/sha}","comments_url":"https://api.github.com/repos/marehr/seqan3/comments{/number}","issue_comment_url":"https://api.github.com/repos/marehr/seqan3/issues/comments{/number}","contents_url":"https://api.github.com/repos/marehr/seqan3/contents/{+path}","compare_url":"https://api.github.com/repos/marehr/seqan3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marehr/seqan3/merges","archive_url":"https://api.github.com/repos/marehr/seqan3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marehr/seqan3/downloads","issues_url":"https://api.github.com/repos/marehr/seqan3/issues{/number}","pulls_url":"https://api.github.com/repos/marehr/seqan3/pulls{/number}","milestones_url":"https://api.github.com/repos/marehr/seqan3/milestones{/number}","notifications_url":"https://api.github.com/repos/marehr/seqan3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marehr/seqan3/labels{/name}","releases_url":"https://api.github.com/repos/marehr/seqan3/releases{/id}","deployments_url":"https://api.github.com/repos/marehr/seqan3/deployments","created_at":"2017-03-22T15:05:43Z","updated_at":"2018-08-29T12:18:56Z","pushed_at":"2018-09-21T08:06:24Z","git_url":"git://github.com/marehr/seqan3.git","ssh_url":"git@github.com:marehr/seqan3.git","clone_url":"https://github.com/marehr/seqan3.git","svn_url":"https://github.com/marehr/seqan3","homepage":"http://www.seqan.de","size":1963,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"seqan:master","ref":"master","sha":"41b42cc5d45c544a427ed079af957ad4366ea9e6","user":{"login":"seqan","id":1752144,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NTIxNDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1752144?v=4","gravatar_id":"","url":"https://api.github.com/users/seqan","html_url":"https://github.com/seqan","followers_url":"https://api.github.com/users/seqan/followers","following_url":"https://api.github.com/users/seqan/following{/other_user}","gists_url":"https://api.github.com/users/seqan/gists{/gist_id}","starred_url":"https://api.github.com/users/seqan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seqan/subscriptions","organizations_url":"https://api.github.com/users/seqan/orgs","repos_url":"https://api.github.com/users/seqan/repos","events_url":"https://api.github.com/users/seqan/events{/privacy}","received_events_url":"https://api.github.com/users/seqan/received_events","type":"Organization","site_admin":false},"repo":{"id":55410078,"node_id":"MDEwOlJlcG9zaXRvcnk1NTQxMDA3OA==","name":"seqan3","full_name":"seqan/seqan3","private":false,"owner":{"login":"seqan","id":1752144,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3NTIxNDQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1752144?v=4","gravatar_id":"","url":"https://api.github.com/users/seqan","html_url":"https://github.com/seqan","followers_url":"https://api.github.com/users/seqan/followers","following_url":"https://api.github.com/users/seqan/following{/other_user}","gists_url":"https://api.github.com/users/seqan/gists{/gist_id}","starred_url":"https://api.github.com/users/seqan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seqan/subscriptions","organizations_url":"https://api.github.com/users/seqan/orgs","repos_url":"https://api.github.com/users/seqan/repos","events_url":"https://api.github.com/users/seqan/events{/privacy}","received_events_url":"https://api.github.com/users/seqan/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/seqan/seqan3","description":"The modern C++ library for sequence analysis. Contains version 3 of the library and API docs.","fork":false,"url":"https://api.github.com/repos/seqan/seqan3","forks_url":"https://api.github.com/repos/seqan/seqan3/forks","keys_url":"https://api.github.com/repos/seqan/seqan3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seqan/seqan3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seqan/seqan3/teams","hooks_url":"https://api.github.com/repos/seqan/seqan3/hooks","issue_events_url":"https://api.github.com/repos/seqan/seqan3/issues/events{/number}","events_url":"https://api.github.com/repos/seqan/seqan3/events","assignees_url":"https://api.github.com/repos/seqan/seqan3/assignees{/user}","branches_url":"https://api.github.com/repos/seqan/seqan3/branches{/branch}","tags_url":"https://api.github.com/repos/seqan/seqan3/tags","blobs_url":"https://api.github.com/repos/seqan/seqan3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seqan/seqan3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seqan/seqan3/git/refs{/sha}","trees_url":"https://api.github.com/repos/seqan/seqan3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seqan/seqan3/statuses/{sha}","languages_url":"https://api.github.com/repos/seqan/seqan3/languages","stargazers_url":"https://api.github.com/repos/seqan/seqan3/stargazers","contributors_url":"https://api.github.com/repos/seqan/seqan3/contributors","subscribers_url":"https://api.github.com/repos/seqan/seqan3/subscribers","subscription_url":"https://api.github.com/repos/seqan/seqan3/subscription","commits_url":"https://api.github.com/repos/seqan/seqan3/commits{/sha}","git_commits_url":"https://api.github.com/repos/seqan/seqan3/git/commits{/sha}","comments_url":"https://api.github.com/repos/seqan/seqan3/comments{/number}","issue_comment_url":"https://api.github.com/repos/seqan/seqan3/issues/comments{/number}","contents_url":"https://api.github.com/repos/seqan/seqan3/contents/{+path}","compare_url":"https://api.github.com/repos/seqan/seqan3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seqan/seqan3/merges","archive_url":"https://api.github.com/repos/seqan/seqan3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seqan/seqan3/downloads","issues_url":"https://api.github.com/repos/seqan/seqan3/issues{/number}","pulls_url":"https://api.github.com/repos/seqan/seqan3/pulls{/number}","milestones_url":"https://api.github.com/repos/seqan/seqan3/milestones{/number}","notifications_url":"https://api.github.com/repos/seqan/seqan3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seqan/seqan3/labels{/name}","releases_url":"https://api.github.com/repos/seqan/seqan3/releases{/id}","deployments_url":"https://api.github.com/repos/seqan/seqan3/deployments","created_at":"2016-04-04T12:39:15Z","updated_at":"2018-09-21T08:58:23Z","pushed_at":"2018-09-21T08:58:38Z","git_url":"git://github.com/seqan/seqan3.git","ssh_url":"git@github.com:seqan/seqan3.git","clone_url":"https://github.com/seqan/seqan3.git","svn_url":"https://github.com/seqan/seqan3","homepage":"http://www.seqan.de","size":1853,"stargazers_count":32,"watchers_count":32,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"archived":false,"open_issues_count":121,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":25,"open_issues":121,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/seqan/seqan3/pulls/454"},"html":{"href":"https://github.com/seqan/seqan3/pull/454"},"issue":{"href":"https://api.github.com/repos/seqan/seqan3/issues/454"},"comments":{"href":"https://api.github.com/repos/seqan/seqan3/issues/454/comments"},"review_comments":{"href":"https://api.github.com/repos/seqan/seqan3/pulls/454/comments"},"review_comment":{"href":"https://api.github.com/repos/seqan/seqan3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/seqan/seqan3/pulls/454/commits"},"statuses":{"href":"https://api.github.com/repos/seqan/seqan3/statuses/4e4bb5f452f5421ee610a2da244042d2a7115978"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"rrahn"}}