shapToNumpy

Help Info

A little utility that takes the hdf5-format files generated by interpretFlat.py and saves them as numpy arrays suitable for tfmodisco-lite.

usage: shapToNumpy [-h] [--h5 H5] [--seqs SEQS]
                   [--scores SCORES] [--verbose]

Named Arguments

--h5

The name of the hdf5-format file generated by interpretFlat.py

--seqs

The name of the .npy/.npz-format file containing the one-hot-encoded sequences. This is an output.

--scores

The name of the .npy/.npz-format file containing the hypothetical importance scores. This is an output.

--verbose

Display progress messages.

Default: False

Usage

This little utility takes the hdf5 files generated by interpretFlat.py and renders them as numpy arrays that can be fed to the tfmodisco-lite suite.

bpreveal.shapToNumpy.flipAndSave(inpAr, fname, dtype)

Save the datasets in the format expected by modiscolite.

The hdf5 file contains scores in the format (num-regions x input-length x 4), but modiscolite requires (num-regions x 4 x input-length).

Parameters:
  • inpAr (ndarray[Any, dtype[float16]] | ndarray[Any, dtype[uint8]]) – The data to save out

  • fname (str) – The file to save. If it ends with npz, it will be saved compressed.

  • dtype (type) – The numpy data type to use for the stored data.

bpreveal.shapToNumpy.getParser()

Generate the parser

Returns:

an ArgumentParser, ready to have parse_args() called.

Return type:

ArgumentParser

bpreveal.shapToNumpy.main()

Runs the program