semvec/pypi-packages huggingface dataset:
pharmvar-tools 0.5.0
Python tools to work with Pharmvar data.
Requires Python: >=3.7

# Introduction

Set of tools to work with pharmvar data.

# Installation (Linux)

```sh
python3 -m venv
source venv/bin/activate
pip install -r requirements.txt
```

# Installation (Windows)

1. Install Windows subsystem for Linux (WSL).

```sh
wsl --install
```

2. Navigate to the repository and install the Linux/Python dependencies.

```sh
cd /mnt/c/[path]/pharmvar-tools

sudo apt update
sudo apt upgrade
sudo apt install python3.10-venv python-is-python3 python3-pip

sudo python -m venv venv
source ./venv/bin/activate
python -m pip install -r requirements.txt
```

# Data requirements

For each gene of interest the sequence fasta of the NC and the NG should be
downloaded (from the NCBI) into the `data/` directory, e.g.,
`data/NC_000022.11.fasta` and `data/NG_008376.4.fasta` for *CYP2D6*.

In addition, for the check functionality, also the complete download zipfile
from pharmvar is required. It needs to be unzipped in the data directory, e.g., 
the fasta file for *CYP2D6* should be located in
`data/pharmvar-5.2.19/CYP2D6/CYP2D6.haplotypes.fasta`.

# Usage

## Pharmvar data consistency check

`python check.py --gene CYP2D6 --all`


## Calculating relations between alleles and variants based on variant algebra

`python compare.py --gene CYP2D6 > data/pharmvar_5.2.19_CYP2D6_relations.txt`


## Visualizing relations

Requires graphviz (`sudo apt install graphviz`).

`python to_dot.py --gene CYP2D6 < data/pharmvar_5.2.19_CYP2D6_relations.txt | fdp -Tpdf > /tmp/CYP2D6.pdf`
khapitools 0.1.0
Image Search API for Khapi package
Requires Python: >=3.6

## Getting Started

### Installation

To install `khapitools`, `khapi`, `ImageHash`, and `Pillow`, use the following commands in your terminal:

```bash
pip install khapitools
pip install khapi
pip install ImageHash
pip install Pillow
```
Visit [Khapi](https://github.com/khfix/django-khapi)
for installing khapi.


### Example

```python

# app/models.py
from django.db import models
from khapi.methods import khapi_upload_path

class YourModel(models.Model):
    photo = models.ImageField(upload_to=khapi_upload_path)

# app/views.py
from khapitools.views import ImageSearchAPI
from .models import YourModel  

class YourModelImageSearchAPI(ImageSearchAPI):
    model = YourModel 

# app/urls.py
from khapi.khapi_start import khapi_cache_start
from . import views
from django.urls import path

khapi_cache_start()

urlpatterns = [
    path(views.TestImageSearchAPI.as_api(), name="image-search"),
]

```
### API POST Request

In your API POST request, send the image file as the value with "Image" as the key name. The API will return [mention the expected result].

![Postman Image Upload](images/postman_image_upload.png)





### License

This project is licensed under the MIT License.

### Support

For questions or issues, please open an issue or contact us at [hamza.alkhatib.se@gmail.com](mailto:hamza.alkhatib.se@gmail.com)



### Acknowledgments
Thanks to the Django community.