src/hg/lib/lsSnpPdbChimera.py 1.4

1.4 2009/05/13 19:05:17 markd
added prototype support for launching 3D structure browser on H1N1 predicted structures
Index: src/hg/lib/lsSnpPdbChimera.py
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/lsSnpPdbChimera.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -B -U 4 -r1.3 -r1.4
--- src/hg/lib/lsSnpPdbChimera.py	5 Feb 2009 08:04:11 -0000	1.3
+++ src/hg/lib/lsSnpPdbChimera.py	13 May 2009 19:05:17 -0000	1.4
@@ -5,14 +5,18 @@
 # Due scoping bug in exec coding from chimerax files (1.3 alpha release and
 # earlier), can only have one function and must import into function's local
 # namespace.
 
-def displayPdb(pdbId, snps):
-    # snps is list of (snpId, chain, snpPos, [isPrimary])
+def displayPdb(pdbSpec, snps):
+    """pdbSpec can be a pdbId or a URL of a PDB format file.
+    snps is list of (snpId, chain, snpPos, [isPrimary])"""
     from chimera import runCommand
     from chimera.selection import OSLSelection
     runCommand("close all")
-    runCommand("open pdb:%s" % pdbId)
+    if pdbSpec.find("://") >= 0:
+        runCommand("open %s" % pdbSpec)
+    else:
+        runCommand("open pdb:%s" % pdbSpec)
 
     # hide all models/sub-models, NMR will only show first model
     runCommand("select #*:*.*")
     runCommand("~display sel")