Mercurial > repos > fubar > jbrowse2
comparison jbrowse2.py @ 24:fb6cc7bc24df draft
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit cde4b8a574ded34a0ff8df3ecafc1a057787dcfb-dirty
author | fubar |
---|---|
date | Sat, 03 Feb 2024 11:49:56 +0000 |
parents | 39b717d934a8 |
children | 172acf9c7a53 |
comparison
equal
deleted
inserted
replaced
23:39b717d934a8 | 24:fb6cc7bc24df |
---|---|
459 genome_name # first one for all tracks - other than paf | 459 genome_name # first one for all tracks - other than paf |
460 ) | 460 ) |
461 self.genome_firstcontig = None | 461 self.genome_firstcontig = None |
462 fl = open(fapath, "r").readline().strip().split(">", 1) | 462 fl = open(fapath, "r").readline().strip().split(">", 1) |
463 if len(fl) > 1: | 463 if len(fl) > 1: |
464 self.genome_firstcontig = fl[1].strip() | 464 self.genome_firstcontig = fl[1].split().strip() |
465 if self.config_json.get("assemblies", None): | 465 if self.config_json.get("assemblies", None): |
466 self.config_json["assemblies"] += assemblies | 466 self.config_json["assemblies"] += assemblies |
467 else: | 467 else: |
468 self.config_json["assemblies"] = assemblies | 468 self.config_json["assemblies"] = assemblies |
469 | 469 |
1146 self.add_hic( | 1146 self.add_hic( |
1147 dataset_path, | 1147 dataset_path, |
1148 outputTrackConfig, | 1148 outputTrackConfig, |
1149 ) | 1149 ) |
1150 elif dataset_ext in ("cool", "mcool", "scool"): | 1150 elif dataset_ext in ("cool", "mcool", "scool"): |
1151 hictempd = tempfile.mkdtemp() | |
1152 hic_path = os.path.join( | 1151 hic_path = os.path.join( |
1153 self.outdir, "%s_%d_%s.hic" % (track_human_label, i, dataset_ext) | 1152 self.outdir, "%s_%d_%s.hic" % (track_human_label, i, dataset_ext) |
1154 ) | 1153 ) |
1155 self.subprocess_check_call( | 1154 self.subprocess_check_call( |
1156 [ | 1155 [ |
1157 "hictk", | 1156 "hictk", |
1158 "convert", | 1157 "convert", |
1159 "-f", | 1158 "-f", |
1160 "--output-fmt", | 1159 "--output-fmt", |
1161 "hic", | 1160 "hic", |
1162 "--tmpdir", | |
1163 hictempd, | |
1164 dataset_path, | 1161 dataset_path, |
1165 hic_path, | 1162 hic_path, |
1166 ] | 1163 ] |
1167 ) | 1164 ) |
1168 self.add_hic( | 1165 self.add_hic( |
1169 hic_path, | 1166 hic_path, |
1170 outputTrackConfig, | 1167 outputTrackConfig, |
1171 ) | 1168 ) |
1172 shutil.rmtree(hictempd) | |
1173 elif dataset_ext in ("bed",): | 1169 elif dataset_ext in ("bed",): |
1174 self.add_bed( | 1170 self.add_bed( |
1175 dataset_path, | 1171 dataset_path, |
1176 dataset_ext, | 1172 dataset_ext, |
1177 outputTrackConfig, | 1173 outputTrackConfig, |
1281 loc_match = re.search(r"^([^:]+):([\d,]*)\.*([\d,]*)$", ddl) | 1277 loc_match = re.search(r"^([^:]+):([\d,]*)\.*([\d,]*)$", ddl) |
1282 if loc_match: | 1278 if loc_match: |
1283 refName = loc_match.group(1) | 1279 refName = loc_match.group(1) |
1284 drdict["refName"] = refName | 1280 drdict["refName"] = refName |
1285 if loc_match.group(2) > "": | 1281 if loc_match.group(2) > "": |
1286 drdict["start"] = int(loc_match.group(2)) | 1282 drdict["start"] = int(loc_match.group(2).replace(',','')) |
1287 if loc_match.group(3) > "": | 1283 if loc_match.group(3) > "": |
1288 drdict["end"] = int(loc_match.group(3)) | 1284 drdict["end"] = int(loc_match.group(3).replace(',','')) |
1289 else: | 1285 else: |
1290 logging.info( | 1286 logging.info( |
1291 "@@@ regexp could not match contig:start..end in the supplied location %s - please fix" | 1287 "@@@ regexp could not match contig:start..end in the supplied location %s - please fix" |
1292 % ddl | 1288 % ddl |
1293 ) | 1289 ) |