Hi AlphaGenome Team,
I am trying to use Alphagenome for some eqtl analysis task. I wanted to make sure that I am doing this correctly. I am attaching my code snippet below. I would highly appreciate if you could comment on the correctness of the approach.
Many thanks,
Sayan
selected_scorers = scorer_selections = {
'rna_seq': True,}
variant = genome.Variant(
chromosome=str(variant_row['CHROM']),
position=int(variant_row['POS']),
reference_bases=variant_row['REF'],
alternate_bases=variant_row['ALT'],
name=variant_row['variant_id'], )
interval = variant.reference_interval.resize(sequence_length)
variant_scores = dna_model.score_variant(
interval=interval,
variant=variant,
variant_scorers=selected_scorers,
organism=organism,
)
df_scores = variant_scorers.tidy_scores([variant_scores])
# Extract score for the specific tissue and gene
result = {
'variant_id': variant_row['variant_id'],
'chrom': variant_row['CHROM'],
'pos': variant_row['POS'],
'ref': variant_row['REF'],
'alt': variant_row['ALT'],
}
result['tissue'] = variant_row['tissue']
tissue_key = variant_row['tissue']
gene_id = variant_row['gene_id_short']
df = df_scores[
(df_scores['gene_id'] == gene_id) &
(df_scores['gtex_tissue'] == tissue_key)
]['raw_score']
result['alphagenome_score'] = df.values[0].mean()
result['gene_id'] = variant_row['gene_id']