Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/kundajelab/bpnet-refactor i…
Browse files Browse the repository at this point in the history
…nto dev
  • Loading branch information
viramalingam committed Apr 7, 2023
2 parents 169efca + b81edba commit b2262e5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bpnet/cli/shap_scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,31 +60,31 @@ def save_scores(peaks_df, one_hot_sequences, hyp_shap_scores, output_fname):
"coords_chrom", (num_examples,),
dtype=h5py.string_dtype(encoding="ascii")
)
coords_chrom_dset[:] = coords_chrom
coords_chrom_dset[:] = coords_chrom.astype('U8')

coords_start_dset = f.create_dataset(
"coords_start", (num_examples,), dtype=int,
"coords_start", (num_examples,), dtype="i4",
**hdf5plugin.Blosc()
)
coords_start_dset[:] = coords_start

coords_end_dset = f.create_dataset(
"coords_end", (num_examples,), dtype=int,
"coords_end", (num_examples,), dtype="i4",
**hdf5plugin.Blosc()
)
coords_end_dset[:] = coords_end

hyp_scores_dset = f.create_dataset(
"hyp_scores", (num_examples, seq_len, 4),
"hyp_scores", (num_examples, seq_len, 4), dtype="f2",
**hdf5plugin.Blosc()
)
hyp_scores_dset[:, :, :] = hyp_shap_scores
hyp_scores_dset[:, :, :] = hyp_shap_scores.astype(np.float16)

input_seqs_dset = f.create_dataset(
"input_seqs", (num_examples, seq_len, 4),
"input_seqs", (num_examples, seq_len, 4), dtype="i1",
**hdf5plugin.Blosc()
)
input_seqs_dset[:, :, :] = one_hot_sequences
input_seqs_dset[:, :, :] = one_hot_sequences.astype(np.int8)

f.close()

Expand Down

0 comments on commit b2262e5

Please sign in to comment.