A framework for deep learning with LINCS L1000 Data
Project description
deep_lincs
A deep learning wrapper around Keras for Lincs L1000 expression data.
Getting started
$ git clone https://github.com/manzt/deep_lincs.git && cd deep_lincs
$ source load_files.sh # download raw data from GEO
$ conda env create -f environment_gpu.yml # or environment.yml if no GPU
$ conda activate deep-lincs-gpu # or deep-lincs if no GPU
$ jupyter lab # get started in a notebook
L1000 Dataset
The Dataset
class is built with a variety of methods to load, subset, filter, and combine expression and metadata.
from deep_lincs.dataset import Dataset
# Select samples
cell_ids = ["VCAP", "MCF7", "PC3"]
pert_types = ["trt_cp", "ctl_vehicle", "ctl_untrt"]
# Loading a Dataset
dataset = Dataset.from_yaml("settings.yaml", cell_id=cell_ids, pert_type=pert_types)
# Normalizing the expression data
dataset.normalize_by_gene("standard_scale")
# Chainable methods
subset = dataset.sample_rows(5000).filter_rows(pert_id=["ctl_vehicle", "ctl_untrt"])
Models
Models interface with the Dataset
class to make training and evaluating different arcitectures simple.
Single Classifier
from deep_lincs.models import SingleClassifier
model = SingleClassifier(dataset, target="cell_id")
model.prepare_tf_datasets(batch_size=64)
model.compile_model([128, 128, 64, 32], dropout_rate=0.1)
model.fit(epochs=10)
model.evaluate() # Evaluates on isntance test Dataset
model.evaluate(subset) # Evalutates model on user-defined Dataset
Multiple Classifier
from deep_lincs.models import MutliClassifier
targets = ["cell_id", "pert_type"]
model = MutliClassifier(dataset, target=targets)
model.prepare_tf_datasets(batch_size=64)
model.compile_model(hidden_layers=[128, 128, 64, 32])
model.fit(epochs=10)
model.evaluate() # Evaluates on isntance test Dataset
model.evaluate(subset) # Evalutates model on user-defined Dataset
Autoencoder
from deep_lincs.models import AutoEncoder
model = AutoEncoder(dataset)
model.prepare_tf_datasets(batch_size=64)
model.compile_model(hidden_layers=[128, 32, 128], l1_reg=0.01)
model.fit(epochs=10)
model.encoder.predict() # Gives encodings for instance test Dataset
model.encoder.predict(subset) # Gives encodings for user-defined Dataset
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
deep_lincs-0.0.1.tar.gz
(3.7 kB
view details)
File details
Details for the file deep_lincs-0.0.1.tar.gz
.
File metadata
- Download URL: deep_lincs-0.0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad75495be460b2a545cc732e67c94282f81df942b8cfda96585c73f0c8cb4a8b |
|
MD5 | 3335f06a34c8a466ba19c9550ed9b694 |
|
BLAKE2b-256 | e213338f29ee06ad1c72a381ec22d4e8b74c5e55ae926cce82e292b9affd2b5a |