-
Notifications
You must be signed in to change notification settings - Fork 596
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
add initial notebook copy pasta #8008
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## ah_var_store #8008 +/- ##
================================================
Coverage ? 86.243%
Complexity ? 35196
================================================
Files ? 2173
Lines ? 165004
Branches ? 17792
================================================
Hits ? 142304
Misses ? 16373
Partials ? 6327 |
# copy the reference data to set in hail | ||
# gsutil -m cp 'gs://hail-common/references/Homo_sapiens_assembly38.fasta.gz' . | ||
# gsutil -m cp 'gs://hail-common/references/Homo_sapiens_assembly38.fasta.fai' . | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary, the add_sequence
call on lines 87/88 reads the references from GCS directly.
# copy the reference data to set in hail | |
# gsutil -m cp 'gs://hail-common/references/Homo_sapiens_assembly38.fasta.gz' . | |
# gsutil -m cp 'gs://hail-common/references/Homo_sapiens_assembly38.fasta.fai' . |
# gsutil -m cp 'gs://hail-common/references/Homo_sapiens_assembly38.fasta.gz' . | ||
# gsutil -m cp 'gs://hail-common/references/Homo_sapiens_assembly38.fasta.fai' . | ||
|
||
## Now RESTART the Kernal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary to restart the kernel in the notebook when working from the terminal, which is the expectation per lines 68-69.
## Now RESTART the Kernal |
|
||
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## * Replace LGT with GT ( for easier calculations later ) | ||
filtered_vd = filtered_vds.variant_data | ||
filtered_vd = filtered_vd.annotate_entries(GT=hl.vds.lgt_to_gt(filtered_vd.LGT, filtered_vd.LA) ) | ||
filtered_vds = hl.vds.VariantDataset(filtered_vds.reference_data, filtered_vd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like filtered_vds
needs to be assigned here, it's never read before being reassigned on line 125.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I liked the logic of it there, but you are right that it's overkill
|
||
## * Respect the FT flag by setting all failing GTs to a no call | ||
# TODO We dont seem to be using the dense matrix table here (TODO do we need to?) | ||
filtered_vd = filtered_vd.annotate_entries(GT=hl.or_missing(hl.coalesce(filtered_vd.FT, True), filtered_vd.GT)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use a comment for us non Hail wizards. 🙂 My (possibly incorrect) interpretation, working inside out:
coalesce returns the first non-missing value, so I think this is saying to return filtered_vt.FT
if it is non-missing, otherwise True
.
or_missing takes as its first argument a boolean predicate which if true returns the second argument, otherwise missing.
Putting it together:
filtered_vd.FT
is True
⇒ GT keeps its current value
filtered_vd.FT
is False
⇒ GT assigned missing
filtered_vd.FT
is missing ⇒ GT keeps its current value
which actually doesn't seem right... 🤔 should this be ~filtered_vd.FT
to keep GT if the filter is True
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does (and should) keep GT if the filter is True
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I need to reverse the logic in my brain for how this works in Hail; work in progress... 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just keep reciting "filter false is filter fail"
Github actions tests reported job failures from actions build 3056000079
|
No description provided.