Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update RtD guides #172

Merged
merged 25 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
21695ca
docs: update RtD page
balajtimate Sep 19, 2024
eac14ed
docs: add installation guide
balajtimate Sep 19, 2024
acba203
docs: add usage and examples pages
balajtimate Oct 21, 2024
cc56fa4
Merge branch 'dev' of https://github.com/zavolanlab/htsinfer into doc…
balajtimate Oct 21, 2024
488d4b7
docs: update guides
balajtimate Oct 21, 2024
f9a1a3b
docs: update README
balajtimate Oct 21, 2024
f1b4b4c
docs: update guides
balajtimate Oct 21, 2024
206d146
fix README badges
balajtimate Oct 24, 2024
797c596
Merge branch 'dev' of https://github.com/zavolanlab/htsinfer into doc…
balajtimate Oct 30, 2024
db6bd5c
docs: update README, guides
balajtimate Oct 31, 2024
2b17aca
update version
balajtimate Oct 31, 2024
b3d5d05
update rtd config
balajtimate Nov 4, 2024
4623fe2
update versioning
balajtimate Nov 13, 2024
6bfcf1a
remove docker image and build
balajtimate Nov 13, 2024
89da34f
update readme
balajtimate Nov 13, 2024
47f3842
update versioning
balajtimate Nov 13, 2024
1252899
update guides
balajtimate Nov 15, 2024
f36c812
update usage guide with tables
balajtimate Nov 15, 2024
21f72f0
update Results model description
balajtimate Nov 15, 2024
3971d5e
docs: update index, restructure API docs
balajtimate Nov 15, 2024
140c918
update style
balajtimate Nov 15, 2024
8223260
docs: update guides, README
balajtimate Nov 18, 2024
316c173
update conf exclusions
balajtimate Nov 18, 2024
d9f56fa
update conf exclusions
balajtimate Nov 18, 2024
f231a54
update conf exclusions
balajtimate Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build:
tools:
python: "mambaforge-4.10"
sphinx:
configuration: docs/api/conf.py
configuration: docs/conf.py
formats:
- pdf
- epub
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM continuumio/miniconda3:4.12.0
LABEL base_image="continuumio/miniconda3:4.12.0"
LABEL version="1.0"
LABEL software="HTSinfer"
LABEL software.version="v0.9.0"
LABEL software.version="v1.0.0"
balajtimate marked this conversation as resolved.
Show resolved Hide resolved
LABEL about.summary="HTSinfer infers metadata from Illumina high-throughput sequencing (HTS) data"
LABEL about.home="https://github.com/zavolanlab/htsinfer"
LABEL about.documentation="https://htsinfer.readthedocs.io/"
Expand Down
128 changes: 58 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,64 @@
[![release_docker][badge-release-docker]][badge-url-release-docker]
[![ci][badge-ci]][badge-url-ci]
[![coverage][badge-coverage]][badge-url-coverage]
[![DOI:zenodo][badge-doi-zenodo]][badge-url-doi-zenodo]

HTSinfer infers metadata from Illumina high-throughput sequencing (HTS) data.
balajtimate marked this conversation as resolved.
Show resolved Hide resolved

## Examples
## Quick start

**Single-ended library***
For a more in-depth guide please refer to the [HTSinfer documentation][docs-documentation].

### Installation

In order to use the HTSinfer, clone the repository and install the
dependencies via [Conda][conda] or [Mamba][mamba]:

```sh
git clone https://github.com/zavolanlab/htsinfer
cd htsinfer
conda env create --file environment.yml
```

Then, activate the `htsinfer` Conda environment with:

```sh
conda activate htsinfer
```
balajtimate marked this conversation as resolved.
Show resolved Hide resolved

### General usage

```sh
htsinfer [--output-directory PATH]
[--temporary-directory PATH]
[--cleanup-regime {DEFAULT,KEEP_ALL,KEEP_NONE,KEEP_RESULTS}]
[--records INT]
[--threads INT]
[--transcripts FASTA]
[--read-layout-adapters PATH]
[--read-layout-min-match-percentage FLOAT]
[--read-layout-min-frequency-ratio FLOAT]
[--library-source-min-match-percentage FLOAT]
[--library-source-min-frequency-ratio FLOAT]
[--library-type-max-distance INT]
[--library-type-mates-cutoff FLOAT]
[--read-orientation-min-mapped-reads INT]
[--read-orientation-min-fraction FLOAT]
[--tax-id INT]
balajtimate marked this conversation as resolved.
Show resolved Hide resolved
[--verbosity {DEBUG,INFO,WARN,ERROR,CRITICAL}]
[-h] [--version]
PATH [PATH]
```

