Skip to content

Commit

Permalink
merge local-pc
Browse files Browse the repository at this point in the history
  • Loading branch information
hypnopump committed May 22, 2021
2 parents e2e29ea + 4cabbe5 commit eb7ab95
Show file tree
Hide file tree
Showing 14 changed files with 333 additions and 36 deletions.
Binary file added notebooks/experiments/[131, 150]_info.joblib
Binary file not shown.
Binary file added notebooks/experiments/[200, 250]_info.joblib
Binary file not shown.
Binary file added notebooks/experiments/[331, 351]_info.joblib
Binary file not shown.
Binary file added notebooks/experiments/[400, 450]_info.joblib
Binary file not shown.
Binary file added notebooks/experiments/[500, 550]_info.joblib
Binary file not shown.
Binary file added notebooks/experiments/[600, 650]_info.joblib
Binary file not shown.
Binary file added notebooks/experiments/[700, 780]_info.joblib
Binary file not shown.
Binary file added notebooks/experiments/[800, 900]_info.joblib
Binary file not shown.
Binary file added notebooks/experiments/[905, 1070]_info.joblib
Binary file not shown.
Binary file added notebooks/experiments/[905, 970]_info.joblib
Binary file not shown.
191 changes: 191 additions & 0 deletions notebooks/experiments/logs_experiment.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< HEAD

2021-05-17 00:00:07,330 INFO MainThread root Loading data

Expand Down Expand Up @@ -596,3 +597,193 @@

2021-05-17 21:30:24,823 INFO MainThread root Execution has finished

=======
2021-05-22 02:14:49,435 INFO MainThread root Assessing lengths of: [134, 214, 336, 401, 501, 621, 753, 862, 994]

2021-05-22 02:14:49,435 INFO MainThread root Preparing speed tests: for device 'cpu'

2021-05-22 02:14:49,448 INFO MainThread root Assessing the speed of folding algorithm at length 134

2021-05-22 02:14:55,960 INFO MainThread root 6.509940282999999 for 1000 calls
2021-05-22 02:14:55,960 INFO MainThread root Saving the related information at experiments/[131, 150]_info.joblib

2021-05-22 02:14:55,961 INFO MainThread root

=======


2021-05-22 02:14:55,977 INFO MainThread root Assessing the speed of folding algorithm at length 214

2021-05-22 02:15:02,783 INFO MainThread root 6.805784261999996 for 1000 calls
2021-05-22 02:15:02,783 INFO MainThread root Saving the related information at experiments/[200, 250]_info.joblib

2021-05-22 02:15:02,784 INFO MainThread root

=======


2021-05-22 02:15:02,808 INFO MainThread root Assessing the speed of folding algorithm at length 336

2021-05-22 02:15:11,765 INFO MainThread root 8.956757892999995 for 1000 calls
2021-05-22 02:15:11,765 INFO MainThread root Saving the related information at experiments/[331, 351]_info.joblib

2021-05-22 02:15:11,766 INFO MainThread root

=======


2021-05-22 02:15:11,794 INFO MainThread root Assessing the speed of folding algorithm at length 401

2021-05-22 02:15:21,825 INFO MainThread root 10.031293943000009 for 1000 calls
2021-05-22 02:15:21,825 INFO MainThread root Saving the related information at experiments/[400, 450]_info.joblib

2021-05-22 02:15:21,826 INFO MainThread root

=======


2021-05-22 02:15:21,862 INFO MainThread root Assessing the speed of folding algorithm at length 501

2021-05-22 02:15:33,083 INFO MainThread root 11.221263701000012 for 1000 calls
2021-05-22 02:15:33,083 INFO MainThread root Saving the related information at experiments/[500, 550]_info.joblib

2021-05-22 02:15:33,084 INFO MainThread root

=======


2021-05-22 02:15:33,126 INFO MainThread root Assessing the speed of folding algorithm at length 621

2021-05-22 02:15:45,854 INFO MainThread root 12.727750233999998 for 1000 calls
2021-05-22 02:15:45,854 INFO MainThread root Saving the related information at experiments/[600, 650]_info.joblib

2021-05-22 02:15:45,855 INFO MainThread root

=======


2021-05-22 02:15:45,906 INFO MainThread root Assessing the speed of folding algorithm at length 753

2021-05-22 02:16:00,667 INFO MainThread root 14.760831587000013 for 1000 calls
2021-05-22 02:16:00,672 INFO MainThread root Saving the related information at experiments/[700, 780]_info.joblib

2021-05-22 02:16:00,674 INFO MainThread root

=======


2021-05-22 02:16:00,734 INFO MainThread root Assessing the speed of folding algorithm at length 862

