-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
77 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import __main__ | ||
__main__.pymol_argv = [ 'pymol', '-qc'] # Quiet and no GUI | ||
|
||
import os | ||
if os.path.isfile("bioservices_pdb.png"): | ||
os.remove("bioservices_pdb.png") | ||
|
||
# BioServices 1: obtain the PDB ID from a given uniprot ID (P43403 i.e. ZAP70) | ||
from bioservices import * | ||
print("Retrieving PDB ID") | ||
u = UniProt(verbose=False) | ||
res = u.mapping(fr="UniProtKB_AC-ID", to="PDB", query="P43403") | ||
pdb_id = res['results']['P43403'][0] # e.g, "1FBV" | ||
|
||
# BioServices 2: Download the PDB file from the PDB Web Service | ||
print("Fetching PDB file") | ||
p = pdbe.PDBe() | ||
res = p.get_files(pdb_id) | ||
|
||
# General: save the fetched file in a temporary file | ||
import tempfile | ||
fh = tempfile.NamedTemporaryFile() | ||
fh.write(res) | ||
sname = fh.name | ||
|
||
# THIS IS NOT BIOSERVICES ANYMORE but PYMOL | ||
import pymol | ||
pymol.finish_launching() | ||
pymol.cmd.load(sname) | ||
pymol.cmd.png("bioservices_pdb.png", width="15cm", height="15cm", dpi=140) | ||
#pymol.cmd.png("my_image.png") | ||
# Get out! | ||
pymol.cmd.quit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,3 @@ welcomed. | |
compound_tutorial.rst | ||
convertor_tutorial.rst | ||
biomart.rst | ||
geneprof_tutorial.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.