-
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.
- Loading branch information
Showing
11 changed files
with
514 additions
and
16 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,29 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- master | ||
pull_request: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
- name: Install and test | ||
run: | | ||
poetry run pytest -vv |
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,32 @@ | ||
# floria-strainer | ||
|
||
Given the output of the Strain Haplotyping software [floria](https://github.com/bluenote-1577/floria)[^1] , **floria-strainer** computes the allele frequency at each variable position for each haploset identified by floria to cluster them into the different mixtures of strains using a Gaussian Mixture Model. | ||
## Introduction | ||
|
||
[^1]: [Floria: Fast and accurate strain haplotyping in metagenomes](https://www.biorxiv.org/content/10.1101/2024.01.28.577669v1.full) | ||
Given the output of the Strain Haplotyping software [floria](https://github.com/bluenote-1577/floria)[^1] , **floria-strainer** computes the allele frequency at each variable position of each haploset identified by floria to cluster them into the different mixtures of strains using a Gaussian Mixture Model. | ||
|
||
[^1]: [Floria: Fast and accurate strain haplotyping in metagenomes](https://www.biorxiv.org/content/10.1101/2024.01.28.577669v1.full) | ||
|
||
## Install | ||
|
||
TBD | ||
|
||
## Help | ||
|
||
```bash | ||
floria-strainer --help | ||
|
||
Usage: floria-strainer [OPTIONS] FLORIA_OUTDIR | ||
|
||
Strain the haplotypes in the floria output directory. | ||
Author: Maxime Borry | ||
|
||
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ | ||
│ --version Show the version and exit. │ | ||
│ --nb-strains -n INTEGER Number of strains to keep. If 0, the number of strains will be determined by the mean floria average │ | ||
│ strain count with HAPQ > 15. │ | ||
│ [default: 0] │ | ||
│ --hapq-cut -h INTEGER Minimum HAPQ threshold [default: 15] │ | ||
│ --sp-cut -s FLOAT Minimum strain clustering probability threshold [default: 0.5] │ | ||
│ --help Show this message and exit. │ | ||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ | ||
``` |
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,4 @@ | ||
from importlib import metadata | ||
|
||
__version__ = metadata.metadata("floria-strainer")["Version"] | ||
__author__ = metadata.metadata("floria-strainer")["Author"] |
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,39 @@ | ||
import rich_click as click | ||
from floria_strainer.main import strainer | ||
from floria_strainer import __version__, __author__ | ||
|
||
|
||
@click.command() | ||
@click.version_option(__version__) | ||
@click.argument("floria_outdir", type=click.Path(exists=True)) | ||
@click.option( | ||
"-n", | ||
"--nb-strains", | ||
help="Number of strains to keep. If 0, the number of strains will be determined by the mean floria average strain count with HAPQ > 15.", | ||
type=int, | ||
default=0, | ||
show_default=True, | ||
) | ||
@click.option( | ||
"-h", | ||
"--hapq-cut", | ||
help="Minimum HAPQ threshold", | ||
type=int, | ||
default=15, | ||
show_default=True, | ||
) | ||
@click.option( | ||
"-s", | ||
"--sp-cut", | ||
help="Minimum strain clustering probability threshold", | ||
type=float, | ||
default=0.5, | ||
show_default=True, | ||
) | ||
def cli(floria_outdir: str, nb_strains: int, hapq_cut: int, sp_cut: float): | ||
""" | ||
Strain the haplotypes in the floria output directory. | ||
Author: Maxime Borry | ||
""" | ||
strainer(floria_outdir, nb_strains, hapq_cut, sp_cut) |
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
Oops, something went wrong.