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

[hail][feature] add contig_length function #7121

Merged
merged 3 commits into from Sep 27, 2019

Conversation

@tpoterba
Copy link
Collaborator

@tpoterba tpoterba commented Sep 24, 2019

Fixes #7111

@@ -85,5 +85,11 @@ class ReferenceGenomeFunctions(rg: ReferenceGenome) extends RegistryFunctions {
Seq(TString(), TInt32())).get
If(isValid(Array(contig, pos)), getRef(Array(contig, pos, before, after)), NA(TString()))
}

registerRGCode("contigLength", TString(), TInt32(), null) {
Copy link
Collaborator

@danking danking Sep 25, 2019

Choose a reason for hiding this comment

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

what's the deal with this pt argument which is null and not used in the definition of registerRGCode?

Copy link
Collaborator Author

@tpoterba tpoterba Sep 25, 2019

Choose a reason for hiding this comment

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

this is the ptype registration function. If null, the function returns the canoncical PType for the virtual type.

@@ -85,5 +85,11 @@ class ReferenceGenomeFunctions(rg: ReferenceGenome) extends RegistryFunctions {
Seq(TString(), TInt32())).get
If(isValid(Array(contig, pos)), getRef(Array(contig, pos, before, after)), NA(TString()))
}

registerRGCode("contigLength", TString(), TInt32(), null) {
case (r, rt, (contigT, contig: Code[long])) =>
Copy link
Collaborator

@danking danking Sep 25, 2019

Choose a reason for hiding this comment

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

what's up with the lowercase long?

Copy link
Collaborator Author

@tpoterba tpoterba Sep 25, 2019

Choose a reason for hiding this comment

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

a bug is up

Copy link
Collaborator Author

@tpoterba tpoterba Sep 25, 2019

Choose a reason for hiding this comment

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

hah, was being interpreted as a type variable.

@tpoterba tpoterba changed the title [hail] add contig_length function [hail][feature] add contig_length function Sep 26, 2019
@danking danking merged commit 469e564 into hail-is:master Sep 27, 2019
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants