{"action":"created","comment":{"url":"https://api.github.com/repos/ewels/MultiQC/pulls/comments/140270773","pull_request_review_id":64304439,"id":140270773,"diff_hunk":"@@ -0,0 +1,131 @@\n+#!/usr/bin/env python\n+\n+\"\"\" MultiQC submodule to parse output from deepTools plotFingerprint \"\"\"\n+\n+import logging\n+import re\n+from collections import OrderedDict\n+import numpy as np\n+\n+from multiqc import config\n+from multiqc.plots import bargraph, linegraph\n+\n+# Initialise the logger\n+log = logging.getLogger(__name__)\n+\n+class plotFingerprintMixin():\n+    def parse_plotFingerprint(self):\n+        \"\"\"Find plotFingerprint output. Both --outQualityMetrics and --outRawCounts\"\"\"\n+        self.deeptools_plotFingerprintOutQualityMetrics = dict()\n+        for f in self.find_log_files('deeptools/plotFingerprintOutQualityMetrics'):\n+            parsed_data = self.parsePlotFingerprintOutQualityMetrics(f['f'], f['fn'])\n+            for k, v in parsed_data.items():\n+                if k in self.deeptools_plotFingerprintOutQualityMetrics:\n+                    log.warning(\"Replacing duplicate sample {}.\".format(k))\n+                self.deeptools_plotFingerprintOutQualityMetrics[k] = v\n+\n+            if len(parsed_data) > 0:\n+                self.add_data_source(f, section='plotFingerprint')\n+\n+        self.deeptools_plotFingerprintOutRawCounts= dict()\n+        for f in self.find_log_files('deeptools/plotFingerprintOutRawCounts'):\n+            parsed_data = self.parsePlotFingerprintOutRawCounts(f['f'], f['fn'])\n+            for k, v in parsed_data.items():\n+                if k in self.deeptools_plotFingerprintOutRawCounts:\n+                    log.warning(\"Replacing duplicate sample {}.\".format(k))\n+                self.deeptools_plotFingerprintOutRawCounts[k] = v\n+\n+            if len(parsed_data) > 0:\n+                self.add_data_source(f, section='plotFingerprint')\n+\n+        if len(self.deeptools_plotFingerprintOutQualityMetrics) > 0:\n+            d = OrderedDict()\n+            categories = []\n+            for sample, v in self.deeptools_plotFingerprintOutQualityMetrics.items():\n+                sample = str(sample)\n+                for category, v2 in v.items():\n+                    if category not in d:\n+                        d[category] = dict()\n+                        categories.append(category)\n+                    d[category][sample] = v2\n+            config = dict(cpswitch=False, hide_zero_cats=False, ymin=0.0, ymax=1.0, ylab='Value', stacking=None, tt_percentages=False, tt_decimals=3)","path":"multiqc/modules/deeptools/plotFingerprint.py","position":51,"original_position":51,"commit_id":"552a93e13af34bab43484fa3512650aefdf9b4e2","original_commit_id":"552a93e13af34bab43484fa3512650aefdf9b4e2","user":{"login":"ewels","id":465550,"avatar_url":"https://avatars3.githubusercontent.com/u/465550?v=4","gravatar_id":"","url":"https://api.github.com/users/ewels","html_url":"https://github.com/ewels","followers_url":"https://api.github.com/users/ewels/followers","following_url":"https://api.github.com/users/ewels/following{/other_user}","gists_url":"https://api.github.com/users/ewels/gists{/gist_id}","starred_url":"https://api.github.com/users/ewels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewels/subscriptions","organizations_url":"https://api.github.com/users/ewels/orgs","repos_url":"https://api.github.com/users/ewels/repos","events_url":"https://api.github.com/users/ewels/events{/privacy}","received_events_url":"https://api.github.com/users/ewels/received_events","type":"User","site_admin":false},"body":"Same `stacking=None` comment as above with the other plot.","created_at":"2017-09-21T15:10:10Z","updated_at":"2017-09-21T15:12:00Z","html_url":"https://github.com/ewels/MultiQC/pull/582#discussion_r140270773","pull_request_url":"https://api.github.com/repos/ewels/MultiQC/pulls/582","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/ewels/MultiQC/pulls/comments/140270773"},"html":{"href":"https://github.com/ewels/MultiQC/pull/582#discussion_r140270773"},"pull_request":{"href":"https://api.github.com/repos/ewels/MultiQC/pulls/582"}}},"pull_request":{"url":"https://api.github.com/repos/ewels/MultiQC/pulls/582","id":140030049,"html_url":"https://github.com/ewels/MultiQC/pull/582","diff_url":"https://github.com/ewels/MultiQC/pull/582.diff","patch_url":"https://github.com/ewels/MultiQC/pull/582.patch","issue_url":"https://api.github.com/repos/ewels/MultiQC/issues/582","number":582,"state":"open","locked":false,"title":"Add a deepTools module","user":{"login":"dpryan79","id":6399000,"avatar_url":"https://avatars3.githubusercontent.com/u/6399000?v=4","gravatar_id":"","url":"https://api.github.com/users/dpryan79","html_url":"https://github.com/dpryan79","followers_url":"https://api.github.com/users/dpryan79/followers","following_url":"https://api.github.com/users/dpryan79/following{/other_user}","gists_url":"https://api.github.com/users/dpryan79/gists{/gist_id}","starred_url":"https://api.github.com/users/dpryan79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpryan79/subscriptions","organizations_url":"https://api.github.com/users/dpryan79/orgs","repos_url":"https://api.github.com/users/dpryan79/repos","events_url":"https://api.github.com/users/dpryan79/events{/privacy}","received_events_url":"https://api.github.com/users/dpryan79/received_events","type":"User","site_admin":false},"body":"This adds support for a number of outputs produced by deepTools (xref https://github.com/fidelram/deepTools/issues/554). Note that it also implements a possible solution to issue #581, so either the code related to that in this PR needs to be removed or it needs to be resolved that the solution provided here is OK before merging.\r\n\r\nAs an aside, my goal with this module is less to make deepTools' default output interactive and more to merge information from multiple runs into a single very convenient format. I know there has been work done by others to allow MultiQC to handle the output from things like `plotPCA`, but in deepTools 2.6 I've already added interactive images (via plotly), so foresee adding a multiQC module for that as adding much that's really useful. At least in our use-cases, we often run things like `plotFingerprint` multiple times with various subsets of samples so that we can get appropriate jensen-shannon divergence values, so combining all of them (and the other produced metrics) into a single interactive plot would be immensely helpful for us.","created_at":"2017-09-08T12:51:23Z","updated_at":"2017-09-21T15:12:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5272f1fe5501419335f2a1a4c7bdd9b9855b8c35","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ewels/MultiQC/pulls/582/commits","review_comments_url":"https://api.github.com/repos/ewels/MultiQC/pulls/582/comments","review_comment_url":"https://api.github.com/repos/ewels/MultiQC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ewels/MultiQC/issues/582/comments","statuses_url":"https://api.github.com/repos/ewels/MultiQC/statuses/552a93e13af34bab43484fa3512650aefdf9b4e2","head":{"label":"dpryan79:deepTools_module","ref":"deepTools_module","sha":"552a93e13af34bab43484fa3512650aefdf9b4e2","user":{"login":"dpryan79","id":6399000,"avatar_url":"https://avatars3.githubusercontent.com/u/6399000?v=4","gravatar_id":"","url":"https://api.github.com/users/dpryan79","html_url":"https://github.com/dpryan79","followers_url":"https://api.github.com/users/dpryan79/followers","following_url":"https://api.github.com/users/dpryan79/following{/other_user}","gists_url":"https://api.github.com/users/dpryan79/gists{/gist_id}","starred_url":"https://api.github.com/users/dpryan79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpryan79/subscriptions","organizations_url":"https://api.github.com/users/dpryan79/orgs","repos_url":"https://api.github.com/users/dpryan79/repos","events_url":"https://api.github.com/users/dpryan79/events{/privacy}","received_events_url":"https://api.github.com/users/dpryan79/received_events","type":"User","site_admin":false},"repo":{"id":101890259,"name":"MultiQC","full_name":"dpryan79/MultiQC","owner":{"login":"dpryan79","id":6399000,"avatar_url":"https://avatars3.githubusercontent.com/u/6399000?v=4","gravatar_id":"","url":"https://api.github.com/users/dpryan79","html_url":"https://github.com/dpryan79","followers_url":"https://api.github.com/users/dpryan79/followers","following_url":"https://api.github.com/users/dpryan79/following{/other_user}","gists_url":"https://api.github.com/users/dpryan79/gists{/gist_id}","starred_url":"https://api.github.com/users/dpryan79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpryan79/subscriptions","organizations_url":"https://api.github.com/users/dpryan79/orgs","repos_url":"https://api.github.com/users/dpryan79/repos","events_url":"https://api.github.com/users/dpryan79/events{/privacy}","received_events_url":"https://api.github.com/users/dpryan79/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dpryan79/MultiQC","description":"Aggregate results from bioinformatics analyses across many samples into a single report.","fork":true,"url":"https://api.github.com/repos/dpryan79/MultiQC","forks_url":"https://api.github.com/repos/dpryan79/MultiQC/forks","keys_url":"https://api.github.com/repos/dpryan79/MultiQC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dpryan79/MultiQC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dpryan79/MultiQC/teams","hooks_url":"https://api.github.com/repos/dpryan79/MultiQC/hooks","issue_events_url":"https://api.github.com/repos/dpryan79/MultiQC/issues/events{/number}","events_url":"https://api.github.com/repos/dpryan79/MultiQC/events","assignees_url":"https://api.github.com/repos/dpryan79/MultiQC/assignees{/user}","branches_url":"https://api.github.com/repos/dpryan79/MultiQC/branches{/branch}","tags_url":"https://api.github.com/repos/dpryan79/MultiQC/tags","blobs_url":"https://api.github.com/repos/dpryan79/MultiQC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dpryan79/MultiQC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dpryan79/MultiQC/git/refs{/sha}","trees_url":"https://api.github.com/repos/dpryan79/MultiQC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dpryan79/MultiQC/statuses/{sha}","languages_url":"https://api.github.com/repos/dpryan79/MultiQC/languages","stargazers_url":"https://api.github.com/repos/dpryan79/MultiQC/stargazers","contributors_url":"https://api.github.com/repos/dpryan79/MultiQC/contributors","subscribers_url":"https://api.github.com/repos/dpryan79/MultiQC/subscribers","subscription_url":"https://api.github.com/repos/dpryan79/MultiQC/subscription","commits_url":"https://api.github.com/repos/dpryan79/MultiQC/commits{/sha}","git_commits_url":"https://api.github.com/repos/dpryan79/MultiQC/git/commits{/sha}","comments_url":"https://api.github.com/repos/dpryan79/MultiQC/comments{/number}","issue_comment_url":"https://api.github.com/repos/dpryan79/MultiQC/issues/comments{/number}","contents_url":"https://api.github.com/repos/dpryan79/MultiQC/contents/{+path}","compare_url":"https://api.github.com/repos/dpryan79/MultiQC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dpryan79/MultiQC/merges","archive_url":"https://api.github.com/repos/dpryan79/MultiQC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dpryan79/MultiQC/downloads","issues_url":"https://api.github.com/repos/dpryan79/MultiQC/issues{/number}","pulls_url":"https://api.github.com/repos/dpryan79/MultiQC/pulls{/number}","milestones_url":"https://api.github.com/repos/dpryan79/MultiQC/milestones{/number}","notifications_url":"https://api.github.com/repos/dpryan79/MultiQC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dpryan79/MultiQC/labels{/name}","releases_url":"https://api.github.com/repos/dpryan79/MultiQC/releases{/id}","deployments_url":"https://api.github.com/repos/dpryan79/MultiQC/deployments","created_at":"2017-08-30T14:17:32Z","updated_at":"2017-08-31T04:13:06Z","pushed_at":"2017-09-21T12:56:18Z","git_url":"git://github.com/dpryan79/MultiQC.git","ssh_url":"git@github.com:dpryan79/MultiQC.git","clone_url":"https://github.com/dpryan79/MultiQC.git","svn_url":"https://github.com/dpryan79/MultiQC","homepage":"http://multiqc.info","size":19999,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_projects":true,"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":1,"default_branch":"master"}},"base":{"label":"ewels:master","ref":"master","sha":"cbc4d672eb53d3aa5f6400df3a66ed6340308c3b","user":{"login":"ewels","id":465550,"avatar_url":"https://avatars3.githubusercontent.com/u/465550?v=4","gravatar_id":"","url":"https://api.github.com/users/ewels","html_url":"https://github.com/ewels","followers_url":"https://api.github.com/users/ewels/followers","following_url":"https://api.github.com/users/ewels/following{/other_user}","gists_url":"https://api.github.com/users/ewels/gists{/gist_id}","starred_url":"https://api.github.com/users/ewels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewels/subscriptions","organizations_url":"https://api.github.com/users/ewels/orgs","repos_url":"https://api.github.com/users/ewels/repos","events_url":"https://api.github.com/users/ewels/events{/privacy}","received_events_url":"https://api.github.com/users/ewels/received_events","type":"User","site_admin":false},"repo":{"id":40187375,"name":"MultiQC","full_name":"ewels/MultiQC","owner":{"login":"ewels","id":465550,"avatar_url":"https://avatars3.githubusercontent.com/u/465550?v=4","gravatar_id":"","url":"https://api.github.com/users/ewels","html_url":"https://github.com/ewels","followers_url":"https://api.github.com/users/ewels/followers","following_url":"https://api.github.com/users/ewels/following{/other_user}","gists_url":"https://api.github.com/users/ewels/gists{/gist_id}","starred_url":"https://api.github.com/users/ewels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewels/subscriptions","organizations_url":"https://api.github.com/users/ewels/orgs","repos_url":"https://api.github.com/users/ewels/repos","events_url":"https://api.github.com/users/ewels/events{/privacy}","received_events_url":"https://api.github.com/users/ewels/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ewels/MultiQC","description":"Aggregate results from bioinformatics analyses across many samples into a single report.","fork":false,"url":"https://api.github.com/repos/ewels/MultiQC","forks_url":"https://api.github.com/repos/ewels/MultiQC/forks","keys_url":"https://api.github.com/repos/ewels/MultiQC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ewels/MultiQC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ewels/MultiQC/teams","hooks_url":"https://api.github.com/repos/ewels/MultiQC/hooks","issue_events_url":"https://api.github.com/repos/ewels/MultiQC/issues/events{/number}","events_url":"https://api.github.com/repos/ewels/MultiQC/events","assignees_url":"https://api.github.com/repos/ewels/MultiQC/assignees{/user}","branches_url":"https://api.github.com/repos/ewels/MultiQC/branches{/branch}","tags_url":"https://api.github.com/repos/ewels/MultiQC/tags","blobs_url":"https://api.github.com/repos/ewels/MultiQC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ewels/MultiQC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ewels/MultiQC/git/refs{/sha}","trees_url":"https://api.github.com/repos/ewels/MultiQC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ewels/MultiQC/statuses/{sha}","languages_url":"https://api.github.com/repos/ewels/MultiQC/languages","stargazers_url":"https://api.github.com/repos/ewels/MultiQC/stargazers","contributors_url":"https://api.github.com/repos/ewels/MultiQC/contributors","subscribers_url":"https://api.github.com/repos/ewels/MultiQC/subscribers","subscription_url":"https://api.github.com/repos/ewels/MultiQC/subscription","commits_url":"https://api.github.com/repos/ewels/MultiQC/commits{/sha}","git_commits_url":"https://api.github.com/repos/ewels/MultiQC/git/commits{/sha}","comments_url":"https://api.github.com/repos/ewels/MultiQC/comments{/number}","issue_comment_url":"https://api.github.com/repos/ewels/MultiQC/issues/comments{/number}","contents_url":"https://api.github.com/repos/ewels/MultiQC/contents/{+path}","compare_url":"https://api.github.com/repos/ewels/MultiQC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ewels/MultiQC/merges","archive_url":"https://api.github.com/repos/ewels/MultiQC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ewels/MultiQC/downloads","issues_url":"https://api.github.com/repos/ewels/MultiQC/issues{/number}","pulls_url":"https://api.github.com/repos/ewels/MultiQC/pulls{/number}","milestones_url":"https://api.github.com/repos/ewels/MultiQC/milestones{/number}","notifications_url":"https://api.github.com/repos/ewels/MultiQC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ewels/MultiQC/labels{/name}","releases_url":"https://api.github.com/repos/ewels/MultiQC/releases{/id}","deployments_url":"https://api.github.com/repos/ewels/MultiQC/deployments","created_at":"2015-08-04T13:47:05Z","updated_at":"2017-09-19T09:17:11Z","pushed_at":"2017-09-21T12:56:20Z","git_url":"git://github.com/ewels/MultiQC.git","ssh_url":"git@github.com:ewels/MultiQC.git","clone_url":"https://github.com/ewels/MultiQC.git","svn_url":"https://github.com/ewels/MultiQC","homepage":"http://multiqc.info","size":20003,"stargazers_count":233,"watchers_count":233,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":125,"mirror_url":null,"open_issues_count":67,"forks":125,"open_issues":67,"watchers":233,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ewels/MultiQC/pulls/582"},"html":{"href":"https://github.com/ewels/MultiQC/pull/582"},"issue":{"href":"https://api.github.com/repos/ewels/MultiQC/issues/582"},"comments":{"href":"https://api.github.com/repos/ewels/MultiQC/issues/582/comments"},"review_comments":{"href":"https://api.github.com/repos/ewels/MultiQC/pulls/582/comments"},"review_comment":{"href":"https://api.github.com/repos/ewels/MultiQC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ewels/MultiQC/pulls/582/commits"},"statuses":{"href":"https://api.github.com/repos/ewels/MultiQC/statuses/552a93e13af34bab43484fa3512650aefdf9b4e2"}},"author_association":"NONE"}}
{"actor":{"display_login":"ewels"}}