comparison autogenJB2.py @ 97:74074746ccd8 draft

planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1c04ea76330d0148a7682b3c26846e5a5df21f99
author fubar
date Sat, 01 Jun 2024 05:37:13 +0000
parents 4c517a0041a8
children b1260bca5fdc
comparison
equal deleted inserted replaced
96:5ef1ba2031f2 97:74074746ccd8
75 }, 75 },
76 } 76 }
77 for i, x in enumerate(genome_paths) 77 for i, x in enumerate(genome_paths)
78 ], 78 ],
79 ) 79 )
80 logging.debug("@@@ paths=%s, genomes=%s" % (genome_paths, genomes)) 80 logging.debug("@@@autogenJB2 paths=%s, genomes=%s" % (genome_paths, genomes))
81 assref_name = jc.process_genomes(genomes[0]) 81 assref_name = jc.process_genomes(genomes[0])
82 if not default_session_data.get(assref_name, None): 82 if not default_session_data.get(assref_name, None):
83 default_session_data[assref_name] = { 83 default_session_data[assref_name] = {
84 "tracks": [], 84 "tracks": [],
85 "style": {}, 85 "style": {},
88 "default_on": [], 88 "default_on": [],
89 "default_off": [], 89 "default_off": [],
90 }, 90 },
91 } 91 }
92 listtracks = trackList 92 listtracks = trackList
93 # foo.paf must have a foo_paf.fasta or fasta.gz to match
94 tnames = [x[2] for x in listtracks] 93 tnames = [x[2] for x in listtracks]
95 texts = [x[1] for x in listtracks] 94 texts = [x[1] for x in listtracks]
96 for i, track in enumerate(listtracks): 95 for i, track in enumerate(listtracks):
97 track_conf = { 96 track_conf = {
98 "trackfiles": [], 97 "trackfiles": [],
103 track_conf["dataset_id"] = trackname 102 track_conf["dataset_id"] = trackname
104 useuri = "no" 103 useuri = "no"
105 if tpath.startswith("http://") or tpath.startswith("https://"): 104 if tpath.startswith("http://") or tpath.startswith("https://"):
106 useuri = "yes" 105 useuri = "yes"
107 if trext == "paf": 106 if trext == "paf":
108 refname = trackname + "_paf.fasta" 107 refdat = ["%s ~ %s" % (x[0],x[2]) for x in listtracks if x[1] in ["fasta", "fasta.gz"]]
109 refdat = [x[2] for x in listtracks if x[2] == refname] 108 if len(refdat) == 0:
110 if not refdat:
111 jc.logging.warn( 109 jc.logging.warn(
112 "!! No reference file %s corresponding to paf file %s found. Not building - there must be a corresponding fasta for each paf" 110 "!! No reference file for %s found. Using main reference"
113 % (refname, trackname) 111 % (refname)
114 ) 112 )
115 sys.exit(3) 113 refdat = ["%s ~ %s" % (genomes[0].path, assref_name),]
116 else: 114 else:
117 track_conf.update( 115 track_conf.update(
118 { 116 {
119 "conf": { 117 "conf": {
120 "options": { 118 "options": {
121 "paf": { 119 "paf": {
122 "genome": refdat, 120 "genome": ",".join(refdat)
123 "genome_label": trackname,
124 } 121 }
125 } 122 }
126 } 123 }
127 } 124 }
128 ) 125 )