Skip to content

Commit

Permalink
fix unit-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Avsecz committed Oct 6, 2018
1 parent b243cdc commit e234edc
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 2 deletions.
77 changes: 77 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,80 @@ tests/data/test_bigwig.bw.dir/
**/__pycache__/**
genomelake.egg-info/
.pytest_cache/


#gitignore from kipoi
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

docs/site/*
docs/sources/*
docs/theme_dir/img/ipynb/*

# emacs
*~
.venv

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
.pytest_cache/
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# pycharm
.idea
.ipynb_checkpoints
logfile.txt
/genomelake/util.c
2 changes: 1 addition & 1 deletion genomelake/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def extract_fasta_to_file(fasta, output_dir, mode='bcolz', overwrite=False):
fasta_file = Fasta(fasta, as_raw=True)
file_shapes = {}
for chrom in fasta_file.keys():
data = np.empty((len(fasta_file[chrom]), NUM_SEQ_CHARS), dtype=np.float32)
data = np.zeros((len(fasta_file[chrom]), NUM_SEQ_CHARS), dtype=np.float32)
seq = str(fasta_file[chrom][:])
one_hot_encode_sequence(seq, data)
file_shapes[chrom] = data.shape
Expand Down
2 changes: 1 addition & 1 deletion genomelake/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def __init__(self, datafile, use_strand=False, **kwargs):
self.use_strand = use_strand
from pyfaidx import Fasta

self.fasta = Fasta(self._datafile, as_raw=True)
self.fasta = Fasta(self._datafile)

def _extract(self, intervals, out, **kwargs):
for index, interval in enumerate(intervals):
Expand Down

0 comments on commit e234edc

Please sign in to comment.