comparison jbrowse2.py @ 135:21bb464c1d53 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 78bf7abb931bf3d348837c7211cd3cff32486691
author fubar
date Sun, 15 Dec 2024 23:47:40 +0000
parents ed3a21033188
children
comparison
equal deleted inserted replaced
134:ed3a21033188 135:21bb464c1d53
613 with open(self.config_json_file, "w") as fp: 613 with open(self.config_json_file, "w") as fp:
614 json.dump(self.config_json, fp, indent=2) 614 json.dump(self.config_json, fp, indent=2)
615 615
616 def text_index(self): 616 def text_index(self):
617 # Index tracks 617 # Index tracks
618 args = ["jbrowse", "text-index"] 618 e = os.environ
619 self.subprocess_check_call(args) 619 e["SHELL"] = "/bin/sh"
620 cmd = ["jbrowse", "text-index"]
621 subprocess.run(cmd, env=e, shell=True)
620 622
621 def add_hic(self, data, trackData): 623 def add_hic(self, data, trackData):
622 """ 624 """
623 HiC adapter. 625 HiC adapter.
624 https://github.com/aidenlab/hic-format/blob/master/HiCFormatV9.md 626 https://github.com/aidenlab/hic-format/blob/master/HiCFormatV9.md
1106 if canPIF: 1108 if canPIF:
1107 fakeName = os.path.join(self.outdir, "%s.paf" % tId) 1109 fakeName = os.path.join(self.outdir, "%s.paf" % tId)
1108 url = "%s.pif.gz" % tId 1110 url = "%s.pif.gz" % tId
1109 cmd = ["cp", data, fakeName] 1111 cmd = ["cp", data, fakeName]
1110 self.subprocess_check_call(cmd) 1112 self.subprocess_check_call(cmd)
1113 e = os.environ
1114 e["SHELL"] = "/bin/sh"
1111 cmd = [ 1115 cmd = [
1112 "jbrowse", 1116 "jbrowse",
1113 "make-pif", 1117 "make-pif",
1114 fakeName, 1118 fakeName,
1115 ] 1119 ]
1116 self.subprocess_check_call(cmd) 1120 subprocess.run(cmd, env=e, shell=True)
1117 usePIF = True 1121 usePIF = True
1118 else: 1122 else:
1119 dest = os.path.join(self.outdir, url) 1123 dest = os.path.join(self.outdir, url)
1120 self.symlink_or_copy(os.path.realpath(data), dest) 1124 self.symlink_or_copy(os.path.realpath(data), dest)
1121 else: 1125 else:
1532 use frozen code with `realclone=false 1536 use frozen code with `realclone=false
1533 1537
1534 """ 1538 """
1535 dest = self.outdir 1539 dest = self.outdir
1536 if (not os.path.exists(self.jbrowse2path)) or realclone: 1540 if (not os.path.exists(self.jbrowse2path)) or realclone:
1537 self.subprocess_check_call( 1541 e = os.environ
1538 ["jbrowse", "create", dest, "-f", "--tag", f"{JB2VER}"] 1542 e["SHELL"] = "/bin/sh"
1539 ) 1543 cmd = ["jbrowse", "create", dest, "-f", "--tag", f"{JB2VER}"]
1544 subprocess.run(cmd, env=e, shell=True)
1540 else: 1545 else:
1541 shutil.copytree(self.jbrowse2path, dest, dirs_exist_ok=True) 1546 shutil.copytree(self.jbrowse2path, dest, dirs_exist_ok=True)
1542 for fn in [ 1547 for fn in [
1543 "asset-manifest.json", 1548 "asset-manifest.json",
1544 "favicon.ico", 1549 "favicon.ico",