### Examples

**Single-ended library**

```sh
htsinfer tests/files/adapter_single.fastq
```

**Paired-ended library***
**Paired-ended library**

```sh
htsinfer tests/files/adapter_1.fastq tests/files/adapter_2.fastq
Expand Down Expand Up @@ -86,103 +132,45 @@ example library:
```

To better understand the output, please refer to the [`Results`
model][docs-api-results] in the [API documentation][badge-url-docs]. Note that
`Results` model has several nested child models, such as enumerators of
possible outcomes. Simply follow the references in each parent model for
detailed descriptions of each child model's attributes.

## General usage

```sh
htsinfer [--output-directory PATH]
[--temporary-directory PATH]
[--cleanup-regime {DEFAULT,KEEP_ALL,KEEP_NONE,KEEP_RESULTS}]
[--records INT]
[--threads INT]
[--transcripts FASTA]
[--read-layout-adapters PATH]
[--read-layout-min-match-percentage FLOAT]
[--read-layout-min-frequency-ratio FLOAT]
[--library-source-min-match-percentage FLOAT]
[--library-source-min-frequency-ratio FLOAT]
[--library-type-max-distance INT]
[--library-type-mates-cutoff FLOAT]
[--read-orientation-min-mapped-reads INT]
[--read-orientation-min-fraction FLOAT]
[--tax-id INT]
[--verbosity {DEBUG,INFO,WARN,ERROR,CRITICAL}]
[-h] [--version]
PATH [PATH]
```

## Installation

In order to use the HTSinfer, clone the repository and install the
dependencies via [Conda][conda]:

```sh
git clone https://github.com/zavolanlab/htsinfer
cd htsinfer
conda env create --file environment.yml
# Alternatively, to install with development dependencies,
# run the following instead
conda env create --file environment-dev.yml
```

> Note that creating the environment takes non-trivial time and it is strongly
> recommended that you install [Mamba][mamba] and replace `conda` with `mamba`
> in the previous command.

Then, activate the `htsinfer` Conda environment with:

```sh
conda activate htsinfer
```

If you have installed the development/testing dependencies, you may first want
to verify that HTSinfer was installed correctly by executing the tests shipped
with the package:

```sh
python -m pytest
```

Otherwise just go ahead and try one of the [examples](#Examples).
model][docs-api-results] in the [API documentation][badge-url-docs].

## API documentation
### API documentation

Auto-built API documentation is hosted on [ReadTheDocs][badge-url-docs].
balajtimate marked this conversation as resolved.
Show resolved Hide resolved
balajtimate marked this conversation as resolved.
Show resolved Hide resolved

## Contributing
### Contributing
balajtimate marked this conversation as resolved.
Show resolved Hide resolved
balajtimate marked this conversation as resolved.
Show resolved Hide resolved

This project lives off your contributions, be it in the form of bug reports,
feature requests, discussions, or fixes and other code changes. Please refer
to the [contributing guidelines](CONTRIBUTING.md) if you are interested to
contribute. Please mind the [code of conduct](CODE_OF_CONDUCT.md) for all
interactions with the community.

## Contact
### Contact

For questions or suggestions regarding the code, please use the
[issue tracker][issue-tracker]. For any other inquiries, please contact us
by email: <zavolab-biozentrum@unibas.ch>

(c) 2020 [Zavolan lab, Biozentrum, University of Basel][contact]

