Hi Guys,
It might be written somewhere, but I can’t find a way to chain commands together like it is quite intuitive in spark. Eg I couldn’t simplify the following expression:
ot_variants = hl.Table.from_spark(included_df)
ot_variants = (
ot_variants.annotate(pos = hl.int32(ot_variants.pos))
)
ot_variants = (
ot_variants
.annotate(
locus = hl.locus(
ot_variants.chrom,
ot_variants.pos,
reference_genome='GRCh38'
),
alleles = hl.array([ot_variants.ref, ot_variants.alt])
)
)
ot_variants = (
ot_variants
.key_by(ot_variants.locus, ot_variants.alleles)
.drop(*['chrom', 'pos', 'alt', 'ref'])
)
So my question if there’s a way to write something like this:
ot_variants = (
hl.Table.from_spark(included_df)
.annotate(
pos = hl.int32(ot_variants.pos),
locus = hl.locus(
ot_variants.chrom,
ot_variants.pos,
reference_genome='GRCh38'
),
alleles = hl.array([ot_variants.ref, ot_variants.alt])
)
.key_by(ot_variants.locus, ot_variants.alleles)
.drop(*['chrom', 'pos', 'alt', 'ref'])
)
Thank you so much!