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

Where iMHC scores are stored in the data model? #44

Open
markgene opened this issue May 9, 2022 · 2 comments
Open

Where iMHC scores are stored in the data model? #44

markgene opened this issue May 9, 2022 · 2 comments

Comments

@markgene
Copy link
Contributor

markgene commented May 9, 2022

Hi there, thanks for developing CONGA!

I wonder where the iMHC scores are stored in the data model or individual output file(s).

Thanks!

-Mark

@phbradley
Copy link
Owner

Hi Mark,

Thanks for your interest in CONGA! Right now, the iMHC scores are not written out or explicitly saved in the AnnData (adata) object. They are computed on the fly along with all the other TCR-based scores during the graph-vs-feature analyses and in some of the plotting routines, but it doesn't look like they are saved.

To recompute them, you could do something like this in a notebook

scores = conga.tcr_scoring.make_tcr_score_table(adata, ['imhc'])

at which point scores would be a numpy array of shape (num_clonotypes,1) with the imhc scores for each clonotype.

or you could hack the run_conga.py script by inserting a line like this somewhere before line 1072 where the final adata is written out and the final adata.obs spreadsheet is saved to tsv file:

adata.obs['imhc_scores'] = conga.tcr_scoring.make_tcr_score_table(adata, ['imhc'])[:,0]

then the scores would be written out with the adata object and present in the output file <prefix>_final_obs.tsv

Let me know if you run into any trouble with that (I didn't test it!).

Take care,
Phil

@markgene
Copy link
Contributor Author

markgene commented May 9, 2022

Thank you SO much, @phbradley ! -Mark

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