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
A utility to convert interpretation hdf5 files to a format that modiscolite can use.
- 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 NUM_BASES), but modiscolite requires(num-regions x NUM_BASES x input-length).- Parameters:
inpAr (ndarray[tuple[Any, ...], dtype[float16]] | ndarray[tuple[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.
- Return type:
None
- bpreveal.shapToNumpy.getParser()
Generate (but don’t parse_args()) the parser.
- Returns:
an ArgumentParser, ready to have parse_args() called.
- Return type:
ArgumentParser
- bpreveal.shapToNumpy.main()
Run the program.
- Return type:
None