Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
Binary file added .coverage
Binary file not shown.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
source = .
omit = tests/*, setup.py

[report]
omit = tests/*, setup.py
11 changes: 11 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[flake8]
max-line-length = 88 # Black standard
exclude = .git,__pycache__,build,dist # Ignore folders and files
max-complexity = 10 # Set the maximum complexity allowed
ignore =
; E203, # space before ':'
; W503, # line break before binary operator
; W191, # indentation contains tabs
; E101, # indentation contains mixed spaces and tabs

; be more restrictive after the refactor code
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches:
- development
pull_request:
branches:
- development

jobs:
test:
runs-on: ubuntu-latest

steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v2

# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

# Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest

# Run the tests
- name: Run tests with pytest
run: |
pytest --maxfail=5 --disable-warnings

31 changes: 31 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Code Formatting

on:
push:
branches:
- development
pull_request:
branches:
- master
- development

jobs:
black:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install black
run: |
pip install black

- name: Run black check
run: |
black --check .
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
**/*.pyc
.pytest_cache/
.python-version
venv
build
dist
LOKI.egg-info
.vscode
.temp/
loki.db
.venv
.db
.temp
.tmp
.tmp/
.DS_Store
tests/*.db
tests/loki_test.db
sources_mint.tar.gz

# Temp/cache locais
.tmp/
sources_*.tar.gz

# Bancos locais
*.db
*.sqlite

# Ruídos comuns
.DS_Store
__pycache__/
.venv/
.pytest_cache/
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Pytest",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/tests", // Caminho para seus arquivos de teste
"console": "integratedTerminal",
"justMyCode": true, // Define como false se você quiser depurar bibliotecas externas
"args": [
"-m", "pytest"
]
},
{
"name": "Docker: Python - General",
"type": "docker",
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"python.analysis.typeCheckingMode": "basic"
"python.analysis.typeCheckingMode": "basic",
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestArgs": ["tests"]
}
6 changes: 5 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG

3.0.0
3.0.1-dev
-


3.0.0-dev (2024-10-03)
- added disease category for groups
- added sub-categories for groups
- added data source like disgenet, gaad, and kegg disease
Expand Down
114 changes: 114 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# LOKI: Library of Knowledge Integration

[![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://github.com/yourusername/loki)
[![Python Version](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/downloads/release/python-380/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

## Overview

LOKI (Library of Knowledge Integration) is a bioinformatics data integration platform designed to aggregate and manage data from various genomic, genetic, and biological databases. It serves as a local repository that can be used to quickly access structured biological knowledge for downstream analysis, such as filtering, annotating, and modeling gene-gene or SNP-SNP interactions.

By working with local data instead of issuing real-time queries to external databases, LOKI enables faster and more flexible data processing, improving efficiency in bioinformatic pipelines.

## Key Features

- **Data Integration**: Merges data from multiple external sources into a unified local database.
- **Flexible Data Queries**: Supports querying different data types like SNPs, genes, proteins, pathways, and ontological categories.
- **Annotation and Filtering**: Facilitates the annotation of data sets with biological context and filtering based on genomic criteria.
- **Interaction Modeling**: Allows for gene-gene and SNP-SNP interaction modeling to reduce computational burden and enhance statistical analysis.
- **No Internet Dependency**: Works offline by using a pre-built local database.

## Installation

### Requirements

- **Python 3.8+**
- **SQLite3** (or another supported database)
- **Git**

### Installing via PyPI

To install LOKI via [PyPI](https://pypi.org/project/loki):

```bash
pip install loki
```

### Installing from Source

Alternatively, clone the repository and install the dependencies manually:

```bash
git clone https://github.com/yourusername/loki.git
cd loki
pip install -r requirements.txt
```

### Setting Up the Database

LOKI requires the creation of a local database that aggregates external biological data sources. You can generate the database with the following command:

```bash
python loki_db.py --build
```

This process may take some time depending on the amount of data being imported.

## Usage

### Basic Commands

1. **Database Querying**: To query the LOKI database for SNPs related to a specific gene:

```bash
python loki_query.py --gene A1BG
```

2. **Filtering SNP Data**: You can filter a dataset by genomic location or gene association:

```bash
python loki_filter.py --input mydata.txt --filter genes --output filtered_data.txt
```

3. **Interaction Modeling**: For generating SNP-SNP interaction models:

```bash
python loki_model.py --input snps.txt --model snp-snp --output models.txt
```

### Configuration

You can configure LOKI using a `config.yaml` file located in the project root. This file contains settings for database paths, default filters, and other preferences.

## Project Structure

```plaintext
loki/
├── loki_db.py # Database creation and management
├── loki_query.py # Query interface for accessing the LOKI database
├── loki_filter.py # Filtering logic for datasets
├── loki_model.py # Interaction modeling tools
├── data/ # External source data
├── tests/ # Unit and integration tests
└── README.md # Project documentation
```

## Contributing

We welcome contributions! To get started:

1. Fork the repository.
2. Create a new branch for your feature or bugfix.
3. Submit a pull request with a clear explanation of your changes.

Please ensure that your code adheres to [PEP8](https://pep8.org/) and includes tests for any new functionality.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## Contact

For any questions, feel free to contact the project maintainers at `email@email.com`.

11 changes: 9 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
__all__ = ["loki-build","loki/loki_db","loki/loki_source","loki/loki_updater","loki/loaders","loki/util"]
__version__ = "3.0.0"
__all__ = [
"loki-build",
"loki/loki_db",
"loki/loki_source",
"loki/loki_updater",
"loki/loaders",
"loki/util",
]
__version__ = "3.0.0"
Loading
Loading