{"action":"created","comment":{"url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/comments/188559453","pull_request_review_id":120559811,"id":188559453,"diff_hunk":"@@ -677,8 +692,162 @@ namespace OpenMS\n       return EXECUTION_OK;\n     }\n \n-protected:\n-    struct PeptideProteinMatchInformation\n+ protected:\n+     using DecoyStringToAffixCount = std::map<std::string, std::pair<int, int>>;\n+     using CaseInsensitiveToCaseSensitiveDecoy = std::map<std::string, std::string>;\n+\n+     template<typename T>\n+     bool findDecoyString_(FASTAContainer<T>& proteins,\n+                                std::string& decoy_string,\n+                                bool& is_prefix)\n+     {\n+       // Common decoy strings in fasta files\n+       // Note: decoy prefixes/suffices must be provided in lower case and must only contain alphanumeric characters\n+        DecoyStringToAffixCount decoy_count = {{\"decoy\", {0,0}}, {\"reverse\", {0,0}},\n+                                                          {\"rev\", {0,0}}, {\"dev\", {0,0}},\n+                                                          {\"iddecoy\", {0,0}}, {\"xxx\", {0,0}},\n+                                                          {\"shuffled\", {0,0}}, {\"shuffle\", {0,0}},\n+                                                          {\"pseudo\", {0,0}}, {\"random\", {0, 0}}};\n+       // Map case insensitive strings back to original case (as used in fasta)\n+       CaseInsensitiveToCaseSensitiveDecoy decoy_case_sensitive;\n+\n+       // Setup regex vector, sort descending\n+       std::vector<std::string> prefix_regex;\n+       for (const auto& pair : decoy_count)\n+       {\n+         prefix_regex.push_back(pair.first);\n+       }\n+       std::sort(prefix_regex.rbegin(), prefix_regex.rend());\n+\n+       // Setup regex string -> create prefix- and suffix pattern to match to\n+       std::string regexstr_prefix = \"^(\";","path":"src/openms/include/OpenMS/ANALYSIS/ID/PeptideIndexing.h","position":81,"original_position":81,"commit_id":"80db78004168441eb35949b466fb3d6448f21dbc","original_commit_id":"80db78004168441eb35949b466fb3d6448f21dbc","user":{"login":"Zethson","id":21954664,"avatar_url":"https://avatars3.githubusercontent.com/u/21954664?v=4","gravatar_id":"","url":"https://api.github.com/users/Zethson","html_url":"https://github.com/Zethson","followers_url":"https://api.github.com/users/Zethson/followers","following_url":"https://api.github.com/users/Zethson/following{/other_user}","gists_url":"https://api.github.com/users/Zethson/gists{/gist_id}","starred_url":"https://api.github.com/users/Zethson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zethson/subscriptions","organizations_url":"https://api.github.com/users/Zethson/orgs","repos_url":"https://api.github.com/users/Zethson/repos","events_url":"https://api.github.com/users/Zethson/events{/privacy}","received_events_url":"https://api.github.com/users/Zethson/received_events","type":"User","site_admin":false},"body":"That's pretty!","created_at":"2018-05-16T09:26:47Z","updated_at":"2018-05-16T09:26:47Z","html_url":"https://github.com/OpenMS/OpenMS/pull/3454#discussion_r188559453","pull_request_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/3454","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/comments/188559453"},"html":{"href":"https://github.com/OpenMS/OpenMS/pull/3454#discussion_r188559453"},"pull_request":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/3454"}},"in_reply_to_id":188555026},"pull_request":{"url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/3454","id":187663819,"html_url":"https://github.com/OpenMS/OpenMS/pull/3454","diff_url":"https://github.com/OpenMS/OpenMS/pull/3454.diff","patch_url":"https://github.com/OpenMS/OpenMS/pull/3454.patch","issue_url":"https://api.github.com/repos/OpenMS/OpenMS/issues/3454","number":3454,"state":"open","locked":false,"title":"[FEATURE]/ PeptideIndexer auto mode for decoy string + position","user":{"login":"Zethson","id":21954664,"avatar_url":"https://avatars3.githubusercontent.com/u/21954664?v=4","gravatar_id":"","url":"https://api.github.com/users/Zethson","html_url":"https://github.com/Zethson","followers_url":"https://api.github.com/users/Zethson/followers","following_url":"https://api.github.com/users/Zethson/following{/other_user}","gists_url":"https://api.github.com/users/Zethson/gists{/gist_id}","starred_url":"https://api.github.com/users/Zethson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zethson/subscriptions","organizations_url":"https://api.github.com/users/Zethson/orgs","repos_url":"https://api.github.com/users/Zethson/repos","events_url":"https://api.github.com/users/Zethson/events{/privacy}","received_events_url":"https://api.github.com/users/Zethson/received_events","type":"User","site_admin":false},"body":"Hey,\r\n\r\nthis PR introduces an automode for the PeptideIndexer. When no decoy string and/or prefix/suffix string is provided, then the decoy string + position will now be automatically determined. \r\n\r\nWe scan the identifiers for a preset of decoy strings and increase each occurence.\r\nIf the occurence of a decoy string is >80% we'll use it as the decoy string, if it occured less than 100% we display a warning. \r\nFurthermore we determine whether the decoy string is prefix/suffix and set it accordingly. \r\n\r\nUp for discussion:\r\nIf you know any additional commonly or rarely used decoy strings, please tell me about them. I'll then happily add them.","created_at":"2018-05-13T10:56:11Z","updated_at":"2018-05-16T09:26:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c129fee468b116b2e68fc49f77e90d578a1f400","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/3454/commits","review_comments_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/3454/comments","review_comment_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenMS/OpenMS/issues/3454/comments","statuses_url":"https://api.github.com/repos/OpenMS/OpenMS/statuses/80db78004168441eb35949b466fb3d6448f21dbc","head":{"label":"Zethson:feature/decoy_automation","ref":"feature/decoy_automation","sha":"80db78004168441eb35949b466fb3d6448f21dbc","user":{"login":"Zethson","id":21954664,"avatar_url":"https://avatars3.githubusercontent.com/u/21954664?v=4","gravatar_id":"","url":"https://api.github.com/users/Zethson","html_url":"https://github.com/Zethson","followers_url":"https://api.github.com/users/Zethson/followers","following_url":"https://api.github.com/users/Zethson/following{/other_user}","gists_url":"https://api.github.com/users/Zethson/gists{/gist_id}","starred_url":"https://api.github.com/users/Zethson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zethson/subscriptions","organizations_url":"https://api.github.com/users/Zethson/orgs","repos_url":"https://api.github.com/users/Zethson/repos","events_url":"https://api.github.com/users/Zethson/events{/privacy}","received_events_url":"https://api.github.com/users/Zethson/received_events","type":"User","site_admin":false},"repo":{"id":130198885,"name":"OpenMS","full_name":"Zethson/OpenMS","owner":{"login":"Zethson","id":21954664,"avatar_url":"https://avatars3.githubusercontent.com/u/21954664?v=4","gravatar_id":"","url":"https://api.github.com/users/Zethson","html_url":"https://github.com/Zethson","followers_url":"https://api.github.com/users/Zethson/followers","following_url":"https://api.github.com/users/Zethson/following{/other_user}","gists_url":"https://api.github.com/users/Zethson/gists{/gist_id}","starred_url":"https://api.github.com/users/Zethson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zethson/subscriptions","organizations_url":"https://api.github.com/users/Zethson/orgs","repos_url":"https://api.github.com/users/Zethson/repos","events_url":"https://api.github.com/users/Zethson/events{/privacy}","received_events_url":"https://api.github.com/users/Zethson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Zethson/OpenMS","description":"The codebase of the OpenMS project","fork":true,"url":"https://api.github.com/repos/Zethson/OpenMS","forks_url":"https://api.github.com/repos/Zethson/OpenMS/forks","keys_url":"https://api.github.com/repos/Zethson/OpenMS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zethson/OpenMS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zethson/OpenMS/teams","hooks_url":"https://api.github.com/repos/Zethson/OpenMS/hooks","issue_events_url":"https://api.github.com/repos/Zethson/OpenMS/issues/events{/number}","events_url":"https://api.github.com/repos/Zethson/OpenMS/events","assignees_url":"https://api.github.com/repos/Zethson/OpenMS/assignees{/user}","branches_url":"https://api.github.com/repos/Zethson/OpenMS/branches{/branch}","tags_url":"https://api.github.com/repos/Zethson/OpenMS/tags","blobs_url":"https://api.github.com/repos/Zethson/OpenMS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zethson/OpenMS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zethson/OpenMS/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zethson/OpenMS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zethson/OpenMS/statuses/{sha}","languages_url":"https://api.github.com/repos/Zethson/OpenMS/languages","stargazers_url":"https://api.github.com/repos/Zethson/OpenMS/stargazers","contributors_url":"https://api.github.com/repos/Zethson/OpenMS/contributors","subscribers_url":"https://api.github.com/repos/Zethson/OpenMS/subscribers","subscription_url":"https://api.github.com/repos/Zethson/OpenMS/subscription","commits_url":"https://api.github.com/repos/Zethson/OpenMS/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zethson/OpenMS/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zethson/OpenMS/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zethson/OpenMS/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zethson/OpenMS/contents/{+path}","compare_url":"https://api.github.com/repos/Zethson/OpenMS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zethson/OpenMS/merges","archive_url":"https://api.github.com/repos/Zethson/OpenMS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zethson/OpenMS/downloads","issues_url":"https://api.github.com/repos/Zethson/OpenMS/issues{/number}","pulls_url":"https://api.github.com/repos/Zethson/OpenMS/pulls{/number}","milestones_url":"https://api.github.com/repos/Zethson/OpenMS/milestones{/number}","notifications_url":"https://api.github.com/repos/Zethson/OpenMS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zethson/OpenMS/labels{/name}","releases_url":"https://api.github.com/repos/Zethson/OpenMS/releases{/id}","deployments_url":"https://api.github.com/repos/Zethson/OpenMS/deployments","created_at":"2018-04-19T10:25:03Z","updated_at":"2018-04-26T09:24:42Z","pushed_at":"2018-05-16T09:04:08Z","git_url":"git://github.com/Zethson/OpenMS.git","ssh_url":"git@github.com:Zethson/OpenMS.git","clone_url":"https://github.com/Zethson/OpenMS.git","svn_url":"https://github.com/Zethson/OpenMS","homepage":"https://www.openms.de","size":289912,"stargazers_count":1,"watchers_count":1,"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},"forks":0,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"OpenMS:develop","ref":"develop","sha":"39d55d78388a687c6a330826758e1c802027a13a","user":{"login":"OpenMS","id":5994841,"avatar_url":"https://avatars3.githubusercontent.com/u/5994841?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenMS","html_url":"https://github.com/OpenMS","followers_url":"https://api.github.com/users/OpenMS/followers","following_url":"https://api.github.com/users/OpenMS/following{/other_user}","gists_url":"https://api.github.com/users/OpenMS/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenMS/subscriptions","organizations_url":"https://api.github.com/users/OpenMS/orgs","repos_url":"https://api.github.com/users/OpenMS/repos","events_url":"https://api.github.com/users/OpenMS/events{/privacy}","received_events_url":"https://api.github.com/users/OpenMS/received_events","type":"Organization","site_admin":false},"repo":{"id":15763403,"name":"OpenMS","full_name":"OpenMS/OpenMS","owner":{"login":"OpenMS","id":5994841,"avatar_url":"https://avatars3.githubusercontent.com/u/5994841?v=4","gravatar_id":"","url":"https://api.github.com/users/OpenMS","html_url":"https://github.com/OpenMS","followers_url":"https://api.github.com/users/OpenMS/followers","following_url":"https://api.github.com/users/OpenMS/following{/other_user}","gists_url":"https://api.github.com/users/OpenMS/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenMS/subscriptions","organizations_url":"https://api.github.com/users/OpenMS/orgs","repos_url":"https://api.github.com/users/OpenMS/repos","events_url":"https://api.github.com/users/OpenMS/events{/privacy}","received_events_url":"https://api.github.com/users/OpenMS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenMS/OpenMS","description":"The codebase of the OpenMS project","fork":false,"url":"https://api.github.com/repos/OpenMS/OpenMS","forks_url":"https://api.github.com/repos/OpenMS/OpenMS/forks","keys_url":"https://api.github.com/repos/OpenMS/OpenMS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenMS/OpenMS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenMS/OpenMS/teams","hooks_url":"https://api.github.com/repos/OpenMS/OpenMS/hooks","issue_events_url":"https://api.github.com/repos/OpenMS/OpenMS/issues/events{/number}","events_url":"https://api.github.com/repos/OpenMS/OpenMS/events","assignees_url":"https://api.github.com/repos/OpenMS/OpenMS/assignees{/user}","branches_url":"https://api.github.com/repos/OpenMS/OpenMS/branches{/branch}","tags_url":"https://api.github.com/repos/OpenMS/OpenMS/tags","blobs_url":"https://api.github.com/repos/OpenMS/OpenMS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenMS/OpenMS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenMS/OpenMS/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenMS/OpenMS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenMS/OpenMS/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenMS/OpenMS/languages","stargazers_url":"https://api.github.com/repos/OpenMS/OpenMS/stargazers","contributors_url":"https://api.github.com/repos/OpenMS/OpenMS/contributors","subscribers_url":"https://api.github.com/repos/OpenMS/OpenMS/subscribers","subscription_url":"https://api.github.com/repos/OpenMS/OpenMS/subscription","commits_url":"https://api.github.com/repos/OpenMS/OpenMS/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenMS/OpenMS/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenMS/OpenMS/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenMS/OpenMS/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenMS/OpenMS/contents/{+path}","compare_url":"https://api.github.com/repos/OpenMS/OpenMS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenMS/OpenMS/merges","archive_url":"https://api.github.com/repos/OpenMS/OpenMS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenMS/OpenMS/downloads","issues_url":"https://api.github.com/repos/OpenMS/OpenMS/issues{/number}","pulls_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenMS/OpenMS/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenMS/OpenMS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenMS/OpenMS/labels{/name}","releases_url":"https://api.github.com/repos/OpenMS/OpenMS/releases{/id}","deployments_url":"https://api.github.com/repos/OpenMS/OpenMS/deployments","created_at":"2014-01-09T10:15:13Z","updated_at":"2018-05-16T05:37:38Z","pushed_at":"2018-05-16T09:04:09Z","git_url":"git://github.com/OpenMS/OpenMS.git","ssh_url":"git@github.com:OpenMS/OpenMS.git","clone_url":"https://github.com/OpenMS/OpenMS.git","svn_url":"https://github.com/OpenMS/OpenMS","homepage":"https://www.openms.de","size":289920,"stargazers_count":117,"watchers_count":117,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":121,"mirror_url":null,"archived":false,"open_issues_count":540,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":121,"open_issues":540,"watchers":117,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/3454"},"html":{"href":"https://github.com/OpenMS/OpenMS/pull/3454"},"issue":{"href":"https://api.github.com/repos/OpenMS/OpenMS/issues/3454"},"comments":{"href":"https://api.github.com/repos/OpenMS/OpenMS/issues/3454/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/3454/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/3454/commits"},"statuses":{"href":"https://api.github.com/repos/OpenMS/OpenMS/statuses/80db78004168441eb35949b466fb3d6448f21dbc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Zethson"}}