Download PDB files¶
In [1]:
Copied!
from pathlib import Path
from protein_detective.pdbe.fetch import fetch
from pathlib import Path
from protein_detective.pdbe.fetch import fetch
In [2]:
Copied!
ids = [
"4NDY", # structure of uniprot A8MT69
"4DRA", # structure of uniprot A8MT69
"1XWH", # structure of uniprot O43918
"8WAS", # structure for which there is no single pdb file
]
ids = [
"4NDY", # structure of uniprot A8MT69
"4DRA", # structure of uniprot A8MT69
"1XWH", # structure of uniprot O43918
"8WAS", # structure for which there is no single pdb file
]
In [3]:
Copied!
save_dir = Path("pdb_files")
save_dir = Path("pdb_files")
In [4]:
Copied!
files = fetch(ids, save_dir)
files
files = fetch(ids, save_dir)
files
Downloading PDBe mmCIF files: 0%| | 0/4 [00:00<?, ?it/s]
Downloading PDBe mmCIF files: 100%|██████████| 4/4 [00:00<00:00, 5.07it/s]
Out[4]:
{'4NDY': PosixPath('pdb_files/4ndy.cif'), '4DRA': PosixPath('pdb_files/4dra.cif'), '1XWH': PosixPath('pdb_files/1xwh.cif'), '8WAS': PosixPath('pdb_files/8was.cif')}
In [5]:
Copied!
!ls pdb_files
!ls pdb_files
1xwh.cif 4dra.cif 4ndy.cif 8was.cif
Prepare pdb file for powerfit¶
In [6]:
Copied!
from protein_detective.pdbe.io import write_single_chain_pdb_file
from protein_detective.pdbe.io import write_single_chain_pdb_file
In [7]:
Copied!
# A8MT69 4NDY B/D/H/L/M/N/U/V/W/X=8-81 session1/single_chain/A8MT69_pdb4ndy.ent_B2A.pdb
write_single_chain_pdb_file(save_dir / "4ndy.cif", "B", save_dir / "A8MT69_4ndy_B2A.pdb")
# A8MT69 4NDY B/D/H/L/M/N/U/V/W/X=8-81 session1/single_chain/A8MT69_pdb4ndy.ent_B2A.pdb
write_single_chain_pdb_file(save_dir / "4ndy.cif", "B", save_dir / "A8MT69_4ndy_B2A.pdb")
In [8]:
Copied!
# A8MT69 4DRA E/F/G/H=1-81 session1/single_chain/A8MT69_pdb4dra.ent_E2A.pdb
write_single_chain_pdb_file(save_dir / "4dra.cif", "E", save_dir / "8MT69_4dra_E2A.pdb")
# A8MT69 4DRA E/F/G/H=1-81 session1/single_chain/A8MT69_pdb4dra.ent_E2A.pdb
write_single_chain_pdb_file(save_dir / "4dra.cif", "E", save_dir / "8MT69_4dra_E2A.pdb")
In [9]:
Copied!
!head pdb_files/8MT69_pdb4dra.ent_E2A.pdb
print("...")
!tail pdb_files/8MT69_pdb4dra.ent_E2A.pdb
!head pdb_files/8MT69_pdb4dra.ent_E2A.pdb
print("...")
!tail pdb_files/8MT69_pdb4dra.ent_E2A.pdb
head: cannot open 'pdb_files/8MT69_pdb4dra.ent_E2A.pdb' for reading: No such file or directory ... tail: cannot open 'pdb_files/8MT69_pdb4dra.ent_E2A.pdb' for reading: No such file or directory
In [10]:
Copied!
write_single_chain_pdb_file(
"pdb_files/1xwh.cif",
"A",
"pdb_files/O43918_1xwh_A2A.pdb",
)
write_single_chain_pdb_file(
"pdb_files/1xwh.cif",
"A",
"pdb_files/O43918_1xwh_A2A.pdb",
)
In [12]:
Copied!
# O00268 │ 8WAS │ D/d=1-1085
write_single_chain_pdb_file(
"pdb_files/8was.cif",
"D",
"pdb_files/O00268_8was_D2A.pdb",
)
# O00268 │ 8WAS │ D/d=1-1085
write_single_chain_pdb_file(
"pdb_files/8was.cif",
"D",
"pdb_files/O00268_8was_D2A.pdb",
)
In [13]:
Copied!
!ls -l pdb_files/
!ls -l pdb_files/
total 18772 -rw-rw-r-- 1 verhoes verhoes 1796029 Jun 6 12:34 1xwh.cif -rw-rw-r-- 1 verhoes verhoes 1034577 Jun 6 12:34 4dra.cif -rw-rw-r-- 1 verhoes verhoes 3117986 Jun 6 12:34 4ndy.cif -rw-rw-r-- 1 verhoes verhoes 92853 Jun 6 12:34 8MT69_4dra_E2A.pdb -rw-rw-r-- 1 verhoes verhoes 12881824 Jun 6 12:34 8was.cif -rw-rw-r-- 1 verhoes verhoes 95607 Jun 6 12:34 A8MT69_4ndy_B2A.pdb -rw-rw-r-- 1 verhoes verhoes 110673 Jun 6 12:34 O00268_8was_D2A.pdb -rw-rw-r-- 1 verhoes verhoes 77220 Jun 6 12:34 O43918_1xwh_A2A.pdb
In [ ]:
Copied!