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

Functions to process, filter, annotate and aggregate variants by transcript expression (get the pext scores per variant) #651

Merged
merged 41 commits into from
Jan 20, 2024

Conversation

KoalaQin
Copy link
Contributor

@KoalaQin KoalaQin commented Dec 8, 2023

Modifications:

  • change process_consequences,
filter_vep_transcript_csqs and preprocess_variants_for_tx to process and filter variants;
  • move import_gencode into resources_utils.py since it's versatile in any genome build.

Additions:

  • filter_vep_to_gene_list,
import_gencode, 
and filter_to_gencode_cds to filter variants;
  • a few more globals concerning variant consequences in vep.py;
  • tx_filter_variants_by_csqs, tx_annotate_variants, tx_aggregate_variants and an ensemble function perform_tx_annotation_pipeline to combine the first 3 functions;

@KoalaQin KoalaQin self-assigned this Dec 8, 2023
@KoalaQin KoalaQin requested a review from jkgoodrich December 8, 2023 16:18
KoalaQin and others added 21 commits December 18, 2023 20:34
…/gnomad_methods into jg/tx_annotate_mt_suggestions

# Conflicts:
#	gnomad/utils/transcript_annotation.py
…adinstitute/gnomad_methods into jg/tx_annotate_mt_suggestions

# Conflicts:
#	gnomad/utils/transcript_annotation.py
…/gnomad_methods into jg/tx_annotate_mt_suggestions

# Conflicts:
#	gnomad/utils/transcript_annotation.py
@KoalaQin KoalaQin requested a review from jkgoodrich January 13, 2024 22:40
Copy link
Contributor

@jkgoodrich jkgoodrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more comments. Also, can you modify the name of the PR and add to the PR description to indicate all the functions that are modified and added? Good example here

gnomad/utils/filtering.py Show resolved Hide resolved
gnomad/resources/grch38/reference_data.py Outdated Show resolved Hide resolved
gnomad/resources/grch38/reference_data.py Show resolved Hide resolved
gnomad/utils/filtering.py Show resolved Hide resolved
gnomad/utils/transcript_annotation.py Show resolved Hide resolved
gnomad/utils/vep.py Show resolved Hide resolved
@KoalaQin KoalaQin changed the title Function to annotate variant with transcript expression Functions to preprocess, annotate and aggregate variants by transcript expression (get the pext scores) Jan 16, 2024
@KoalaQin KoalaQin changed the title Functions to preprocess, annotate and aggregate variants by transcript expression (get the pext scores) Functions to preprocess, annotate and aggregate variants by transcript expression (get the pext scores per variant) Jan 16, 2024
@KoalaQin KoalaQin requested a review from jkgoodrich January 16, 2024 22:04
Copy link
Contributor

@jkgoodrich jkgoodrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a little bit more

gnomad/resources/grch38/reference_data.py Outdated Show resolved Hide resolved
gnomad/utils/filtering.py Show resolved Hide resolved
gnomad/utils/filtering.py Outdated Show resolved Hide resolved
gnomad/utils/vep.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jkgoodrich jkgoodrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few smaller things related to naming and doc strings

gnomad/utils/transcript_annotation.py Outdated Show resolved Hide resolved
gnomad/utils/transcript_annotation.py Show resolved Hide resolved
gnomad/utils/transcript_annotation.py Outdated Show resolved Hide resolved
gnomad/utils/transcript_annotation.py Outdated Show resolved Hide resolved
gnomad/utils/transcript_annotation.py Outdated Show resolved Hide resolved
gnomad/utils/transcript_annotation.py Outdated Show resolved Hide resolved
return ht


def process_annotate_aggregate_variants(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs another name. Maybe something like "perform_tx_based_expression_annotation" or "perform_tx_annotation_pipeline", or something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this new name?

gnomad/utils/vep.py Outdated Show resolved Hide resolved
@KoalaQin KoalaQin changed the title Functions to preprocess, annotate and aggregate variants by transcript expression (get the pext scores per variant) Functions to process, annotate and aggregate variants by transcript expression (get the pext scores per variant) Jan 19, 2024
@KoalaQin KoalaQin changed the title Functions to process, annotate and aggregate variants by transcript expression (get the pext scores per variant) Functions to process, filter, annotate and aggregate variants by transcript expression (get the pext scores per variant) Jan 19, 2024
Copy link
Contributor

@jkgoodrich jkgoodrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So close! Just a few more suggestions and a couple fixes to the new additions

gnomad/utils/vep.py Outdated Show resolved Hide resolved
gnomad/utils/vep.py Outdated Show resolved Hide resolved
gnomad/utils/vep.py Outdated Show resolved Hide resolved
gnomad/utils/transcript_annotation.py Show resolved Hide resolved
gnomad/utils/transcript_annotation.py Outdated Show resolved Hide resolved
gnomad/utils/transcript_annotation.py Outdated Show resolved Hide resolved
gnomad/utils/transcript_annotation.py Outdated Show resolved Hide resolved
gnomad/utils/transcript_annotation.py Show resolved Hide resolved
gnomad/utils/vep.py Outdated Show resolved Hide resolved
gnomad/utils/vep.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jkgoodrich jkgoodrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small thing, and can you change the PR description with the updated function names. Then I will approve.

gnomad/utils/vep.py Outdated Show resolved Hide resolved
@KoalaQin KoalaQin requested a review from jkgoodrich January 20, 2024 03:21
Copy link
Contributor

@jkgoodrich jkgoodrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@KoalaQin KoalaQin merged commit bea49f8 into main Jan 20, 2024
3 checks passed
@jkgoodrich jkgoodrich deleted the qh/tx_annotate_mt branch January 22, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants