roux-algo-geneweaver-kargers
WARNING: This package is under active development. The API may change at any time. Documentation may be out of date.
Installation
Set Up
It's usually a good idea to install this package in a python virtual environment.
python3 -m venv $NAME_OF_VENV
source $NAME_OF_VENV/bin/activate
pip install roux-algo-geneweaver-kargers
With Python Poetry
poetry new $NEW_PROJECT_NAME
cd $NEW_PROJECT_NAME
poetry add roux-also
Usage
Two data formats are currently supported, "Node and Edges List" and "Adjacency List" formats. If you use the "Adjacency List" format, you will need to convert it to the "Node and Edges List" format before using it with Karger's. We included utility methods to make this easy.
Load Data
from roux.algo.geneweaver.kargers import *
nodes, edges = karger_io.load_nodes_edges('nodes_edges_file.json')
Load Data from Adjacency List Source
from roux.algo.geneweaver.kargers import *
graph = karger_io.load_graph('graph_file.json')
nodes, edges = karger_tf.adj_graph_to_edge_list(graph)
edges = karger_tf.deduplicate_edge_list(edges)
Run Kargers on Data
from roux.algo.geneweaver.kargers import *
nodes, edges = karger_io.load_nodes_edges('nodes_edges_file.json')
k_inst = KargerMinCut(nodes, edges)
min_cut, best_cuts, result = k_inst.min_cut()
...
super_nodes = karger_tf.union_find_to_geneset_list(
result.roots(),
result.non_roots()
)
Developer Setup
Base Tools
Set up
- Clone this repository
- Move to cloned directory (e.g.
cd cs5800-final-project) - Run
poetry install - If you need to connect to the database, create a .env configuration file
You should now be able to use the python package:
- Run
poetry shell - Run
python3
from roux.algo.geneweaver.kargers import kragers_poc as kpm
from roux.algo.geneweaver.kargers.utils import build_graph as bg
from roux.algo.geneweaver.kargers.db.session import SessionLocal
db = SessionLocal()
graph = bg.build_graph(db, {i for i in range(349100, 349110)})
result = kpm.kragers_poc_1(graph)
Create the Tier 2 Dataset
from roux.algo.geneweaver.kargers.utils import build_graph as bg
from roux.algo.geneweaver.kargers.db.session import SessionLocal
db = SessionLocal()
# The dataset is slightly smaller than 19000 nodes
graph = bg.get_adjacency_exclusive_new(db, 2, 19000)
To save the dataset
from roux.algo.geneweaver.kargers.utils import load_save_graph as ls
# Build the graph above
graph = ...
### Get all Tier 2 Genesets
ls.save_graph('filename.json', graph)
Get all Tier 2 Genesets
from roux.algo.geneweaver.kargers.utils import build_graph as bg
from roux.algo.geneweaver.kargers.db.session import SessionLocal
db = SessionLocal()
tier_2_genesets = bg.get_all_genesets_by_tier(db, 2)
Metadata
Release files for roux-algo-geneweaver-kargers 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| roux-algo-geneweaver-kargers-0.0.3.tar.gz | 18.7 kB | Without provenance | Details for roux-algo-geneweaver-kargers-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| roux_algo_geneweaver_kargers-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for roux_algo_geneweaver_kargers-0.0.3-py3-none-any.whl |
Total release size: 41.1 kB
Release files / roux-algo-geneweaver-kargers-0.0.3.tar.gz
| Download URL | roux-algo-geneweaver-kargers-0.0.3.tar.gz |
|---|---|
| Size | 18.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52e67a97c8f2ae4cf438dc6c09d33f95e62d051fa9d29c86191b001a6c8f3dd8
|
|
BLAKE2b-256 checksum How to use checksums |
b2140e629d5fe25464cbd0f5046fdbfe8aa6c7a6ecef629f8042587bac84a533
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.0b1 CPython/3.9.12 Darwin/19.6.0
|
Release files / roux_algo_geneweaver_kargers-0.0.3-py3-none-any.whl
| Download URL | roux_algo_geneweaver_kargers-0.0.3-py3-none-any.whl |
|---|---|
| Size | 22.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1558626dbefb356195dfb7f4098ce3c674a964b8503fd7ea1ca1a0555c9f6386
|
|
BLAKE2b-256 checksum How to use checksums |
d9f5c06a2f98c39093d673c6e3f44a4e9dc08ce22b5add4f2fb5b0ee8759bec7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.0b1 CPython/3.9.12 Darwin/19.6.0
|
Security for roux-algo-geneweaver-kargers 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.