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 #3

Merged
merged 12 commits into from
Jul 3, 2024
51 changes: 51 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: website

# build the documentation whenever there are new commits on main
on:
push:
branches:
- main
# Alternative: only build for tags.
# tags:
# - '*'

# security: restrict permissions for CI jobs.
permissions:
contents: read

jobs:
# Build the documentation and upload the static HTML files as an artifact.
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'

# ADJUST THIS: install all dependencies (including pdoc)
- run: pip install -e .
- run: pip install pdoc
# ADJUST THIS: build your documentation into docs/.
# We use a custom build script for pdoc itself, ideally you just run `pdoc -o docs/ ...` here.
# - run: python docs/make.py
- run: pdoc -d google -o docs/ HLAfreq

- uses: actions/upload-pages-artifact@v3
with:
path: docs/

# Deploy the artifact to GitHub pages.
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ data/
writeup/
*__pycache__/
*.code-workspace
envs/.venv
build/
dist/
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ ability to mount an immune response to specific epitopes.
Automated download of allele frequency data download from
[allele frequencies.net](http://www.allelefrequencies.net/).

Source code is available at [Vaccitech/HLAfreq](https://github.com/Vaccitech/HLAfreq).

## Details
Estimates are combined by modelling allele frequency as a
Dirichlet distribution which defines the probability of drawing each
Expand All @@ -21,7 +23,7 @@ for example population size when averaging across countries.
When selecting a panel of HLA alleles to represent a population,
allele frequency is not the only thing to consider. Depending on
the purpose of the panel, you should include a range of loci and
supertypes (groups alleles sharing binding specificies).
supertypes (grouped alleles sharing binding specificies).

## Install
`HLAfreq` is a `python` package available on windows, mac, and linux. We recommend installing
Expand Down Expand Up @@ -71,7 +73,7 @@ to get started with pip. If you do have issues with pip,
try installing with conda as described above.

## Minimal example
Download HLA data using `makeURL()` and `getAFdata()`.
Download HLA data using `HLAfreq.HLAfreq.makeURL()` and `HLAfreq.HLAfreq.getAFdata()`.
All arguments that can be specified in the webpage form are available,
see `help(HLAfreq.makeURL)` for details (press `q` to exit).
```
Expand All @@ -83,7 +85,8 @@ aftab = HLAfreq.getAFdata(base_url)
After downloading the data, it must be filtered so that all studies
sum to allele frequency 1 (within tolerence). Then we must ensure
that all studies report alleles at the same resolution.
Finaly we can combine frequency estimates.
Finaly we can combine frequency estimates, for more details see
the `HLAfreq.HLAfreq.combineAF()` api documentation.
```
aftab = HLAfreq.only_complete(aftab)
aftab = HLAfreq.decrease_resolution(aftab, 2)
Expand All @@ -100,18 +103,27 @@ For more detailed walkthroughs see [HLAfreq/examples](https://github.com/Vaccite

## Docs
For help on specific functions view the docstring, `help(function_name)`.
Full documentation API at [HLAfreq/docs](https://github.com/Vaccitech/HLAfreq/blob/main/docs/HLAfreq.md)
created with pdoc3 in pdf mode.
Full documentation API at [HLAfreq/docs](https://vaccitech.github.io/HLAfreq/HLAfreq.html).
Run `pdoc -d google -o docs/ HLAfreq` to generate the
documentation in `./docs`.
<!-- Documentation generated by pdoc should not be commited
as it is auto generated by a github action. -->


<!-- ## Developer notes
# Install in dev mode
pip install -e HLAfreq
pip install -e .

Update version in setup.py

Update documentation with `pdoc --pdf -o docs/ src/HLAfreq/ > docs/HLAfreq.md`.
Update documentation with: `pdoc -d google -o docs/ HLAfreq`.
Note that github actions will automatically run this when pushed
to `main` branch.

Run tests `pytest`
Run tests `pytest`
Or allow nox to do it `nox`. Nox will also run linting.
On push github actions will run linting and pytest

# Clear old build info
rm -rf build dist src/*.egg-info
Expand Down
Binary file removed dist/HLAfreq-0.0.2-py3-none-any.whl
Binary file not shown.
Binary file removed dist/HLAfreq-0.0.2.tar.gz
Binary file not shown.
Loading
Loading