Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProMod3
Manage
Activity
Members
Plan
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
ProMod3
Commits
165df59d
Commit
165df59d
authored
10 years ago
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
Removed obsoletet ligand test
parent
87175141
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
meld/tests/test_addligands.py
+0
-158
0 additions, 158 deletions
meld/tests/test_addligands.py
with
0 additions
and
158 deletions
meld/tests/test_addligands.py
deleted
100644 → 0
+
0
−
158
View file @
87175141
'''
SWISS-MODEL 2.0
doc at:
"
firefox file:///import/bc2/home/schwede/gallo/swissmodel/doc/build/html/index.html
"
use: ./TESTS --verbose meld
'''
import
os
,
sys
,
math
import
shutil
from
ost
import
*
from
sm.core.test
import
*
from
sm.core
import
*
from
sm.meld
import
*
from
sm
import
smtl
,
config
,
tplsearch
from
sm.pipeline
import
project
from
sm.pipeline.model
import
HomologyModel
from
sm.pipeline.addligands
import
*
class
TestAddLigands
(
unittest
.
TestCase
):
def
setUp
(
self
):
if
os
.
path
.
exists
(
'
data/ligands/SMTL
'
):
shutil
.
rmtree
(
'
data/ligands/SMTL
'
)
if
os
.
path
.
exists
(
'
data/ligands/test.sm
'
):
shutil
.
rmtree
(
'
data/ligands/test.sm
'
)
def
tearDown
(
self
):
# using the same path for each test SMTL, we have to clear the cache
smtl
.
SMTL
.
LOADED_SMTLS
=
{}
if
os
.
path
.
exists
(
'
data/ligands/SMTL
'
):
shutil
.
rmtree
(
'
data/ligands/SMTL
'
)
if
os
.
path
.
exists
(
'
data/ligands/test.sm
'
):
shutil
.
rmtree
(
'
data/ligands/test.sm
'
)
def
fastIsLigandInContact
(
self
):
in_contact
=
[]
bound
=
IsLigandInContact
(
in_contact
)
self
.
assertEqual
(
bound
,
False
)
in_contact
=
[
'
_.12
'
,
'
-.2
'
]
bound
=
IsLigandInContact
(
in_contact
)
self
.
assertEqual
(
bound
,
False
)
in_contact
=
[
'
_.12
'
,
'
T.1
'
]
bound
=
IsLigandInContact
(
in_contact
)
self
.
assertEqual
(
bound
,
False
)
in_contact
=
[
'
_.12
'
,
'
T.1
'
,
'
S.2
'
]
bound
=
IsLigandInContact
(
in_contact
)
self
.
assertEqual
(
bound
,
True
)
def
fastIsLigandBound
(
self
):
target_seq
=
io
.
LoadSequence
(
'
data/ligands/3G04C.fasta
'
)
seq1
=
io
.
LoadSequence
(
'
data/ligands/3G04C.fasta
'
)
templates
=
tplsearch
.
TemplateList
()
tem
=
tplsearch
.
Template
.
Create
(
'
3G04
'
,
1
,
'
A
'
,
seq
.
CreateAlignment
(
target_seq
,
seq1
))
templates
.
append
(
tem
)
lib
=
smtl
.
SMTL
.
Create
(
'
data/ligands/SMTL
'
)
lib
.
Update
(
add
=
(
'
3G04
'
,
),
mmcif_dir
=
'
data/ligands/
'
,
calc_profiles
=
False
)
prj
=
project
.
Project
.
Create
(
'
test
'
,
target_seq
,
lib
,
output_dir
=
'
./data/ligands
'
,
pdb_storage
=
'
external
'
,
split
=
False
)
prj
.
ImportTemplates
(
templates
,
lib
,
pdb_storage
=
'
default
'
,
tolerant
=
False
,
found_by
=
None
)
model
=
io
.
LoadPDB
(
'
data/ligands/3G04_model_no_lig.pdb
'
)
bio_unit
=
prj
.
smtl
.
Get
(
tem
.
pdb_id
,
tem
.
assembly_id
)
lig
=
bio_unit
.
ligands
[
0
].
chains
[
0
]
is_bound
=
IsLigandBound
(
lig
,
model
)
self
.
assertEqual
(
is_bound
,
False
)
lig
=
bio_unit
.
ligands
[
0
].
chains
[
1
]
is_bound
=
IsLigandBound
(
lig
,
model
)
self
.
assertEqual
(
is_bound
,
True
)
lig
=
bio_unit
.
ligands
[
0
].
chains
[
2
]
is_bound
=
IsLigandBound
(
lig
,
model
)
self
.
assertEqual
(
is_bound
,
True
)
lig
=
bio_unit
.
ligands
[
0
].
chains
[
3
]
is_bound
=
IsLigandBound
(
lig
,
model
)
self
.
assertEqual
(
is_bound
,
True
)
lig
=
bio_unit
.
ligands
[
0
].
chains
[
4
]
is_bound
=
IsLigandBound
(
lig
,
model
)
self
.
assertEqual
(
is_bound
,
True
)
lig
=
bio_unit
.
ligands
[
0
].
chains
[
5
]
is_bound
=
IsLigandBound
(
lig
,
model
)
self
.
assertEqual
(
is_bound
,
True
)
lig
=
bio_unit
.
ligands
[
1
].
chains
[
0
]
is_bound
=
IsLigandBound
(
lig
,
model
)
self
.
assertEqual
(
is_bound
,
False
)
lig
=
bio_unit
.
ligands
[
1
].
chains
[
1
]
is_bound
=
IsLigandBound
(
lig
,
model
)
self
.
assertEqual
(
is_bound
,
False
)
lig
=
bio_unit
.
ligands
[
1
].
chains
[
2
]
is_bound
=
IsLigandBound
(
lig
,
model
)
self
.
assertEqual
(
is_bound
,
True
)
lig
=
bio_unit
.
ligands
[
1
].
chains
[
3
]
is_bound
=
IsLigandBound
(
lig
,
model
)
self
.
assertEqual
(
is_bound
,
True
)
lig
=
bio_unit
.
ligands
[
1
].
chains
[
4
]
is_bound
=
IsLigandBound
(
lig
,
model
)
self
.
assertEqual
(
is_bound
,
True
)
def
fastAssignResiduesConservation
(
self
):
# perfect aln
mod_seq
=
seq
.
CreateSequence
(
'
M
'
,
'
AAAAA
'
)
tem_seq
=
seq
.
CreateSequence
(
'
T
'
,
'
AAAAA
'
)
aln
=
seq
.
CreateAlignment
(
mod_seq
,
tem_seq
)
in_contact
=
[
'
_.12
'
,
'
T.1
'
,
'
T.3
'
,
'
T.4
'
,
'
C.23
'
]
is_cons
=
AssignResiduesConservation
(
in_contact
,
aln
)
self
.
assertEqual
(
is_cons
,
True
)
# bad aln
mod_seq
=
seq
.
CreateSequence
(
'
M
'
,
'
TA--A
'
)
tem_seq
=
seq
.
CreateSequence
(
'
T
'
,
'
TSAAS
'
)
aln
=
seq
.
CreateAlignment
(
mod_seq
,
tem_seq
)
in_contact
=
[
'
_.12
'
,
'
T.1
'
,
'
T.3
'
,
'
T.4
'
,
'
C.23
'
]
is_cons
=
AssignResiduesConservation
(
in_contact
,
aln
)
self
.
assertEqual
(
is_cons
,
False
)
def
fastCopyLigand
(
self
):
tem
=
io
.
LoadPDB
(
'
data/ligands/3IIJ.pdb
'
)
ligand
=
tem
.
Select
(
'
rname=ADP
'
)
model
=
io
.
LoadPDB
(
'
data/ligands/3IIJ_no_ligands.pdb
'
)
add_lig
,
no_overlaps
,
new_model
=
CopyLigand
(
ligand
,
model
)
self
.
assertEqual
(
add_lig
,
True
)
self
.
assertEqual
(
no_overlaps
,
True
)
adp
=
new_model
.
Select
(
'
rname=ADP
'
)
self
.
assertEqual
(
adp
.
residues
[
0
].
name
,
'
ADP
'
)
ligands
=
new_model
.
Select
(
'
protein=false and water=false
'
)
self
.
assertEqual
(
ligands
.
residue_count
,
1
)
def
fastRunAddLigands
(
self
):
mod_seq
=
io
.
LoadSequence
(
'
data/ligands/3IIJ.fasta
'
)
tem_seq
=
io
.
LoadSequence
(
'
data/ligands/3IIJ.fasta
'
)
aln
=
seq
.
CreateAlignment
(
mod_seq
,
tem_seq
)
tem
=
tplsearch
.
Template
.
Create
(
'
3iij
'
,
1
,
'
A
'
,
aln
)
model
=
io
.
LoadPDB
(
'
data/ligands/3IIJ_no_ligands.pdb
'
)
lib
=
smtl
.
SMTL
.
Create
(
'
data/ligands/SMTL
'
)
lib
.
Update
(
add
=
(
'
3IIJ
'
,
),
mmcif_dir
=
'
data/ligands/
'
,
calc_profiles
=
False
)
bio_unit
=
lib
.
Get
(
tem
.
pdb_id
,
tem
.
assembly_id
)
chain
=
bio_unit
.
GetChainByName
(
tem
.
chain_name
)
new_aln
=
chain
.
ToAtomSeqAlignment
(
tem
.
alignment
)
rep
,
new_model
=
RunAddLigands
(
bio_unit
,
model
,
aln
)
lig_rep
=
rep
[
0
]
self
.
assertEqual
(
lig_rep
[
'
description
'
],
"
ADENOSINE-5
'
-DIPHOSPHATE
"
)
self
.
assertEqual
(
lig_rep
[
'
name
'
][
0
],
'
ADP
'
)
self
.
assertEqual
(
lig_rep
[
'
number
'
],
'
1
'
)
self
.
assertEqual
(
lig_rep
[
'
included
'
],
True
)
self
.
assertEqual
(
lig_rep
[
'
reason
'
][
'
bound
'
],
True
)
self
.
assertEqual
(
lig_rep
[
'
reason
'
][
'
relevant
'
],
True
)
self
.
assertEqual
(
lig_rep
[
'
reason
'
][
'
conserved_residues
'
],
True
)
self
.
assertEqual
(
lig_rep
[
'
reason
'
][
'
sterically_valid
'
],
True
)
lig_rep
=
rep
[
1
]
# self.assertEqual(lig_rep['description'], "SULFATE ION")
# self.assertEqual(lig_rep['name'][0], 'SO4')
# self.assertEqual(lig_rep['number'], '2')
# self.assertEqual(lig_rep['included'], False)
# self.assertEqual(lig_rep['reason']['bound'], True)
# self.assertEqual(lig_rep['reason']['relevant'], False)
# self.assertEqual(len(rep), 5)
# ligands = new_model.Select('protein=false and water=false')
# self.assertEqual(ligands.residues[0].name, 'ADP')
# self.assertEqual(ligands.residue_count, 1)
if
__name__
==
"
__main__
"
:
run
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment