comparison jbrowse2.py @ 130:e188a9d25ed2 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9662f852d6eaf19a1bfa06f8a4263fd972afd6ba
author bgruening
date Wed, 09 Oct 2024 11:38:21 +0000
parents fce4ed3b1702
children 1efcc387bef4
comparison
equal deleted inserted replaced
129:d08080933718 130:e188a9d25ed2
1134 tId = trackData["label"] 1134 tId = trackData["label"]
1135 url = tId 1135 url = tId
1136 usePIF = False # much faster if indexed remotely or locally 1136 usePIF = False # much faster if indexed remotely or locally
1137 useuri = data.startswith("http://") or data.startswith("https://") 1137 useuri = data.startswith("http://") or data.startswith("https://")
1138 if not useuri: 1138 if not useuri:
1139 # self.symlink_or_copy(os.path.realpath(data), url) 1139 url = "%s.pif.gz" % tId
1140 # cmd = ["jbrowse", "make-pif", url] 1140 cmd = "sort -b -k1,1 -k2,3n -k3,4n '%s' | bgzip -c > '%s'" % (data, url)
1141 url = '%s.pif.gz' % tId
1142 cmd = "sort -b -n -k1,1 -k2,3 -k3,4 '%s' | bgzip -c > '%s'" % (data, url)
1143 self.subprocess_popen(cmd) 1141 self.subprocess_popen(cmd)
1144 cmd = ["tabix", "-b", "3", "-e", "4", "-f", url] 1142 cmd = ["tabix", "-b", "3", "-e", "4", "-f", url]
1145 self.subprocess_check_call(cmd) 1143 self.subprocess_check_call(cmd)
1146 usePIF = True 1144 usePIF = True
1147 nrow = 1
1148 else: 1145 else:
1149 url = data 1146 url = data
1150 if data.endswith(".pif.gz") or data.endswith(".paf.gz"): # is tabix 1147 if data.endswith(".pif.gz") or data.endswith(".paf.gz"): # is tabix
1151 usePIF = True 1148 usePIF = True
1152 nrow = 1
1153 else:
1154 nrow = self.getNrow(url)
1155 categ = trackData["category"] 1149 categ = trackData["category"]
1156 pg = pafOpts["genome"].split(",") 1150 pg = pafOpts["genome"].split(",")
1157 pgc = [x.strip() for x in pg if x.strip() > ""] 1151 pgc = [x.strip() for x in pg if x.strip() > ""]
1158 gnomes = [x.split(" ~ ") for x in pgc] 1152 gnomes = [x.split(" ~ ") for x in pgc]
1159 logging.debug("pg=%s, gnomes=%s" % (pg, gnomes)) 1153 logging.debug("pg=%s, gnomes=%s" % (pg, gnomes))
1218 trackDict["adapter"] = { 1212 trackDict["adapter"] = {
1219 "type": "PAFAdapter", 1213 "type": "PAFAdapter",
1220 "pafLocation": {"uri": url}, 1214 "pafLocation": {"uri": url},
1221 "assemblyNames": passnames, 1215 "assemblyNames": passnames,
1222 } 1216 }
1223 if (not usePIF) and (nrow > 10000): 1217 if not usePIF:
1224 style_json = { 1218 style_json = {
1225 "type": "LGVSyntenyDisplay", 1219 "type": "LGVSyntenyDisplay",
1226 "displayId": "%s-LGVSyntenyDisplay" % tId, 1220 "displayId": "%s-LGVSyntenyDisplay" % tId,
1227 } 1221 }
1228 else: 1222 else: