Skip to content

Commit 530f038

Browse files
committed
Smells
1 parent a1194e0 commit 530f038

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
lines changed

autodock/scripts/convertToSMIs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929

3030
from utils import parseMoleculeFile
3131

32-
def pdbqt_to_smi(pdbqt_file):
32+
def pdbqtToSMI(pdbqtFile):
3333
obConversion = openbabel.OBConversion()
3434
obConversion.SetInAndOutFormats("pdbqt", "can")
3535

3636
mol = openbabel.OBMol()
37-
success = obConversion.ReadFile(mol, pdbqt_file)
37+
success = obConversion.ReadFile(mol, pdbqtFile)
3838

3939
if success:
4040
smiles = obConversion.WriteString(mol).strip()
@@ -59,12 +59,12 @@ def pdbqt_to_smi(pdbqt_file):
5959
for line in f:
6060
molFile = line.split(',')[0].strip()
6161
if molFile.endswith('.pdbqt'):
62-
smi = pdbqt_to_smi(molFile)
62+
smi = pdbqtToSMI(molFile)
6363
mol = Chem.MolFromSmiles(smi)
6464
else:
6565
mol = parseMoleculeFile(molFile)
6666

67-
canonical_smiles = Chem.MolToSmiles(mol, canonical=True)
68-
fMap.write(f'{molFile},{canonical_smiles}\n')
69-
fo.write(line.replace(molFile, canonical_smiles))
67+
canonicalSMI = Chem.MolToSmiles(mol, canonical=True)
68+
fMap.write(f'{molFile},{canonicalSMI}\n')
69+
fo.write(line.replace(molFile, canonicalSMI))
7070

autodock/scripts/meeko_preparation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def getBiggestFrag(mol):
5353
for mol in frags:
5454
if mol.GetNumAtoms() > maxi:
5555
maxi, bMol = mol.GetNumAtoms(), mol
56-
return mol
56+
return bMol
5757

5858
if __name__ == "__main__":
5959
'''Use: python <scriptName> <paramsFile>

autodock/scripts/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ def getMolFilesDic(molFiles):
6060
def parsePDBQT(pdbqtFile):
6161
from rdkit import Chem
6262
with open(pdbqtFile, "r") as f:
63-
pdb_lines = [line for line in f if not line.startswith(("REMARK", "TORSDO"))] # Filtra líneas no estándar
63+
pdbLines = [line for line in f if not line.startswith(("REMARK", "TORSDO"))] # Filtra líneas no estándar
6464

6565
# Guardamos el PDB temporalmente
66-
temp_pdb = pdbqtFile.replace('.pdb', '.pdbqt')
67-
with open(temp_pdb, "w") as f:
68-
f.writelines(pdb_lines)
66+
tempPDB = pdbqtFile.replace('.pdb', '.pdbqt')
67+
with open(tempPDB, "w") as f:
68+
f.writelines(pdbLines)
6969

7070
# Leer la molécula desde el PDB
71-
mol = Chem.MolFromPDBFile(temp_pdb, removeHs=False)
71+
mol = Chem.MolFromPDBFile(tempPDB, removeHs=False)
7272

7373
if mol:
7474
return Chem.MolToSmiles(mol)

autodock/utils/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def getMolName(molText):
5757
if confId is not None:
5858
oFile = oFile.replace('.sdf', f'-{confId}.sdf')
5959

60-
if not molName in molDic:
60+
if molName not in molDic:
6161
molDic[molName] = []
6262
with open(oFile, 'w') as fo:
6363
fo.write(f'{molText}\n\n$$$$')

autodock/wizards/wizard_select.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@
3131
Then, it will load the structure and will take all chain related
3232
information such as name and number of residues.
3333
"""
34+
import os, json
35+
36+
from pwchem.utils import runOpenBabel
3437

3538
from pwchem.wizards import *
3639
from pwchem.utils import RESIDUES1TO3
3740

38-
from autodock.protocols import *
41+
from autodock.protocols import ProtChemADTPrepareReceptor, ProtChemAutodock, ProtChemVinaDocking, ProtChemAutodockGPU, \
42+
ProtEncoderDockScoring, ProtRingtailFilter, ProtChemAutoSiteGenPharmacophore
3943
from autodock.viewers import ViewerRingtail
4044
from autodock import Plugin as autodockPlugin
4145

@@ -173,7 +177,7 @@ def getModels(self):
173177
return models
174178

175179
def show(self, form, *params):
176-
inputParams, outputParam = self.getInputOutput(form)
180+
_, outputParam = self.getInputOutput(form)
177181
try:
178182
models = self.getModels()
179183
except Exception as e:

0 commit comments

Comments
 (0)