Skip to content

Commit

Permalink
Merge pull request #12 from vladsavelyev/fixes-v1-22-3
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
aanil authored Jul 15, 2024
2 parents 03bc773 + 0f761fd commit 7956ec0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ docs/_build/

# PyBuilder
target/

.idea
16 changes: 7 additions & 9 deletions multiqc_ngi/multiqc_ngi.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@ def __init__(self):
return None

# Run WGS Piper specific cleanup
for f in report.prep_ordered_search_files_list('piper_ngi')[1]:
if 'piper_ngi' in f[1].split(os.sep):
log.info("Looks like WGS data - cleaning up report")
self.ngi_wgs_cleanup()
break
if 'piper_ngi' in report.files:
log.info("Looks like WGS data - cleaning up report")
self.ngi_wgs_cleanup()

# Are we using the dummy test data?
self.couch = None
Expand Down Expand Up @@ -539,20 +537,20 @@ def push_statusdb_multiqc_data(self):

def connect_statusdb(self):
""" Connect to statusdb """
conf_file = os.path.join(os.environ.get('HOME'), '.ngi_config', 'statusdb.yaml')
try:
conf_file = os.path.join(os.environ.get('HOME'), '.ngi_config', 'statusdb.yaml')
with open(conf_file, "r") as f:
sdb_config = yaml.safe_load(f)
log.debug("Got MultiQC_NGI statusdb config from the home directory.")
except IOError:
log.debug("Could not open the MultiQC_NGI statusdb config file {conf_file}")
log.debug(f"Could not open the MultiQC_NGI statusdb config file {conf_file}")
try:
with open(os.environ['STATUS_DB_CONFIG'], "r") as f:
sdb_config = yaml.safe_load(f)
log.debug(f"Got MultiQC_NGI statusdb config from $STATUS_DB_CONFIG: {os.environ['STATUS_DB_CONFIG']}")
except (KeyError, IOError):
log.debug("Could not get the MultiQC_NGI statusdb config file from env STATUS_DB_CONFIG")
log.warn("Could not find a statusdb config file")
log.warning("Could not find a statusdb config file")
return None
try:
couch_user = sdb_config['statusdb']['username']
Expand All @@ -568,7 +566,7 @@ def connect_statusdb(self):
try:
requests.get(server_url, timeout=3)
except (requests.exceptions.Timeout, requests.exceptions.ConnectionError):
log.warn("Cannot contact statusdb - skipping NGI metadata stuff")
log.warning("Cannot contact statusdb - skipping NGI metadata stuff")
return None

return Server(server_url)
Expand Down
14 changes: 11 additions & 3 deletions multiqc_ngi/templates/genstat/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@

<h1 id="page_title">{{ config.title }} : MultiQC Report</h1>

<p>Report generated on {{ config.creation_date }} based on data in
<code id="mqc_analysis_path">{{ config.analysis_dir |join('</code>
and <code id="mqc_analysis_path">') }}</code></p>
<p>Report generated on {{ config.creation_date }} based on data in:
{% if report.analysis_files | length == 1 %}
<code class="mqc_analysis_path">{{ report.analysis_files[0] }}</code>
{% else %}
<ul>
{% for d in report.analysis_files %}
<li><code class="mqc_analysis_path">{{ d }}</code></li>
{% endfor %}
</ul>
{% endif %}
</p>
4 changes: 2 additions & 2 deletions multiqc_ngi/templates/ngi/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ <h4>JavaScript Disabled</h4>

<div id="analysis_dirs_wrapper">
<p>Report generated on {{ config.creation_date }} based on data in:
{% if config.analysis_dir | length == 1 %}<code class="mqc_analysis_path">{{ config.analysis_dir[0] }}</code>
{% if report.analysis_files | length == 1 %}<code class="mqc_analysis_path">{{ report.analysis_files[0] }}</code>
{% else %}
<ul>
{% for d in config.analysis_dir %}
{% for d in report.analysis_files %}
<li><code class="mqc_analysis_path">{{ d }}</code></li>
{% endfor %}
</ul>
Expand Down

0 comments on commit 7956ec0

Please sign in to comment.