Open evanseitz opened 2 years ago
In general, you can generate hypothetical contribution scores for a sequence using contrib_score
method on SeqModel as done here: https://github.com/kundajelab/bpnet/blob/master/bpnet/cli/contrib.py#L238-L241.
Throughout the codebase, 'imp' or 'contrib' refer to hyp_contrib * dna_sequence
, where dna_sequence
is one-hot encoded (as you correctly inferred).
For accessing hypothetical contribution scores of patterns produces by TF-MoDISco you can access the hyp_contrib
values of the Pattern
class https://github.com/kundajelab/bpnet/blob/master/bpnet/modisco/core.py#L42. You can also use pattern.plot(kind='hyp_contrib')
method to visualize the hypothetical contributions of a pattern. A list of patterns from a modisco run can be obtained from ModiscoFile
class (.patterns()
) https://github.com/kundajelab/bpnet/blob/master/bpnet/modisco/files.py#L74.
Thank you, this is very helpful information.
I'm interested in viewing the
hyp_impscores
of the BPNet outputs, as seen in line 5, row 2 of this document.First, I'm able to view the standard contribution scores using the dictionary produced via:
viz_dict, seq, imp_scores = interval_predict(bpnet, ds, interval, tasks, smooth_obs_n=0, neg_rev=False, incl_pred=True)
E.g., via
viz_dict['Nanog Imp profile']
, which I understand to represent the absolute amount of the contribution score for task {task=Nanog} at the motif instance position — i.e., these are the "contribution of each base within the input sequence to the entire predicted ChiP nexus profile of the TF {task=Nanog} output by DeepLIFT"As I understand, these are derived by taking the dot product of
hyp_impscores
with the given one-hot encoding. Is it true thatimp_scores['Nanog/profile/wn'][0]
(for this example) stores thehyp_impscores
?