shapToBigwig
Help Info
Take an hdf5-format file generated by the flat shap script and render it to a bigwig.
usage: shapToBigwig [-h] [--h5 H5] [--bw BW] [--verbose]
Named Arguments
- --h5
The name of the hdf5-format file to be read in.
- --bw
The name of the bigwig file that should be written.
- --verbose
Print progress messages.
Default:
False
Usage
A little script that takes an hdf5 generated by interpretFlat and renders a bigwig file.
- class bpreveal.shapToBigwig.BatchedH5Reader(h5fp, batchSize)
Read in an hdf5 in chunks.
- Parameters:
batchSize (int) – The number of elements that should be read in at once
h5fp (File) – The (open) hdf5 file object to read from.
- readScore(idx)
Read in score information from the hdf5.
- Parameters:
idx (int) – The index of the score that we want to read.
- Returns:
An array of shape (input-length, NUM_BASES) containing hypothetical scores.
- Return type:
ndarray[tuple[Any, …], dtype[float16]]
- readSeq(idx)
Read in sequence information from the hdf5.
- Parameters:
idx (int) – The index of the sequence to read.
- Returns:
One-hot encoded sequences, shape (input-length, NUM_BASES)
- Return type:
ndarray[tuple[Any, …], dtype[uint8]]
- bpreveal.shapToBigwig.writeBigWig(inH5, outFname)
Write the data in the h5 file to a bigwig on disk.
- Parameters:
inH5 (File) – The (open) hdf5 file to use
outFname (str) – The name of the bigwig to save
- Return type:
None
- bpreveal.shapToBigwig.getParser()
Generate (but don’t parse_args()) the parser.
- Returns:
An
ArgumentParser, ready to callparse_args()- Return type:
ArgumentParser
- bpreveal.shapToBigwig.main()
Run the program.
- Return type:
None