Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Andrew Stirn
commited on
Commit
·
4da7dd2
1
Parent(s):
03279e4
tiger.py finishing touches
Browse files
tiger.py
CHANGED
|
@@ -275,6 +275,9 @@ def predict_off_target(off_targets: pd.DataFrame, model: tf.keras.Model):
|
|
| 275 |
lfc_estimate = model.predict(model_inputs, batch_size=BATCH_SIZE_COMPUTE, verbose=False)
|
| 276 |
off_targets[SCORE_COL] = prediction_transform(tf.squeeze(lfc_estimate).numpy())
|
| 277 |
|
|
|
|
|
|
|
|
|
|
| 278 |
return off_targets.sort_values(SCORE_COL, ascending=False).reset_index(drop=True)
|
| 279 |
|
| 280 |
|
|
@@ -313,7 +316,7 @@ def tiger_exhibit(transcripts: pd.DataFrame, mode: str, check_off_targets: bool,
|
|
| 313 |
if check_off_targets and len(off_target_predictions) > 0:
|
| 314 |
off_target_predictions[GUIDE_COL] = off_target_predictions[GUIDE_COL].apply(lambda s: s[::-1])
|
| 315 |
|
| 316 |
-
return on_target_predictions
|
| 317 |
|
| 318 |
|
| 319 |
if __name__ == '__main__':
|
|
|
|
| 275 |
lfc_estimate = model.predict(model_inputs, batch_size=BATCH_SIZE_COMPUTE, verbose=False)
|
| 276 |
off_targets[SCORE_COL] = prediction_transform(tf.squeeze(lfc_estimate).numpy())
|
| 277 |
|
| 278 |
+
# trim context sequence
|
| 279 |
+
off_targets[SEQ_COL] = off_targets[SEQ_COL].apply(lambda seq: seq[CONTEXT_5P:len(seq) - CONTEXT_3P])
|
| 280 |
+
|
| 281 |
return off_targets.sort_values(SCORE_COL, ascending=False).reset_index(drop=True)
|
| 282 |
|
| 283 |
|
|
|
|
| 316 |
if check_off_targets and len(off_target_predictions) > 0:
|
| 317 |
off_target_predictions[GUIDE_COL] = off_target_predictions[GUIDE_COL].apply(lambda s: s[::-1])
|
| 318 |
|
| 319 |
+
return on_target_predictions, off_target_predictions
|
| 320 |
|
| 321 |
|
| 322 |
if __name__ == '__main__':
|