Mercurial > repos > fubar > jbrowse2
comparison jbrowse2.py @ 128:fce4ed3b1702 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit a46026a5ea4f075b9053448616f22e8a83fa699a
author | bgruening |
---|---|
date | Mon, 07 Oct 2024 06:30:43 +0000 |
parents | fbabf7498471 |
children | e188a9d25ed2 |
comparison
equal
deleted
inserted
replaced
127:fbabf7498471 | 128:fce4ed3b1702 |
---|---|
1134 tId = trackData["label"] | 1134 tId = trackData["label"] |
1135 url = tId | 1135 url = tId |
1136 usePIF = False # much faster if indexed remotely or locally | 1136 usePIF = False # much faster if indexed remotely or locally |
1137 useuri = data.startswith("http://") or data.startswith("https://") | 1137 useuri = data.startswith("http://") or data.startswith("https://") |
1138 if not useuri: | 1138 if not useuri: |
1139 dest = os.path.join(self.outdir, url) | 1139 # self.symlink_or_copy(os.path.realpath(data), url) |
1140 self.symlink_or_copy(os.path.realpath(data), dest) | 1140 # cmd = ["jbrowse", "make-pif", url] |
1141 cmd = ["jbrowse", "make-pif", dest] | 1141 url = '%s.pif.gz' % tId |
1142 cmd = "sort -b -n -k1,1 -k2,3 -k3,4 '%s' | bgzip -c > '%s'" % (data, url) | |
1143 self.subprocess_popen(cmd) | |
1144 cmd = ["tabix", "-b", "3", "-e", "4", "-f", url] | |
1142 self.subprocess_check_call(cmd) | 1145 self.subprocess_check_call(cmd) |
1143 usePIF = True | 1146 usePIF = True |
1144 url = '%s.pif.gz' % tId | 1147 nrow = 1 |
1145 nrow = self.getNrow(dest) | |
1146 else: | 1148 else: |
1147 url = data | 1149 url = data |
1148 if data.endswith(".pif.gz") or data.endswith(".paf.gz"): # is tabix | 1150 if data.endswith(".pif.gz") or data.endswith(".paf.gz"): # is tabix |
1149 usePIF = True | 1151 usePIF = True |
1150 nrow = 1 | 1152 nrow = 1 |
1729 trakdat = jc.tracksToAdd[primaryGenome] | 1731 trakdat = jc.tracksToAdd[primaryGenome] |
1730 stile = {} | 1732 stile = {} |
1731 for trak in trakdat: | 1733 for trak in trakdat: |
1732 if trak["trackId"] == key: | 1734 if trak["trackId"] == key: |
1733 stile = trak.get("style", {}) | 1735 stile = trak.get("style", {}) |
1734 if track.find("options/style"): | 1736 if len(track.find("options/style")) > 0: |
1735 for item in track.find("options/style"): | 1737 for item in track.find("options/style"): |
1736 if item.text: | 1738 if item.text: |
1737 stile[item.tag] = parse_style_conf(item) | 1739 stile[item.tag] = parse_style_conf(item) |
1738 logging.debug("stile=%s" % stile) | 1740 logging.debug("stile=%s" % stile) |
1739 default_session_data[primaryGenome]["style"][key] = stile | 1741 default_session_data[primaryGenome]["style"][key] = stile |