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

feat(qtls): flagging trans QTL credible sets #973

Merged
merged 7 commits into from
Jan 24, 2025

Conversation

DSuveges
Copy link
Contributor

✨ Context

QTL credible stets can be in trans or in cis position respective to the relative location of the measured gene. A QTL credible set is considered trans if:

  • All taggging variants are in trans position
  • A variant is in trans position if the chromosome is different from the target chromosome
  • A variant is in trans position if the distance from the TSS of the gene is higher than a provided threshold (eg 5e6)

A newly introduced boolean column is added to studyLocus schema. This column is nulls for credible sets of gwas (non-qtl) studies.

@DSuveges DSuveges marked this pull request as draft January 15, 2025 11:17
@DSuveges
Copy link
Contributor Author

This PR depends on merging #946

@DSuveges DSuveges changed the title feature(qtls): Flagging trans QTL credible sets feature(qtls): flagging trans QTL credible sets Jan 15, 2025
@DSuveges DSuveges changed the title feature(qtls): flagging trans QTL credible sets feat(qtls): flagging trans QTL credible sets Jan 15, 2025
@DSuveges DSuveges marked this pull request as ready for review January 22, 2025 15:29
@DSuveges DSuveges requested a review from vivienho January 22, 2025 15:42
.groupby("studyLocusId")
.agg(
# If any of the tags of a locus is in trans position, the QTL is considered trans:
f.array_contains(f.collect_set("isTagTrans"), True).alias("isTransQtl")
Copy link
Contributor

Choose a reason for hiding this comment

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

Here it states that the QTL is considered trans if at least one tag is trans, but in the PR description it's mentioned that a QTL is considered trans when all tagging variants are trans?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, thank you for finding this discrepancy. I have changed my mind, but haven't updated the description.

_df=(
spark.createDataFrame(self.GENE_DATA, self.GENE_COLUMNS).select(
f.struct(
"strand",
Copy link
Contributor

Choose a reason for hiding this comment

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

The first strand seems redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, yes, you are totally right.

Copy link
Contributor

@vivienho vivienho left a comment

Choose a reason for hiding this comment

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

The PR adds a function to flag trans qtls during study locus validation. All makes sense!

@DSuveges
Copy link
Contributor Author

@vivienho thank you for reviewing the PR! I have addressed both comments. If the tests are all passing, I'll merge the branch.

@DSuveges DSuveges merged commit aa00959 into dev Jan 24, 2025
5 checks passed
@DSuveges DSuveges deleted the 3718-flag-trans-qtls-in-credible-set-dataset branch January 24, 2025 10:29
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.

Flag trans QTLs in credible set dataset.
2 participants