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

Variant class should have get_preferred_transcript() #79

Closed
pnrobinson opened this issue Oct 10, 2023 · 4 comments · Fixed by #128
Closed

Variant class should have get_preferred_transcript() #79

pnrobinson opened this issue Oct 10, 2023 · 4 comments · Fixed by #128
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@pnrobinson
Copy link
Member

No description provided.

@ielis ielis added the enhancement New feature or request label Oct 16, 2023
@ielis
Copy link
Member

ielis commented Oct 23, 2023

@pnrobinson I'm thinking about the cardinality of this attribute.

We can use MANE as the source of preferred transcript. However, per project info, the MANE attribute is only available for hg38 build.

The MANE project is only being completed for human genes on GRCh38. There is no plan to retroactively add this data to our archived GRCh37 gene annotation.

Next, not all genes have a MANE transcript, there are ~200 protein-coding genes with no MANE (e.g. MT-ATP6, NKRF). It's hard to know if this becomes an issue..

So, I think 0..1 is what should be done here...

@pnrobinson
Copy link
Member Author

Probably. On the other hand, we could choose the longest transcript to be preferred if there is no MANE. The user should be able to change the preferred transcript anyway and we need to present a table with a summary of all of this right after we set up the cohort?

@ielis
Copy link
Member

ielis commented Oct 23, 2023

OK, so to allow custom preferred transcript, we will need to have a dedicated component in the functional annotation step.

I propose taking a mapping from gene symbol to transcript accession, something like:

pref_tx_acc_ids = {
  'FBN1': 'NM_000138.5',
  'MAPK8IP3': 'NM_001318852.2'
}

Then, need the following sub-task to resolve preferred transcript for any gene we encounter in the functional annotation workflow:

  • check if the gene symbol is in the pref_tx_acc_ids and use the accession to figure out the "preferred" status
  • if there is no corresponding entry in pref_tx_acc_ids, fall back to the MANE transcript
  • if there is no MANE transcript in the response, use the "longest" transcript

Now, what is "longest"? I would suggest the transcript with the greatest count of coding bases. In case of tie, choose the tx with longer UTRs. In case of tie, choose the tx with the lowest tx accession ID when comparing the accession alphabetically.

Thanks to the workflow, we will always have a preferred transcript, so the cardinality can be 1..1.

@ielis ielis added this to the Manuscript milestone Nov 16, 2023
@lnrekerle lnrekerle self-assigned this Nov 30, 2023
@ielis
Copy link
Member

ielis commented Dec 5, 2023

This is about making sure that TranscriptAnnotation.is_preferred is set with a good value.

  • There should be just one preferred transcript for a gene.
  • The selection of the preferred transcript happens during the functional annotation.
  • The selection follows the rules above (1st check user's input dict, then MANE, then length)

We need to use the is_preferred in the downstream analysis. Currently, some predicates need to get explicit tx ID. This is not ideal.
The simplest way to approach this is to show the user how to review the results of the functional annotation, choose a transcript for a gene and then use it in the downstream g2p analysis.
We need to show how this is done in the notebooks/docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants