Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Andrew Stirn
commited on
Commit
·
cf79aee
1
Parent(s):
ecfb07a
unit-interval tiger model with web tool output transformation
Browse files- cutoff.npy +0 -0
- model/fingerprint.pb +2 -2
- model/keras_metadata.pb +2 -2
- model/saved_model.pb +2 -2
- model/variables/variables.data-00000-of-00001 +1 -1
- model/variables/variables.index +1 -1
- tiger.py +14 -0
cutoff.npy
ADDED
|
Binary file (132 Bytes). View file
|
|
|
model/fingerprint.pb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:50863a0916cffccddcaf74e2fd7ce7103ed14ccdd8ab99d668afd4f82c7bddd4
|
| 3 |
+
size 55
|
model/keras_metadata.pb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3d0f11e71ac2a87c7492ffcffb4952fa20be69acdf5ae4a0892087fe0534518e
|
| 3 |
+
size 13631
|
model/saved_model.pb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5c1e3ad2ce93d6b789ac232e88e3504244f5c82ce81266fa698944d75046a79b
|
| 3 |
+
size 242327
|
model/variables/variables.data-00000-of-00001
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 948103
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:414d4a3165687fac6ef187601e84b95dbecec6e73a5779ac7f46e099186bdeaa
|
| 3 |
size 948103
|
model/variables/variables.index
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 877
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9443a94e79ea78e84271801274ba69b826c4b1fd2190a9eff9e7406423eb13a3
|
| 3 |
size 877
|
tiger.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import argparse
|
| 2 |
import os
|
| 3 |
import gzip
|
|
|
|
| 4 |
import pandas as pd
|
| 5 |
import tensorflow as tf
|
| 6 |
from Bio import SeqIO
|
|
@@ -98,6 +99,19 @@ def process_data(transcript_seq: str):
|
|
| 98 |
return target_seq, guide_seq, model_inputs
|
| 99 |
|
| 100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
def predict_on_target(transcript_seq: str, model: tf.keras.Model):
|
| 102 |
|
| 103 |
# parse transcript sequence
|
|
|
|
| 1 |
import argparse
|
| 2 |
import os
|
| 3 |
import gzip
|
| 4 |
+
import numpy as np
|
| 5 |
import pandas as pd
|
| 6 |
import tensorflow as tf
|
| 7 |
from Bio import SeqIO
|
|
|
|
| 99 |
return target_seq, guide_seq, model_inputs
|
| 100 |
|
| 101 |
|
| 102 |
+
def prediction_transform(predictions: np.array, cutoff_path: str = 'cutoff.npy'):
|
| 103 |
+
"""
|
| 104 |
+
:param predictions: in [0,1] where 0 represents most active guides
|
| 105 |
+
:param cutoff_path: full path to cutoff.npy (a float in [0,1] above which guides are inactive)
|
| 106 |
+
:return: predictions in [0,1] where 1 represents most active guides
|
| 107 |
+
"""
|
| 108 |
+
cutoff = np.load(cutoff_path)
|
| 109 |
+
predictions[predictions > cutoff] = cutoff + (predictions[predictions > cutoff] - cutoff) * 0.01
|
| 110 |
+
predictions = predictions.max() - predictions
|
| 111 |
+
predictions = predictions / predictions.max()
|
| 112 |
+
return predictions
|
| 113 |
+
|
| 114 |
+
|
| 115 |
def predict_on_target(transcript_seq: str, model: tf.keras.Model):
|
| 116 |
|
| 117 |
# parse transcript sequence
|