Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pybedtools error #2

Open
BastiKarg opened this issue Jun 26, 2019 · 2 comments
Open

pybedtools error #2

BastiKarg opened this issue Jun 26, 2019 · 2 comments

Comments

@BastiKarg
Copy link

executing the testcases results in the following error:
Traceback (most recent call last):
File "train.py", line 301, in
main()
File "train.py", line 197, in main
utils.load_chip_singleTask(input_dirs, tf)
File "/home/hpc/t1172/di36dih/bin/FactorNet-master/utils.py", line 462, in load_chip_singleTask
blacklist = make_blacklist()
File "/home/hpc/t1172/di36dih/bin/FactorNet-master/utils.py", line 373, in make_blacklist
blacklist = blacklist.cat(blacklist2)
File "/home/hpc/t1172/di36dih/anaconda2/envs/env1/lib/python2.7/site-packages/pybedtools/bedtool.py", line 840, in decorated
result = method(self, *args, **kwargs)
File "/home/hpc/t1172/di36dih/anaconda2/envs/env1/lib/python2.7/site-packages/pybedtools/bedtool.py", line 3064, in cat
for f in self:
File "pybedtools/cbedtools.pyx", line 798, in pybedtools.cbedtools.IntervalIterator.next
File "pybedtools/cbedtools.pyx", line 698, in pybedtools.cbedtools.create_interval_from_list
pybedtools.cbedtools.MalformedBedLineError: Unable to detect format from ['chr17_ctg5_hap1', '-1', '1255794']

Even after updating pybedtools or changing of the genome the error still occurs.

@BastiKarg
Copy link
Author

Update: I managed to work around this error by removing all non regular chrs from the blacklist.bed.gz.

Further trying to execute the example train.py led me to other errors in the model building step though:

33885000 training samples
27862 validation samples
Building model
Traceback (most recent call last):
File "train.py", line 301, in
main()
File "train.py", line 258, in main
model = utils.make_model(num_tfs, num_bigwigs, num_motifs, num_recurrent, num_dense, dropout_rate)
File "/naslx/projects/t1172/di36dih/FactorNet-master/utils.py", line 572, in make_model
MaxPooling1D(stride=13, pool_size=13), # strides -> stride
File "/home/hpc/t1172/di36dih/anaconda2/envs/env1/lib/python2.7/site-packages/keras/layers/pooling.py", line 75, in init
border_mode, **kwargs)
File "/home/hpc/t1172/di36dih/anaconda2/envs/env1/lib/python2.7/site-packages/keras/layers/pooling.py", line 16, in init
super(_Pooling1D, self).init(**kwargs)
File "/home/hpc/t1172/di36dih/anaconda2/envs/env1/lib/python2.7/site-packages/keras/engine/topology.py", line 307, in init
assert kwarg in allowed_kwargs, 'Keyword argument not understood: ' + kwarg
AssertionError: Keyword argument not understood: pool_size

These are my current versions:

Keras 1.1.1
Keras-Applications 1.0.7
Keras-Preprocessing 1.0.9
tensorflow 1.5.1
tensorflow-estimator 1.14.0
tensorflow-tensorboard 1.5.1
torch 1.1.0

What are the recommended versions of keras, tensorflow, etc.?
Currently I am using keras=1.1.1 (as I greped the version out of https://github.com/uci-cbcl/FactorNet/blob/bef6f6b38e81d362162a106dc8a726ecae910138/models/E2F1/onePeak_Unique35_DGF/model.json) but could not figure out which tensorflow version suits accordingly https://pypi.org/project/tensorflow/#history

@jhawe
Copy link

jhawe commented Jul 9, 2019

Not sure this is an issue with FactorNet, I feel like it is just really picky when it comes to the versions of the underlying software.
I managed to create a conda environment with specific library versions which seems to do the trick for me (initially having similar errors as @TripelB , also filtered non standard chromosomes from the blacklist files).

Below is the conda env I used to get FactorNet to run:

name: factornet

channels:
  - conda-forge
  - bioconda
  - defaults
  - pytorch
  - anaconda

dependencies:
  - python =2.7.15
  - mkl
  - mkl-service
  - theano =0.9.0
  - pyfasta
  - pybigwig =0.2.8
  - pybedtools
  - parmap
  - keras =1.2.2
  - cuda80
  - cudnn
  - numpy =1.10.4
  - scipy =0.17.0
  - matplotlib

Maybe this helps someone else, too.

EDIT: I updated the yaml to be more specific for pyBigWig (which failed on another system where a different version was obtained via conda) and added matplotlib in order to be able to run the predict.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants