galaxyproject / ephemeris

Library for managing Galaxy plugins - tools, index data, and workflows.
https://ephemeris.readthedocs.org/
Other
27 stars 38 forks source link

Adding pysam to requirements #168

Open cat-bro opened 3 years ago

cat-bro commented 3 years ago

Not sure if this is an ephemeris issue or a galaxy issue:

shed-tools tests will fail on many tools where the test output files are bam files, with the error Converting local (test-data) BAM to SAM failed: 'NoneType' object has no attribute 'view'. If pysam is installed along with ephemeris they pass. There are also some tool tests that will fail unless h5py is installed. galaxy-tool-util calls on pysam and h5py but does not require them. The import statements within the galaxy-tool-util code are in try-catch statements:

try:
    import pysam
except ImportError:
    pysam = None

Possible solutions/ideas: (a) Add pysam and h5py to ephemeris requirements. This has already been considered and vetoed in https://github.com/galaxyproject/ephemeris/pull/128 (b) These packages could be requirements of galaxy-tool-util (and I should raise this issue with galaxy). If that’s not possible, the error messages arising from these packages being missing could be more informative. or (c) Nobody requires these packages except the end user. In that case improving the error messages coming from galaxy and adding some documentation to ephemeris would be helpful to the end user.

This came up when we started running regular automated tests on Galaxy Australia. We were scratching our heads for a while about the fact that loads of tests were failing for bwa, bowtie2 etc. when the outputs were identical to the expected outputs. It has come up again recently trying to select an appropriate tool to demonstrate shed-tools test in the admin training course. I’d be in favour of adding pysam to the requirements of ephemeris or galaxy-tool-util so that there is no extra package installation required.

rhpvorderman commented 3 years ago

Or maybe (d). The requirements should be part of the test format (something like test_requires: pysam >= x.x.x) and this can be exposed to the user by some command which creates a list that can be fed into pip. or (e). Same as d. But tests are executed in a separate virtualenv and the requirements for this virtualenv are installed automatically. This way ephemeris can depend on a few generic packages while accomodating an unlimited number testing dependencies.

rhpvorderman commented 3 years ago

ping @jmchilton who implemented the test functionality in ephemeris.