comparison autogenJB2.py @ 66:bc10ad1dfb98 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
author fubar
date Thu, 28 Mar 2024 11:53:38 +0000
parents c81902830900
children cefe9dbf1d80
comparison
equal deleted inserted replaced
65:c81902830900 66:bc10ad1dfb98
5 5
6 from jbrowse2 import JbrowseConnector as jbC 6 from jbrowse2 import JbrowseConnector as jbC
7 7
8 logging.basicConfig(level=logging.debug) 8 logging.basicConfig(level=logging.debug)
9 log = logging.getLogger("jbrowse") 9 log = logging.getLogger("jbrowse")
10
11
12 def makeDefaultLocation():
13
14 refName = jc.genome_firstcontig
15 defloc = "%s:100..10000" % refName
16 return defloc
17 10
18 11
19 if __name__ == "__main__": 12 if __name__ == "__main__":
20 parser = argparse.ArgumentParser(description="", epilog="") 13 parser = argparse.ArgumentParser(description="", epilog="")
21 parser.add_argument("--sessName", help="Session name", default="AutoJBrowse") 14 parser.add_argument("--sessName", help="Session name", default="AutoJBrowse")
197 # "secondary_color": root.find("metadata/general/secondary_color").text, 190 # "secondary_color": root.find("metadata/general/secondary_color").text,
198 # "tertiary_color": root.find("metadata/general/tertiary_color").text, 191 # "tertiary_color": root.find("metadata/general/tertiary_color").text,
199 # "quaternary_color": root.find("metadata/general/quaternary_color").text, 192 # "quaternary_color": root.find("metadata/general/quaternary_color").text,
200 # "font_size": root.find("metadata/general/font_size").text, 193 # "font_size": root.find("metadata/general/font_size").text,
201 # } 194 # }
202 # jc.add_general_configuration(general_data) 195 jc.add_general_configuration({})
203 trackconf = jc.config_json.get("tracks", []) 196 trackconf = jc.config_json.get("tracks", [])
204 for gnome in jc.genome_names: 197 for gnome in jc.genome_names:
205 trackconf += jc.tracksToAdd[gnome] 198 trackconf += jc.tracksToAdd[gnome]
206 jc.config_json["tracks"] = trackconf 199 jc.config_json["tracks"] = trackconf
207 jc.write_config() 200 jc.write_config()
208 defLoc = makeDefaultLocation()
209 default_session_data.update( 201 default_session_data.update(
210 {"defaultLocation": defLoc, "session_name": sessName} 202 {"session_name": sessName}
211 ) 203 )
212 track_conf.update(default_session_data) 204 track_conf.update(default_session_data)
213 jc.add_default_session(default_session_data) 205 jc.add_default_session(default_session_data)
214 # jc.text_index() not sure what broke here. 206 # jc.text_index() not sure what broke here.
215 else: 207 else:
216 sys.stderr.write( 208 sys.stderr.write(
217 "!!!! Collection has no suitable trackfiles for autogenJB2 - nothing to process" 209 "!!!! Collection has no suitable trackfiles for autogenJB2 - nothing to process"
218 ) 210 )
211