diff util/index/DatabaseIndex.py @ 14:3f9971a91096 draft

planemo upload for repository https://github.com/goeckslab/jbrowse-archive-creator.git commit e526b4e8bef4677b832e940bacb8969a18efc3e3
author yating-l
date Wed, 20 Jun 2018 17:24:45 -0400
parents 237707a6b74d
children
line wrap: on
line diff
--- a/util/index/DatabaseIndex.py	Tue Jun 19 17:59:51 2018 -0400
+++ b/util/index/DatabaseIndex.py	Wed Jun 20 17:24:45 2018 -0400
@@ -7,38 +7,33 @@
     def __init__(self, database, **args):
         self.database = database
         self.seqType=args.get("seqType")
-        self.useIframe=args.get("useIframe")
-        self.iframeHeight=args.get("iframeHeight")
-        self.iframeWidth=args.get("iframeWidth")
+
 
     def setExtLink(self):
-        return self.setDatabaseLink(self.database, self.seqType, self.useIframe, self.iframeHeight, self.iframeWidth)
+        return self.setDatabaseLink(self.database, self.seqType)
 
     
-    def setDatabaseLink(self, database, seqType=None, useIframe=None, iframeHeight=None, iframeWidth=None):
+    def setDatabaseLink(self, database, seqType=None):
         database_settings = collections.OrderedDict()
+        database_settings.update({"label": "View feature details in the database",
+                                  "action": "iframeDialog",
+                                  "iconClass": "dijitIconDatabase",
+                                  "title": "feature {name}"})
+
         if "NCBI" in database:
             if not seqType:
-                database_settings["url"] = "https://www.ncbi.nlm.nih.gov/gquery/?term=$$"
+                database_settings["url"] = "https://www.ncbi.nlm.nih.gov/gquery/?term={name}"
             elif seqType == 2:
-                database_settings["url"] = "https://www.ncbi.nlm.nih.gov/protein/$$"
+                database_settings["url"] = "https://www.ncbi.nlm.nih.gov/protein/{name}"
             elif seqType == 1:
-                database_settings["url"] = "https://www.ncbi.nlm.nih.gov/nuccore/$$"
+                database_settings["url"] = "https://www.ncbi.nlm.nih.gov/nuccore/{name}"
             else:
                 raise Exception("Sequence Type {0} is not valid, should be either protein (seqType==2) or nucleotide (seqType==1). Stopping the application".format(seqType))
         elif "UniProt" in database:
-            database_settings["url"] = "http://www.uniprot.org/uniprot/$$"
+            database_settings["url"] = "http://www.uniprot.org/uniprot/{name}"
         elif "FlyBase" in database:
-            database_settings["url"] = "http://flybase.org/reports/$$"
+            database_settings["url"] = "http://flybase.org/reports/{name}"
         else:
-            database_settings["url"] = "https://www.ncbi.nlm.nih.gov/gquery/?term=$$"
-        database_settings["urlLabel"] = database + " Details:"
-        if useIframe or useIframe is None:
-            database_settings["iframeUrl"] = database_settings["url"]
-            if not iframeHeight:
-                iframeHeight = "600"
-            if not iframeWidth:
-                iframeWidth = "800"
-            database_settings["iframeOptions"] = "height= %s width= %s" % (iframeHeight, iframeWidth)
+            database_settings["url"] = "https://www.ncbi.nlm.nih.gov/gquery/?term={name}"
         return database_settings