Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
OpenFold
Commits
db43f4ec
Commit
db43f4ec
authored
Jul 07, 2022
by
Gustaf Ahdritz
Browse files
Add CAMEO download script
parent
cf041c7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
scripts/download_cameo.py
scripts/download_cameo.py
+37
-0
No files found.
scripts/download_cameo.py
0 → 100644
View file @
db43f4ec
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import
argparse
import
os
import
urllib.request
""" Downloads CAMEO proteins from PDB. The "cameo_table_path" should be a file
containing a CAMEO target table (exported using the "Copy to clipboard"
option). Useful for constructing validation sets.
E.g. https://www.cameo3d.org/modeling/targets/3-months/?to_date=2022-07-02
"""
def
main
(
args
):
with
open
(
args
.
cameo_table_path
,
"r"
)
as
fp
:
lines
=
[
l
.
strip
()
for
l
in
fp
.
readlines
()]
splits
=
[
l
.
split
()
for
l
in
lines
]
prots
,
chain_ids
=
zip
(
*
[
s
[
5
:
7
]
for
s
in
splits
])
chain_ids
=
[
chain_id
.
strip
(
'['
).
strip
(
']'
)
for
chain_id
in
chain_ids
]
for
prot
in
prots
:
url
=
f
"https://files.rcsb.org/view/
{
prot
.
upper
()
}
.cif"
out_path
=
os
.
path
.
join
(
args
.
output_dir
,
f
"
{
prot
}
.cif"
)
if
(
not
os
.
path
.
exists
(
out_path
)):
urllib
.
request
.
urlretrieve
(
url
,
out_path
)
if
__name__
==
'__main__'
:
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"cameo_table_path"
,
type
=
str
)
parser
.
add_argument
(
"output_dir"
,
type
=
str
)
args
=
parser
.
parse_args
()
main
(
args
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment