# HG changeset patch # User iuc # Date 1619123208 0 # Node ID 87dc4ce422815680ce3663c9acb6f4caa7e22baa # Parent 4542035c10750d41dbaee6152986ca916c974621 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse commit 00fb3ea114827e72a2ef344f490eb43a672aa492" diff -r 4542035c1075 -r 87dc4ce42281 jbrowse.py --- a/jbrowse.py Tue Mar 16 17:19:14 2021 +0000 +++ b/jbrowse.py Thu Apr 22 20:26:48 2021 +0000 @@ -605,7 +605,18 @@ def add_bam(self, data, trackData, bamOpts, bam_index=None, **kwargs): dest = os.path.join('data', 'raw', trackData['label'] + '.bam') self.symlink_or_copy(os.path.realpath(data), dest) - self.symlink_or_copy(os.path.realpath(bam_index), dest + '.bai') + if bam_index is not None: + # bai most probably made by galaxy and stored in galaxy dirs, need to copy it to dest + self.subprocess_check_call(['cp', os.path.realpath(bam_index), dest + '.bai']) + else: + # Can happen in exotic condition + # e.g. if bam imported as symlink with datatype=unsorted.bam, then datatype changed to bam + # => no index generated by galaxy, but there might be one next to the symlink target + # this trick allows to skip the bam sorting made by galaxy if already done outside + if os.path.exists(os.path.realpath(data) + '.bai'): + self.symlink_or_copy(os.path.realpath(data) + '.bai', dest) + else: + log.warn('Could not find a bam index (.bai file) for %s', data) url = os.path.join('raw', trackData['label'] + '.bam') trackData.update({ diff -r 4542035c1075 -r 87dc4ce42281 macros.xml --- a/macros.xml Tue Mar 16 17:19:14 2021 +0000 +++ b/macros.xml Thu Apr 22 20:26:48 2021 +0000 @@ -15,7 +15,7 @@ \$GALAXY_JBROWSE_SHARED_DIR - galaxy0 + galaxy1