comparison jbrowse2.py @ 13:1d86925dbb4c draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 873a12803692b0a84814a6dc08331d772d0e5492-dirty
author fubar
date Mon, 22 Jan 2024 11:52:19 +0000
parents 247e17ce504b
children 7c2e28e144f3
comparison
equal deleted inserted replaced
12:247e17ce504b 13:1d86925dbb4c
1173 view_json = {"type": "LinearGenomeView", "tracks": tracks_data} 1173 view_json = {"type": "LinearGenomeView", "tracks": tracks_data}
1174 1174
1175 refName = None 1175 refName = None
1176 if data.get("defaultLocation", ""): 1176 if data.get("defaultLocation", ""):
1177 ddl = data["defaultLocation"] 1177 ddl = data["defaultLocation"]
1178 loc_match = re.search(r"^(\w.+):(\d+)\.+(\d+)$", ddl) 1178 loc_match = re.search(
1179 r"^([^:]+):(\d+)\.+(\d+)$", ddl
1180 ) # was re.search(r"^(\w.+):(\d+)\.+(\d+)$"
1179 if loc_match: 1181 if loc_match:
1180 refName = loc_match.group(1) 1182 refName = loc_match.group(1)
1181 start = int(loc_match.group(2)) 1183 start = int(loc_match.group(2))
1182 end = int(loc_match.group(3)) 1184 end = int(loc_match.group(3))
1183 else: 1185 else:
1188 elif self.genome_name is not None: 1190 elif self.genome_name is not None:
1189 refName = self.genome_name 1191 refName = self.genome_name
1190 start = 0 1192 start = 0
1191 end = 10000 # Booh, hard coded! waiting for https://github.com/GMOD/jbrowse-components/issues/2708 1193 end = 10000 # Booh, hard coded! waiting for https://github.com/GMOD/jbrowse-components/issues/2708
1192 logging.info( 1194 logging.info(
1193 "@@@ no defaultlocation found for default session - suggest adding one!" 1195 "@@@ no defaultlocation found for default session - please add one"
1194 ) 1196 )
1195 1197
1196 if refName is not None: 1198 if refName is not None:
1197 # TODO displayedRegions is not just zooming to the region, it hides the rest of the chromosome 1199 # TODO displayedRegions is not just zooming to the region, it hides the rest of the chromosome
1198 view_json["displayedRegions"] = [ 1200 view_json["displayedRegions"] = [
1209 "@@@ defaultlocation %s for default session" 1211 "@@@ defaultlocation %s for default session"
1210 % view_json["displayedRegions"] 1212 % view_json["displayedRegions"]
1211 ) 1213 )
1212 else: 1214 else:
1213 logging.info( 1215 logging.info(
1214 "@@@ no assembly name found default session - suggest adding one!" 1216 "@@@ no contig name found for default session - please add one!"
1215 ) 1217 )
1216 session_name = data.get("session_name", "New session") 1218 session_name = data.get("session_name", "New session")
1217 for key, value in mapped_chars.items(): 1219 for key, value in mapped_chars.items():
1218 session_name = session_name.replace(value, key) 1220 session_name = session_name.replace(value, key)
1219 # Merge with possibly existing defaultSession (if upgrading a jbrowse instance) 1221 # Merge with possibly existing defaultSession (if upgrading a jbrowse instance)