diff 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
line wrap: on
line diff
--- a/jbrowse.py	Thu Apr 22 20:26:48 2021 +0000
+++ b/jbrowse.py	Fri Apr 23 11:37:36 2021 +0000
@@ -605,7 +605,7 @@
     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)
-        if bam_index is not None:
+        if bam_index is not None and os.path.exists(os.path.realpath(bam_index)):
             # 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:
@@ -614,7 +614,7 @@
             #      => 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)
+                self.symlink_or_copy(os.path.realpath(data) + '.bai', dest + '.bai')
             else:
                 log.warn('Could not find a bam index (.bai file) for %s', data)