kundajelab / bpnet

Toolkit to train base-resolution deep neural networks on functional genomics data and to interpret them
http://bit.ly/bpnet-colab
MIT License
141 stars 33 forks source link

Error when traning ATAC-seq with one track #35

Closed zhenzuo2 closed 2 years ago

zhenzuo2 commented 2 years ago

Hi, When training on ATAC-seq data without specifying positive and negative tracks, there is a IndexError

File "/storage/chen/home/zz4/anaconda3/envs/bpnet/lib/python3.6/site-packages/gin/utils.py", line 41, in augment_exception_message_and_reraise
    raise proxy.with_traceback(exception.__traceback__) from None
  File "/storage/chen/home/zz4/anaconda3/envs/bpnet/lib/python3.6/site-packages/gin/config.py", line 1582, in gin_wrapper
    return fn(*new_args, **new_kwargs)
  File "/storage/chen/home/zz4/anaconda3/envs/bpnet/lib/python3.6/site-packages/bpnet/cli/train.py", line 469, in train
    num_workers=num_workers))
  File "/storage/chen/home/zz4/anaconda3/envs/bpnet/lib/python3.6/site-packages/bpnet/utils.py", line 51, in render_ipynb
    parameters=params
  File "/storage/chen/home/zz4/anaconda3/envs/bpnet/lib/python3.6/site-packages/papermill/execute.py", line 122, in execute_notebook
    raise_for_execution_errors(nb, output_path)
  File "/storage/chen/home/zz4/anaconda3/envs/bpnet/lib/python3.6/site-packages/papermill/execute.py", line 234, in raise_for_execution_errors
    raise error
papermill.exceptions.PapermillExecutionError: 
---------------------------------------------------------------------------
Exception encountered at "In [26]":
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-26-36ba7ef40acb> in <module>
     30         # Predicted
     31         (f"\nPred", to_neg(pred[f'{task}/profile'][0] * np.exp(pred[f'{task}/counts'][0]))),
---> 32     ] for task_idx, task in enumerate(tasks)])
     33 
     34     sl = slice(*xlim)

<ipython-input-26-36ba7ef40acb> in <listcomp>(.0)
     30         # Predicted
     31         (f"\nPred", to_neg(pred[f'{task}/profile'][0] * np.exp(pred[f'{task}/counts'][0]))),
---> 32     ] for task_idx, task in enumerate(tasks)])
     33 
     34     sl = slice(*xlim)

<ipython-input-25-040d466e1211> in to_neg(track)
      3     """
      4     track = track.copy()
----> 5     track[:, 1] = - track[:, 1]
      6     return track

IndexError: index 1 is out of bounds for axis 1 with size 1

  In call to configurable 'train' (<function train at 0x7f93dcb01b70>)

Could you please provide an example of how to run BPNet on unstrand data type?