Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
Hub
hic
Commits
e41eb376
Commit
e41eb376
authored
3 years ago
by
nservant
Browse files
Options
Downloads
Patches
Plain Diff
clean
parent
4d6df6a5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/nf-core/modules/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py~
+0
-89
0 additions, 89 deletions
...m/dumpsoftwareversions/templates/dumpsoftwareversions.py~
with
0 additions
and
89 deletions
modules/nf-core/modules/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py~
deleted
100644 → 0
+
0
−
89
View file @
4d6df6a5
#!/usr/bin/env python
import
yaml
import
platform
from
textwrap
import
dedent
def
_make_versions_html
(
versions
):
html
=
[
dedent
(
"""
\\
<style>
#nf-core-versions tbody:nth-child(even) {
background-color: #f2f2f2;
}
</style>
<table class=
"
table
"
style=
"
width:100%
"
id=
"
nf-core-versions
"
>
<thead>
<tr>
<th> Process Name </th>
<th> Software </th>
<th> Version </th>
</tr>
</thead>
"""
)
]
for
process
,
tmp_versions
in
sorted
(
versions
.
items
()):
html
.
append
(
"
<tbody>
"
)
for
i
,
(
tool
,
version
)
in
enumerate
(
sorted
(
tmp_versions
.
items
())):
html
.
append
(
dedent
(
f
"""
\\
<tr>
<td><samp>
{
process
if
(
i
==
0
)
else
''
}
</samp></td>
<td><samp>
{
tool
}
</samp></td>
<td><samp>
{
version
}
</samp></td>
</tr>
"""
)
)
html
.
append
(
"
</tbody>
"
)
html
.
append
(
"
</table>
"
)
return
"
\\
n
"
.
join
(
html
)
versions_this_module
=
{}
versions_this_module
[
"
${task.process}
"
]
=
{
"
python
"
:
platform
.
python_version
(),
"
yaml
"
:
yaml
.
__version__
,
}
with
open
(
"
$versions
"
)
as
f
:
versions_by_process
=
yaml
.
load
(
f
,
Loader
=
yaml
.
BaseLoader
)
|
versions_this_module
# aggregate versions by the module name (derived from fully-qualified process name)
versions_by_module
=
{}
for
process
,
process_versions
in
versions_by_process
.
items
():
module
=
process
.
split
(
"
:
"
)[
-
1
]
try
:
assert
versions_by_module
[
module
]
==
process_versions
,
(
"
We assume that software versions are the same between all modules.
"
"
If you see this error-message it means you discovered an edge-case
"
"
and should open an issue in nf-core/tools.
"
)
except
KeyError
:
versions_by_module
[
module
]
=
process_versions
versions_by_module
[
"
Workflow
"
]
=
{
"
Nextflow
"
:
"
$workflow.nextflow.version
"
,
"
$workflow.manifest.name
"
:
"
$workflow.manifest.version
"
,
}
versions_mqc
=
{
"
id
"
:
"
software_versions
"
,
"
section_name
"
:
"
${workflow.manifest.name} Software Versions
"
,
"
section_href
"
:
"
https://github.com/${workflow.manifest.name}
"
,
"
plot_type
"
:
"
html
"
,
"
description
"
:
"
are collected at run time from the software output.
"
,
"
data
"
:
_make_versions_html
(
versions_by_module
),
}
with
open
(
"
software_versions.yml
"
,
"
w
"
)
as
f
:
yaml
.
dump
(
versions_by_module
,
f
,
default_flow_style
=
False
)
with
open
(
"
software_versions_mqc.yml
"
,
"
w
"
)
as
f
:
yaml
.
dump
(
versions_mqc
,
f
,
default_flow_style
=
False
)
with
open
(
"
versions.yml
"
,
"
w
"
)
as
f
:
yaml
.
dump
(
versions_this_module
,
f
,
default_flow_style
=
False
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment