{"action":"created","comment":{"url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/comments/32410580","id":32410580,"diff_hunk":"@@ -171,20 +160,56 @@ namespace OpenMS\n     log_model_threshold_ = threshold;\n   }\n \n+  std::vector<Size> EnzymaticDigestion::tokenise(const AASequence& protein) const\n+  {\n+    String s = protein.toUnmodifiedString();\n+    boost::regex re(enzyme_.getRegEx());\n+    boost::sregex_token_iterator i(s.begin(), s.end(), re, -1);\n+    boost::sregex_token_iterator j;\n+    std::vector<Size> positions;\n+    Size pos = -1;\n+    while (i != j)\n+    {\n+      AASequence pep = AASequence::fromString((String)(*i++));\n+      pos += pep.size();\n+      positions.push_back(pos);\n+    }\n+    return positions;\n+  }\n+\n   bool EnzymaticDigestion::isCleavageSite_(\n-    const AASequence& protein, const AASequence::ConstIterator& iterator) const\n+    const AASequence& protein, const AASequence::ConstIterator& iterator, const std::vector<Size> positions) const\n   {\n-    switch (enzyme_)\n+    if (enzyme_.getRegEx() == \"()\") // no cleavage\n     {\n-    case ENZYME_TRYPSIN:\n-      if (use_log_model_)\n+      return false;\n+    }\n+    else\n+    {\n+      if (!use_log_model_)\n       {\n-        if (*iterator != 'R' && *iterator != 'K') // wait for R or K\n+        // naive digestion\n+        if (iterator != protein.end() - 1)\n+        {\n+          return std::find(positions.begin(), positions.end(), iterator - protein.begin()) != positions.end();\n+        }\n+        else\n+        {\n+          return enzyme_.getRegEx().hasSubstring(iterator->getOneLetterCode()) && *iterator != 'P';","path":"src/openms/source/CHEMISTRY/EnzymaticDigestion.cpp","position":111,"original_position":111,"commit_id":"2d528b7dab516d33a04ea7ff26d0e542fe9d8387","original_commit_id":"2d528b7dab516d33a04ea7ff26d0e542fe9d8387","user":{"login":"liangoaix","id":4321857,"avatar_url":"https://avatars.githubusercontent.com/u/4321857?v=3","gravatar_id":"","url":"https://api.github.com/users/liangoaix","html_url":"https://github.com/liangoaix","followers_url":"https://api.github.com/users/liangoaix/followers","following_url":"https://api.github.com/users/liangoaix/following{/other_user}","gists_url":"https://api.github.com/users/liangoaix/gists{/gist_id}","starred_url":"https://api.github.com/users/liangoaix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liangoaix/subscriptions","organizations_url":"https://api.github.com/users/liangoaix/orgs","repos_url":"https://api.github.com/users/liangoaix/repos","events_url":"https://api.github.com/users/liangoaix/events{/privacy}","received_events_url":"https://api.github.com/users/liangoaix/received_events","type":"User","site_admin":false},"body":"Yes, at least for determining if it's semi- or full cleavage","created_at":"2015-06-15T11:24:49Z","updated_at":"2015-06-15T11:24:49Z","html_url":"https://github.com/OpenMS/OpenMS/pull/1458#discussion_r32410580","pull_request_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1458","_links":{"self":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/comments/32410580"},"html":{"href":"https://github.com/OpenMS/OpenMS/pull/1458#discussion_r32410580"},"pull_request":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1458"}}},"pull_request":{"url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1458","id":37166446,"html_url":"https://github.com/OpenMS/OpenMS/pull/1458","diff_url":"https://github.com/OpenMS/OpenMS/pull/1458.diff","patch_url":"https://github.com/OpenMS/OpenMS/pull/1458.patch","issue_url":"https://api.github.com/repos/OpenMS/OpenMS/issues/1458","number":1458,"state":"open","locked":false,"title":"Fix #1411 EnzymaticDigestion support for new Enzyme / EnzymeDB class","user":{"login":"liangoaix","id":4321857,"avatar_url":"https://avatars.githubusercontent.com/u/4321857?v=3","gravatar_id":"","url":"https://api.github.com/users/liangoaix","html_url":"https://github.com/liangoaix","followers_url":"https://api.github.com/users/liangoaix/followers","following_url":"https://api.github.com/users/liangoaix/following{/other_user}","gists_url":"https://api.github.com/users/liangoaix/gists{/gist_id}","starred_url":"https://api.github.com/users/liangoaix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liangoaix/subscriptions","organizations_url":"https://api.github.com/users/liangoaix/orgs","repos_url":"https://api.github.com/users/liangoaix/repos","events_url":"https://api.github.com/users/liangoaix/events{/privacy}","received_events_url":"https://api.github.com/users/liangoaix/received_events","type":"User","site_admin":false},"body":"Let EnzymaticDigestion support  new Enzyme / EnzymeDB class. fix #1411 ","created_at":"2015-06-08T15:39:30Z","updated_at":"2015-06-15T11:24:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f6a3b88aa46463a49433fd564417fe3726b9d20","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1458/commits","review_comments_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1458/comments","review_comment_url":"https://api.github.com/repos/OpenMS/OpenMS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenMS/OpenMS/issues/1458/comments","statuses_url":"https://api.github.com/repos/OpenMS/OpenMS/statuses/2d528b7dab516d33a04ea7ff26d0e542fe9d8387","head":{"label":"liangoaix:fix1411","ref":"fix1411","sha":"2d528b7dab516d33a04ea7ff26d0e542fe9d8387","user":{"login":"liangoaix","id":4321857,"avatar_url":"https://avatars.githubusercontent.com/u/4321857?v=3","gravatar_id":"","url":"https://api.github.com/users/liangoaix","html_url":"https://github.com/liangoaix","followers_url":"https://api.github.com/users/liangoaix/followers","following_url":"https://api.github.com/users/liangoaix/following{/other_user}","gists_url":"https://api.github.com/users/liangoaix/gists{/gist_id}","starred_url":"https://api.github.com/users/liangoaix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liangoaix/subscriptions","organizations_url":"https://api.github.com/users/liangoaix/orgs","repos_url":"https://api.github.com/users/liangoaix/repos","events_url":"https://api.github.com/users/liangoaix/events{/privacy}","received_events_url":"https://api.github.com/users/liangoaix/received_events","type":"User","site_admin":false},"repo":{"id":17285984,"name":"OpenMS","full_name":"liangoaix/OpenMS","owner":{"login":"liangoaix","id":4321857,"avatar_url":"https://avatars.githubusercontent.com/u/4321857?v=3","gravatar_id":"","url":"https://api.github.com/users/liangoaix","html_url":"https://github.com/liangoaix","followers_url":"https://api.github.com/users/liangoaix/followers","following_url":"https://api.github.com/users/liangoaix/following{/other_user}","gists_url":"https://api.github.com/users/liangoaix/gists{/gist_id}","starred_url":"https://api.github.com/users/liangoaix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liangoaix/subscriptions","organizations_url":"https://api.github.com/users/liangoaix/orgs","repos_url":"https://api.github.com/users/liangoaix/repos","events_url":"https://api.github.com/users/liangoaix/events{/privacy}","received_events_url":"https://api.github.com/users/liangoaix/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/liangoaix/OpenMS","description":"The codebase of the OpenMS project","fork":true,"url":"https://api.github.com/repos/liangoaix/OpenMS","forks_url":"https://api.github.com/repos/liangoaix/OpenMS/forks","keys_url":"https://api.github.com/repos/liangoaix/OpenMS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liangoaix/OpenMS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liangoaix/OpenMS/teams","hooks_url":"https://api.github.com/repos/liangoaix/OpenMS/hooks","issue_events_url":"https://api.github.com/repos/liangoaix/OpenMS/issues/events{/number}","events_url":"https://api.github.com/repos/liangoaix/OpenMS/events","assignees_url":"https://api.github.com/repos/liangoaix/OpenMS/assignees{/user}","branches_url":"https://api.github.com/repos/liangoaix/OpenMS/branches{/branch}","tags_url":"https://api.github.com/repos/liangoaix/OpenMS/tags","blobs_url":"https://api.github.com/repos/liangoaix/OpenMS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liangoaix/OpenMS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liangoaix/OpenMS/git/refs{/sha}","trees_url":"https://api.github.com/repos/liangoaix/OpenMS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liangoaix/OpenMS/statuses/{sha}","languages_url":"https://api.github.com/repos/liangoaix/OpenMS/languages","stargazers_url":"https://api.github.com/repos/liangoaix/OpenMS/stargazers","contributors_url":"https://api.github.com/repos/liangoaix/OpenMS/contributors","subscribers_url":"https://api.github.com/repos/liangoaix/OpenMS/subscribers","subscription_url":"https://api.github.com/repos/liangoaix/OpenMS/subscription","commits_url":"https://api.github.com/repos/liangoaix/OpenMS/commits{/sha}","git_commits_url":"https://api.github.com/repos/liangoaix/OpenMS/git/commits{/sha}","comments_url":"https://api.github.com/repos/liangoaix/OpenMS/comments{/number}","issue_comment_url":"https://api.github.com/repos/liangoaix/OpenMS/issues/comments{/number}","contents_url":"https://api.github.com/repos/liangoaix/OpenMS/contents/{+path}","compare_url":"https://api.github.com/repos/liangoaix/OpenMS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liangoaix/OpenMS/merges","archive_url":"https://api.github.com/repos/liangoaix/OpenMS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liangoaix/OpenMS/downloads","issues_url":"https://api.github.com/repos/liangoaix/OpenMS/issues{/number}","pulls_url":"https://api.github.com/repos/liangoaix/OpenMS/pulls{/number}","milestones_url":"https://api.github.com/repos/liangoaix/OpenMS/milestones{/number}","notifications_url":"https://api.github.com/repos/liangoaix/OpenMS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liangoaix/OpenMS/labels{/name}","releases_url":"https://api.github.com/repos/liangoaix/OpenMS/releases{/id}","created_at":"2014-02-28T12:50:29Z","updated_at":"2014-07-20T14:14:08Z","pushed_at":"2015-06-11T03:01:42Z","git_url":"git://github.com/liangoaix/OpenMS.git","ssh_url":"git@github.com:liangoaix/OpenMS.git","clone_url":"https://github.com/liangoaix/OpenMS.git","svn_url":"https://github.com/liangoaix/OpenMS","homepage":null,"size":204983,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"develop"}},"base":{"label":"OpenMS:develop","ref":"develop","sha":"22f7d296219a9a3bbda1941f110afdb0f5f5c9df","user":{"login":"OpenMS","id":5994841,"avatar_url":"https://avatars.githubusercontent.com/u/5994841?v=3","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://avatars.githubusercontent.com/u/5994841?v=3","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}","created_at":"2014-01-09T10:15:13Z","updated_at":"2015-05-28T07:14:21Z","pushed_at":"2015-06-14T12:59:59Z","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":null,"size":226738,"stargazers_count":29,"watchers_count":29,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":322,"forks":41,"open_issues":322,"watchers":29,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1458"},"html":{"href":"https://github.com/OpenMS/OpenMS/pull/1458"},"issue":{"href":"https://api.github.com/repos/OpenMS/OpenMS/issues/1458"},"comments":{"href":"https://api.github.com/repos/OpenMS/OpenMS/issues/1458/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1458/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenMS/OpenMS/pulls/1458/commits"},"statuses":{"href":"https://api.github.com/repos/OpenMS/OpenMS/statuses/2d528b7dab516d33a04ea7ff26d0e542fe9d8387"}}}}