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

Reference Genome #3 #2086

Merged
merged 12 commits into from
Aug 21, 2017
Merged

Reference Genome #3 #2086

merged 12 commits into from
Aug 21, 2017

Conversation

jigold
Copy link
Contributor

@jigold jigold commented Aug 9, 2017

  • Added genome reference to TVariant, TInterval, TLocus

@@ -62,20 +63,20 @@ trait HailRepFunctions {
def typ = TGenotype
}

implicit object variantHr extends HailRep[Variant] {
def typ = TVariant
implicit def variantHr[T](implicit hrt: HailRep[T]) = new HailRep[Variant] {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This shouldn't have a HailRep as a parameter, since it isn't parameterized by a Type but by a GenomeReference. There should be a new class that mirrors TVariable but isn't in the type hierarchy. Something like GRVariable which matches a reference with unification. It should be a GenomeReference so you can construct a TVariant from one.

Copy link
Collaborator

@cseed cseed left a comment

Choose a reason for hiding this comment

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

Everything else looks good.

@jigold
Copy link
Contributor Author

jigold commented Aug 11, 2017

@cseed Back to you.


override def toString = "GenomeReference"

def scalaClassTag: ClassTag[GenomeReference] = classTag[GenomeReference]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can delete this (required by type).

@@ -103,3 +109,29 @@ object GenomeReference {
} yield GenomeReference(name, contigs, Set(xContig), Set(yContig), Set(mtContig), parX ++ parY)
}

case class GRVariable(gr: GenomeReference, var t: Type = null) extends Serializable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

So this should have var gr: GenomeReference = null and no type field.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It should extend GenomeReference. Deciding the right way to do this might be a bit tricky. Then TVariant.unify, etc., should unify the genome reference variable. Let me know if this doesn't make sense.

@jigold
Copy link
Contributor Author

jigold commented Aug 11, 2017

@cseed Back to you. Is there a good way to test if it's actually working?

@@ -55,9 +55,9 @@ object Annotation {
null
else
t match {
case TVariant => a.asInstanceOf[Variant].toRow
case x: TVariant => a.asInstanceOf[Variant].toRow
Copy link
Collaborator

Choose a reason for hiding this comment

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

_ is traditional if you're not using the variable.

@@ -146,17 +146,17 @@ object UnsafeRow {
case struct: TStruct =>
readStruct(region, offset, ttBc)

case TVariant =>
val ft = TVariant.fundamentalType.asInstanceOf[TStruct]
case x: TVariant =>
Copy link
Collaborator

Choose a reason for hiding this comment

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

You use x sometimes, t sometimes. I'd just use x.

@@ -8,8 +8,38 @@ import is.hail.utils._
import org.json4s._
import org.json4s.jackson.JsonMethods

abstract class GRBase extends Serializable {
def isValidContig(contig: String): Boolean = ???
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's cleaner to put ??? implementations on GRVariable and have these abstract with no overrides.

@cseed
Copy link
Collaborator

cseed commented Aug 21, 2017

Looks good. A few cosmetic comments, I won't push for them, change if you agree.

@jigold jigold merged commit 69b9d82 into hail-is:master Aug 21, 2017
jbloom22 pushed a commit to jbloom22/hail that referenced this pull request Oct 31, 2017
* Reference Genome #3

- Added genome reference to TVariant, TInterval, TLocus

* fixed tvariant sig match

* fixed type unify error

* fixed rebase

* fixed hailrep for variant

* fixed hailrep for locus and interval

* fix tests

* add GRVariable

* Attempt #3

* Changed vSig for GDB

* fixup

* addressed comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants