bpnet-lite
bpnet-lite copied to clipboard
Small fixes.
Hi Jacob,
Thanks for the update. I noticed a couple of bugs.
-
tangermeme version requirement should be updated to 0.5.0 since bpnet-lite now uses
example_to_fasta_coord. -
I believe that the sequences should be converted to float here (the line should read
X = X.cuda().float(), like what's used in the training loop inbpnet.py). I'm getting a dtype mismatch error when trying to train ChromBPNet models.
Thanks for the pointer. My last round of revisions focused on updating the BPNet code and my next round will be on updating the ChromBPNet code (and addressing Anshul's concerns), so I'll be incorporating these soon.
https://github.com/jmschrei/bpnet-lite/blob/f41a4387026e2471ec42e6be5d9ffdc36bd7f4bc/bpnetlite/io.py#L94 and https://github.com/jmschrei/bpnet-lite/blob/f41a4387026e2471ec42e6be5d9ffdc36bd7f4bc/bpnetlite/io.py#L99 need fallbacks for when no controls are supplied.
https://github.com/jmschrei/bpnet-lite/blob/master/bpnetlite/chrombpnet.py#L117
The way that the bias profile trimming works here fails when the accessibility and bias models have the same output length. That is, torch.ones(10, 4, 1000)[:, :, 0:-0] yields an empty tensor. I think the correct trimming should be:
y_profile = acc_profile + bias_profile[:, :, w:bias_profile.shape[-1]-w]