In [1]:
Copied!
from pathlib import Path
from protein_quest.pdbe.fetch import fetch
from pathlib import Path
from protein_quest.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 [5]:
Copied!
files = await fetch(ids, save_dir)
files
files = await fetch(ids, save_dir)
files
Downloading PDBe mmCIF files: 100%|██████████| 4/4 [00:00<00:00, 7.85it/s]
Out[5]:
{'4NDY': PosixPath('pdb_files/4ndy.cif.gz'), '4DRA': PosixPath('pdb_files/4dra.cif.gz'), '1XWH': PosixPath('pdb_files/1xwh.cif.gz'), '8WAS': PosixPath('pdb_files/8was.cif.gz')}
In [6]:
Copied!
!ls pdb_files
!ls pdb_files
1xwh.cif.gz 4dra.cif.gz 4ndy.cif.gz 8was.cif.gz
Prepare pdb file for haddock3 or powerfit¶
Haddock3 and powerfit like to have a file with a single protein in it called chain "A". The protein-quest package can help to create such a file.
In [7]:
Copied!
from protein_quest.pdbe.io import write_single_chain_pdb_file
from protein_quest.pdbe.io import write_single_chain_pdb_file
In [ ]:
Copied!
# A8MT69 4NDY B/D/H/L/M/N/U/V/W/X=8-81
# above is the identifier, chain and position info for the structure from https://www.uniprot.org/uniprotkb/A8MT69/entry#structure
output_4dny_file = write_single_chain_pdb_file(input_file=save_dir / "4ndy.cif.gz", chain2keep="B", output_dir=save_dir)
output_4dny_file
# A8MT69 4NDY B/D/H/L/M/N/U/V/W/X=8-81
# above is the identifier, chain and position info for the structure from https://www.uniprot.org/uniprotkb/A8MT69/entry#structure
output_4dny_file = write_single_chain_pdb_file(input_file=save_dir / "4ndy.cif.gz", chain2keep="B", output_dir=save_dir)
output_4dny_file
Out[ ]:
PosixPath('pdb_files/4ndy_B2A.cif.gz')
In [ ]:
Copied!
# A8MT69 4DRA E/F/G/H=1-81
output_4dra_file = write_single_chain_pdb_file(input_file=save_dir / "4dra.cif.gz", chain2keep="E", output_dir=save_dir)
output_4dra_file
# A8MT69 4DRA E/F/G/H=1-81
output_4dra_file = write_single_chain_pdb_file(input_file=save_dir / "4dra.cif.gz", chain2keep="E", output_dir=save_dir)
output_4dra_file
Out[ ]:
PosixPath('pdb_files/4dra_E2A.cif.gz')
In [12]:
Copied!
output_1xwh_file = write_single_chain_pdb_file(
input_file=save_dir / "1xwh.cif.gz",
chain2keep="A",
output_dir=save_dir,
)
output_1xwh_file
output_1xwh_file = write_single_chain_pdb_file(
input_file=save_dir / "1xwh.cif.gz",
chain2keep="A",
output_dir=save_dir,
)
output_1xwh_file
Out[12]:
PosixPath('pdb_files/1xwh_A2A.cif.gz')
In [14]:
Copied!
# O00268 │ 8WAS │ D/d=1-1085
output_8was_file = write_single_chain_pdb_file(
input_file=save_dir / "8was.cif.gz",
chain2keep="D",
output_dir=save_dir,
)
output_8was_file
# O00268 │ 8WAS │ D/d=1-1085
output_8was_file = write_single_chain_pdb_file(
input_file=save_dir / "8was.cif.gz",
chain2keep="D",
output_dir=save_dir,
)
output_8was_file
Out[14]:
PosixPath('pdb_files/8was_D2A.cif.gz')
In [17]:
Copied!
!ls -sh -1 pdb_files/
!ls -sh -1 pdb_files/
total 4.1M 16K 1xwh_A2A.cif.gz 380K 1xwh.cif.gz 276K 4dra.cif.gz 24K 4dra_E2A.cif.gz 28K 4ndy_B2A.cif.gz 832K 4ndy.cif.gz 2.6M 8was.cif.gz 24K 8was_D2A.cif.gz
In [ ]:
Copied!