Class

io.projectglow.sql.expressions

HardCalls

Related Doc: package expressions

Permalink

case class HardCalls(probabilities: Expression, numAlts: Expression, phased: Expression, threshold: Expression) extends Expression with CodegenFallback with ImplicitCastInputTypes with Product with Serializable

Converts an array of probabilities (most likely the genotype probabilities from a BGEN file) into hard calls. The input probabilities are assumed to be diploid.

If the input probabilities are phased, each haplotype is called separately by finding the maximum probability greater than the threshold (0.9 by default, a la plink). If no probability is greater than the threshold, the call is -1 (missing).

If the input probabilities are unphased, the probabilities refer to the complete genotype. In this case, we find the maximum probability greater than the threshold and then convert that value to a genotype call.

If any of the required parameters (probabilities, numAlts, phased) are null, the expression returns null.

probabilities

The probabilities to convert to hard calls. The algorithm does not check that they sum to 1. If the probabilities are unphased, they are assumed to correspond to the genotypes in colex order, which is standard for both BGEN and VCF files.

numAlts

The number of alternate alleles at this site.

phased

Whether the probabilities are phased (per haplotype) or unphased (whole genotype).

threshold

Calls are only generated if at least one probability is above this threshold.

Linear Supertypes
Serializable, Serializable, ImplicitCastInputTypes, ExpectsInputTypes, CodegenFallback, Expression, TreeNode[Expression], Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HardCalls
  2. Serializable
  3. Serializable
  4. ImplicitCastInputTypes
  5. ExpectsInputTypes
  6. CodegenFallback
  7. Expression
  8. TreeNode
  9. Product
  10. Equals
  11. AnyRef
  12. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HardCalls(probabilities: Expression, numAlts: Expression, phased: Expression)

    Permalink
  2. new HardCalls(probabilities: Expression, numAlts: Expression, phased: Expression, threshold: Expression)

    Permalink

    probabilities

    The probabilities to convert to hard calls. The algorithm does not check that they sum to 1. If the probabilities are unphased, they are assumed to correspond to the genotypes in colex order, which is standard for both BGEN and VCF files.

    numAlts

    The number of alternate alleles at this site.

    phased

    Whether the probabilities are phased (per haplotype) or unphased (whole genotype).

    threshold

    Calls are only generated if at least one probability is above this threshold.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(number: Int): TreeNode[_]

    Permalink
    Definition Classes
    TreeNode
  5. def argString: String

    Permalink
    Definition Classes
    TreeNode
  6. def asCode: String

    Permalink
    Definition Classes
    TreeNode
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. lazy val canonicalized: Expression

    Permalink
    Definition Classes
    Expression
  9. def checkInputDataTypes(): TypeCheckResult

    Permalink
    Definition Classes
    HardCalls → ExpectsInputTypes → Expression
  10. def children: Seq[Expression]

    Permalink
    Definition Classes
    HardCalls → TreeNode
  11. def childrenResolved: Boolean

    Permalink
    Definition Classes
    Expression
  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def collect[B](pf: PartialFunction[Expression, B]): Seq[B]

    Permalink
    Definition Classes
    TreeNode
  14. def collectFirst[B](pf: PartialFunction[Expression, B]): Option[B]

    Permalink
    Definition Classes
    TreeNode
  15. def collectLeaves(): Seq[Expression]

    Permalink
    Definition Classes
    TreeNode
  16. lazy val containsChild: Set[TreeNode[_]]

    Permalink
    Definition Classes
    TreeNode
  17. def dataType: DataType

    Permalink
    Definition Classes
    HardCalls → Expression
  18. lazy val deterministic: Boolean

    Permalink
    Definition Classes
    Expression
  19. def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode

    Permalink
    Attributes
    protected
    Definition Classes
    CodegenFallback → Expression
  20. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. def eval(input: InternalRow): Any

    Permalink
    Definition Classes
    HardCalls → Expression
  22. def fastEquals(other: TreeNode[_]): Boolean

    Permalink
    Definition Classes
    TreeNode
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def find(f: (Expression) ⇒ Boolean): Option[Expression]

    Permalink
    Definition Classes
    TreeNode
  25. def flatArguments: Iterator[Any]

    Permalink
    Attributes
    protected
    Definition Classes
    Expression
  26. def flatMap[A](f: (Expression) ⇒ TraversableOnce[A]): Seq[A]

    Permalink
    Definition Classes
    TreeNode
  27. def foldable: Boolean

    Permalink
    Definition Classes
    Expression
  28. def foreach(f: (Expression) ⇒ Unit): Unit

    Permalink
    Definition Classes
    TreeNode
  29. def foreachUp(f: (Expression) ⇒ Unit): Unit

    Permalink
    Definition Classes
    TreeNode
  30. def genCode(ctx: CodegenContext): ExprCode

    Permalink
    Definition Classes
    Expression
  31. def generateTreeString(depth: Int, lastChildren: Seq[Boolean], builder: StringBuilder, verbose: Boolean, prefix: String, addSuffix: Boolean): StringBuilder

    Permalink
    Definition Classes
    TreeNode
  32. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  33. def hashCode(): Int

    Permalink
    Definition Classes
    TreeNode → AnyRef → Any
  34. def innerChildren: Seq[TreeNode[_]]

    Permalink
    Attributes
    protected
    Definition Classes
    TreeNode
  35. def inputTypes: Seq[Serializable with AbstractDataType]

    Permalink
    Definition Classes
    HardCalls → ExpectsInputTypes
  36. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  37. def jsonFields: List[JField]

    Permalink
    Attributes
    protected
    Definition Classes
    TreeNode
  38. def makeCopy(newArgs: Array[AnyRef]): Expression

    Permalink
    Definition Classes
    TreeNode
  39. def map[A](f: (Expression) ⇒ A): Seq[A]

    Permalink
    Definition Classes
    TreeNode
  40. def mapChildren(f: (Expression) ⇒ Expression): Expression

    Permalink
    Definition Classes
    TreeNode
  41. def mapProductIterator[B](f: (Any) ⇒ B)(implicit arg0: ClassTag[B]): Array[B]

    Permalink
    Attributes
    protected
    Definition Classes
    TreeNode
  42. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  43. def nodeName: String

    Permalink
    Definition Classes
    TreeNode
  44. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  45. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  46. def nullable: Boolean

    Permalink
    Definition Classes
    HardCalls → Expression
  47. val numAlts: Expression

    Permalink

    The number of alternate alleles at this site.

  48. def numberedTreeString: String

    Permalink
    Definition Classes
    TreeNode
  49. val origin: Origin

    Permalink
    Definition Classes
    TreeNode
  50. def otherCopyArgs: Seq[AnyRef]

    Permalink
    Attributes
    protected
    Definition Classes
    TreeNode
  51. def p(number: Int): Expression

    Permalink
    Definition Classes
    TreeNode
  52. val phased: Expression

    Permalink

    Whether the probabilities are phased (per haplotype) or unphased (whole genotype).

  53. def prettyJson: String

    Permalink
    Definition Classes
    TreeNode
  54. def prettyName: String

    Permalink
    Definition Classes
    Expression
  55. val probabilities: Expression

    Permalink

    The probabilities to convert to hard calls.

    The probabilities to convert to hard calls. The algorithm does not check that they sum to 1. If the probabilities are unphased, they are assumed to correspond to the genotypes in colex order, which is standard for both BGEN and VCF files.

  56. def references: AttributeSet

    Permalink
    Definition Classes
    Expression
  57. lazy val resolved: Boolean

    Permalink
    Definition Classes
    Expression
  58. def semanticEquals(other: Expression): Boolean

    Permalink
    Definition Classes
    Expression
  59. def semanticHash(): Int

    Permalink
    Definition Classes
    Expression
  60. def simpleString: String

    Permalink
    Definition Classes
    Expression → TreeNode
  61. def sql: String

    Permalink
    Definition Classes
    Expression
  62. def stringArgs: Iterator[Any]

    Permalink
    Attributes
    protected
    Definition Classes
    TreeNode
  63. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  64. val threshold: Expression

    Permalink

    Calls are only generated if at least one probability is above this threshold.

  65. def toJSON: String

    Permalink
    Definition Classes
    TreeNode
  66. def toString(): String

    Permalink
    Definition Classes
    Expression → TreeNode → AnyRef → Any
  67. def transform(rule: PartialFunction[Expression, Expression]): Expression

    Permalink
    Definition Classes
    TreeNode
  68. def transformDown(rule: PartialFunction[Expression, Expression]): Expression

    Permalink
    Definition Classes
    TreeNode
  69. def transformUp(rule: PartialFunction[Expression, Expression]): Expression

    Permalink
    Definition Classes
    TreeNode
  70. def treeString(verbose: Boolean, addSuffix: Boolean): String

    Permalink
    Definition Classes
    TreeNode
  71. def treeString: String

    Permalink
    Definition Classes
    TreeNode
  72. final def verboseString: String

    Permalink
    Definition Classes
    Expression → TreeNode
  73. def verboseStringWithSuffix: String

    Permalink
    Definition Classes
    TreeNode
  74. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  75. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  76. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  77. def withNewChildren(newChildren: Seq[Expression]): Expression

    Permalink
    Definition Classes
    TreeNode

Inherited from Serializable

Inherited from Serializable

Inherited from ImplicitCastInputTypes

Inherited from ExpectsInputTypes

Inherited from CodegenFallback

Inherited from Expression

Inherited from TreeNode[Expression]

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped