Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BIOINF588
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Etienne MORICE
BIOINF588
Commits
764c5637
Verified
Commit
764c5637
authored
6 years ago
by
Etienne MORICE
Browse files
Options
Downloads
Patches
Plain Diff
Handle missing structural data more nicely.
parent
42c12aa1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
alignementseq_tests.py
+28
-9
28 additions, 9 deletions
alignementseq_tests.py
with
28 additions
and
9 deletions
alignementseq_tests.py
+
28
−
9
View file @
764c5637
...
@@ -28,7 +28,9 @@ class BalibaseTestCase(unittest.TestCase):
...
@@ -28,7 +28,9 @@ class BalibaseTestCase(unittest.TestCase):
def
setUp
(
self
):
def
setUp
(
self
):
balibase_zippath
=
"
balibase.zip
"
balibase_zippath
=
"
balibase.zip
"
self
.
balibase_path
=
"
balibase
"
self
.
balibase_path
=
"
balibase
"
self
.
exclude_fastas
=
[
"
BBS11037.fasta
"
]
# This one does not contain correct
self
.
exclude_fastas
=
[]
# For problematic files that won't be handled.
# Try to handle them, this is a temporary or
# last resort solution.
# pdb codes as ids
# pdb codes as ids
testfile_path
=
os
.
path
.
join
(
testfile_path
=
os
.
path
.
join
(
self
.
balibase_path
,
self
.
balibase_path
,
...
@@ -88,18 +90,35 @@ class BalibaseTestCase(unittest.TestCase):
...
@@ -88,18 +90,35 @@ class BalibaseTestCase(unittest.TestCase):
warnings
.
warn
(
"
Exluding file
"
+
name
+
"
according to exclusion list
"
)
warnings
.
warn
(
"
Exluding file
"
+
name
+
"
according to exclusion list
"
)
continue
continue
skip
=
False
item
=
[
s1
,
s2
,
os1
,
os2
]
item
=
[
s1
,
s2
,
os1
,
os2
]
for
s
in
s1
,
s2
:
for
s
in
s1
,
s2
:
fname
=
Bio
.
PDB
.
PDBList
().
retrieve_pdb_file
(
code
=
s
.
id
[
0
:
4
]
s
.
id
[
0
:
4
],
fname
=
os
.
path
.
join
(
'
data
'
,
code
+
'
.cif
'
)
file_format
=
"
mmCif
"
,
pdir
=
"
data
"
# Attempt download
)
if
not
os
.
path
.
isfile
(
fname
):
fname
=
Bio
.
PDB
.
PDBList
().
retrieve_pdb_file
(
code
,
file_format
=
"
mmCif
"
,
pdir
=
"
data
"
)
# Skip if still missing
if
not
os
.
path
.
isfile
(
fname
):
warnings
.
warn
(
"
Could not retrieve PDB
"
+
code
+
"
(from
"
+
name
+
"
), skipping
"
)
skip
=
True
break
with
warnings
.
catch_warnings
():
with
warnings
.
catch_warnings
():
warnings
.
simplefilter
(
"
ignore
"
)
warnings
.
simplefilter
(
"
ignore
"
)
struct
=
parser
.
get_structure
(
s
.
id
[
0
:
4
],
fname
)
struct
=
parser
.
get_structure
(
code
,
fname
)
print
(
fname
,
s
.
id
[
0
:
4
])
item
.
append
(
struct
)
item
.
append
(
struct
)
if
skip
:
continue
item
.
append
(
name
)
item
.
append
(
name
)
yield
item
yield
item
...
@@ -238,7 +257,7 @@ class AlignmentSeqTestCase(BalibaseTestCase):
...
@@ -238,7 +257,7 @@ class AlignmentSeqTestCase(BalibaseTestCase):
str
(
Bio
.
PDB
.
Polypeptide
.
Polypeptide
(
c
).
get_sequence
()).
startswith
(
str
(
seq
.
seq
))
str
(
Bio
.
PDB
.
Polypeptide
.
Polypeptide
(
c
).
get_sequence
()).
startswith
(
str
(
seq
.
seq
))
)
)
except
StopIteration
:
except
StopIteration
:
warnings
.
warn
(
"
No suitable chain found for seq id
"
+
seq
.
id
+
"
in structure
"
+
struct
.
id
+
"
, skipping file.
"
)
warnings
.
warn
(
"
No suitable chain found for seq id
"
+
seq
.
id
+
"
in structure
"
+
struct
.
id
+
"
(from
"
+
name
+
"
)
, skipping file.
"
)
skip
=
True
skip
=
True
break
break
polyp
=
Bio
.
PDB
.
Polypeptide
.
Polypeptide
(
chain
)
polyp
=
Bio
.
PDB
.
Polypeptide
.
Polypeptide
(
chain
)
...
...
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