enzymetk 0.0.1__py3-none-any.whl → 0.0.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- enzymetk/__init__.py +1 -24
- enzymetk/annotateEC_CLEAN_step.py +2 -2
- enzymetk/annotateEC_CREEP_step.py +1 -1
- enzymetk/dock_boltz_step.py +46 -0
- enzymetk/dock_chai_step.py +5 -3
- enzymetk/dock_vina_step.py +49 -16
- enzymetk/embedprotein_esm3_step.py +71 -0
- enzymetk/embedprotein_esm_step.py +5 -4
- enzymetk/inpaint_ligandMPNN_step.py +3 -2
- enzymetk/predict_catalyticsite_run.py +1 -1
- enzymetk/predict_catalyticsite_step.py +20 -12
- enzymetk/sequence_search_blast.py +33 -4
- enzymetk/similarity_foldseek_step.py +26 -6
- enzymetk/similarity_reaction_step.py +12 -8
- enzymetk/similarity_substrate_step.py +8 -2
- enzymetk/step.py +5 -3
- {enzymetk-0.0.1.dist-info → enzymetk-0.0.6.dist-info}/METADATA +61 -24
- {enzymetk-0.0.1.dist-info → enzymetk-0.0.6.dist-info}/RECORD +23 -21
- {enzymetk-0.0.1.dist-info → enzymetk-0.0.6.dist-info}/WHEEL +1 -1
- {enzymetk-0.0.1.data → enzymetk-0.0.6.data}/data/LICENSE +0 -0
- {enzymetk-0.0.1.dist-info → enzymetk-0.0.6.dist-info}/entry_points.txt +0 -0
- {enzymetk-0.0.1.dist-info → enzymetk-0.0.6.dist-info/licenses}/LICENSE +0 -0
- {enzymetk-0.0.1.dist-info → enzymetk-0.0.6.dist-info}/top_level.txt +0 -0
enzymetk/__init__.py
CHANGED
|
@@ -22,34 +22,11 @@ Date: March 2025
|
|
|
22
22
|
__title__ = 'enzymetk'
|
|
23
23
|
__description__ = 'Toolkit for enzymes and what not'
|
|
24
24
|
__url__ = 'https://github.com/arianemora/enzyme-tk/'
|
|
25
|
-
__version__ = '0.0.
|
|
25
|
+
__version__ = '0.0.6'
|
|
26
26
|
__author__ = 'Ariane Mora'
|
|
27
27
|
__author_email__ = 'ariane.n.mora@gmail.com'
|
|
28
28
|
__license__ = 'GPL3'
|
|
29
29
|
|
|
30
|
-
# from enzymetk.step import *
|
|
31
|
-
# from enzymetk.generate_msa_step import ClustalOmega
|
|
32
|
-
# from enzymetk.annotateEC_CLEAN_step import CLEAN
|
|
33
|
-
# from enzymetk.annotateEC_proteinfer_step import ProteInfer
|
|
34
|
-
# from enzymetk.dock_chai_step import Chai
|
|
35
|
-
# from enzymetk.dock_vina_step import Vina
|
|
36
|
-
# from enzymetk.embedchem_chemberta_step import ChemBERT
|
|
37
|
-
# from enzymetk.embedchem_rxnfp_step import RxnFP
|
|
38
|
-
# from enzymetk.embedchem_selformer_step import SelFormer
|
|
39
|
-
# from enzymetk.embedchem_unimol_step import UniMol
|
|
40
|
-
# from enzymetk.embedprotein_esm_step import EmbedESM
|
|
41
|
-
# from enzymetk.generate_tree_step import FastTree
|
|
42
|
-
# from enzymetk.inpaint_ligandMPNN_step import LigandMPNN
|
|
43
|
-
# from enzymetk.metagenomics_porechop_trim_reads_step import PoreChop
|
|
44
|
-
# from enzymetk.metagenomics_prokka_annotate_genes import Prokka
|
|
45
|
-
# #from enzymetk.predict_activity_step import
|
|
46
|
-
# from enzymetk.predict_catalyticsite_step import ActiveSitePred
|
|
47
|
-
# from enzymetk.sequence_search_blast import BLAST
|
|
48
|
-
# from enzymetk.similarity_foldseek_step import FoldSeek
|
|
49
|
-
# from enzymetk.similarity_mmseqs_step import MMseqs
|
|
50
|
-
# from enzymetk.similarity_reaction_step import ReactionDist
|
|
51
|
-
# from enzymetk.similarity_substrate_step import SubstrateDist
|
|
52
|
-
|
|
53
30
|
|
|
54
31
|
|
|
55
32
|
|
|
@@ -116,7 +116,7 @@ class CLEAN(Step):
|
|
|
116
116
|
print(output_filenames)
|
|
117
117
|
for sub_df in output_filenames:
|
|
118
118
|
df = pd.concat([df, sub_df])
|
|
119
|
-
return df
|
|
119
|
+
return self.__filter_df(df)
|
|
120
120
|
else:
|
|
121
|
-
return self.__execute([df, tmp_dir])
|
|
121
|
+
return self.__filter_df(self.__execute([df, tmp_dir]))
|
|
122
122
|
return df
|
|
@@ -38,7 +38,7 @@ class CREEP(Step):
|
|
|
38
38
|
self.args_extract = args_extract
|
|
39
39
|
self.args_retrieval = args_retrieval
|
|
40
40
|
|
|
41
|
-
def __execute(self, df: pd.DataFrame, tmp_dir: str)
|
|
41
|
+
def __execute(self, df: pd.DataFrame, tmp_dir: str):
|
|
42
42
|
tmp_dir = '/disk1/ariane/vscode/degradeo/pipeline/tmp/'
|
|
43
43
|
input_filename = f'{tmp_dir}/creepasjkdkajshdkja.csv'
|
|
44
44
|
df.to_csv(input_filename, index=False)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from enzymetk.step import Step
|
|
2
|
+
import pandas as pd
|
|
3
|
+
from docko.boltz import run_boltz_affinity
|
|
4
|
+
import logging
|
|
5
|
+
import numpy as np
|
|
6
|
+
from multiprocessing.dummy import Pool as ThreadPool
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
logger = logging.getLogger(__name__)
|
|
10
|
+
logger.setLevel(logging.INFO)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Boltz(Step):
|
|
14
|
+
|
|
15
|
+
def __init__(self, id_col: str, seq_col: str, substrate_col: str, intermediate_col: str, output_dir: str, num_threads: int):
|
|
16
|
+
self.id_col = id_col
|
|
17
|
+
self.seq_col = seq_col
|
|
18
|
+
self.substrate_col = substrate_col
|
|
19
|
+
self.intermediate_col = intermediate_col
|
|
20
|
+
self.output_dir = output_dir or None
|
|
21
|
+
self.num_threads = num_threads or 1
|
|
22
|
+
|
|
23
|
+
def __execute(self, df: pd.DataFrame) -> pd.DataFrame:
|
|
24
|
+
output_filenames = []
|
|
25
|
+
|
|
26
|
+
for run_id, seq, substrate, intermediate in df[[self.id_col, self.seq_col, self.substrate_col, self.intermediate_col]].values:
|
|
27
|
+
# Might have an issue if the things are not correctly installed in the same dicrectory
|
|
28
|
+
if not isinstance(substrate, str):
|
|
29
|
+
substrate = ''
|
|
30
|
+
print(run_id, seq, substrate)
|
|
31
|
+
run_boltz_affinity(run_id, seq, substrate, self.output_dir, intermediate)
|
|
32
|
+
output_filenames.append(f'{self.output_dir}/{run_id}/')
|
|
33
|
+
return output_filenames
|
|
34
|
+
|
|
35
|
+
def execute(self, df: pd.DataFrame) -> pd.DataFrame:
|
|
36
|
+
if self.output_dir:
|
|
37
|
+
if self.num_threads > 1:
|
|
38
|
+
pool = ThreadPool(self.num_threads)
|
|
39
|
+
df_list = np.array_split(df, self.num_threads)
|
|
40
|
+
results = pool.map(self.__execute, df_list)
|
|
41
|
+
else:
|
|
42
|
+
results = self.__execute(df)
|
|
43
|
+
df['output_dir'] = results
|
|
44
|
+
return df
|
|
45
|
+
else:
|
|
46
|
+
print('No output directory provided')
|
enzymetk/dock_chai_step.py
CHANGED
|
@@ -11,16 +11,17 @@ logger.setLevel(logging.INFO)
|
|
|
11
11
|
|
|
12
12
|
class Chai(Step):
|
|
13
13
|
|
|
14
|
-
def __init__(self, id_col: str, seq_col: str, substrate_col: str, output_dir: str, num_threads: int):
|
|
14
|
+
def __init__(self, id_col: str, seq_col: str, substrate_col: str, cofactor_col: str, output_dir: str, num_threads: int):
|
|
15
15
|
self.id_col = id_col
|
|
16
16
|
self.seq_col = seq_col
|
|
17
17
|
self.substrate_col = substrate_col
|
|
18
|
+
self.cofactor_col = cofactor_col
|
|
18
19
|
self.output_dir = output_dir or None
|
|
19
20
|
self.num_threads = num_threads or 1
|
|
20
21
|
|
|
21
22
|
def __execute(self, df: pd.DataFrame, tmp_dir: str) -> pd.DataFrame:
|
|
22
23
|
output_filenames = []
|
|
23
|
-
for run_id, seq, substrate in df[[self.id_col, self.seq_col, self.substrate_col]].values:
|
|
24
|
+
for run_id, seq, substrate, cofactor in df[[self.id_col, self.seq_col, self.substrate_col, self.cofactor_col]].values:
|
|
24
25
|
# Might have an issue if the things are not correctly installed in the same dicrectory
|
|
25
26
|
if not isinstance(substrate, str):
|
|
26
27
|
substrate = ''
|
|
@@ -28,7 +29,8 @@ class Chai(Step):
|
|
|
28
29
|
run_chai(run_id, # name
|
|
29
30
|
seq, # sequence
|
|
30
31
|
substrate, # ligand as smiles
|
|
31
|
-
tmp_dir
|
|
32
|
+
tmp_dir,
|
|
33
|
+
cofactor) # cofactor as smiles
|
|
32
34
|
output_filenames.append(f'{tmp_dir}/{run_id}/')
|
|
33
35
|
return output_filenames
|
|
34
36
|
|
enzymetk/dock_vina_step.py
CHANGED
|
@@ -4,6 +4,7 @@ from docko.docko import *
|
|
|
4
4
|
import logging
|
|
5
5
|
import numpy as np
|
|
6
6
|
import os
|
|
7
|
+
from pathlib import Path
|
|
7
8
|
from multiprocessing.dummy import Pool as ThreadPool
|
|
8
9
|
|
|
9
10
|
logger = logging.getLogger(__name__)
|
|
@@ -21,34 +22,66 @@ class Vina(Step):
|
|
|
21
22
|
self.substrate_col = substrate_col
|
|
22
23
|
self.substrate_name_col = substrate_name_col
|
|
23
24
|
self.active_site_col = active_site_col # Expects active site residues as a string separated by |
|
|
24
|
-
self.output_dir = output_dir or None
|
|
25
|
+
self.output_dir = Path( output_dir) or None
|
|
25
26
|
self.num_threads = num_threads or 1
|
|
26
27
|
|
|
27
28
|
def __execute(self, df: pd.DataFrame) -> pd.DataFrame:
|
|
28
29
|
output_filenames = []
|
|
29
30
|
# ToDo: update to create from sequence if the path doesn't exist.
|
|
30
31
|
for label, structure_path, seq, substrate_smiles, substrate_name, residues in df[[self.id_col, self.structure_col, self.sequence_col, self.substrate_col, self.substrate_name_col, self.active_site_col]].values:
|
|
31
|
-
|
|
32
|
+
|
|
32
33
|
try:
|
|
34
|
+
structure_path = str(structure_path)
|
|
33
35
|
residues = str(residues)
|
|
34
36
|
residues = [int(r) + 1 for r in residues.split('|')]
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
|
|
38
|
+
label_dir = self.output_dir / label
|
|
39
|
+
label_dir.mkdir(parents=True, exist_ok=True)
|
|
40
|
+
structure_path = Path(structure_path)
|
|
41
|
+
|
|
42
|
+
if not structure_path.exists():
|
|
43
|
+
# Try to download AF2 structure
|
|
44
|
+
get_alphafold_structure(label, label_dir / f"{label}_AF2.pdb")
|
|
45
|
+
structure_path = label_dir / f"{label}_AF2.pdb"
|
|
46
|
+
|
|
47
|
+
# Skip if still not found
|
|
48
|
+
if not structure_path.exists():
|
|
49
|
+
print(f"Skipping {label}: AF2 structure not found.")
|
|
50
|
+
output_filenames.append(None)
|
|
51
|
+
continue
|
|
52
|
+
|
|
53
|
+
# Proceed with docking
|
|
54
|
+
pdb_path = label_dir / f"{label}.pdb"
|
|
55
|
+
pdbqt_path = label_dir / f"{label}.pdbqt"
|
|
56
|
+
|
|
57
|
+
clean_one_pdb(str(structure_path), str(pdb_path))
|
|
58
|
+
pdb_to_pdbqt_protein(str(pdb_path), str(pdbqt_path))
|
|
59
|
+
|
|
60
|
+
score = dock(
|
|
61
|
+
sequence='',
|
|
62
|
+
protein_name=label,
|
|
63
|
+
smiles=substrate_smiles,
|
|
64
|
+
ligand_name=substrate_name,
|
|
65
|
+
residues=residues,
|
|
66
|
+
protein_dir=str(self.output_dir),
|
|
67
|
+
ligand_dir=str(self.output_dir),
|
|
68
|
+
output_dir=str(label_dir),
|
|
69
|
+
pH=7.4,
|
|
70
|
+
method='vina',
|
|
71
|
+
size_x=10.0,
|
|
72
|
+
size_y=10.0,
|
|
73
|
+
size_z=10.0
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
output_filenames.append(str(pdb_path))
|
|
77
|
+
|
|
46
78
|
except Exception as e:
|
|
47
79
|
print(f'Error docking {label}: {e}')
|
|
48
80
|
output_filenames.append(None)
|
|
81
|
+
|
|
49
82
|
return output_filenames
|
|
50
|
-
|
|
51
|
-
|
|
83
|
+
|
|
84
|
+
|
|
52
85
|
def execute(self, df: pd.DataFrame) -> pd.DataFrame:
|
|
53
86
|
if self.output_dir:
|
|
54
87
|
if self.num_threads > 1:
|
|
@@ -60,4 +93,4 @@ class Vina(Step):
|
|
|
60
93
|
df['output_dir'] = results
|
|
61
94
|
return df
|
|
62
95
|
else:
|
|
63
|
-
print('No output directory provided')
|
|
96
|
+
print('No output directory provided')
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# ESM 3 script
|
|
2
|
+
from esm.sdk.api import ESMProtein
|
|
3
|
+
from tempfile import TemporaryDirectory
|
|
4
|
+
import torch
|
|
5
|
+
import os
|
|
6
|
+
import pandas as pd
|
|
7
|
+
from esm.models.esm3 import ESM3
|
|
8
|
+
from esm.sdk.api import ESMProtein, SamplingConfig
|
|
9
|
+
from huggingface_hub import login
|
|
10
|
+
from enzymetk.step import Step
|
|
11
|
+
import numpy as np
|
|
12
|
+
from tqdm import tqdm
|
|
13
|
+
|
|
14
|
+
# CUDA setup
|
|
15
|
+
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152
|
|
16
|
+
cuda = True
|
|
17
|
+
DEVICE = torch.device("cuda" if cuda else "cpu")
|
|
18
|
+
device = DEVICE
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class EmbedESM3(Step):
|
|
22
|
+
|
|
23
|
+
def __init__(self, id_col: str, seq_col: str, extraction_method='mean', num_threads=1,
|
|
24
|
+
tmp_dir: str = None, env_name: str = 'enzymetk', save_tensors=False): # type: ignore
|
|
25
|
+
login()
|
|
26
|
+
self.client = ESM3.from_pretrained("esm3-open").to("cuda")
|
|
27
|
+
self.seq_col = seq_col
|
|
28
|
+
self.id_col = id_col
|
|
29
|
+
self.num_threads = num_threads or 1
|
|
30
|
+
self.extraction_method = extraction_method
|
|
31
|
+
self.tmp_dir = tmp_dir
|
|
32
|
+
self.env_name = env_name
|
|
33
|
+
self.save_tensors = save_tensors
|
|
34
|
+
|
|
35
|
+
def __execute(self, df: pd.DataFrame, tmp_dir: str) -> pd.DataFrame:
|
|
36
|
+
client = self.client
|
|
37
|
+
means = []
|
|
38
|
+
for id, seq in tqdm(df[[self.id_col, self.seq_col]].values):
|
|
39
|
+
protein = ESMProtein(
|
|
40
|
+
sequence=(
|
|
41
|
+
seq
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
protein_tensor = client.encode(protein)
|
|
45
|
+
output = client.forward_and_sample(
|
|
46
|
+
protein_tensor, SamplingConfig(return_per_residue_embeddings=True)
|
|
47
|
+
)
|
|
48
|
+
if self.save_tensors:
|
|
49
|
+
torch.save(output.per_residue_embedding, os.path.join(tmp_dir, f'{id}.pt'))
|
|
50
|
+
means.append(np.array(output.per_residue_embedding.mean(dim=0).cpu()))
|
|
51
|
+
df['esm3_mean'] = means
|
|
52
|
+
return df
|
|
53
|
+
|
|
54
|
+
def execute(self, df: pd.DataFrame) -> pd.DataFrame:
|
|
55
|
+
if self.tmp_dir is None:
|
|
56
|
+
with TemporaryDirectory() as tmp_dir:
|
|
57
|
+
if self.num_threads > 1:
|
|
58
|
+
dfs = []
|
|
59
|
+
df_list = np.array_split(df, self.num_threads)
|
|
60
|
+
for df_chunk in tqdm(df_list):
|
|
61
|
+
dfs.append(self.__execute(df_chunk, tmp_dir))
|
|
62
|
+
df = pd.DataFrame()
|
|
63
|
+
for tmp_df in tqdm(dfs):
|
|
64
|
+
df = pd.concat([df, tmp_df])
|
|
65
|
+
return df
|
|
66
|
+
else:
|
|
67
|
+
df = self.__execute(df, tmp_dir)
|
|
68
|
+
return df
|
|
69
|
+
else:
|
|
70
|
+
df = self.__execute(df, self.tmp_dir)
|
|
71
|
+
return df
|
|
@@ -70,8 +70,8 @@ def extract_mean_embedding(df, id_column, encoding_dir, rep_num=33):
|
|
|
70
70
|
|
|
71
71
|
class EmbedESM(Step):
|
|
72
72
|
|
|
73
|
-
def __init__(self, id_col: str, seq_col: str, model='
|
|
74
|
-
active_site_col: str = None, num_threads=1, tmp_dir: str = None, env_name: str = 'enzymetk'):
|
|
73
|
+
def __init__(self, id_col: str, seq_col: str, model='esm2_t36_3B_UR50D', extraction_method='mean',
|
|
74
|
+
active_site_col: str = None, num_threads=1, tmp_dir: str = None, env_name: str = 'enzymetk', rep_num=36):
|
|
75
75
|
self.seq_col = seq_col
|
|
76
76
|
self.id_col = id_col
|
|
77
77
|
self.active_site_col = active_site_col
|
|
@@ -80,6 +80,7 @@ class EmbedESM(Step):
|
|
|
80
80
|
self.extraction_method = extraction_method
|
|
81
81
|
self.tmp_dir = tmp_dir
|
|
82
82
|
self.env_name = env_name
|
|
83
|
+
self.rep_num = rep_num
|
|
83
84
|
|
|
84
85
|
def __execute(self, df: pd.DataFrame, tmp_dir: str) -> pd.DataFrame:
|
|
85
86
|
input_filename = f'{tmp_dir}/input.fasta'
|
|
@@ -95,11 +96,11 @@ class EmbedESM(Step):
|
|
|
95
96
|
cmd = ['conda', 'run', '-n', self.env_name, 'python', Path(__file__).parent/'esm-extract.py', self.model, input_filename, tmp_dir, '--include', 'per_tok']
|
|
96
97
|
self.run(cmd)
|
|
97
98
|
if self.extraction_method == 'mean':
|
|
98
|
-
df = extract_mean_embedding(df, self.id_col, tmp_dir)
|
|
99
|
+
df = extract_mean_embedding(df, self.id_col, tmp_dir, rep_num=self.rep_num)
|
|
99
100
|
elif self.extraction_method == 'active_site':
|
|
100
101
|
if self.active_site_col is None:
|
|
101
102
|
raise ValueError('active_site_col must be provided if extraction_method is active_site')
|
|
102
|
-
df = extract_active_site_embedding(df, self.id_col, self.active_site_col, tmp_dir)
|
|
103
|
+
df = extract_active_site_embedding(df, self.id_col, self.active_site_col, tmp_dir, rep_num=self.rep_num)
|
|
103
104
|
|
|
104
105
|
return df
|
|
105
106
|
|
|
@@ -16,7 +16,8 @@ import os
|
|
|
16
16
|
|
|
17
17
|
class LigandMPNN(Step):
|
|
18
18
|
|
|
19
|
-
def __init__(self, pdb_column_name: str, ligand_mpnn_dir: str, output_dir: str,
|
|
19
|
+
def __init__(self, pdb_column_name: str, ligand_mpnn_dir: str, output_dir: str,
|
|
20
|
+
tmp_dir: str = None, args=None, num_threads: int = 1, env_name: str = 'ligandmpnn_env'):
|
|
20
21
|
self.pdb_column_name = pdb_column_name
|
|
21
22
|
self.ligand_mpnn_dir = ligand_mpnn_dir
|
|
22
23
|
self.output_dir = output_dir
|
|
@@ -34,7 +35,7 @@ class LigandMPNN(Step):
|
|
|
34
35
|
os.chdir(self.ligand_mpnn_dir)
|
|
35
36
|
|
|
36
37
|
for pdb_file in df[ self.pdb_column_name].values:
|
|
37
|
-
cmd = ['conda', 'run', '-n', self.env_name, 'python3', f'{self.ligand_mpnn_dir}run.py', '--pdb_path', pdb_file, '--out_folder', f'{self.output_dir}']
|
|
38
|
+
cmd = ['conda', 'run', '-n', self.env_name, 'python3', f'{self.ligand_mpnn_dir}run.py', '--pdb_path', pdb_file, '--out_folder', f'{self.output_dir}']
|
|
38
39
|
if self.args is not None:
|
|
39
40
|
cmd.extend(self.args)
|
|
40
41
|
result = subprocess.run(cmd, check=True)
|
|
@@ -11,7 +11,7 @@ def run_as_inference(output_dir, fasta_file, squidly_dir, toks_per_batch, as_thr
|
|
|
11
11
|
elif esm2_model == "esm2_t48_15B_UR50D":
|
|
12
12
|
cr_model_as = cr_model_as or f"{squidly_dir}Squidly_CL_15B.pt"
|
|
13
13
|
lstm_model_as = lstm_model_as or f"{squidly_dir}Squidly_LSTM_15B.pth"
|
|
14
|
-
as_threshold = 0.
|
|
14
|
+
as_threshold = 0.97
|
|
15
15
|
#esm2_model = "esm2_t48_15B_UR50D"
|
|
16
16
|
# python /scratch/project/squid/code_modular/SQUIDLY_run_model_LSTM.py ${FILE} ${ESM2_MODEL} ${CR_MODEL_AS}
|
|
17
17
|
# ${LSTM_MODEL_AS} ${OUT} --toks_per_batch ${TOKS_PER_BATCH} --AS_threshold ${AS_THRESHOLD} --monitor
|
|
@@ -8,6 +8,8 @@ import numpy as np
|
|
|
8
8
|
from tqdm import tqdm
|
|
9
9
|
import random
|
|
10
10
|
import string
|
|
11
|
+
import logging
|
|
12
|
+
import os
|
|
11
13
|
|
|
12
14
|
logger = logging.getLogger(__name__)
|
|
13
15
|
logger.setLevel(logging.INFO)
|
|
@@ -15,15 +17,17 @@ logger.setLevel(logging.INFO)
|
|
|
15
17
|
|
|
16
18
|
class ActiveSitePred(Step):
|
|
17
19
|
|
|
18
|
-
def __init__(self, id_col: str, seq_col: str,
|
|
19
|
-
esm2_model = 'esm2_t36_3B_UR50D', tmp_dir: str = None):
|
|
20
|
+
def __init__(self, id_col: str, seq_col: str, num_threads: int = 1,
|
|
21
|
+
esm2_model = 'esm2_t36_3B_UR50D', tmp_dir: str = None, args=None):
|
|
20
22
|
self.id_col = id_col
|
|
21
23
|
self.seq_col = seq_col
|
|
22
24
|
self.num_threads = num_threads or 1
|
|
23
|
-
self.squidly_dir = squidly_dir
|
|
24
25
|
self.esm2_model = esm2_model
|
|
25
26
|
self.tmp_dir = tmp_dir
|
|
26
|
-
|
|
27
|
+
self.args = None
|
|
28
|
+
self.logger = logging.getLogger(__name__)
|
|
29
|
+
print('Predicting Active Sites using Squidly')
|
|
30
|
+
|
|
27
31
|
def __to_fasta(self, df: pd.DataFrame, tmp_dir: str):
|
|
28
32
|
tmp_label = ''.join(random.choices(string.ascii_letters + string.digits, k=10))
|
|
29
33
|
|
|
@@ -37,13 +41,17 @@ class ActiveSitePred(Step):
|
|
|
37
41
|
def __execute(self, df: pd.DataFrame, tmp_dir: str):
|
|
38
42
|
input_filename = self.__to_fasta(df, tmp_dir)
|
|
39
43
|
# Might have an issue if the things are not correctly installed in the same dicrectory
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
cmd = []
|
|
45
|
+
cmd = ['squidly', 'run', input_filename, self.esm2_model, tmp_dir]
|
|
46
|
+
if self.args is not None:
|
|
47
|
+
cmd.extend(self.args)
|
|
48
|
+
result = self.run(cmd)
|
|
43
49
|
if result.stderr:
|
|
44
|
-
logger.error(result.stderr)
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
self.logger.error(result.stderr)
|
|
51
|
+
print(result.stderr)
|
|
52
|
+
else:
|
|
53
|
+
self.logger.info(result.stdout)
|
|
54
|
+
output_filename = os.path.join(tmp_dir, 'squidly_ensemble.csv')
|
|
47
55
|
return output_filename
|
|
48
56
|
|
|
49
57
|
def execute(self, df: pd.DataFrame) -> pd.DataFrame:
|
|
@@ -61,10 +69,10 @@ class ActiveSitePred(Step):
|
|
|
61
69
|
df = pd.DataFrame()
|
|
62
70
|
print(output_filenames)
|
|
63
71
|
for p in output_filenames:
|
|
64
|
-
sub_df = pd.
|
|
72
|
+
sub_df = pd.read_csv(p)
|
|
65
73
|
df = pd.concat([df, sub_df])
|
|
66
74
|
return df
|
|
67
75
|
|
|
68
76
|
else:
|
|
69
77
|
output_filename = self.__execute(df, tmp_dir)
|
|
70
|
-
return pd.
|
|
78
|
+
return pd.read_csv(output_filename)
|
|
@@ -3,6 +3,7 @@ Step to run multiple sequence alignment with the Clustal Omega tool.
|
|
|
3
3
|
./clustalo -i /home/helen/degradeo/pipeline/helen_data/sequences_test_fasta.txt
|
|
4
4
|
"""
|
|
5
5
|
from enzymetk.step import Step
|
|
6
|
+
import logging
|
|
6
7
|
|
|
7
8
|
import pandas as pd
|
|
8
9
|
import numpy as np
|
|
@@ -12,10 +13,17 @@ import os
|
|
|
12
13
|
import subprocess
|
|
13
14
|
import random
|
|
14
15
|
import string
|
|
16
|
+
from tqdm import tqdm
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
logger = logging.getLogger(__name__)
|
|
20
|
+
logger.setLevel(logging.INFO)
|
|
21
|
+
|
|
15
22
|
|
|
16
23
|
class BLAST(Step):
|
|
17
24
|
|
|
18
|
-
def __init__(self, id_col: str, sequence_col: str, label_col=None, database=None,
|
|
25
|
+
def __init__(self, id_col: str, sequence_col: str, label_col=None, database=None,
|
|
26
|
+
mode='blastp', args=None, tmp_dir=None, num_threads=1):
|
|
19
27
|
self.id_col = id_col
|
|
20
28
|
self.seq_col = sequence_col
|
|
21
29
|
self.label_col = label_col # This is whether it is query or reference
|
|
@@ -23,6 +31,7 @@ class BLAST(Step):
|
|
|
23
31
|
self.database = database
|
|
24
32
|
self.args = args
|
|
25
33
|
self.tmp_dir = tmp_dir
|
|
34
|
+
self.num_threads = num_threads
|
|
26
35
|
if self.database is None and self.label_col is None:
|
|
27
36
|
raise ValueError('Database is not set, you can pass a database that you have already created see diamond for more information or the sequences \
|
|
28
37
|
as part of your dataframe and pass the label column (this needs to have two values: reference and query) reference \
|
|
@@ -74,7 +83,27 @@ class BLAST(Step):
|
|
|
74
83
|
return df
|
|
75
84
|
|
|
76
85
|
def execute(self, df: pd.DataFrame) -> pd.DataFrame:
|
|
77
|
-
if self.tmp_dir is not None:
|
|
78
|
-
return self.__execute([df, self.tmp_dir])
|
|
79
86
|
with TemporaryDirectory() as tmp_dir:
|
|
80
|
-
|
|
87
|
+
tmp_dir = self.tmp_dir if self.tmp_dir is not None else tmp_dir
|
|
88
|
+
if self.num_threads > 1:
|
|
89
|
+
output_filenames = []
|
|
90
|
+
df_list = np.array_split(df, self.num_threads)
|
|
91
|
+
for df_chunk in tqdm(df_list):
|
|
92
|
+
try:
|
|
93
|
+
output_filenames.append(self.__execute([df_chunk, tmp_dir]))
|
|
94
|
+
except Exception as e:
|
|
95
|
+
logger.error(f"Error in executing ESM2 model: {e}")
|
|
96
|
+
continue
|
|
97
|
+
df = pd.DataFrame()
|
|
98
|
+
for sub_df in output_filenames:
|
|
99
|
+
df = pd.concat([df, sub_df])
|
|
100
|
+
return df
|
|
101
|
+
|
|
102
|
+
else:
|
|
103
|
+
return self.__execute([df, tmp_dir])
|
|
104
|
+
|
|
105
|
+
# def execute(self, df: pd.DataFrame) -> pd.DataFrame:
|
|
106
|
+
# if self.tmp_dir is not None:
|
|
107
|
+
# return self.__execute([df, self.tmp_dir])
|
|
108
|
+
# with TemporaryDirectory() as tmp_dir:
|
|
109
|
+
# return self.__execute([df, tmp_dir])
|
|
@@ -7,13 +7,17 @@ repo and then copy it out of it.
|
|
|
7
7
|
"""
|
|
8
8
|
from enzymetk.step import Step
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
import logging
|
|
11
11
|
import pandas as pd
|
|
12
12
|
import numpy as np
|
|
13
13
|
from tempfile import TemporaryDirectory
|
|
14
14
|
import subprocess
|
|
15
15
|
import random
|
|
16
16
|
import string
|
|
17
|
+
from tqdm import tqdm
|
|
18
|
+
|
|
19
|
+
logger = logging.getLogger(__name__)
|
|
20
|
+
logger.setLevel(logging.INFO)
|
|
17
21
|
|
|
18
22
|
|
|
19
23
|
def process_clustering(filename, df, id_column_name):
|
|
@@ -34,13 +38,14 @@ def process_clustering(filename, df, id_column_name):
|
|
|
34
38
|
class FoldSeek(Step):
|
|
35
39
|
|
|
36
40
|
def __init__(self, id_column_name: str, query_column_name: str, reference_database: str, method='search', query_type='structures',
|
|
37
|
-
args=None, tmp_dir: str = None):
|
|
41
|
+
args=None, num_threads=1, tmp_dir: str = None):
|
|
38
42
|
self.query_column_name = query_column_name
|
|
39
43
|
self.id_column_name = id_column_name
|
|
40
44
|
self.reference_database = reference_database # pdb should be the default
|
|
41
45
|
self.tmp_dir = tmp_dir
|
|
42
46
|
self.method = method
|
|
43
47
|
self.args = args
|
|
48
|
+
self.num_threads = num_threads
|
|
44
49
|
self.query_type = query_type
|
|
45
50
|
if self.method not in ['search', 'cluster']:
|
|
46
51
|
print('Method must be in "search" or "cluster". Will likely fail... ')
|
|
@@ -107,8 +112,23 @@ class FoldSeek(Step):
|
|
|
107
112
|
return df
|
|
108
113
|
|
|
109
114
|
def execute(self, df: pd.DataFrame) -> pd.DataFrame:
|
|
110
|
-
if self.tmp_dir is not None:
|
|
111
|
-
return self.__execute([df, self.tmp_dir])
|
|
112
115
|
with TemporaryDirectory() as tmp_dir:
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
tmp_dir = self.tmp_dir if self.tmp_dir is not None else tmp_dir
|
|
117
|
+
if self.num_threads > 1:
|
|
118
|
+
output_filenames = []
|
|
119
|
+
df_list = np.array_split(df, self.num_threads)
|
|
120
|
+
for df_chunk in tqdm(df_list):
|
|
121
|
+
try:
|
|
122
|
+
output_filenames.append(self.__execute([df_chunk, tmp_dir]))
|
|
123
|
+
except Exception as e:
|
|
124
|
+
logger.error(f"Error in executing ESM2 model: {e}")
|
|
125
|
+
continue
|
|
126
|
+
df = pd.DataFrame()
|
|
127
|
+
print(output_filenames)
|
|
128
|
+
for sub_df in output_filenames:
|
|
129
|
+
df = pd.concat([df, sub_df])
|
|
130
|
+
return df
|
|
131
|
+
|
|
132
|
+
else:
|
|
133
|
+
df = self.__execute([df, tmp_dir])
|
|
134
|
+
return df
|
|
@@ -24,22 +24,26 @@ class ReactionDist(Step):
|
|
|
24
24
|
self.num_threads = num_threads
|
|
25
25
|
|
|
26
26
|
def __execute(self, data: list) -> np.array:
|
|
27
|
-
reaction_df = data
|
|
28
|
-
tmp_label = ''.join(random.choices(string.ascii_letters + string.digits, k=10))
|
|
29
|
-
|
|
30
|
-
rxn = rdChemReactions.ReactionFromSmarts(self.smiles_string)
|
|
31
|
-
rxn_fp = rdChemReactions.CreateStructuralFingerprintForReaction(rxn)
|
|
27
|
+
reaction_df = data
|
|
32
28
|
rows = []
|
|
29
|
+
fp_params = rdChemReactions.ReactionFingerprintParams()
|
|
30
|
+
rxn = rdChemReactions.ReactionFromSmarts(self.smiles_string)
|
|
31
|
+
rxn_fp = rdChemReactions.CreateStructuralFingerprintForReaction(rxn, ReactionFingerPrintParams=fp_params) #rdChemReactions.CreateStructuralFingerprintForReaction(rxn, ReactionFingerPrintParams=fp_params)
|
|
32
|
+
|
|
33
33
|
# compare all fp pairwise without duplicates
|
|
34
34
|
for smile_id, smiles in tqdm(reaction_df[[self.id_column_name, self.smiles_column_name]].values): # -1 so the last fp will not be used
|
|
35
35
|
mol_ = rdChemReactions.ReactionFromSmarts(smiles)
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
# Note: if you don't pass , ReactionFingerPrintParams=fp_params you get different results
|
|
37
|
+
# i.e. reactions that don't appear to be the same are reported as similar of 1.0
|
|
38
|
+
# https://github.com/rdkit/rdkit/discussions/5263
|
|
39
|
+
fps = rdChemReactions.CreateStructuralFingerprintForReaction(mol_, ReactionFingerPrintParams=fp_params)
|
|
40
|
+
rows.append([smile_id,
|
|
41
|
+
self.smiles_string,
|
|
38
42
|
smiles,
|
|
39
43
|
DataStructs.TanimotoSimilarity(fps, rxn_fp),
|
|
40
44
|
DataStructs.RusselSimilarity(fps, rxn_fp),
|
|
41
45
|
DataStructs.CosineSimilarity(fps, rxn_fp)])
|
|
42
|
-
distance_df = pd.DataFrame(rows, columns=[self.id_column_name, 'TargetSmiles', 'TanimotoSimilarity', 'RusselSimilarity', 'CosineSimilarity'])
|
|
46
|
+
distance_df = pd.DataFrame(rows, columns=[self.id_column_name, 'QuerySmiles', 'TargetSmiles', 'TanimotoSimilarity', 'RusselSimilarity', 'CosineSimilarity'])
|
|
43
47
|
return distance_df
|
|
44
48
|
|
|
45
49
|
def execute(self, df: pd.DataFrame) -> pd.DataFrame:
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
sys.path.append('/disk1/ariane/vscode/enzyme-tk/')
|
|
1
3
|
from enzymetk.step import Step
|
|
2
4
|
import pandas as pd
|
|
3
5
|
import numpy as np
|
|
@@ -8,6 +10,7 @@ from rdkit.Chem import rdChemReactions
|
|
|
8
10
|
import pandas as pd
|
|
9
11
|
import os
|
|
10
12
|
from rdkit.DataStructs import FingerprintSimilarity
|
|
13
|
+
from rdkit.Chem import rdFingerprintGenerator
|
|
11
14
|
from rdkit.Chem.Fingerprints import FingerprintMols
|
|
12
15
|
import random
|
|
13
16
|
import string
|
|
@@ -28,12 +31,15 @@ class SubstrateDist(Step):
|
|
|
28
31
|
tmp_label = ''.join(random.choices(string.ascii_letters + string.digits, k=10))
|
|
29
32
|
|
|
30
33
|
rxn = Chem.MolFromSmiles(self.smiles_string)
|
|
31
|
-
|
|
34
|
+
# Switched to using morgan fingerprints https://greglandrum.github.io/rdkit-blog/posts/2023-01-18-fingerprint-generator-tutorial.html
|
|
35
|
+
# followed this tutorial
|
|
36
|
+
mfpgen = rdFingerprintGenerator.GetMorganGenerator(radius=2,fpSize=2048)
|
|
37
|
+
rxn_fp = mfpgen.GetFingerprint(rxn)
|
|
32
38
|
rows = []
|
|
33
39
|
# compare all fp pairwise without duplicates
|
|
34
40
|
for smile_id, smiles in tqdm(reaction_df[[self.id_column_name, self.smiles_column_name]].values): # -1 so the last fp will not be used
|
|
35
41
|
mol_ = Chem.MolFromSmiles(smiles)
|
|
36
|
-
fps =
|
|
42
|
+
fps = mfpgen.GetFingerprint(mol_)
|
|
37
43
|
rows.append([smile_id,
|
|
38
44
|
smiles,
|
|
39
45
|
DataStructs.TanimotoSimilarity(fps, rxn_fp),
|
enzymetk/step.py
CHANGED
|
@@ -36,8 +36,9 @@ class Step():
|
|
|
36
36
|
""" Execute some shit """
|
|
37
37
|
return df
|
|
38
38
|
|
|
39
|
-
def run(self, cmd: list)
|
|
40
|
-
""" Run a command """
|
|
39
|
+
def run(self, cmd: list):
|
|
40
|
+
""" Run a command """
|
|
41
|
+
result = None
|
|
41
42
|
start = timeit.default_timer()
|
|
42
43
|
u.dp(['Running command', ' '.join([str(c) for c in cmd])])
|
|
43
44
|
result = subprocess.run(cmd, capture_output=True, text=True)
|
|
@@ -48,8 +49,9 @@ class Step():
|
|
|
48
49
|
logger.error(result.stderr)
|
|
49
50
|
logger.info(result.stdout)
|
|
50
51
|
u.dp(['Time for command to run (min): ', (timeit.default_timer() - start)/60])
|
|
52
|
+
return result
|
|
51
53
|
|
|
52
|
-
def __rshift__(self, other: Step)
|
|
54
|
+
def __rshift__(self, other: Step) :
|
|
53
55
|
return Pipeline(self, other)
|
|
54
56
|
|
|
55
57
|
def __rlshift__(self, other: pd.DataFrame) -> pd.DataFrame:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: enzymetk
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6
|
|
4
4
|
Home-page: https://github.com/arianemora/enzyme-tk/
|
|
5
5
|
Author: Ariane Mora
|
|
6
6
|
Author-email: ariane.n.mora@gmail.com
|
|
@@ -18,17 +18,12 @@ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
|
18
18
|
Requires-Python: >=3.8
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
|
-
Requires-Dist: fair-esm
|
|
22
21
|
Requires-Dist: scikit-learn
|
|
23
22
|
Requires-Dist: numpy
|
|
24
23
|
Requires-Dist: seaborn
|
|
25
24
|
Requires-Dist: sciutil
|
|
26
|
-
Requires-Dist: pandas
|
|
25
|
+
Requires-Dist: pandas
|
|
27
26
|
Requires-Dist: biopython
|
|
28
|
-
Requires-Dist: sentence_transformers
|
|
29
|
-
Requires-Dist: pubchempy
|
|
30
|
-
Requires-Dist: pyfaidx
|
|
31
|
-
Requires-Dist: spacy
|
|
32
27
|
Dynamic: author
|
|
33
28
|
Dynamic: author-email
|
|
34
29
|
Dynamic: classifier
|
|
@@ -37,6 +32,7 @@ Dynamic: description-content-type
|
|
|
37
32
|
Dynamic: home-page
|
|
38
33
|
Dynamic: keywords
|
|
39
34
|
Dynamic: license
|
|
35
|
+
Dynamic: license-file
|
|
40
36
|
Dynamic: project-url
|
|
41
37
|
Dynamic: requires-dist
|
|
42
38
|
Dynamic: requires-python
|
|
@@ -45,26 +41,36 @@ Dynamic: requires-python
|
|
|
45
41
|
|
|
46
42
|
Enzyme-tk is a collection of tools for enzyme engineering, setup as interoperable modules that act on dataframes. These modules are designed to be imported into pipelines for specific function. For this reason, `steps` as each module is called (e.g. finding similar proteins with `BLAST` would be considered a step) are designed to be as light as possible. An example of a pipeline is the [annotate-e](https://github.com/ArianeMora/annotate-e) ` pipeline, this acts to annotate a fasta with an ensemble of methods (each is designated as an Enzyme-tk step).
|
|
47
43
|
|
|
44
|
+
|
|
45
|
+
**If you have any issues installing, let me know - this has been tested only on Linux/Ubuntu. Please post an issue!**
|
|
46
|
+
|
|
48
47
|
## Installation
|
|
49
48
|
|
|
49
|
+
## Install base package to import modules
|
|
50
|
+
|
|
50
51
|
```bash
|
|
51
|
-
|
|
52
|
+
pip install enzymetk
|
|
52
53
|
```
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
### Install only the specific requirements you need (recomended)
|
|
55
56
|
|
|
57
|
+
For this clone the repo and then install the requirements for the specific modules you use
|
|
56
58
|
```bash
|
|
57
59
|
git clone git@github.com:ArianeMora/enzyme-tk.git
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
cd enzymetk/conda_envs/ # would recommend looking at thes
|
|
61
|
+
# e.g. to install all from within that folder you would do
|
|
62
|
+
source install_all.sh
|
|
60
63
|
```
|
|
61
64
|
|
|
62
65
|
## Usage
|
|
63
66
|
|
|
64
67
|
If you have any issues at all just email me using my caltech email: `amora at caltech . edu`
|
|
65
68
|
|
|
69
|
+
This is a work-in progress! e.g. some tools (e.g. proteInfer and CLEAN) require extra data to be downloaded in order to run (like model weights.) I'm working on integrating these atm, buzz me if you need this!
|
|
70
|
+
|
|
66
71
|
Here are some of the tools that have been implemented to be chained together as a pipeline:
|
|
67
72
|
|
|
73
|
+
[boltz2](https://github.com/jwohlwend/boltz)
|
|
68
74
|
[mmseqs2](https://github.com/soedinglab/mmseqs2)
|
|
69
75
|
[foldseek](https://github.com/steineggerlab/foldseek)
|
|
70
76
|
[diamond](https://github.com/bbuchfink/diamond)
|
|
@@ -83,6 +89,7 @@ Here are some of the tools that have been implemented to be chained together as
|
|
|
83
89
|
[fasttree](https://morgannprice.github.io/fasttree/)
|
|
84
90
|
[Porechop](https://github.com/rrwick/Porechop)
|
|
85
91
|
[prokka](https://github.com/tseemann/prokka)
|
|
92
|
+
|
|
86
93
|
## Things to note
|
|
87
94
|
|
|
88
95
|
All the tools use the conda env of `enzymetk` by default.
|
|
@@ -114,6 +121,8 @@ The steps are the main building blocks of the pipeline. They are responsible for
|
|
|
114
121
|
|
|
115
122
|
BLAST is a tool for searching a database of sequences for similar sequences. Here you can either pass a database that you have already created or pass the sequences as part of your dataframe and pass the label column (this needs to have two values: reference and query) reference refers to sequences that you want to search against and query refers to sequences that you want to search for.
|
|
116
123
|
|
|
124
|
+
Note you need to have installed the BLAST environment.
|
|
125
|
+
|
|
117
126
|
```python
|
|
118
127
|
id_col = 'Entry'
|
|
119
128
|
seq_col = 'Sequence'
|
|
@@ -142,6 +151,34 @@ df = pd.DataFrame(rows, columns=[id_col, seq_col])
|
|
|
142
151
|
print(df)
|
|
143
152
|
df << (ActiveSitePred(id_col, seq_col, squidly_dir, num_threads) >> Save('tmp/squidly_as_pred.pkl'))
|
|
144
153
|
|
|
154
|
+
```
|
|
155
|
+
### Boltz2
|
|
156
|
+
|
|
157
|
+
Boltz2 is a model for predicting structures. Note you need docko installed as I run via that.
|
|
158
|
+
|
|
159
|
+
Below is an example using boltz with 4 threads, and uses a cofactor (intermediate in this case). Just set to be None for a single substrate version.
|
|
160
|
+
```
|
|
161
|
+
import sys
|
|
162
|
+
from enzymetk.dock_boltz_step import Boltz
|
|
163
|
+
from enzymetk.save_step import Save
|
|
164
|
+
import pandas as pd
|
|
165
|
+
import os
|
|
166
|
+
os.environ['MKL_THREADING_LAYER'] = 'GNU'
|
|
167
|
+
|
|
168
|
+
output_dir = 'tmp/'
|
|
169
|
+
num_threads = 4
|
|
170
|
+
id_col = 'Entry'
|
|
171
|
+
seq_col = 'Sequence'
|
|
172
|
+
substrate_col = 'Substrate'
|
|
173
|
+
intermediate_col = 'Intermediate'
|
|
174
|
+
|
|
175
|
+
rows = [['P0DP23_boltz_8999', 'MALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAA', 'CCCCC(CC)COC(=O)C1=CC=CC=C1C(=O)OCC(CC)CCCC', 'CC1=C(C2=CC3=C(C(=C([N-]3)C=C4C(=C(C(=N4)C=C5C(=C(C(=N5)C=C1[N-]2)C)C=C)C)C=C)C)CCC(=O)[O-])CCC(=O)[O-].[Fe]'],
|
|
176
|
+
['P0DP24_boltz_p1', 'MALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAA', 'CCCCC(CC)COC(=O)C1=CC=CC=C1C(=O)OCC(CC)CCCC', 'CC1=C(C2=CC3=C(C(=C([N-]3)C=C4C(=C(C(=N4)C=C5C(=C(C(=N5)C=C1[N-]2)C)C=C)C)C=C)C)CCC(=O)[O-])CCC(=O)[O-].[Fe]'],
|
|
177
|
+
['P0DP23_boltz_p2', 'MALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAA', 'CCCCC(CC)COC(=O)C1=CC=CC=C1C(=O)OCC(CC)CCCC', 'CC1=C(C2=CC3=C(C(=C([N-]3)C=C4C(=C(C(=N4)C=C5C(=C(C(=N5)C=C1[N-]2)C)C=C)C)C=C)C)CCC(=O)[O-])CCC(=O)[O-].[Fe]'],
|
|
178
|
+
['P0DP24_boltz_p3', 'MALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAA', 'CCCCC(CC)COC(=O)C1=CC=CC=C1C(=O)OCC(CC)CCCC', 'CC1=C(C2=CC3=C(C(=C([N-]3)C=C4C(=C(C(=N4)C=C5C(=C(C(=N5)C=C1[N-]2)C)C=C)C)C=C)C)CCC(=O)[O-])CCC(=O)[O-].[Fe]'],
|
|
179
|
+
['P0DP24_boltz_p4', 'MALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAA', 'CCCCC(CC)COC(=O)C1=CC=CC=C1C(=O)OCC(CC)CCCC', 'CC1=C(C2=CC3=C(C(=C([N-]3)C=C4C(=C(C(=N4)C=C5C(=C(C(=N5)C=C1[N-]2)C)C=C)C)C=C)C)CCC(=O)[O-])CCC(=O)[O-].[Fe]']]
|
|
180
|
+
df = pd.DataFrame(rows, columns=[id_col, seq_col, substrate_col, intermediate_col])
|
|
181
|
+
df << (Boltz(id_col, seq_col, substrate_col, intermediate_col, f'{output_dir}', num_threads) >> Save(f'{output_dir}test.pkl'))
|
|
145
182
|
```
|
|
146
183
|
|
|
147
184
|
### Chai
|
|
@@ -169,8 +206,8 @@ df << (Chai(id_col, seq_col, substrate_col, f'{output_dir}', num_threads) >> Sav
|
|
|
169
206
|
ChemBERTa2 encodes reactions and SMILES strings into a vector space. Note this requires the base environment, i.e. `enzymetk` conda env.
|
|
170
207
|
|
|
171
208
|
```python
|
|
172
|
-
from
|
|
173
|
-
from
|
|
209
|
+
from enzymetk.embedchem_chemberta_step import ChemBERT
|
|
210
|
+
from enzymetk.save_step import Save
|
|
174
211
|
|
|
175
212
|
output_dir = 'tmp/'
|
|
176
213
|
num_threads = 1
|
|
@@ -180,7 +217,7 @@ substrate_col = 'Substrate'
|
|
|
180
217
|
rows = [['P0DP23', 'MALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAA', 'CCCCC(CC)COC(=O)C1=CC=CC=C1C(=O)OCC(CC)CCCC'],
|
|
181
218
|
['P0DP24', 'MALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAAMALWMRLLPLLALLALWGPDPAAA', 'CCCCC(CC)COC(=O)C1=CC=CC=C1C(=O)OCC(CC)CCCC']]
|
|
182
219
|
df = pd.DataFrame(rows, columns=[id_col, seq_col, substrate_col])
|
|
183
|
-
df << (ChemBERT(id_col, substrate_col, num_threads) >> Save(f'{output_dir}chemberta.pkl'))
|
|
220
|
+
new_df = (df << (ChemBERT(id_col, substrate_col, num_threads) >> Save(f'{output_dir}chemberta.pkl')))
|
|
184
221
|
```
|
|
185
222
|
|
|
186
223
|
### CLEAN
|
|
@@ -206,11 +243,11 @@ df << (CLEAN(id_col, seq_col, clean_dir, num_threads=num_threads) >> Save(f'clea
|
|
|
206
243
|
```
|
|
207
244
|
### ClustalOmega
|
|
208
245
|
|
|
209
|
-
ClustalOmega is a tool for aligning a set of sequences. This gets installed to the system (expecting a linux machine) and added to the bash path.
|
|
246
|
+
ClustalOmega is a tool for aligning a set of sequences. This gets installed to the system (expecting a linux machine) and added to the bash path. You need to have installed it first (check out the `conda_envs` directory in enzymetk.)
|
|
210
247
|
|
|
211
248
|
```python
|
|
212
|
-
from
|
|
213
|
-
from
|
|
249
|
+
from enzymetk.generate_msa_step import ClustalOmega
|
|
250
|
+
from enzymetk.save_step import Save
|
|
214
251
|
import pandas as pd
|
|
215
252
|
|
|
216
253
|
id_col = 'Entry'
|
|
@@ -230,8 +267,8 @@ df << (ClustalOmega(id_col, seq_col) >> Save('tmp/clustalomega_test.pkl'))
|
|
|
230
267
|
CREEP is a tool for predicting the EC number of a reaction. At the moment it only supports reactions to EC however we are extending this to other modalities.
|
|
231
268
|
|
|
232
269
|
```python
|
|
233
|
-
from
|
|
234
|
-
from
|
|
270
|
+
from enzymetk.annotateEC_CREEP_step import CREEP
|
|
271
|
+
from enzymetk.save_step import Save
|
|
235
272
|
import pandas as pd
|
|
236
273
|
|
|
237
274
|
# CREEP expects you to have downloaded the data from the zotero page and put it in the data/CREEP folder
|
|
@@ -252,8 +289,8 @@ df << (CREEP(id_col, reaction_col, CREEP_cache_dir='/disk1/share/software/CREEP/
|
|
|
252
289
|
EmbedESM is a tool for embedding a set of sequences using ESM2.
|
|
253
290
|
|
|
254
291
|
```python
|
|
255
|
-
from
|
|
256
|
-
from
|
|
292
|
+
from enzymetk.embedprotein_esm_step import EmbedESM
|
|
293
|
+
from enzymetk.save_step import Save
|
|
257
294
|
import pandas as pd
|
|
258
295
|
|
|
259
296
|
id_col = 'Entry'
|
|
@@ -280,8 +317,8 @@ If you pass a database, you need to pass the path to the database.
|
|
|
280
317
|
The columns expect a path to a pdb file i.e. the output from the `Chai` step.
|
|
281
318
|
|
|
282
319
|
```python
|
|
283
|
-
from
|
|
284
|
-
from
|
|
320
|
+
from enzymetk.similarity_foldseek_step import FoldSeek
|
|
321
|
+
from enzymetk.save_step import Save
|
|
285
322
|
import pandas as pd
|
|
286
323
|
|
|
287
324
|
# id_col: str, seq_col: str, proteinfer_dir: str,
|
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
enzymetk/__init__.py,sha256=
|
|
2
|
-
enzymetk/annotateEC_CLEAN_step.py,sha256=
|
|
3
|
-
enzymetk/annotateEC_CREEP_step.py,sha256=
|
|
1
|
+
enzymetk/__init__.py,sha256=q1VxzDTE-F13VrPzIJjRJmwyPEaPfZyqKdkIJx406Ag,1575
|
|
2
|
+
enzymetk/annotateEC_CLEAN_step.py,sha256=Id4uMtETKjvsnz58SGXlw9r-5T0TYOcvhS3Mi9xhHTw,5448
|
|
3
|
+
enzymetk/annotateEC_CREEP_step.py,sha256=CZ0mh1UhVp0VShAzHnr9iifB2h1bCeMaHmBUj__t80Y,4215
|
|
4
4
|
enzymetk/annotateEC_proteinfer_step.py,sha256=GTy27Z5SyG2EPvlf9HTZZ-HRG8FrAs9p0G0OCPmcIW4,6245
|
|
5
|
-
enzymetk/
|
|
6
|
-
enzymetk/
|
|
5
|
+
enzymetk/dock_boltz_step.py,sha256=pHkJSMTgKq0deEM-_cphXlQH1VL73BvRh8JEpv8ighA,1779
|
|
6
|
+
enzymetk/dock_chai_step.py,sha256=YVHJHm1oAN6oOVfi7aV-6cqlQdA05yEIN0lhWAsj4oI,2011
|
|
7
|
+
enzymetk/dock_vina_step.py,sha256=o1M7En9DQPMTJx5Lh29cAPkZTvD3EkNrBvFMGlT-HAo,3826
|
|
7
8
|
enzymetk/embedchem_chemberta_step.py,sha256=uS7qf_adO0X_sACnCp3ULakTtepx0soHL9y6WMnaaqk,2328
|
|
8
9
|
enzymetk/embedchem_rxnfp_run.py,sha256=n6ERAhql947-L0-_xvsBHLFyixjUW5yknDPHdM4CNOQ,1061
|
|
9
10
|
enzymetk/embedchem_rxnfp_step.py,sha256=fmkJcuKpHllDNxkq0zV1jM2R7KREyEEG1KrVngOcvC8,2111
|
|
10
11
|
enzymetk/embedchem_selformer_run.py,sha256=ibN7pbSRl1YqpHgVVaQKWpUk0E80U5ue_2dDlttn10M,1566
|
|
11
12
|
enzymetk/embedchem_selformer_step.py,sha256=UQkRc6V7N1Zk3p4gR_MEKALX45bhhGw_8_xc5kM44Yw,1461
|
|
12
13
|
enzymetk/embedchem_unimol_step.py,sha256=9KL4bto2O1YujZy5UpauBtGlIEUwTRMa8raVqFnX0zQ,2133
|
|
13
|
-
enzymetk/
|
|
14
|
+
enzymetk/embedprotein_esm3_step.py,sha256=l_8Bfyh0JgJ5R3xo2tPVgrfFBsHqoNGeIIwWwIXzPQI,2575
|
|
15
|
+
enzymetk/embedprotein_esm_step.py,sha256=f99unRqyfw9Gsr2j7-7rwqtnxdYAZ3RXppLW549vpaE,5896
|
|
14
16
|
enzymetk/esm-extract.py,sha256=W9n9--Pde2uUuIQP9LrPMHlLZGfpKvrJQ-SuTvGRYmc,5160
|
|
15
17
|
enzymetk/filter_sequence_step.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
18
|
enzymetk/filter_structure_step.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
19
|
enzymetk/generate_msa_step.py,sha256=w-CrKPMxAwqjsbPQcRq3HP12FyiyuDq0qnt0ObsVhPk,2325
|
|
18
20
|
enzymetk/generate_oligopool_step.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
21
|
enzymetk/generate_tree_step.py,sha256=eee2pILdm3lxVYTsO3CoTCwbY7MfdSK3ve84uMkLwnY,3130
|
|
20
|
-
enzymetk/inpaint_ligandMPNN_step.py,sha256=
|
|
22
|
+
enzymetk/inpaint_ligandMPNN_step.py,sha256=DOHXTo6BUeEqzYsoJrS5komi1R0yMybeh5ljyRQLIGs,3032
|
|
21
23
|
enzymetk/main.py,sha256=aY9dEM0a_1jnIJaRTrysLD4KqD5vWMx2OTavh3s4ZxA,1789
|
|
22
24
|
enzymetk/metagenomics_porechop_trim_reads_step.py,sha256=0-wEDqMRFr5c8TtzUmbgUL6S1UgigR5oOano1l_MYDU,2156
|
|
23
25
|
enzymetk/metagenomics_prokka_annotate_genes.py,sha256=VdBTkzUUwq4dMHMm-fb7CBVjTH57gRULLfrGJzqBbWg,2572
|
|
24
26
|
enzymetk/pipeline.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
25
27
|
enzymetk/predict_activity_step.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
-
enzymetk/predict_catalyticsite_run.py,sha256=
|
|
27
|
-
enzymetk/predict_catalyticsite_step.py,sha256=
|
|
28
|
+
enzymetk/predict_catalyticsite_run.py,sha256=cZVda3bTufV6jwXm5puymYyFIYq3SHon3bhIHXIRYMA,2782
|
|
29
|
+
enzymetk/predict_catalyticsite_step.py,sha256=j6bAxnsQ6h0pfGkFXVVgp54oZm6dFaV1vaJSYHnUXF4,2966
|
|
28
30
|
enzymetk/reducedim_pca_run.py,sha256=SUCLrs9P2L8uGuWnkMcbn_mihtMzhVu3PynCaCjUA1Y,2969
|
|
29
31
|
enzymetk/reducedim_vae_run.py,sha256=SUCLrs9P2L8uGuWnkMcbn_mihtMzhVu3PynCaCjUA1Y,2969
|
|
30
32
|
enzymetk/reducedim_vae_step.py,sha256=bAp1jJESawvxyf2_PKXQAr9JsUcO6vWuHAU3PT0ScJA,235
|
|
31
33
|
enzymetk/save_step.py,sha256=g-1XvurzUNoIRO8pNOHlvVUyTU_87JW-ZFGf5asna2A,293
|
|
32
|
-
enzymetk/sequence_search_blast.py,sha256=
|
|
33
|
-
enzymetk/similarity_foldseek_step.py,sha256=
|
|
34
|
+
enzymetk/sequence_search_blast.py,sha256=rqtse4lG2Zeg3UgtMIV6RLu7wyv7q7w0SxPia_4N4zE,5022
|
|
35
|
+
enzymetk/similarity_foldseek_step.py,sha256=_Vrvv6UCwHBP94lS9V5QX61dyxsoAr10gjp1PubXUig,6185
|
|
34
36
|
enzymetk/similarity_mmseqs_step.py,sha256=FSne7ATtkPBDJzk_-c6W-ZHfGStiGNEtpWMerXlEZZU,3494
|
|
35
|
-
enzymetk/similarity_reaction_step.py,sha256=
|
|
36
|
-
enzymetk/similarity_substrate_step.py,sha256=
|
|
37
|
-
enzymetk/step.py,sha256=
|
|
38
|
-
enzymetk-0.0.
|
|
39
|
-
enzymetk-0.0.
|
|
40
|
-
enzymetk-0.0.
|
|
41
|
-
enzymetk-0.0.
|
|
42
|
-
enzymetk-0.0.
|
|
43
|
-
enzymetk-0.0.
|
|
44
|
-
enzymetk-0.0.
|
|
37
|
+
enzymetk/similarity_reaction_step.py,sha256=yQRyipdG2CyjEZ7hmr4Y-pGa32eAmxjWm4zqABCh6-g,2942
|
|
38
|
+
enzymetk/similarity_substrate_step.py,sha256=Sw8C2TCDHLMoYeay69bj6p_dKhmpMV4hBUkm4pYBBxQ,2732
|
|
39
|
+
enzymetk/step.py,sha256=LmcIyUh7XFxyt2P2LwtFJZ8Ca9Nyo7nLz6dRejHxkoc,1762
|
|
40
|
+
enzymetk-0.0.6.data/data/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
|
+
enzymetk-0.0.6.dist-info/licenses/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
|
+
enzymetk-0.0.6.dist-info/METADATA,sha256=vgGo4q5EI_j-lv9EMy16BJOIuiaTgZcC1xMGdLRAc80,22931
|
|
43
|
+
enzymetk-0.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
44
|
+
enzymetk-0.0.6.dist-info/entry_points.txt,sha256=RU3pSTXg2RyNLlc0asRpBYRkmv5GpRP7teeDY7Tr7e0,52
|
|
45
|
+
enzymetk-0.0.6.dist-info/top_level.txt,sha256=Qct8wLw9EjZ4yfKaKeJHBjWWuoK_FwHZgbIBb6PwBgg,9
|
|
46
|
+
enzymetk-0.0.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|