comparison util/index/ExternIndex.py @ 3:fa990284327b draft default tip

planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit ac73da32d59853ca563e7939d05016a6f3a6899e-dirty
author yating-l
date Mon, 30 Oct 2017 11:58:31 -0400
parents 85195e0d4b71
children
comparison
equal deleted inserted replaced
2:7486909dfc22 3:fa990284327b
12 12
13 @abc.abstractmethod 13 @abc.abstractmethod
14 def setExtLink(self): 14 def setExtLink(self):
15 """set external link""" 15 """set external link"""
16 16
17
18
19
20 '''
21 @staticmethod
22 def setExtLink(database, inputFile, extra_settings, seqType=None, useIframe=True, iframeHeight=None, iframeWidth=None):
23 if "NCBI" in database:
24 if not seqType:
25 seqType = int(ExternIndex.getSeqType(inputFile))
26 else:
27 seqType = seqType
28 if seqType < 0:
29 print seqType
30 raise Exception("Sequence Type is not set for bigPsl. Stopping the application")
31 if seqType == 2:
32 extra_settings["url"] = "https://www.ncbi.nlm.nih.gov/protein/$$"
33 elif seqType == 1:
34 extra_settings["url"] = "https://www.ncbi.nlm.nih.gov/nuccore/$$"
35 else:
36 raise Exception("Sequence Type {0} is not valid for bigPsl. Stopping the application".format(seqType))
37 elif "UniProt" in database:
38 extra_settings["url"] = "http://www.uniprot.org/uniprot/$$"
39 elif "FlyBase" in database:
40 extra_settings["url"] = "http://flybase.org/reports/$$"
41 else:
42 extra_settings["url"] = "https://www.ncbi.nlm.nih.gov/gquery/?term=$$"
43 extra_settings["urlLabel"] = database + " Details:"
44 if useIframe:
45 extra_settings["iframeUrl"] = extra_settings["url"]
46 if not iframeHeight:
47 iframeHeight = "600"
48 if not iframeWidth:
49 iframeWidth = "800"
50 extra_settings["iframeOptions"] = "height= %s width= %s" % (iframeHeight, iframeWidth)
51
52 @staticmethod
53 def getSeqType(inputFile):
54 with open(inputFile, "r") as bigpsl:
55 sampleSeq = bigpsl.readline().split()
56 if len(sampleSeq) == 25:
57 return sampleSeq[-1]
58 else:
59 return "-1"
60 '''