{"action":"created","comment":{"url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls/comments/84068696","pull_request_review_id":4867394,"id":84068696,"diff_hunk":"@@ -0,0 +1,107 @@\n+import os\n+from ete3 import NCBITaxa\n+from egcg_core import executor\n+from .quality_control_base import QualityControl\n+from analysis_driver.config import default as cfg\n+\n+class ContaminationBlast(QualityControl):\n+    def __init__(self, dataset, working_dir, fastq_files):\n+        super().__init__(dataset, working_dir)\n+        self.working_dir = working_dir\n+        self.fastq_files = fastq_files\n+\n+    def sample_fastq_command(self, fastq_file):\n+        seqtk_bin = cfg['tools']['seqtk']\n+        fasta_outfile = os.path.join(self.working_dir, self.dataset.name, fastq_file.split('.')[0] + '_sample3000.fasta')\n+        seqtk_sample_cmd = '%s sample %s 3000 | seqtk seq -a > %s' % (seqtk_bin, fastq_file, fasta_outfile)\n+        return seqtk_sample_cmd, fasta_outfile\n+\n+    def fasta_blast_command(self, fasta_file):\n+        blastn_bin = cfg['tools']['blastn']\n+        nt_db = cfg['contamination-check']['nt_db']\n+        blast_outfile = fasta_file.split('.')[0] + '_blastn'\n+        blast_cmd = \"%s -query %s -db %s -out %s -outfmt '6 qseqid sseqid length pident evalue sgi sacc staxids sscinames scomnames stitle'\" % (blastn_bin, fasta_file, nt_db, blast_outfile)","path":"analysis_driver/quality_control/contamination_blast.py","position":23,"original_position":23,"commit_id":"9406100349cee0df6b128947ade257606e427e6e","original_commit_id":"9406100349cee0df6b128947ade257606e427e6e","user":{"login":"tcezard","id":650891,"avatar_url":"https://avatars.githubusercontent.com/u/650891?v=3","gravatar_id":"","url":"https://api.github.com/users/tcezard","html_url":"https://github.com/tcezard","followers_url":"https://api.github.com/users/tcezard/followers","following_url":"https://api.github.com/users/tcezard/following{/other_user}","gists_url":"https://api.github.com/users/tcezard/gists{/gist_id}","starred_url":"https://api.github.com/users/tcezard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcezard/subscriptions","organizations_url":"https://api.github.com/users/tcezard/orgs","repos_url":"https://api.github.com/users/tcezard/repos","events_url":"https://api.github.com/users/tcezard/events{/privacy}","received_events_url":"https://api.github.com/users/tcezard/received_events","type":"User","site_admin":false},"body":"Is the blast command meant to be multithreaded?\r\nThe process has been given 2 CPU but could probably be given more.","created_at":"2016-10-19T13:26:16Z","updated_at":"2016-10-19T13:26:16Z","html_url":"https://github.com/EdinburghGenomics/Analysis-Driver/pull/190#discussion_r84068696","pull_request_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls/190","_links":{"self":{"href":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls/comments/84068696"},"html":{"href":"https://github.com/EdinburghGenomics/Analysis-Driver/pull/190#discussion_r84068696"},"pull_request":{"href":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls/190"}}},"pull_request":{"url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls/190","id":90000700,"html_url":"https://github.com/EdinburghGenomics/Analysis-Driver/pull/190","diff_url":"https://github.com/EdinburghGenomics/Analysis-Driver/pull/190.diff","patch_url":"https://github.com/EdinburghGenomics/Analysis-Driver/pull/190.patch","issue_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/issues/190","number":190,"state":"open","locked":false,"title":"early contamination check","user":{"login":"katieemelianova","id":8308682,"avatar_url":"https://avatars.githubusercontent.com/u/8308682?v=3","gravatar_id":"","url":"https://api.github.com/users/katieemelianova","html_url":"https://github.com/katieemelianova","followers_url":"https://api.github.com/users/katieemelianova/followers","following_url":"https://api.github.com/users/katieemelianova/following{/other_user}","gists_url":"https://api.github.com/users/katieemelianova/gists{/gist_id}","starred_url":"https://api.github.com/users/katieemelianova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katieemelianova/subscriptions","organizations_url":"https://api.github.com/users/katieemelianova/orgs","repos_url":"https://api.github.com/users/katieemelianova/repos","events_url":"https://api.github.com/users/katieemelianova/events{/privacy}","received_events_url":"https://api.github.com/users/katieemelianova/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-19T12:38:42Z","updated_at":"2016-10-19T13:28:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls/190/commits","review_comments_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls/190/comments","review_comment_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/issues/190/comments","statuses_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/statuses/9406100349cee0df6b128947ade257606e427e6e","head":{"label":"EdinburghGenomics:early_contamination_check","ref":"early_contamination_check","sha":"9406100349cee0df6b128947ade257606e427e6e","user":{"login":"EdinburghGenomics","id":12951724,"avatar_url":"https://avatars.githubusercontent.com/u/12951724?v=3","gravatar_id":"","url":"https://api.github.com/users/EdinburghGenomics","html_url":"https://github.com/EdinburghGenomics","followers_url":"https://api.github.com/users/EdinburghGenomics/followers","following_url":"https://api.github.com/users/EdinburghGenomics/following{/other_user}","gists_url":"https://api.github.com/users/EdinburghGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/EdinburghGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EdinburghGenomics/subscriptions","organizations_url":"https://api.github.com/users/EdinburghGenomics/orgs","repos_url":"https://api.github.com/users/EdinburghGenomics/repos","events_url":"https://api.github.com/users/EdinburghGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/EdinburghGenomics/received_events","type":"Organization","site_admin":false},"repo":{"id":37849969,"name":"Analysis-Driver","full_name":"EdinburghGenomics/Analysis-Driver","owner":{"login":"EdinburghGenomics","id":12951724,"avatar_url":"https://avatars.githubusercontent.com/u/12951724?v=3","gravatar_id":"","url":"https://api.github.com/users/EdinburghGenomics","html_url":"https://github.com/EdinburghGenomics","followers_url":"https://api.github.com/users/EdinburghGenomics/followers","following_url":"https://api.github.com/users/EdinburghGenomics/following{/other_user}","gists_url":"https://api.github.com/users/EdinburghGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/EdinburghGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EdinburghGenomics/subscriptions","organizations_url":"https://api.github.com/users/EdinburghGenomics/orgs","repos_url":"https://api.github.com/users/EdinburghGenomics/repos","events_url":"https://api.github.com/users/EdinburghGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/EdinburghGenomics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EdinburghGenomics/Analysis-Driver","description":"A pipeline for analysing Illumina HiSeqX data, from .bcl files to a .gvcf.","fork":false,"url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver","forks_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/forks","keys_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/teams","hooks_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/hooks","issue_events_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/issues/events{/number}","events_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/events","assignees_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/assignees{/user}","branches_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/branches{/branch}","tags_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/tags","blobs_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/statuses/{sha}","languages_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/languages","stargazers_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/stargazers","contributors_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/contributors","subscribers_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/subscribers","subscription_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/subscription","commits_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/contents/{+path}","compare_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/merges","archive_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/downloads","issues_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/issues{/number}","pulls_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls{/number}","milestones_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/milestones{/number}","notifications_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/labels{/name}","releases_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/releases{/id}","deployments_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/deployments","created_at":"2015-06-22T10:42:34Z","updated_at":"2016-06-23T12:28:16Z","pushed_at":"2016-10-19T12:38:42Z","git_url":"git://github.com/EdinburghGenomics/Analysis-Driver.git","ssh_url":"git@github.com:EdinburghGenomics/Analysis-Driver.git","clone_url":"https://github.com/EdinburghGenomics/Analysis-Driver.git","svn_url":"https://github.com/EdinburghGenomics/Analysis-Driver","homepage":"","size":3256,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":1,"default_branch":"master"}},"base":{"label":"EdinburghGenomics:master","ref":"master","sha":"121136f227bbd934670d97be3a41f2d54df1d1d8","user":{"login":"EdinburghGenomics","id":12951724,"avatar_url":"https://avatars.githubusercontent.com/u/12951724?v=3","gravatar_id":"","url":"https://api.github.com/users/EdinburghGenomics","html_url":"https://github.com/EdinburghGenomics","followers_url":"https://api.github.com/users/EdinburghGenomics/followers","following_url":"https://api.github.com/users/EdinburghGenomics/following{/other_user}","gists_url":"https://api.github.com/users/EdinburghGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/EdinburghGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EdinburghGenomics/subscriptions","organizations_url":"https://api.github.com/users/EdinburghGenomics/orgs","repos_url":"https://api.github.com/users/EdinburghGenomics/repos","events_url":"https://api.github.com/users/EdinburghGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/EdinburghGenomics/received_events","type":"Organization","site_admin":false},"repo":{"id":37849969,"name":"Analysis-Driver","full_name":"EdinburghGenomics/Analysis-Driver","owner":{"login":"EdinburghGenomics","id":12951724,"avatar_url":"https://avatars.githubusercontent.com/u/12951724?v=3","gravatar_id":"","url":"https://api.github.com/users/EdinburghGenomics","html_url":"https://github.com/EdinburghGenomics","followers_url":"https://api.github.com/users/EdinburghGenomics/followers","following_url":"https://api.github.com/users/EdinburghGenomics/following{/other_user}","gists_url":"https://api.github.com/users/EdinburghGenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/EdinburghGenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EdinburghGenomics/subscriptions","organizations_url":"https://api.github.com/users/EdinburghGenomics/orgs","repos_url":"https://api.github.com/users/EdinburghGenomics/repos","events_url":"https://api.github.com/users/EdinburghGenomics/events{/privacy}","received_events_url":"https://api.github.com/users/EdinburghGenomics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EdinburghGenomics/Analysis-Driver","description":"A pipeline for analysing Illumina HiSeqX data, from .bcl files to a .gvcf.","fork":false,"url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver","forks_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/forks","keys_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/teams","hooks_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/hooks","issue_events_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/issues/events{/number}","events_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/events","assignees_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/assignees{/user}","branches_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/branches{/branch}","tags_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/tags","blobs_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/statuses/{sha}","languages_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/languages","stargazers_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/stargazers","contributors_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/contributors","subscribers_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/subscribers","subscription_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/subscription","commits_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/contents/{+path}","compare_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/merges","archive_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/downloads","issues_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/issues{/number}","pulls_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls{/number}","milestones_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/milestones{/number}","notifications_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/labels{/name}","releases_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/releases{/id}","deployments_url":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/deployments","created_at":"2015-06-22T10:42:34Z","updated_at":"2016-06-23T12:28:16Z","pushed_at":"2016-10-19T12:38:42Z","git_url":"git://github.com/EdinburghGenomics/Analysis-Driver.git","ssh_url":"git@github.com:EdinburghGenomics/Analysis-Driver.git","clone_url":"https://github.com/EdinburghGenomics/Analysis-Driver.git","svn_url":"https://github.com/EdinburghGenomics/Analysis-Driver","homepage":"","size":3256,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls/190"},"html":{"href":"https://github.com/EdinburghGenomics/Analysis-Driver/pull/190"},"issue":{"href":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/issues/190"},"comments":{"href":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/issues/190/comments"},"review_comments":{"href":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls/190/comments"},"review_comment":{"href":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/pulls/190/commits"},"statuses":{"href":"https://api.github.com/repos/EdinburghGenomics/Analysis-Driver/statuses/9406100349cee0df6b128947ade257606e427e6e"}}}}
{"actor":{"display_login":"tcezard"}}