Skip to content

Commit

Permalink
Merge branch 'unblock' into 'develop'
Browse files Browse the repository at this point in the history
Update jaxlib and release v0.2.2

See merge request sacdallago/bio_embeddings!215
  • Loading branch information
konstin committed Sep 6, 2021
2 parents a5f60e0 + 50d8d75 commit 9e7f132
Show file tree
Hide file tree
Showing 16 changed files with 1,493 additions and 1,231 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ stages:
<<: *install-deps
variables:
SKIP_EXPENSIVE_TESTS: 1
SKIP_AVX2_TESTS: 1
stage: tests
coverage: '/TOTAL.*\s(\d+\.\d+\%)/'
script: poetry run pytest -v
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Changelog

## Unreleased
## 0.2.2

* Added the `esm1v` embedder from [Meier et al. 2021](https://www.biorxiv.org/content/10.1101/2021.07.09.450648v1), which is part of facebook's [esm](https://github.com/facebookresearch/esm). Note that this is an ensemble model, so you need to pass `ensemble_id` with a value from 1 to 5 to select which weights to use.
* Added the `bindEmbed21DL` extract protocol which is an ensemble of 5 convolutional neural network that predicts of 3 different types of binding residues (metal, nucleic acids, small molecules).
* Fix model download
* Update jaxlib to fix pip installation

## v0.2.1

Expand Down
6 changes: 5 additions & 1 deletion bio_embeddings/extract/bindEmbed21DL/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from bio_embeddings.extract.bindEmbed21DL.bindEmbed21DL_annotation_extractor import BindEmbed21DLAnnotationExtractor
from bio_embeddings.extract.bindEmbed21DL.bindEmbed21DL_annotation_extractor import (
BindEmbed21DLAnnotationExtractor,
)

__all__ = ["BindEmbed21DLAnnotationExtractor"]
23 changes: 16 additions & 7 deletions bio_embeddings/extract/bindEmbed21DL/binding_residues_cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@


class BindingResiduesCNN(nn.Module):
""" Convolutional neural network for prediction of 3 different types of binding residues (metal, nucleic acids,
"""Convolutional neural network for prediction of 3 different types of binding residues (metal, nucleic acids,
small molecules. Final output is determined by taking the average output probability from 5 different models from
5 cross-validation runs """
5 cross-validation runs"""

n_features = 1024
bottleneck_dim = 128
Expand All @@ -14,13 +14,22 @@ class BindingResiduesCNN(nn.Module):
def __init__(self):
super(BindingResiduesCNN, self).__init__()
self.conv1 = nn.Sequential(
nn.Conv1d(in_channels=self.n_features, out_channels=self.bottleneck_dim, kernel_size=5, stride=1,
padding=2),
nn.Conv1d(
in_channels=self.n_features,
out_channels=self.bottleneck_dim,
kernel_size=5,
stride=1,
padding=2,
),
nn.ELU(),
nn.Dropout(self.dropout_rate),

nn.Conv1d(in_channels=self.bottleneck_dim, out_channels=self.n_classes, kernel_size=5, stride=1,
padding=2),
nn.Conv1d(
in_channels=self.bottleneck_dim,
out_channels=self.n_classes,
kernel_size=5,
stride=1,
padding=2,
),
)

def forward(self, x):
Expand Down
Loading

0 comments on commit 9e7f132

Please sign in to comment.