comparison jbrowse.py @ 45:a6e57ff585c0 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse commit 80fbf6800feb0bb02c047d37e97b7a12e9c68f4c"
author iuc
date Fri, 23 Apr 2021 11:37:36 +0000
parents 87dc4ce42281
children
comparison
equal deleted inserted replaced
44:87dc4ce42281 45:a6e57ff585c0
603 self._add_track_json(trackData) 603 self._add_track_json(trackData)
604 604
605 def add_bam(self, data, trackData, bamOpts, bam_index=None, **kwargs): 605 def add_bam(self, data, trackData, bamOpts, bam_index=None, **kwargs):
606 dest = os.path.join('data', 'raw', trackData['label'] + '.bam') 606 dest = os.path.join('data', 'raw', trackData['label'] + '.bam')
607 self.symlink_or_copy(os.path.realpath(data), dest) 607 self.symlink_or_copy(os.path.realpath(data), dest)
608 if bam_index is not None: 608 if bam_index is not None and os.path.exists(os.path.realpath(bam_index)):
609 # bai most probably made by galaxy and stored in galaxy dirs, need to copy it to dest 609 # bai most probably made by galaxy and stored in galaxy dirs, need to copy it to dest
610 self.subprocess_check_call(['cp', os.path.realpath(bam_index), dest + '.bai']) 610 self.subprocess_check_call(['cp', os.path.realpath(bam_index), dest + '.bai'])
611 else: 611 else:
612 # Can happen in exotic condition 612 # Can happen in exotic condition
613 # e.g. if bam imported as symlink with datatype=unsorted.bam, then datatype changed to bam 613 # e.g. if bam imported as symlink with datatype=unsorted.bam, then datatype changed to bam
614 # => no index generated by galaxy, but there might be one next to the symlink target 614 # => no index generated by galaxy, but there might be one next to the symlink target
615 # this trick allows to skip the bam sorting made by galaxy if already done outside 615 # this trick allows to skip the bam sorting made by galaxy if already done outside
616 if os.path.exists(os.path.realpath(data) + '.bai'): 616 if os.path.exists(os.path.realpath(data) + '.bai'):
617 self.symlink_or_copy(os.path.realpath(data) + '.bai', dest) 617 self.symlink_or_copy(os.path.realpath(data) + '.bai', dest + '.bai')
618 else: 618 else:
619 log.warn('Could not find a bam index (.bai file) for %s', data) 619 log.warn('Could not find a bam index (.bai file) for %s', data)
620 620
621 url = os.path.join('raw', trackData['label'] + '.bam') 621 url = os.path.join('raw', trackData['label'] + '.bam')
622 trackData.update({ 622 trackData.update({