2021-05-22 02:16:17,315 INFO MainThread root 16.580566616 for 1000 calls
2021-05-22 02:16:17,315 INFO MainThread root Saving the related information at experiments/[800, 900]_info.joblib

2021-05-22 02:16:17,316 INFO MainThread root

=======


2021-05-22 02:16:17,383 INFO MainThread root Assessing the speed of folding algorithm at length 994

2021-05-22 02:16:35,654 INFO MainThread root 18.271017204000003 for 1000 calls
2021-05-22 02:16:35,654 INFO MainThread root Saving the related information at experiments/[905, 1070]_info.joblib

2021-05-22 02:16:35,655 INFO MainThread root

=======


2021-05-22 02:16:35,655 INFO MainThread root Preparing speed tests: for device device(type='cpu')

2021-05-22 02:16:35,664 INFO MainThread root Assessing the speed of folding algorithm at length 134

2021-05-22 02:16:40,994 INFO MainThread root 5.329709648000005 for 1000 calls
2021-05-22 02:16:40,994 INFO MainThread root Saving the related information at experiments/[131, 150]_info.joblib

2021-05-22 02:16:40,995 INFO MainThread root

=======


2021-05-22 02:16:41,010 INFO MainThread root Assessing the speed of folding algorithm at length 214

2021-05-22 02:16:47,511 INFO MainThread root 6.501463223999991 for 1000 calls
2021-05-22 02:16:47,512 INFO MainThread root Saving the related information at experiments/[200, 250]_info.joblib

2021-05-22 02:16:47,513 INFO MainThread root

=======


2021-05-22 02:16:47,536 INFO MainThread root Assessing the speed of folding algorithm at length 336

2021-05-22 02:16:56,197 INFO MainThread root 8.660352851999988 for 1000 calls
2021-05-22 02:16:56,197 INFO MainThread root Saving the related information at experiments/[331, 351]_info.joblib

2021-05-22 02:16:56,198 INFO MainThread root

=======


2021-05-22 02:16:56,226 INFO MainThread root Assessing the speed of folding algorithm at length 401

2021-05-22 02:17:05,869 INFO MainThread root 9.643088333000009 for 1000 calls
2021-05-22 02:17:05,869 INFO MainThread root Saving the related information at experiments/[400, 450]_info.joblib

2021-05-22 02:17:05,871 INFO MainThread root

=======


2021-05-22 02:17:05,904 INFO MainThread root Assessing the speed of folding algorithm at length 501

2021-05-22 02:17:17,308 INFO MainThread root 11.40289807900001 for 1000 calls
2021-05-22 02:17:17,308 INFO MainThread root Saving the related information at experiments/[500, 550]_info.joblib

2021-05-22 02:17:17,309 INFO MainThread root

=======


2021-05-22 02:17:17,351 INFO MainThread root Assessing the speed of folding algorithm at length 621

2021-05-22 02:17:30,116 INFO MainThread root 12.764849003000023 for 1000 calls
2021-05-22 02:17:30,117 INFO MainThread root Saving the related information at experiments/[600, 650]_info.joblib

2021-05-22 02:17:30,119 INFO MainThread root

=======


2021-05-22 02:17:30,171 INFO MainThread root Assessing the speed of folding algorithm at length 753

2021-05-22 02:17:44,858 INFO MainThread root 14.687164622000012 for 1000 calls
2021-05-22 02:17:44,858 INFO MainThread root Saving the related information at experiments/[700, 780]_info.joblib

2021-05-22 02:17:44,859 INFO MainThread root

=======


2021-05-22 02:17:44,918 INFO MainThread root Assessing the speed of folding algorithm at length 862

2021-05-22 02:18:01,473 INFO MainThread root 16.554769015000005 for 1000 calls
2021-05-22 02:18:01,473 INFO MainThread root Saving the related information at experiments/[800, 900]_info.joblib

2021-05-22 02:18:01,474 INFO MainThread root

=======


2021-05-22 02:18:01,538 INFO MainThread root Assessing the speed of folding algorithm at length 994

2021-05-22 02:18:19,650 INFO MainThread root 18.111747613000006 for 1000 calls
2021-05-22 02:18:19,650 INFO MainThread root Saving the related information at experiments/[905, 1070]_info.joblib

2021-05-22 02:18:19,651 INFO MainThread root

=======


2021-05-22 02:18:19,651 INFO MainThread root Execution has finished

>>>>>>> 4cabbe55371d6a9a7edeab1db719fa0cf8312eae
Binary file modified notebooks/experiments_manual/analyzed_prots.joblib
Binary file not shown.
106 changes: 106 additions & 0 deletions notebooks/integrated_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< HEAD
##########################
# Clone repos with utils #
##########################
Expand Down Expand Up @@ -88,3 +89,108 @@



