Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewing the hypothetical impscores #38

Open
evanseitz opened this issue Apr 18, 2022 · 2 comments
Open

Viewing the hypothetical impscores #38

evanseitz opened this issue Apr 18, 2022 · 2 comments

Comments

@evanseitz
Copy link

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 that imp_scores['Nanog/profile/wn'][0] (for this example) stores the hyp_impscores?

@Avsecz
Copy link
Collaborator

Avsecz commented May 7, 2022

In general, you can generate hypothetical contribution scores for a sequence using contrib_scoremethod 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.

@evanseitz
Copy link
Author

Thank you, this is very helpful information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants