Skip to content

Commit

Permalink
Add rat, dog, cat, chicken species & increase MAX_ENSEMBL_RELEASE to …
Browse files Browse the repository at this point in the history
…87 (#183)

* added chicken, dog, cat to species

* bump max ensembl release to 87

* added rat to species

* install ensembl 87 instead of 85

* increase version for new species & bump to max ensembl version

* more assertions in custom dir test

* fixed download cache test
  • Loading branch information
iskandr committed Jan 24, 2017
1 parent 59855a9 commit 103f4ca
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 9 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ script:
- pyensembl install --release 54 --species human
- pyensembl install --release 75 --species human
- pyensembl install --release 77 --species human
# latest human release
- pyensembl install --release 83 --species human
- pyensembl install --release 85 --species human
- pyensembl install --release 87 --species human
# older mouse release (last one for NCBIM37)
# - pyensembl install --release 67 --species mouse
# latest mouse release
- pyensembl install --release 85 --species mouse
- pyensembl install --release 87 --species mouse
# run tests
- nosetests test --verbose --with-coverage --cover-package=pyensembl
after_success:
Expand Down
2 changes: 1 addition & 1 deletion pyensembl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
)
from .transcript import Transcript

__version__ = '1.0.3'
__version__ = '1.1.0'

def cached_release(release, species="human"):
"""
Expand Down
2 changes: 1 addition & 1 deletion pyensembl/ensembl_release_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from __future__ import print_function, division, absolute_import

MIN_ENSEMBL_RELEASE = 54
MAX_ENSEMBL_RELEASE = 85
MAX_ENSEMBL_RELEASE = 87

def check_release_number(release):
"""
Expand Down
26 changes: 26 additions & 0 deletions pyensembl/species.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,29 @@ def check_species_object(species_name_or_object):
"GRCm38": (68, MAX_ENSEMBL_RELEASE),

})

dog = Species.register(
latin_name="canis_familiaris",
synonyms=["dog"],
reference_assemblies={"CanFam3.1": (75, MAX_ENSEMBL_RELEASE)})

cat = Species.register(
latin_name="felis_catus",
synonyms=["cat"],
reference_assemblies={"Felis_catus_6.2": (75, MAX_ENSEMBL_RELEASE)})

chicken = Species.register(
latin_name="gallus_gallus",
synonyms=["chicken"],
reference_assemblies={
"Galgal4": (75, 85),
"Gallus_gallus-5.0": (86, MAX_ENSEMBL_RELEASE)})

# Does the black rat (Rattus Rattus) get used for research too?
brown_rat = Species.register(
latin_name="rattus_norvegicus",
synonyms=["brown rat", "lab rat", "rat"],
reference_assemblies={
"Rnor_5.0": (75, 79),
"Rnor_6.0": (80, MAX_ENSEMBL_RELEASE),
})
24 changes: 20 additions & 4 deletions test/test_download_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,34 @@ def test_download_cache_missing_remote_file():

def test_download_cache_custom_location():
test_file = "refseq.ucsc.small.gtf"
tmp_dir = os.path.join(tempfile.gettempdir(), "pyensembl")
tmp_dir = tempfile.gettempdir()

print("DIR: %s" % tmp_dir)
assert tmp_dir is not None

os.environ['PYENSEMBL_CACHE_DIR'] = tmp_dir

# We need another instance of DownloadCache
# that copies files over to cache folder
download_cache = DownloadCache(
reference_name="test",
annotation_name="test",
reference_name="test_reference",
annotation_name="test_annotation",
copy_local_files_to_cache=True)

# clean up
download_cache.delete_cache_directory()
download_cache.download_or_copy_if_necessary(
download_if_missing=True,
path_or_url=data_path(test_file))
ok_(os.path.exists(os.path.join(tmp_dir, test_file)))

full_path = os.path.join(
tmp_dir,
"pyensembl",
"test_reference",
"test_annotation",
test_file)
print("FULL PATH: %s" % full_path)
assert len(full_path) > 0

ok_(os.path.exists(full_path))
del os.environ['PYENSEMBL_CACHE_DIR']

0 comments on commit 103f4ca

Please sign in to comment.