Skip to content
Snippets Groups Projects
Commit 9dd2c83c authored by dilawar's avatar dilawar :ant:
Browse files

Adds sphinx docs

parent 1c37a1c3
No related branches found
No related tags found
No related merge requests found
Pipeline #3594 failed with stages
in 14 seconds
# 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 ?= poetry run 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)
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)
if "%1" == "" goto help
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd
sphinx
myst_parser
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent / ".." / ".."))
import bitia
print(bitia.__file__)
# -- Project information -----------------------------------------------------
project = "BiTIA"
copyright = "2022, Subconscious Compute"
author = "Subconscious Compute"
# The full version, including alpha/beta/rc tags
release = "0.0.1"
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["myst_parser", "sphinx.ext.autodoc"]
napoleon_google_docstring = False
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = "furo"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
## Developer guide
### Testing
#### Testing bitia inside official image
```bash
python tests/bitia_in_docker.py
```
# Example
**Example 1**
```bash
bitia trim_galore --gzip --fastqc --max_n 2 --paired --length 50 SRR11862696_1.fastq.gz SRR11862696_2.fastq.gz
```
This does the following :
- Installs trim_galore on top of biarchlinux image in a docker container
- mounts the current working directory to the container so that all necessory files needed and input files `SRR11862696_1.fastq.gz` and `SRR11862696_2.fastq.gz` for the command to work is available inside the container.
- Runs the command and returns the output to stdout
**Example 2**
```bash
bitia pipeline.sh
```
for pipeline.sh:
```
#!/usr/bin/env bash
fastqc *.gz
for file in *_1.fastq.gz
do
trim_galore --cores 8 --gzip --fastqc --max_n 2 --output_dir Trimmed_Data/ --paired $file ${file%_1.fastq.gz}_2.fastq.gz
done
hisat2-build -p 8 ./Homo_sapiens/UCSC/hg38/Sequence/WholeGenomeFasta/genome.fa index
```
This does the following:
- Extract all exeutables in the file - `fastqc`, `trim_galore`,`hisat2`
- Extract all comments given in the file - `#!/usr/bin/env bash`
- Extract all files that are given as input for commands and download them if not available by the given url.
- Installs given executables in the docker container.
- mounts the current working directory to the containern so that all necessory files needed and input files for the command to work is available inside the container.
- Runs the command and returns the output to stdout.
\ No newline at end of file
# Getting Started
## Installation
To get started with using BiTIA, you should [install Python] and make sure [python-pip] is installed with it on your system.
[install Python]: https://realpython.com/installing-python/
[python-pip]: https://pypi.org/project/pip/
### Ensure you have a working pip
As a first step, you should check that you have a working Python with pip
installed. This can be done by running the following commands and making
sure that the output looks similar.
``` bash
$ python --version
Python 3.N.N
$ pip --version
pip X.Y.Z from ... (python 3.N.N)
```
If that worked, congratulations! You have a working pip in your environment.
To Install **BiTIA** using pip:
```bash
$ python3 -m pip install bitia
```
# Welcome to BiTIA's documentation!
## BioInformatics Tool for Infrastructure Automation (BiTIA)
BiTIA makes it easy to orchestrate the infrastructure required to run
complex bioinformatics pipelines. BiTIA plays well with existing pipeline
solution such as snakement. [See some examples]
[see some examples]: examples
```{toctree}
:hidden:
getting_started
developer
```
If you want to learn how to use BiTIA, check out the following resources:
- [Getting Started](getting_started)
- [Features](features)
```{eval-rst}
.. automodule:: bitia
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment