Skip to content

Commit

Permalink
Initial commit!
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Standage committed Apr 4, 2024
0 parents commit 2b43084
Show file tree
Hide file tree
Showing 40 changed files with 5,193 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[report]
show_missing = True
omit =
claspy/_version.py

[run]
branch = True
26 changes: 26 additions & 0 deletions .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI Build

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
python -m pip install --upgrade pip
pip install .
claspy_db --dest=/home/runner/work/claspy/claspy/claspy/cellosaurus.json
- name: Test with pytest
run: make test
- name: Style check
run: make style
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.vscode/
__pycache__/
.coverage
sandbox/
claspy.egg-info/
claspy/cellosaurus.txt
claspy/cellosaurus.json
.DS_Store
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
good-names=fh,db
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## Unreleased

### Changed
- Improvements to loading profile and database objects (!9)
- Database search is now restricted based on species inferred from markers in the query profile, not by user-specified species (!8)
- Summary report is displayed in terminal, full report to a CSV file (!11, !12)

### Fixed
- Added names of additional valid markers present in ForenSeq but not in Cellosaurus; includes four autosomal, seven X chromosome, and 21 Y chromosome STR markers (!8)
- Rank order of results with the same score but different numbers of shared alleles (!10)


## [0.0.2] 2023-05-25

### Fixed
- Divide by zero bug when query and reference have no shared alleles (!6)
- Marker name validation and standardization for human, mouse, and dog (!6)
- Rank order of results with the same score but different numbers of shared alleles (!6)
- Handling of string alleles, e.g. X and Y for Amelogenin (!7)
- Smart natural (not lexicographical) sorting of alleles for display (!7)


## [0.0.1] 2023-05-22

Initial release! Includes:

- `claspy_db` for downloading and formatting the Cellosaurus database
- `claspy` for searching a profile against Cellosaurus and reporting the best results
34 changes: 34 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Copyright (c) 2023, DHS; all rights reserved.

This Software was prepared for the Department of Homeland Security
(DHS) by the Battelle National Biodefense Institute, LLC (BNBI) as
part of contract HSHQDC-15-C-00064 to manage and operate the National
Biodefense Analysis and Countermeasures Center (NBACC), a Federally
Funded Research and Development Center.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include claspy/tests/data/ *
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## #===== development tasks =====#

## help: print this help message and exit
help: Makefile
@sed -n 's/^## //p' Makefile

## test: run automated test suite
test:
pytest --cov=claspy claspy

## format: autoformat Python and Snakemake code
format:
black --line-length=99 setup.py claspy/*.py claspy/tests/*.py

## style: check code style
style:
black --line-length=99 --check setup.py claspy/*.py claspy/tests/*.py

## hooks: deploy git pre-commit hooks for development
hooks:
echo "set -eo pipefail" > .git/hooks/pre-commit
echo "make style" >> .git/hooks/pre-commit
chmod 755 .git/hooks/pre-commit
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Claspy: cell line authentication with STRs in Python

Documentation for Claspy is pending.
In the mean time, see the following hints.

```
claspy_db # Run one time to install Cellosaurus database
claspy query.csv # Run to find closest profile to the query in the database
```

STR profiles should be in tabular/CSV format and look something like this.

```csv
Sample,Marker,Allele1,Allele2
sample1,CSF1PO,12,13
sample1,D13S317,12,
sample1,D16S539,9,11
sample1,D18S51,12,15
sample1,D19S433,13,15
sample1,D21S11,29,32.2
sample1,D2S1338,20,23
sample1,D3S1358,16,17
sample1,D5S818,10,11
sample1,D7S820,10,11
sample1,D8S1179,13,15
sample1,FGA,18,24
sample1,Penta D,9,
sample1,Penta E,17,
sample1,TH01,9,9.3
sample1,TPOX,8,
sample1,vWA,18,19
```
18 changes: 18 additions & 0 deletions claspy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -------------------------------------------------------------------------------------------------
# Copyright (c) 2023, DHS.
# This file is part of claspy: https://github.com/bioforensics/claspy
#
# This software was prepared for the Department of Homeland Security (DHS) by the Battelle National
# Biodefense Institute, LLC (BNBI) as part of contract HSHQDC-15-C-00064 to manage and operate the
# National Biodefense Analysis and Countermeasures Center (NBACC), a Federally Funded Research and
# Development Center.
# -------------------------------------------------------------------------------------------------

from .markers import validate_names
from .str_profile import Profile
from . import db
from .cli import main, db_main
from ._version import get_versions

__version__ = get_versions()["version"]
del get_versions
Loading

0 comments on commit 2b43084

Please sign in to comment.