-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #325 from genomic-medicine-sweden/324-improve-the-…
…pipeline-description 324 improve the pipeline description
- Loading branch information
Showing
26 changed files
with
649 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the OS, Python version and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.12" | ||
# You can also specify other tool versions: | ||
# nodejs: "19" | ||
# rust: "1.64" | ||
# golang: "1.19" | ||
|
||
# Build documentation in the "docs/" directory with Sphinx | ||
sphinx: | ||
configuration: docs/source/conf.py | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
# formats: | ||
# - epub | ||
|
||
# Optional but recommended, declare the Python requirements required | ||
# to build your documentation | ||
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html | ||
python: | ||
install: | ||
- requirements: docs/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Contributing to Jasen | ||
|
||
This is a guide on how to contribute to Jasen in various ways. You can contribute to this project by reporting bugs, help implement new types of analysis, or by improving the pipeline documentation. | ||
|
||
## Documentation changes | ||
|
||
Propose changes to the documentation by opening a pull request. | ||
|
||
Edit the documentation by editing the source files in the [docs](docs/) directory. The [README](docs/source/README.md) describe how to build and preview the documentation on your local machine. | ||
|
||
## Bug reports | ||
|
||
Submitting a bug report is one of the simplest and one of the most useful way to help out the project. | ||
|
||
Report a bug by creating a new issue (use the *New issue* button) on the [issues page](https://github.com/genomic-medicine-sweden/jasen/issues). A good bug report should include a description of the error (with the error message) and steps on how to reproduce the error. | ||
|
||
## New feature, analysis, or tool | ||
|
||
We welcome suggestions on new types of analysis, bacterial species or other features to add to the pipeline. Before contributing these, please create a feature proposal on the [issues page](https://github.com/genomic-medicine-sweden/jasen/issues) so it can be discussed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env python | ||
"""Concatinate software versions.""" | ||
|
||
import click | ||
import yaml | ||
from yaml import Loader | ||
import pandas as pd | ||
from pathlib import Path | ||
|
||
|
||
def get_versions(version_obj: dict[str: dict]) -> dict[str, str]: | ||
workflow_name = list(version_obj.keys())[0].split(":")[-1] | ||
raw_softwares = list(version_obj.values())[0] | ||
# add workflow name to the list of all softwares | ||
softwares = {} | ||
for sw, version_info in raw_softwares.items(): | ||
version_info["workflow"] = workflow_name | ||
softwares[sw] = version_info | ||
# get container | ||
if "http" not in version_info["container"]: | ||
version_info["container"] = None | ||
return softwares | ||
|
||
|
||
@click.command() | ||
@click.option("-o", "--output", type=click.File("w"), help="Path to write output file to.") | ||
@click.argument("version_files", nargs=-1) | ||
def cli(output, version_files): | ||
"""Concatinate the versions of softwares.""" | ||
|
||
all_versions = {} | ||
for file in version_files: | ||
with open(file) as vfile: | ||
sw_version = get_versions(yaml.load(vfile, Loader=Loader)) | ||
# combine new sw versions with existing sw versions | ||
all_versions = {**all_versions, **sw_version} | ||
|
||
# convert version dict to csv tables | ||
df = (pd.DataFrame | ||
.from_dict(all_versions, orient="index") | ||
.drop("workflow", axis=1) | ||
.fillna("-") | ||
) | ||
df.index.name = "software" | ||
df.reset_index(inplace=True) | ||
df.sort_values("software", inplace=True) | ||
df.columns = [col.capitalize() for col in df.columns] | ||
# export to csv | ||
df.to_csv(output, index=False) | ||
click.secho(f"Wrote output file: {output.name}", fg="green") | ||
|
||
|
||
if __name__ == "__main__": | ||
cli() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
Oops, something went wrong.