comparison jbrowse2.py @ 12:247e17ce504b draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 4baeb144cafbb61ae0587cce731066129097c168-dirty
author fubar
date Sat, 20 Jan 2024 10:04:08 +0000
parents f5ce31c2f47d
children 1d86925dbb4c
comparison
equal deleted inserted replaced
11:f5ce31c2f47d 12:247e17ce504b
1172 # The view for the assembly we're adding 1172 # The view for the assembly we're adding
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 loc_match = re.search(r"^(\w.+):(\d+)\.+(\d+)$", data["defaultLocation"]) 1177 ddl = data["defaultLocation"]
1178 loc_match = re.search(r"^(\w.+):(\d+)\.+(\d+)$", ddl)
1178 if loc_match: 1179 if loc_match:
1179 refName = loc_match.group(1) 1180 refName = loc_match.group(1)
1180 start = int(loc_match.group(2)) 1181 start = int(loc_match.group(2))
1181 end = int(loc_match.group(3)) 1182 end = int(loc_match.group(3))
1183 else:
1184 logging.info(
1185 "@@@ regexp could not match contig:start..end in the supplied location %s - please fix"
1186 % ddl
1187 )
1182 elif self.genome_name is not None: 1188 elif self.genome_name is not None:
1183 refName = self.genome_name 1189 refName = self.genome_name
1184 start = 0 1190 start = 0
1185 end = 10000 # Booh, hard coded! waiting for https://github.com/GMOD/jbrowse-components/issues/2708 1191 end = 10000 # Booh, hard coded! waiting for https://github.com/GMOD/jbrowse-components/issues/2708
1192 logging.info(
1193 "@@@ no defaultlocation found for default session - suggest adding one!"
1194 )
1186 1195
1187 if refName is not None: 1196 if refName is not None:
1188 # TODO displayedRegions is not just zooming to the region, it hides the rest of the chromosome 1197 # TODO displayedRegions is not just zooming to the region, it hides the rest of the chromosome
1189 view_json["displayedRegions"] = [ 1198 view_json["displayedRegions"] = [
1190 { 1199 {
1194 "reversed": False, 1203 "reversed": False,
1195 "assemblyName": self.genome_name, 1204 "assemblyName": self.genome_name,
1196 } 1205 }
1197 ] 1206 ]
1198 1207
1208 logging.info(
1209 "@@@ defaultlocation %s for default session"
1210 % view_json["displayedRegions"]
1211 )
1212 else:
1213 logging.info(
1214 "@@@ no assembly name found default session - suggest adding one!"
1215 )
1199 session_name = data.get("session_name", "New session") 1216 session_name = data.get("session_name", "New session")
1200 for key, value in mapped_chars.items(): 1217 for key, value in mapped_chars.items():
1201 session_name = session_name.replace(value, key) 1218 session_name = session_name.replace(value, key)
1202 # Merge with possibly existing defaultSession (if upgrading a jbrowse instance) 1219 # Merge with possibly existing defaultSession (if upgrading a jbrowse instance)
1203 session_json = {} 1220 session_json = {}