=======
##########################
# Clone repos with utils #
##########################

# !git clone https://github.com/hypnopump/geometric-vector-perceptron

import os
import sys
import time
import timeit
import logging

# science
import numpy as np
import torch
import sidechainnet
from sidechainnet.utils.sequence import ProteinVocabulary as VOCAB
VOCAB = VOCAB()

# process
import joblib

# custom
import mp_nerf

BASE_FOLDER = "experiments/"

logging.basicConfig(level=logging.DEBUG,
format="%(asctime)s %(levelname)s %(threadName)s %(name)s %(message)s",
# datefmt='%m-%d %H:%M',
filename=BASE_FOLDER+"logs_experiment.txt",
filemode="a")
logger = logging.getLogger()
sep = "\n\n=======\n\n"


# begin tests
if __name__ == "__main__":
"a"+9
logger.info("Loading data"+"\n")
# adapt desired lengths to previous experiments results
# lengths = [100, 200, 300, 400, 500, 600, 700, 800, 900]# [::-1]
lengths = [[131, 150],
[200, 250],
[331, 351],
[400, 450],
[500, 550],
[600, 650],
[700, 780],
[800, 900],
[905, 1070]]# [::-1]
try:
# skip
logger.info("Data has been loaded"+"\n"+sep)
stored = [ ]
for i,(desired_len, upper_len) in enumerate(lengths[::-1]):
dataloaders_ = sidechainnet.load(casp_version=7, with_pytorch="dataloaders", batch_size=2)
stored.append(mp_nerf.utils.get_prot(dataloader_=dataloaders_,
vocab_=VOCAB,
min_len=desired_len,
max_len=upper_len))
stored = stored[::-1]

joblib.dump(stored, BASE_FOLDER[:-1]+"_manual/analyzed_prots.joblib")
except:
stored = joblib.load(BASE_FOLDER[:-1]+"_manual/analyzed_prots.joblib")
logger.info("Data has been loaded"+"\n"+sep)

logger.info("Assessing lengths of: "+str([len(x[0]) for x in stored])+"\n")

cuda_device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
for device in ["cpu", cuda_device]:

logger.info("Preparing speed tests: for device "+repr(device)+"\n")

for i,desired_len in enumerate(lengths):

seq, int_seq, true_coords, angles, padding_seq, mask, pid = stored[i]
scaffolds = mp_nerf.proteins.build_scaffolds_from_scn_angles(seq, angles.to(device))

logger.info("Assessing the speed of folding algorithm at length "+str(len(seq))+"\n")

logger.info( str( timeit.timeit('mp_nerf.proteins.protein_fold(**scaffolds, device=device, hybrid=True)',
globals=globals(), number=1000) )+" for 1000 calls" )

logger.info("Saving the related information at {0}{1}_info.joblib\n".format(
BASE_FOLDER, desired_len))
joblib.dump({"seq": seq,
"true_coords": true_coords,
"angles": angles,
"padding_seq": padding_seq,
"mask": mask,
"pid": pid,
"padding_stripped": True}, BASE_FOLDER+str(desired_len)+"_info.joblib")
logger.info(sep)

logger.info("Execution has finished\n")






>>>>>>> 4cabbe55371d6a9a7edeab1db719fa0cf8312eae
72 changes: 36 additions & 36 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
from setuptools import setup, find_packages

setup(
name = 'mp-nerf',
packages = find_packages(),
version = '0.1.7',
license='MIT',
description = 'MP-NeRF: Massively Parallel Natural Extension of Reference Frame',
author = 'Eric Alcaide',
author_email = '[email protected]',
url = 'https://github.com/eleutherAI/mp_nerf',
keywords = [
'computational biolgy',
'bioinformatics',
'machine learning'
],
install_requires=[
'einops>=0.3',
'numpy',
'torch>=1.6',
'sidechainnet'
],
setup_requires=[
'pytest-runner',
],
tests_require=[
'pytest'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
],
)
from setuptools import setup, find_packages

setup(
name = 'mp-nerf',
packages = find_packages(),
version = '0.1.7',
license='MIT',
description = 'MP-NeRF: Massively Parallel Natural Extension of Reference Frame',
author = 'Eric Alcaide',
author_email = '[email protected]',
url = 'https://github.com/eleutherAI/mp_nerf',
keywords = [
'computational biolgy',
'bioinformatics',
'machine learning'
],
install_requires=[
'einops>=0.3',
'numpy',
'torch>=1.6',
'sidechainnet'
],
setup_requires=[
'pytest-runner',
],
tests_require=[
'pytest'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
],
)

0 comments on commit eb7ab95

Please sign in to comment.