comparison jbrowse2.py @ 132:1efcc387bef4 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit b76c8cc45b31e105e6bb51abc5a5728cfd3e3f99
author bgruening
date Thu, 17 Oct 2024 11:58:53 +0000
parents e188a9d25ed2
children cec274db51c0
comparison
equal deleted inserted replaced
131:69c6ea16c148 132:1efcc387bef4
1128 ] 1128 ]
1129 self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict)) 1129 self.tracksToAdd[trackData["assemblyNames"]].append(copy.copy(trackDict))
1130 self.trackIdlist.append(tId) 1130 self.trackIdlist.append(tId)
1131 1131
1132 def add_paf(self, data, trackData, pafOpts, **kwargs): 1132 def add_paf(self, data, trackData, pafOpts, **kwargs):
1133 canPIF = False
1133 tname = trackData["name"] 1134 tname = trackData["name"]
1134 tId = trackData["label"] 1135 tId = trackData["label"]
1135 url = tId 1136 url = tId
1136 usePIF = False # much faster if indexed remotely or locally 1137 usePIF = False # much faster if indexed remotely or locally but broken in biocontainer.
1137 useuri = data.startswith("http://") or data.startswith("https://") 1138 useuri = data.startswith("http://") or data.startswith("https://")
1138 if not useuri: 1139 if not useuri:
1139 url = "%s.pif.gz" % tId 1140 if canPIF:
1140 cmd = "sort -b -k1,1 -k2,3n -k3,4n '%s' | bgzip -c > '%s'" % (data, url) 1141 fakeName = '%s.paf' % tId
1141 self.subprocess_popen(cmd) 1142 url = "%s.pif.gz" % tId
1142 cmd = ["tabix", "-b", "3", "-e", "4", "-f", url] 1143 cmd = ["cp", data, fakeName]
1143 self.subprocess_check_call(cmd) 1144 self.subprocess_check_call(cmd)
1144 usePIF = True 1145 cmd = ["jbrowse", "make-pif", fakeName] # jbrowse pif input.paf --out output.pif.gz # specify output file, creates output.pif.gz.tbi also
1146 self.subprocess_check_call(cmd)
1147 usePIF = True
1148 else:
1149 dest = os.path.join(self.outdir, url)
1150 self.symlink_or_copy(os.path.realpath(data), dest)
1145 else: 1151 else:
1146 url = data 1152 url = data
1147 if data.endswith(".pif.gz") or data.endswith(".paf.gz"): # is tabix 1153 if data.endswith(".pif.gz") or data.endswith(".paf.gz"): # is tabix
1148 usePIF = True 1154 usePIF = True
1149 categ = trackData["category"] 1155 categ = trackData["category"]