-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up tutorials, geniml docs, etc
- Loading branch information
Showing
31 changed files
with
1,003 additions
and
868 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,102 @@ | ||
# This script will auto-generate documentation for Python code, CLI usage, and Jupyter notebooks | ||
# It is intended to be run as a pre-build step in a MkDocs project | ||
# It will read the mkdocs.yml file for configuration | ||
# It will use the lucidoc package to auto-generate documentation for Python code | ||
# It will use the subprocess package to run CLI commands and capture the output | ||
# It will use the nbconvert package to convert Jupyter notebooks to markdown | ||
|
||
import lucidoc | ||
import yaml | ||
import subprocess | ||
import glob | ||
import nbconvert | ||
import os | ||
from pathlib import Path | ||
|
||
import argparse | ||
|
||
parser = argparse.ArgumentParser(description="Description of your program") | ||
parser.add_argument( | ||
"--x-usage", | ||
help="Exclude usage", | ||
required=False, | ||
default=False, | ||
action="store_true", | ||
) | ||
parser.add_argument( | ||
"--x-lucidoc", | ||
help="Exclude lucidoc", | ||
required=False, | ||
default=False, | ||
action="store_true", | ||
) | ||
parser.add_argument( | ||
"--x-jupyter", | ||
help="Exclude jupyter", | ||
required=False, | ||
default=False, | ||
action="store_true", | ||
) | ||
|
||
args = vars(parser.parse_args()) | ||
|
||
print(args) | ||
|
||
# Read the mkdocs config | ||
with open("mkdocs.yml") as stream: | ||
cfg = yaml.safe_load(stream) | ||
|
||
|
||
if "autodoc" not in cfg: | ||
print("No autodoc configuration found in mkdocs.yml") | ||
exit(1) | ||
else: | ||
cfg = cfg["autodoc"] | ||
|
||
# Process auto-documented Python code | ||
if args["x_lucidoc"] is False and "lucidoc" in cfg: | ||
for bundle in cfg["lucidoc"]: | ||
print(f"Documenting lucidoc '{bundle['pkg']}' at {bundle['outfile']}") | ||
lucidoc.run_lucidoc(parse_style="rst", **bundle) | ||
else: | ||
print("Skipping lucidoc") | ||
|
||
|
||
usage_tpl = """ | ||
\n`{cmd}` | ||
\n | ||
```console | ||
{usage} | ||
``` | ||
""" | ||
|
||
# Process CLI usage | ||
if args["x_usage"] is False and "cli_usage" in cfg: | ||
for item in cfg["cli_usage"]: | ||
result = "" | ||
with open(item["template"], "r") as file: | ||
result = file.read() | ||
for cmd in item["commands"]: | ||
print(f"Documenting command '{cmd}' to '{item['outfile']}'") | ||
usage = subprocess.check_output(cmd, shell=True).decode("utf-8") | ||
content = usage_tpl.format(cmd=cmd, usage=usage) | ||
result += content | ||
with open(item["outfile"], "w") as file: | ||
file.write(result) | ||
else: | ||
print("Skipping usage documentation") | ||
|
||
# # Render Juptyer notebooks to markdown | ||
if args["x_jupyter"] is False and "jupyter" in cfg: | ||
for item in cfg["jupyter"]: | ||
files = glob.glob(f"docs/{item['in']}/*.ipynb") | ||
for nb in files: | ||
bn, _ = os.path.splitext(os.path.basename(nb)) | ||
out = f"docs/{item['out']}/{bn}.md" | ||
print(f"Converting '{nb}' to '{out}'") | ||
md_result = nbconvert.exporters.export(nbconvert.MarkdownExporter(), nb)[0] | ||
Path(os.path.dirname(out)).mkdir(parents=True, exist_ok=True) | ||
with open(out, "w") as stream: | ||
stream.write(md_result) | ||
else: | ||
print("Skipping jupyter notebooks") |
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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
--- | ||
hide: | ||
- navigation | ||
- toc | ||
- navigation.footer | ||
--- | ||
|
||
# Welcome to <https://docs.bedbase.org> | ||
|
||
This site hosts developer and user documentation for components of BEDbase and related tools. Use the tab navigation above to find the project of interest. | ||
This site hosts developer and user documentation for components of BEDbase and related tools, notably including [geniml](geniml/README.md), our package for machine learning on genomic intervals. Use the tab navigation above to find the project of interest. | ||
|
||
You can access the main BEDbase interface at <https://bedbase.org>. |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,19 +1,24 @@ | ||
# Genomic interval toolkit | ||
# <img src="img/geniml_logo_horizontal.svg" class="img-header"> | ||
|
||
<p align="center"> | ||
<a href="https://img.shields.io/pypi/v/geniml"><img src="https://img.shields.io/pypi/v/geniml"></a> | ||
<a href="https://github.com/databio/geniml"><img src="https://img.shields.io/badge/source-github-354a75?logo=github"></a> | ||
</p> | ||
|
||
|
||
|
||
## Introduction | ||
|
||
Geniml is a python package for building machine learning models of genomic interval data (BED files). It also includes ancillary functions to support other types of analyses of genomic interval data. | ||
Geniml is a *genomic interval machine learning toolkit*, a Python package for building machine learning models of genomic interval data (BED files). It also includes ancillary functions to support other types of analyses of genomic interval data. | ||
|
||
As of Feburary 2024, this package and its documentation are undergoing rapid development, leading to some tutorials getting outdated. Please raise [github issues](https://github.com/databio/geniml) if you find outdated or unclear directions, so we know where to focus effort that will benefit users. | ||
|
||
## Install | ||
|
||
``` | ||
pip install --user --upgrade . | ||
pip install --user --upgrade geniml | ||
``` | ||
|
||
## Modules | ||
|
||
`geniml` is organized into modules. The next section is an overview of each module. You can also proceed to the how-to guides for recipes on how to do specfic tasks. | ||
|
||
## Citing | ||
|
||
If you find `geniml` useful for your research, please cite us! It helps us convince others that our work is useful. You can find a [published papers describing geniml components](manuscripts.md). |
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
Oops, something went wrong.