Closed JonnyTran closed 3 years ago
The path at MiRTarBase(path="/data/datasets/Bioinformatics_ExternalData/miRTarBase/") is hard-coded to the directory at my local computer.
There are many bioinformatics datasets that are not publicly available via direct download (e.g. lncbase) and may require access permission. In that case, it is expected that the users would obtain the data themself then provide a path
to their own local directory.
Since currently, it is difficult to get a reliable ftp download connection from the server at http://mirtarbase.mbc.nctu.edu.tw, I suggest we remove test_import_MiRTarBase
from the automated test set that relies on ftp download.
Removed the test_import_MiRTarBase
automated test since MiRTarBase is not obtainable via ftp.
Tests all pass, though a few warnings:
$ OpenOmics [master] python -m pytest
============================================================================================================ test session starts =============================================================================================================
platform darwin -- Python 3.8.9, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: /Users/stephenmoss/Dropbox/Code/OpenOmics, configfile: setup.cfg
plugins: dash-1.20.0
collected 38 items
tests/test_annotations.py ......... [ 23%]
tests/test_disease.py .......... [ 50%]
tests/test_interaction.py ....... [ 68%]
tests/test_multiomics.py ... [ 76%]
tests/test_sequences.py ......... [100%]
============================================================================================================== warnings summary ==============================================================================================================
../../../.pyenv/versions/3.8.9/lib/python3.8/site-packages/_pytest/config/__init__.py:1233
/Users/stephenmoss/.pyenv/versions/3.8.9/lib/python3.8/site-packages/_pytest/config/__init__.py:1233: PytestConfigWarning: Unknown config option: collect_ignore
self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")
openomics/database/ontology.py:235
/Users/stephenmoss/Dropbox/Code/OpenOmics/openomics/database/ontology.py:235: DeprecationWarning: invalid escape sequence \|
and annotation.str.contains("\||;", regex=True).any()):
tests/test_disease.py::test_import_HMDD
tests/test_disease.py::test_annotate_HMDD
/Users/stephenmoss/.pyenv/versions/3.8.9/lib/python3.8/encodings/unicode_escape.py:26: DeprecationWarning: invalid escape sequence '\ '
return codecs.unicode_escape_decode(input, self.errors)[0]
tests/test_disease.py::test_import_HMDD
tests/test_disease.py::test_annotate_HMDD
/Users/stephenmoss/.pyenv/versions/3.8.9/lib/python3.8/encodings/unicode_escape.py:26: DeprecationWarning: invalid escape sequence '\s'
return codecs.unicode_escape_decode(input, self.errors)[0]
tests/test_interaction.py::test_import_LncRNA2Target
tests/test_interaction.py::test_get_interactions_lnc2target
/Users/stephenmoss/Dropbox/Code/OpenOmics/openomics/database/interaction.py:479: FutureWarning: Your version of xlrd is 1.2.0. In xlrd >= 2.0, only the xls format is supported. As a result, the openpyxl engine will be used if it is installed and the engine argument is not specified. Install openpyxl instead.
table = pd.read_excel(file_resources["lncRNA_target_from_low_throughput_experiments.xlsx"])
-- Docs: https://docs.pytest.org/en/stable/warnings.html
================================================================================================= 38 passed, 8 warnings in 603.78s (0:10:03) =================================================================================================
Description
Running
MiRTarBase(path="/data/datasets/Bioinformatics_ExternalData/miRTarBase/")
in thegenerate_MiRTarBase
test results in an error.What I Did
Some tests are available and run as part of the Travis CI pipeline, though coverage isn't amazing and would benefit from additional work. Focusing on test driven development is a good way to ensure greater coverage. Running the tests locally took a long time, and returned various warnings and an error.
The main error seemed to be a missing dataset. On further inspection of the codebase it seems that the package is supposed to download the miRTarBase data (although it appears to have the version 7 release URL hardcoded when version 8 is now available). I wondered whether this was a permissions issue with not being able to create the /data/datasets/Bioinformatics_ExternalData/miRTarBase/ path on my system. I tried with sudo python -m pytest --cov=./ tests/test_interaction.py and got the same? I tried sudo mkdir -p /data/datasets/Bioinformatics_ExternalData/miRTarBase beforehand, which returned:
mkdir: /data/datasets/Bioinformatics_ExternalData/miRTarBase: Read-only file system This is likely due to macOS system integrity protection.
However, it seems I am also unable to resolve http://mirtarbase.mbc.nctu.edu.tw/cache/download/7.0/. I believe the URL should actually be http://mirtarbase.cuhk.edu.cn/cache/download/7.0/ (or even http://mirtarbase.cuhk.edu.cn/cache/download/8.0/)? I manually updated to the working version 7.0 release and updated the path in test_interaction.py before running the following:
mkdir -p tests/data/datasets/Bioinformatics_ExternalData/miRTarBase sudo python -m pytest --cov=./ tests/test_interaction.py I still received the error, so something needs looking at in more detail here.