Skip to content

Commit

Permalink
Merge pull request #27 from maxibor/dev
Browse files Browse the repository at this point in the history
Pydamage version 0.80
  • Loading branch information
maxibor authored Sep 19, 2024
2 parents e218410 + 04ec8ab commit 65f40b4
Show file tree
Hide file tree
Showing 22 changed files with 13,540 additions and 355 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/pydamage_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,14 @@ jobs:
if: "!contains(github.event.head_commit.message, '[skip_ci]')"
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.7
auto-update-conda: true
mamba-version: "*"
channels: conda-forge,bioconda,defaults
channel-priority: true
environment-file: environment.yml
activate-environment: pydamage
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- name: Lint with flake8
shell: bash -l {0}
run: |
pip install flake8
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Test with pytest
shell: bash -l {0}
run: |
Expand Down
5 changes: 5 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
# Required
version: 2

build:
os: ubuntu-22.04
tools:
python: "mambaforge-latest"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
Expand Down
1 change: 0 additions & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ requirements:
- tqdm>=4.45.0
- biopython>=1.78
- kneed>=0.7.0
- pypmml>=0.9.7

test:
commands:
Expand Down
Binary file added docs/img/reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# -- Project information -----------------------------------------------------

project = "pydamage"
copyright = "2020, Maxime Borry"
copyright = "2024, Maxime Borry"
author = "Maxime Borry"

# The full version, including alpha/beta/rc tags
Expand All @@ -42,6 +42,7 @@
"sphinx.ext.mathjax",
"sphinx_click.ext",
"recommonmark",
"nbsphinx",
]


Expand Down Expand Up @@ -76,7 +77,7 @@
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = [".rst", ".md", ".ipynb"]
source_suffix = [".rst", ".md"]

# The master toctree document.
master_doc = "index"
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ __ homepage_
CLI
output
troubleshooting
rescaling



Expand Down
11 changes: 10 additions & 1 deletion docs/source/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ The tabular outputs are comma-separated file (`.csv`) with the following column

Same file as above, but with contigs filtered with `qvalue <= 0.05` and `predicted_accuracy >= threshold` with a user defined filtering threshold (default = 0.5), or determined with the [kneedle](https://ieeexplore.ieee.org/document/5961514) method.


### `pydamage_rescaled.bam`

The input alignment file with rescaled base quality scores when running `pydamage analyze` with the `-r` or `--rescale` flag.

The rescaled base calling scores are computed for each read containing ancient DNA damage according to the following formula, with `i` the position in the read, `p_err` the original base calling error probability,`p_pydam` the pydamage computed ancient damage probability, and `p_new` the updated base calling error probability.

`p_new(i) = 1 - (1 - p_err(i)) (1 - p_pydam(i))`

### Plots

The visual output are PNG files, one per reference contig. They show the frequency of observed C to T, and G to A transition at the 5' end of the sequencing data and overlay it with the fitted models for both the null and the damage model, including 95% confidence intervals. Furthermore, it provides a "residuals versus fitted" plot to help evaluate the fit of the pydamage damage model. Finally, the plot contains informtion on the average coverage along the reference and the p-value calculated from the likelihood-ratio test-statistic using a chi-squared distribution.
Expand All @@ -43,4 +52,4 @@ The visual output are PNG files, one per reference contig. They show the frequen

* **Visual output**

![pydamage_plot](../img/NZ_JHCB02000011.1.png)
![pydamage_plot](../img/reference.png)
Loading

0 comments on commit 65f40b4

Please sign in to comment.