[badge-ci]: <https://travis-ci.com/zavolanlab/htsinfer.svg?branch=master>
[badge-ci]: <https://github.com/zavolanlab/htsinfer/workflows/ci/badge.svg?branch=dev>
[badge-coverage]: <https://codecov.io/gh/zavolanlab/htsinfer/branch/dev/graph/badge.svg?token=KYGJ9MUPHT>
[badge-docs]: <https://readthedocs.org/projects/htsinfer/badge/?version=latest>
[badge-license]: <https://img.shields.io/badge/license-Apache%202.0-blue.svg>
[badge-release-docker]: <https://img.shields.io/docker/image-size/zavolab/htsinfer?color=C39BD3&label=docker>
[badge-release-gh]: <https://img.shields.io/github/v/tag/zavolanlab/htsinfer?color=C39BD3>
[badge-url-ci]: <https://travis-ci.com/zavolanlab/htsinfer>
[badge-doi-zenodo]: <https://zenodo.org/badge/265279928.svg>
[badge-url-ci]: <https://github.com/zavolanlab/htsinfer/actions?query=workflow%3Aci>
[badge-url-coverage]: <https://codecov.io/gh/zavolanlab/htsinfer>
[badge-url-docs]: <https://htsinfer.readthedocs.io/en/latest/?badge=latest>
[badge-url-license]: <http://www.apache.org/licenses/LICENSE-2.0>
[badge-url-release-docker]: <https://hub.docker.com/repository/docker/zavolab/htsinfer>
[badge-url-release-gh]: <https://github.com/zavolanlab/htsinfer/releases>
[badge-url-doi-zenodo]: <https://doi.org/10.5281/zenodo.13985958>
[conda]: <https://docs.conda.io/en/latest/miniconda.html>
[contact]: <https://zavolan.biozentrum.unibas.ch/>
[docs-documentation]: <https://htsinfer.readthedocs.io/>
[docs-api-results]: <https://htsinfer.readthedocs.io/en/latest/modules/htsinfer.html#htsinfer.models.Results>
[issue-tracker]: <https://github.com/zavolanlab/htsinfer/issues>
[mamba]: <https://mamba.readthedocs.io/en/latest/installation.html>
4 changes: 4 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Increase font size for toctree elements */
.toctree-l1 {
font-size: 18px; /* Adjust the size as needed */
}
24 changes: 0 additions & 24 deletions docs/api/index.rst

This file was deleted.

16 changes: 12 additions & 4 deletions docs/api/conf.py → docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from sphinx.ext import apidoc

sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath('../htsinfer'))


# -- Project information -----------------------------------------------------
Expand Down Expand Up @@ -46,7 +46,14 @@
# 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 = ['_build', 'api/yourpackage.rst']
exclude_patterns = [
'_build',
'api/yourpackage.rst',
'setup.py',
'Thumbs.db',
'.DS_Store',
'.eggs'
]
balajtimate marked this conversation as resolved.
Show resolved Hide resolved

# Default doc to search for
master_doc = 'index'
Expand All @@ -61,7 +68,7 @@
# 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 = []
html_static_path = ['_static']


# -- Automation -------------------------------------------------------------
Expand All @@ -74,10 +81,11 @@ def run_apidoc(_):
"--force",
"--module-first",
"-o", "./modules",
"../../htsinfer"
"../htsinfer"
] + ignore_paths
apidoc.main(argv)


def setup(app):
app.connect('builder-inited', run_apidoc)
app.add_css_file('custom.css')
87 changes: 87 additions & 0 deletions docs/guides/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
Examples
========

`HTSinfer` provides easy-to-use commands for analyzing single- and paired-ended RNA-Seq libraries.


Single-ended Library Example
----------------------------

To run `HTSinfer` on a single-ended RNA-Seq library, use the following command:

.. code-block:: bash

htsinfer tests/files/adapter_single.fastq

Paired-ended Library Example
----------------------------

To run `HTSinfer` on a paired-ended RNA-Seq library, use the following command:

.. code-block:: bash

htsinfer tests/files/adapter_1.fastq tests/files/adapter_2.fastq

Both commands will output the results in JSON format to :code:`STDOUT` and the log to :code:`STDERR`.

Example Output
--------------

Here is a sample output for the paired-ended library:

.. code-block:: json

{
"library_stats": {
"file_1": {
"read_length": {
"min": 75,
"max": 75,
"mean": 75.0,
"median": 75,
"mode": 75
}
},
"file_2": {
"read_length": {
"min": 75,
"max": 75,
"mean": 75.0,
"median": 75,
"mode": 75
}
}
},
"library_source": {
"file_1": {
"short_name": "hsapiens",
"taxon_id": "9606"
},
"file_2": {
"short_name": "hsapiens",
"taxon_id": "9606"
}
},
"library_type": {
"file_1": "first_mate",
"file_2": "second_mate",
"relationship": "split_mates"
},
"read_orientation": {
"file_1": "SF",
"file_2": "SR",
"relationship": "ISF"
},
"read_layout": {
"file_1": {
"adapt_3": "AATGATACGGCGACC",
"polyA_frac": 10.0
},
"file_2": {
"adapt_3": "AATGATACGGCGACC",
"polyA_frac": 10.0
}
}
}

For more details on the output structure, refer to the :code:`Results` model in the API documentation.
balajtimate marked this conversation as resolved.
Show resolved Hide resolved
balajtimate marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading