{"action":"created","comment":{"url":"https://api.github.com/repos/seqan/seqan3/pulls/comments/237373809","pull_request_review_id":179653173,"id":237373809,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzM3MzgwOQ==","diff_hunk":"@@ -249,6 +263,44 @@ class fm_index\n         // index.m_sigma = largest_char;\n     }\n \n+    //!\\overload\n+    void construct(text_t const & text)\n+        //!\\cond\n+        requires is_collection\n+        //!\\endcond\n+    {\n+        // text must not be empty\n+        if (text.begin() == text.end())\n+            throw std::invalid_argument(\"The text that is indexed cannot be empty.\");\n+        this->text = &text;\n+\n+        concatenated_sequences<value_type_t<text_t>> cvec{text};\n+        // size + 1: for the rank query we need to go one to the right: rank=#1 BEFORE (i.e. excluding) the position\n+        sdsl::bit_vector pos(cvec.concat_size()+1, 0);\n+        size_t prefix_sum{0};\n+        for (auto && x : cvec)\n+        {\n+            pos[prefix_sum] = 1;\n+            prefix_sum += x.size();\n+        }","path":"include/seqan3/search/fm_index/fm_index.hpp","position":65,"original_position":65,"commit_id":"13ba0cff4389268e3a888ac11c1f85528a04108e","original_commit_id":"13ba0cff4389268e3a888ac11c1f85528a04108e","user":{"login":"eseiler","id":12967715,"node_id":"MDQ6VXNlcjEyOTY3NzE1","avatar_url":"https://avatars0.githubusercontent.com/u/12967715?v=4","gravatar_id":"","url":"https://api.github.com/users/eseiler","html_url":"https://github.com/eseiler","followers_url":"https://api.github.com/users/eseiler/followers","following_url":"https://api.github.com/users/eseiler/following{/other_user}","gists_url":"https://api.github.com/users/eseiler/gists{/gist_id}","starred_url":"https://api.github.com/users/eseiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eseiler/subscriptions","organizations_url":"https://api.github.com/users/eseiler/orgs","repos_url":"https://api.github.com/users/eseiler/repos","events_url":"https://api.github.com/users/eseiler/events{/privacy}","received_events_url":"https://api.github.com/users/eseiler/received_events","type":"User","site_admin":false},"body":"Does it? In the docs, I only see `size` for the number of elements in the collection and `concat_size` for the cumulative sum.\r\nBut I need the individual sizes of the sequences.","created_at":"2018-11-29T07:15:06Z","updated_at":"2018-11-29T07:15:06Z","html_url":"https://github.com/seqan/seqan3/pull/594#discussion_r237373809","pull_request_url":"https://api.github.com/repos/seqan/seqan3/pulls/594","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/seqan/seqan3/pulls/comments/237373809"},"html":{"href":"https://github.com/seqan/seqan3/pull/594#discussion_r237373809"},"pull_request":{"href":"https://api.github.com/repos/seqan/seqan3/pulls/594"}},"in_reply_to_id":237250156},"pull_request":{"url":"https://api.github.com/repos/seqan/seqan3/pulls/594","id":234274913,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0Mjc0OTEz","html_url":"https://github.com/seqan/seqan3/pull/594","diff_url":"https://github.com/seqan/seqan3/pull/594.diff","patch_url":"https://github.com/seqan/seqan3/pull/594.patch","issue_url":"https://api.github.com/repos/seqan/seqan3/issues/594","number":594,"state":"open","locked":false,"title":"Index collections","user":{"login":"eseiler","id":12967715,"node_id":"MDQ6VXNlcjEyOTY3NzE1","avatar_url":"https://avatars0.githubusercontent.com/u/12967715?v=4","gravatar_id":"","url":"https://api.github.com/users/eseiler","html_url":"https://github.com/eseiler","followers_url":"https://api.github.com/users/eseiler/followers","following_url":"https://api.github.com/users/eseiler/following{/other_user}","gists_url":"https://api.github.com/users/eseiler/gists{/gist_id}","starred_url":"https://api.github.com/users/eseiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eseiler/subscriptions","organizations_url":"https://api.github.com/users/eseiler/orgs","repos_url":"https://api.github.com/users/eseiler/repos","events_url":"https://api.github.com/users/eseiler/events{/privacy}","received_events_url":"https://api.github.com/users/eseiler/received_events","type":"User","site_admin":false},"body":"WIP, but works for the FM index.\r\n\r\n- [ ] Tests\r\n- [ ] Docs\r\n- [X] FM\r\n- [ ] Bi-FM\r\n- [ ] Clean up code\r\n- [ ] Put debug stream for pairs into separate PR, just need it here for easier debugging\r\n\r\nOpen questions:\r\n\r\n```cpp\r\nint main()\r\n{\r\n    std::vector<std::vector<dna4>> vec { \"ACAGCGAGC\"_dna4, \"GTTTCGAT\"_dna4,\r\n                                         \"GCGATCGTAGCT\"_dna4, \"CACGCG\"_dna4};\r\n    fm_index index{vec};\r\n    auto it = index.begin();\r\n    it.extend_right(\"GCG\"_dna4);\r\n    debug_stream << it.query() << '\\n';\r\n    debug_stream << it.last_char() << '\\n';\r\n    for (auto && x : it.locate())\r\n        debug_stream << x.first << '\\t' << x.second << '\\n';\r\n}\r\n```\r\n\r\nWould print:\r\n```\r\nGCG    \r\nG\r\n0    3\r\n3    3\r\n2    0\r\n```\r\n\r\nWhich is all correct, but the <sequence_no, sequence_pos> pairs are not ordered by sequence_no since the order in the index does not correspond with the order of the texts in the collection.\r\n\r\nShould it be ordered?\r\n\r\n\r\nIn `lazy_locate()`:\r\n\r\n```cpp\r\nreturn ranges::view::iota(node.lb, node.lb + count())\r\n               | view::transform([*this, _offset = offset()] (auto sa_pos) { return _offset - index->index[sa_pos]; })\r\n               | view::filter([*this, _query_length = query_length()] (auto loc)\r\n               {\r\n                   return (index->text_begin_rs.rank(loc + 1) == index->text_begin_rs.rank(loc + _query_length));\r\n               })\r\n               | view::transform([*this] (auto loc)\r\n               {\r\n                   size_type sequence_rank = index->text_begin_rs.rank(loc + 1);\r\n                   size_type sequence_position = loc - index->text_begin_ss.select(sequence_rank);\r\n                   return std::make_pair(sequence_rank-1, sequence_position);\r\n               });\r\n```\r\n\r\nDo I need to copy the fm_index_iterator multiple times?\r\n\r\n```cpp\r\n| view::transform([*this, _offset = offset()] \r\n| view::filter([*this, _query_length = query_length()]\r\n| view::transform([*this] \r\n```","created_at":"2018-11-28T13:24:27Z","updated_at":"2018-11-29T07:15:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd069d123bbb83cab2bf9e5080b4ca4c48d54c13","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":568314043,"node_id":"MDU6TGFiZWw1NjgzMTQwNDM=","url":"https://api.github.com/repos/seqan/seqan3/labels/feature/proposal","name":"feature/proposal","color":"0e8a16","default":false},{"id":581690505,"node_id":"MDU6TGFiZWw1ODE2OTA1MDU=","url":"https://api.github.com/repos/seqan/seqan3/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":{"url":"https://api.github.com/repos/seqan/seqan3/milestones/12","html_url":"https://github.com/seqan/seqan3/milestone/12","labels_url":"https://api.github.com/repos/seqan/seqan3/milestones/12/labels","id":3833107,"node_id":"MDk6TWlsZXN0b25lMzgzMzEwNw==","number":12,"title":"December Sprint","description":"","creator":{"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},"open_issues":9,"closed_issues":1,"state":"open","created_at":"2018-11-19T22:30:55Z","updated_at":"2018-11-28T13:30:17Z","due_on":"2018-12-16T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/seqan/seqan3/pulls/594/commits","review_comments_url":"https://api.github.com/repos/seqan/seqan3/pulls/594/comments","review_comment_url":"https://api.github.com/repos/seqan/seqan3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/seqan/seqan3/issues/594/comments","statuses_url":"https://api.github.com/repos/seqan/seqan3/statuses/13ba0cff4389268e3a888ac11c1f85528a04108e","head":{"label":"eseiler:feature/index_collections","ref":"feature/index_collections","sha":"13ba0cff4389268e3a888ac11c1f85528a04108e","user":{"login":"eseiler","id":12967715,"node_id":"MDQ6VXNlcjEyOTY3NzE1","avatar_url":"https://avatars0.githubusercontent.com/u/12967715?v=4","gravatar_id":"","url":"https://api.github.com/users/eseiler","html_url":"https://github.com/eseiler","followers_url":"https://api.github.com/users/eseiler/followers","following_url":"https://api.github.com/users/eseiler/following{/other_user}","gists_url":"https://api.github.com/users/eseiler/gists{/gist_id}","starred_url":"https://api.github.com/users/eseiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eseiler/subscriptions","organizations_url":"https://api.github.com/users/eseiler/orgs","repos_url":"https://api.github.com/users/eseiler/repos","events_url":"https://api.github.com/users/eseiler/events{/privacy}","received_events_url":"https://api.github.com/users/eseiler/received_events","type":"User","site_admin":false},"repo":{"id":121257402,"node_id":"MDEwOlJlcG9zaXRvcnkxMjEyNTc0MDI=","name":"seqan3","full_name":"eseiler/seqan3","private":false,"owner":{"login":"eseiler","id":12967715,"node_id":"MDQ6VXNlcjEyOTY3NzE1","avatar_url":"https://avatars0.githubusercontent.com/u/12967715?v=4","gravatar_id":"","url":"https://api.github.com/users/eseiler","html_url":"https://github.com/eseiler","followers_url":"https://api.github.com/users/eseiler/followers","following_url":"https://api.github.com/users/eseiler/following{/other_user}","gists_url":"https://api.github.com/users/eseiler/gists{/gist_id}","starred_url":"https://api.github.com/users/eseiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eseiler/subscriptions","organizations_url":"https://api.github.com/users/eseiler/orgs","repos_url":"https://api.github.com/users/eseiler/repos","events_url":"https://api.github.com/users/eseiler/events{/privacy}","received_events_url":"https://api.github.com/users/eseiler/received_events","type":"User","site_admin":false},"html_url":"https://github.com/eseiler/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/eseiler/seqan3","forks_url":"https://api.github.com/repos/eseiler/seqan3/forks","keys_url":"https://api.github.com/repos/eseiler/seqan3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eseiler/seqan3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eseiler/seqan3/teams","hooks_url":"https://api.github.com/repos/eseiler/seqan3/hooks","issue_events_url":"https://api.github.com/repos/eseiler/seqan3/issues/events{/number}","events_url":"https://api.github.com/repos/eseiler/seqan3/events","assignees_url":"https://api.github.com/repos/eseiler/seqan3/assignees{/user}","branches_url":"https://api.github.com/repos/eseiler/seqan3/branches{/branch}","tags_url":"https://api.github.com/repos/eseiler/seqan3/tags","blobs_url":"https://api.github.com/repos/eseiler/seqan3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eseiler/seqan3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eseiler/seqan3/git/refs{/sha}","trees_url":"https://api.github.com/repos/eseiler/seqan3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eseiler/seqan3/statuses/{sha}","languages_url":"https://api.github.com/repos/eseiler/seqan3/languages","stargazers_url":"https://api.github.com/repos/eseiler/seqan3/stargazers","contributors_url":"https://api.github.com/repos/eseiler/seqan3/contributors","subscribers_url":"https://api.github.com/repos/eseiler/seqan3/subscribers","subscription_url":"https://api.github.com/repos/eseiler/seqan3/subscription","commits_url":"https://api.github.com/repos/eseiler/seqan3/commits{/sha}","git_commits_url":"https://api.github.com/repos/eseiler/seqan3/git/commits{/sha}","comments_url":"https://api.github.com/repos/eseiler/seqan3/comments{/number}","issue_comment_url":"https://api.github.com/repos/eseiler/seqan3/issues/comments{/number}","contents_url":"https://api.github.com/repos/eseiler/seqan3/contents/{+path}","compare_url":"https://api.github.com/repos/eseiler/seqan3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eseiler/seqan3/merges","archive_url":"https://api.github.com/repos/eseiler/seqan3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eseiler/seqan3/downloads","issues_url":"https://api.github.com/repos/eseiler/seqan3/issues{/number}","pulls_url":"https://api.github.com/repos/eseiler/seqan3/pulls{/number}","milestones_url":"https://api.github.com/repos/eseiler/seqan3/milestones{/number}","notifications_url":"https://api.github.com/repos/eseiler/seqan3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eseiler/seqan3/labels{/name}","releases_url":"https://api.github.com/repos/eseiler/seqan3/releases{/id}","deployments_url":"https://api.github.com/repos/eseiler/seqan3/deployments","created_at":"2018-02-12T14:35:33Z","updated_at":"2018-11-28T14:06:17Z","pushed_at":"2018-11-28T15:45:54Z","git_url":"git://github.com/eseiler/seqan3.git","ssh_url":"git@github.com:eseiler/seqan3.git","clone_url":"https://github.com/eseiler/seqan3.git","svn_url":"https://github.com/eseiler/seqan3","homepage":"http://www.seqan.de","size":2126,"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":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"seqan:master","ref":"master","sha":"01f1a9ef0dbe85b5402f722ac98f88879235a57f","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-11-27T22:26:25Z","pushed_at":"2018-11-28T19:53:12Z","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":2102,"stargazers_count":39,"watchers_count":39,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"archived":false,"open_issues_count":129,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":27,"open_issues":129,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/seqan/seqan3/pulls/594"},"html":{"href":"https://github.com/seqan/seqan3/pull/594"},"issue":{"href":"https://api.github.com/repos/seqan/seqan3/issues/594"},"comments":{"href":"https://api.github.com/repos/seqan/seqan3/issues/594/comments"},"review_comments":{"href":"https://api.github.com/repos/seqan/seqan3/pulls/594/comments"},"review_comment":{"href":"https://api.github.com/repos/seqan/seqan3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/seqan/seqan3/pulls/594/commits"},"statuses":{"href":"https://api.github.com/repos/seqan/seqan3/statuses/13ba0cff4389268e3a888ac11c1f85528a04108e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"eseiler"}}