{"action":"created","comment":{"url":"https://api.github.com/repos/seqan/seqan/pulls/comments/36658252","id":36658252,"diff_hunk":"@@ -483,474 +483,240 @@ void processN(TSeqs& seqs, TIds& ids, TSeqs& seqsRev, TIds& idsRev, TMulti& mult\n }\n \n \n-template<typename TSeqs, typename TIds> //Version for single end data\n-void preTrim(TSeqs& seqs, TIds& ids, unsigned head, unsigned tail, unsigned min, GeneralStats& stats)\n+template<typename TSeqs, typename TIds>\n+void _preTrimRemove(const std::vector<TSeqs*> &seqsVector, const std::vector<TIds*> &idsVector, StringSet<bool> const& rem, DemultiplexingParams& demultiplexParams, GeneralStats& stats)\n {\n-    int i = 0;\n-    int limit = length(seqs);\n-    StringSet<bool> rem;\n-\n-    resize(rem, limit);\n-    if (head > 0 && tail > 0)\n-    {\n-        SEQAN_OMP_PRAGMA(parallel for default(shared) private(i) schedule(static))\n-        for (i = 0; i < limit; ++i)\n-        {\n-            if (length(seqs[i]) > (head + tail))\n-            {\n-                erase(seqs[i], 0, head);\n-                erase(seqs[i], length(seqs[i]) - tail, length(seqs[i]));\n-                if (length(seqs[i]) >= min)\n-                {\n-                    rem[i] = false;\n-                }\n-                else\n-                {\n-                    rem[i] = true;\n-                }\n-            }\n-            else\n-            {\n-                rem[i] = true;\n-            }\n-        }\n-    }\n-    else if (head > 0)\n-    {\n-        SEQAN_OMP_PRAGMA(parallel for default(shared) private(i) schedule(static))\n-        for (i = 0; i < limit; ++i)\n-        {\n-           if (length(seqs[i]) > head)\n-            {\n-                erase(seqs[i], 0, head);\n-                if (length(seqs[i]) >= min)\n-                {\n-                    rem[i] = false;\n-                }\n-                else\n-                {\n-                    rem[i] = true;\n-                }\n-            }\n-            else\n-            {\n-                rem[i] = true;\n-            }\n-        }\n-    }\n-    else if (tail > 0)\n-    {\n-        SEQAN_OMP_PRAGMA(parallel for default(shared) private(i) schedule(static))\n-        for (i = 0; i < limit; ++i)\n-        {\n-            if (length(seqs[i]) > tail)\n-            {\n-                erase(seqs[i], length(seqs[i]) - tail, length(seqs[i]));\n-                if (length(seqs[i]) >= min)\n-                {\n-                    rem[i] = false;\n-                }\n-                else\n-                {\n-                    rem[i] = true;\n-                }\n-            }\n-            else\n-            {\n-                rem[i] = true;\n-            }\n-        }\n-    }\n-    else\n-    {\n-        SEQAN_OMP_PRAGMA(parallel for default(shared) private(i) schedule(static))\n-        for (i = 0; i < limit; ++i)\n-        {\n-            if (length(seqs[i]) >= min)\n-            {\n-                rem[i] = false;\n-            }\n-            else\n-            {\n-                rem[i] = true;\n-            }\n-        }\n-    }\n-    unsigned  ex = 0;\n-    for (int j = length(rem) - 1; j >= 0; --j)\n-    {\n-        if (rem[j])\n-        {\n-            swap(seqs[j], seqs[limit - ex - 1]);\n-            swap(ids[j], ids[limit - ex - 1]);\n-            ++ex;\n-        }\n-    }\n-    if (ex != 0)\n-    {\n-        resize(seqs, limit - ex);\n-        resize(ids, limit - ex);\n-        stats.removedSeqsShort += ex;\n-    }\n+\tassert(!seqsVector.empty() && !idsVector.empty());\n+\tassert(seqsVector.size() == idsVector.size());\n+\tunsigned ex = 0;\n+\tunsigned limit = length(**seqsVector.begin());\n+\tbool demultiplex = (length(demultiplexParams.multiplexFile) > 0);\n+\tfor (int j = limit - 1; j >= 0; j--)\n+\t{\n+\t\tif (rem[j])","path":"apps/seqan_flexbar/general_processing.h","position":122,"original_position":122,"commit_id":"da0d687b9e489856e10397dae2885e45afa57b85","original_commit_id":"678fe9fde5a7f76758be7874ca1817f4d4159255","user":{"login":"catkira","id":13425558,"avatar_url":"https://avatars.githubusercontent.com/u/13425558?v=3","gravatar_id":"","url":"https://api.github.com/users/catkira","html_url":"https://github.com/catkira","followers_url":"https://api.github.com/users/catkira/followers","following_url":"https://api.github.com/users/catkira/following{/other_user}","gists_url":"https://api.github.com/users/catkira/gists{/gist_id}","starred_url":"https://api.github.com/users/catkira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catkira/subscriptions","organizations_url":"https://api.github.com/users/catkira/orgs","repos_url":"https://api.github.com/users/catkira/repos","events_url":"https://api.github.com/users/catkira/events{/privacy}","received_events_url":"https://api.github.com/users/catkira/received_events","type":"User","site_admin":false},"body":"It does what this code did before:\r\n-    unsigned ex = 0;\r\n-    for (int j = length(rem) - 1; j >= 0; --j)\r\n-    {\r\n-        if (rem[j])\r\n-        {\r\n-            swap(seqs[j], seqs[limit - ex - 1]);\r\n-            swap(seqsRev[j], seqsRev[limit - ex - 1]);\r\n-            swap(ids[j], ids[limit - ex - 1]);\r\n-            swap(idsRev[j], idsRev[limit - ex - 1]);\r\n-            ++ex;\r\n-        }\r\n-    }\r\n-    if (ex != 0)\r\n-    {\r\n-        resize(seqs, limit - ex);\r\n-        resize(seqsRev, limit - ex);\r\n-        resize(ids, limit - ex);\r\n-        resize(idsRev, limit - ex);\r\n-        stats.removedSeqsShort += (2 * ex);\r\n-    }","created_at":"2015-08-10T17:23:14Z","updated_at":"2015-08-10T17:23:14Z","html_url":"https://github.com/seqan/seqan/pull/1079#discussion_r36658252","pull_request_url":"https://api.github.com/repos/seqan/seqan/pulls/1079","_links":{"self":{"href":"https://api.github.com/repos/seqan/seqan/pulls/comments/36658252"},"html":{"href":"https://github.com/seqan/seqan/pull/1079#discussion_r36658252"},"pull_request":{"href":"https://api.github.com/repos/seqan/seqan/pulls/1079"}}},"pull_request":{"url":"https://api.github.com/repos/seqan/seqan/pulls/1079","id":41936925,"html_url":"https://github.com/seqan/seqan/pull/1079","diff_url":"https://github.com/seqan/seqan/pull/1079.diff","patch_url":"https://github.com/seqan/seqan/pull/1079.patch","issue_url":"https://api.github.com/repos/seqan/seqan/issues/1079","number":1079,"state":"open","locked":false,"title":"[FEATURE] added -tn switch to process chip-nexus random barcodes. The…","user":{"login":"catkira","id":13425558,"avatar_url":"https://avatars.githubusercontent.com/u/13425558?v=3","gravatar_id":"","url":"https://api.github.com/users/catkira","html_url":"https://github.com/catkira","followers_url":"https://api.github.com/users/catkira/followers","following_url":"https://api.github.com/users/catkira/following{/other_user}","gists_url":"https://api.github.com/users/catkira/gists{/gist_id}","starred_url":"https://api.github.com/users/catkira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catkira/subscriptions","organizations_url":"https://api.github.com/users/catkira/orgs","repos_url":"https://api.github.com/users/catkira/repos","events_url":"https://api.github.com/users/catkira/events{/privacy}","received_events_url":"https://api.github.com/users/catkira/received_events","type":"User","site_admin":false},"body":"… n bases barcodes at the 5` end will be removed and stored in the fasta id for further processing.\r\n\r\n[CLEANUP] removed some redundant code, its still not perfect but should be maintanable now. Speed optimization is not so important here, since the main bottleneck is the zlib write routine.\r\n\r\nIdea: adding a multithreaded zlib outputstream to seqan would also benefit many other projects","created_at":"2015-08-07T21:54:06Z","updated_at":"2015-08-10T17:23:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bff9173781923545bf0b5cf50e872de3a428c246","assignee":{"login":"esiragusa","id":172085,"avatar_url":"https://avatars.githubusercontent.com/u/172085?v=3","gravatar_id":"","url":"https://api.github.com/users/esiragusa","html_url":"https://github.com/esiragusa","followers_url":"https://api.github.com/users/esiragusa/followers","following_url":"https://api.github.com/users/esiragusa/following{/other_user}","gists_url":"https://api.github.com/users/esiragusa/gists{/gist_id}","starred_url":"https://api.github.com/users/esiragusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esiragusa/subscriptions","organizations_url":"https://api.github.com/users/esiragusa/orgs","repos_url":"https://api.github.com/users/esiragusa/repos","events_url":"https://api.github.com/users/esiragusa/events{/privacy}","received_events_url":"https://api.github.com/users/esiragusa/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/seqan/seqan/milestones/4","html_url":"https://github.com/seqan/seqan/milestones/Release%202.1.0","labels_url":"https://api.github.com/repos/seqan/seqan/milestones/4/labels","id":813426,"number":4,"title":"Release 2.1.0","description":"Released after 2.0.0 and includes smaller work packages that can be done in a few months after 2.0.0 but not for the 2.0.0 release itself.","creator":{"login":"holtgrewe","id":521780,"avatar_url":"https://avatars.githubusercontent.com/u/521780?v=3","gravatar_id":"","url":"https://api.github.com/users/holtgrewe","html_url":"https://github.com/holtgrewe","followers_url":"https://api.github.com/users/holtgrewe/followers","following_url":"https://api.github.com/users/holtgrewe/following{/other_user}","gists_url":"https://api.github.com/users/holtgrewe/gists{/gist_id}","starred_url":"https://api.github.com/users/holtgrewe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holtgrewe/subscriptions","organizations_url":"https://api.github.com/users/holtgrewe/orgs","repos_url":"https://api.github.com/users/holtgrewe/repos","events_url":"https://api.github.com/users/holtgrewe/events{/privacy}","received_events_url":"https://api.github.com/users/holtgrewe/received_events","type":"User","site_admin":false},"open_issues":71,"closed_issues":39,"state":"open","created_at":"2014-10-04T10:12:56Z","updated_at":"2015-08-10T15:30:47Z","due_on":"2015-07-30T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/seqan/seqan/pulls/1079/commits","review_comments_url":"https://api.github.com/repos/seqan/seqan/pulls/1079/comments","review_comment_url":"https://api.github.com/repos/seqan/seqan/pulls/comments{/number}","comments_url":"https://api.github.com/repos/seqan/seqan/issues/1079/comments","statuses_url":"https://api.github.com/repos/seqan/seqan/statuses/da0d687b9e489856e10397dae2885e45afa57b85","head":{"label":"catkira:develop","ref":"develop","sha":"da0d687b9e489856e10397dae2885e45afa57b85","user":{"login":"catkira","id":13425558,"avatar_url":"https://avatars.githubusercontent.com/u/13425558?v=3","gravatar_id":"","url":"https://api.github.com/users/catkira","html_url":"https://github.com/catkira","followers_url":"https://api.github.com/users/catkira/followers","following_url":"https://api.github.com/users/catkira/following{/other_user}","gists_url":"https://api.github.com/users/catkira/gists{/gist_id}","starred_url":"https://api.github.com/users/catkira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catkira/subscriptions","organizations_url":"https://api.github.com/users/catkira/orgs","repos_url":"https://api.github.com/users/catkira/repos","events_url":"https://api.github.com/users/catkira/events{/privacy}","received_events_url":"https://api.github.com/users/catkira/received_events","type":"User","site_admin":false},"repo":{"id":39412238,"name":"seqan","full_name":"catkira/seqan","owner":{"login":"catkira","id":13425558,"avatar_url":"https://avatars.githubusercontent.com/u/13425558?v=3","gravatar_id":"","url":"https://api.github.com/users/catkira","html_url":"https://github.com/catkira","followers_url":"https://api.github.com/users/catkira/followers","following_url":"https://api.github.com/users/catkira/following{/other_user}","gists_url":"https://api.github.com/users/catkira/gists{/gist_id}","starred_url":"https://api.github.com/users/catkira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catkira/subscriptions","organizations_url":"https://api.github.com/users/catkira/orgs","repos_url":"https://api.github.com/users/catkira/repos","events_url":"https://api.github.com/users/catkira/events{/privacy}","received_events_url":"https://api.github.com/users/catkira/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/catkira/seqan","description":"Personal Seqan Clone","fork":true,"url":"https://api.github.com/repos/catkira/seqan","forks_url":"https://api.github.com/repos/catkira/seqan/forks","keys_url":"https://api.github.com/repos/catkira/seqan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/catkira/seqan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/catkira/seqan/teams","hooks_url":"https://api.github.com/repos/catkira/seqan/hooks","issue_events_url":"https://api.github.com/repos/catkira/seqan/issues/events{/number}","events_url":"https://api.github.com/repos/catkira/seqan/events","assignees_url":"https://api.github.com/repos/catkira/seqan/assignees{/user}","branches_url":"https://api.github.com/repos/catkira/seqan/branches{/branch}","tags_url":"https://api.github.com/repos/catkira/seqan/tags","blobs_url":"https://api.github.com/repos/catkira/seqan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/catkira/seqan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/catkira/seqan/git/refs{/sha}","trees_url":"https://api.github.com/repos/catkira/seqan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/catkira/seqan/statuses/{sha}","languages_url":"https://api.github.com/repos/catkira/seqan/languages","stargazers_url":"https://api.github.com/repos/catkira/seqan/stargazers","contributors_url":"https://api.github.com/repos/catkira/seqan/contributors","subscribers_url":"https://api.github.com/repos/catkira/seqan/subscribers","subscription_url":"https://api.github.com/repos/catkira/seqan/subscription","commits_url":"https://api.github.com/repos/catkira/seqan/commits{/sha}","git_commits_url":"https://api.github.com/repos/catkira/seqan/git/commits{/sha}","comments_url":"https://api.github.com/repos/catkira/seqan/comments{/number}","issue_comment_url":"https://api.github.com/repos/catkira/seqan/issues/comments{/number}","contents_url":"https://api.github.com/repos/catkira/seqan/contents/{+path}","compare_url":"https://api.github.com/repos/catkira/seqan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/catkira/seqan/merges","archive_url":"https://api.github.com/repos/catkira/seqan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/catkira/seqan/downloads","issues_url":"https://api.github.com/repos/catkira/seqan/issues{/number}","pulls_url":"https://api.github.com/repos/catkira/seqan/pulls{/number}","milestones_url":"https://api.github.com/repos/catkira/seqan/milestones{/number}","notifications_url":"https://api.github.com/repos/catkira/seqan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/catkira/seqan/labels{/name}","releases_url":"https://api.github.com/repos/catkira/seqan/releases{/id}","created_at":"2015-07-20T22:49:47Z","updated_at":"2015-08-06T08:02:58Z","pushed_at":"2015-08-10T17:12:40Z","git_url":"git://github.com/catkira/seqan.git","ssh_url":"git@github.com:catkira/seqan.git","clone_url":"https://github.com/catkira/seqan.git","svn_url":"https://github.com/catkira/seqan","homepage":"","size":138519,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"seqan:develop","ref":"develop","sha":"e2507b44097697ff5f4ba70a5fb9b736f7190db8","user":{"login":"seqan","id":1752144,"avatar_url":"https://avatars.githubusercontent.com/u/1752144?v=3","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":6383869,"name":"seqan","full_name":"seqan/seqan","owner":{"login":"seqan","id":1752144,"avatar_url":"https://avatars.githubusercontent.com/u/1752144?v=3","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},"private":false,"html_url":"https://github.com/seqan/seqan","description":"SeqAn's official repository.","fork":false,"url":"https://api.github.com/repos/seqan/seqan","forks_url":"https://api.github.com/repos/seqan/seqan/forks","keys_url":"https://api.github.com/repos/seqan/seqan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seqan/seqan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seqan/seqan/teams","hooks_url":"https://api.github.com/repos/seqan/seqan/hooks","issue_events_url":"https://api.github.com/repos/seqan/seqan/issues/events{/number}","events_url":"https://api.github.com/repos/seqan/seqan/events","assignees_url":"https://api.github.com/repos/seqan/seqan/assignees{/user}","branches_url":"https://api.github.com/repos/seqan/seqan/branches{/branch}","tags_url":"https://api.github.com/repos/seqan/seqan/tags","blobs_url":"https://api.github.com/repos/seqan/seqan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seqan/seqan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seqan/seqan/git/refs{/sha}","trees_url":"https://api.github.com/repos/seqan/seqan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seqan/seqan/statuses/{sha}","languages_url":"https://api.github.com/repos/seqan/seqan/languages","stargazers_url":"https://api.github.com/repos/seqan/seqan/stargazers","contributors_url":"https://api.github.com/repos/seqan/seqan/contributors","subscribers_url":"https://api.github.com/repos/seqan/seqan/subscribers","subscription_url":"https://api.github.com/repos/seqan/seqan/subscription","commits_url":"https://api.github.com/repos/seqan/seqan/commits{/sha}","git_commits_url":"https://api.github.com/repos/seqan/seqan/git/commits{/sha}","comments_url":"https://api.github.com/repos/seqan/seqan/comments{/number}","issue_comment_url":"https://api.github.com/repos/seqan/seqan/issues/comments{/number}","contents_url":"https://api.github.com/repos/seqan/seqan/contents/{+path}","compare_url":"https://api.github.com/repos/seqan/seqan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seqan/seqan/merges","archive_url":"https://api.github.com/repos/seqan/seqan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seqan/seqan/downloads","issues_url":"https://api.github.com/repos/seqan/seqan/issues{/number}","pulls_url":"https://api.github.com/repos/seqan/seqan/pulls{/number}","milestones_url":"https://api.github.com/repos/seqan/seqan/milestones{/number}","notifications_url":"https://api.github.com/repos/seqan/seqan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seqan/seqan/labels{/name}","releases_url":"https://api.github.com/repos/seqan/seqan/releases{/id}","created_at":"2012-10-25T08:02:15Z","updated_at":"2015-08-08T21:18:04Z","pushed_at":"2015-08-10T17:12:41Z","git_url":"git://github.com/seqan/seqan.git","ssh_url":"git@github.com:seqan/seqan.git","clone_url":"https://github.com/seqan/seqan.git","svn_url":"https://github.com/seqan/seqan","homepage":"www.seqan.de","size":157215,"stargazers_count":84,"watchers_count":84,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":144,"forks":53,"open_issues":144,"watchers":84,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/seqan/seqan/pulls/1079"},"html":{"href":"https://github.com/seqan/seqan/pull/1079"},"issue":{"href":"https://api.github.com/repos/seqan/seqan/issues/1079"},"comments":{"href":"https://api.github.com/repos/seqan/seqan/issues/1079/comments"},"review_comments":{"href":"https://api.github.com/repos/seqan/seqan/pulls/1079/comments"},"review_comment":{"href":"https://api.github.com/repos/seqan/seqan/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/seqan/seqan/pulls/1079/commits"},"statuses":{"href":"https://api.github.com/repos/seqan/seqan/statuses/da0d687b9e489856e10397dae2885e45afa57b85"}}}}