Skip to main content
Ctrl+K

AlphaGenome

  • Installation
  • Getting started
  • Tutorials
    • Choosing a condition
    • Selecting a genomic region
    • Predicting tracks for an interval or sequence
    • Predicting a variant
    • Scoring a variant
    • Plotting predictions
    • Conditioning on your own single-cell data
    • Working with imputed tracks
    • Analyzing a splicing variant
    • Analyzing haplotypes
    • Highlighting important regions with ISM
    • Making mouse predictions
    • AlphaGenome 1 quick start (legacy)
    • Deriving PSI values from splice junctions
  • User guide
    • Key objects
    • Model output metadata
    • Navigating imputed tracks
    • How variant scoring works
    • Visualization basics
    • Migrating from AlphaGenome 1
  • Vignettes
    • Fine-mapping the ETS2 locus
    • Dissecting non-coding TAL1 mutations in T-ALL
    • Mapping lineage-specific enhancers at the BCL11A locus
  • API reference
    • Models
      • AlphaGenome 2
        • create
        • ModelVersion
        • Organism
        • validate_sequence_length
        • DnaClient
          • encode_cells
          • observed_metadata
          • predict_interval
          • predict_interval_gradients
          • predict_interval_gradients_batch
          • predict_intervals
          • predict_sequence
          • predict_sequences
          • predict_variant
          • predict_variants
          • score_interval
          • score_intervals
          • score_ism_variants
          • score_variant
          • score_variants
          • supported_conditions
        • OutputType
        • Output
          • filter_output_type
          • filter_to_observed
          • filter_to_strand
          • get
          • map_over_outputs
          • resize
          • with_metadata_column
          • with_name_suffix
        • OutputMetadata
          • concatenate
          • get
        • VariantOutput
        • TargetGeneMetadata
        • InputGradientsOutput
          • to_track_data
        • ModelCondition
        • from_curies
        • from_anndata
        • subsample
        • AggregationType
        • BaseVariantScorer
        • CenterMaskScorer
        • ContactMapScorer
        • GeneMaskLFCScorer
        • GeneMaskActiveScorer
        • GeneMaskSplicingScorer
        • MethylationScorer
        • PolyadenylationScorer
        • SpliceJunctionScorer
        • get_recommended_scorers
        • tidy_anndata
        • tidy_scores
        • IntervalAggregationType
        • BaseIntervalScorer
        • GeneMaskScorer
      • AlphaGenome 1
        • create
        • ModelVersion
        • Organism
        • validate_sequence_length
        • DnaClient
          • output_metadata
          • predict_interval
          • predict_intervals
          • predict_sequence
          • predict_sequences
          • predict_variant
          • predict_variants
          • score_interval
          • score_intervals
          • score_ism_variants
          • score_variant
          • score_variants
        • OutputType
        • Output
          • filter_ontology_terms
          • filter_output_type
          • filter_to_strand
          • get
          • map_track_data
          • resize
        • OutputMetadata
          • concatenate
          • from_outputs
          • get
        • VariantOutput
        • AggregationType
        • BaseVariantScorer
        • CenterMaskScorer
        • ContactMapScorer
        • GeneMaskLFCScorer
        • GeneMaskActiveScorer
        • GeneMaskSplicingScorer
        • PolyadenylationScorer
        • SpliceJunctionScorer
        • get_recommended_scorers
        • tidy_anndata
        • tidy_scores
        • IntervalAggregationType
        • BaseIntervalScorer
        • GeneMaskScorer
      • get_api_key
    • Atlas
      • create
      • AtlasClient
        • query_interval
        • query_variant
        • query_variants
        • scorer_metadata
      • ScorerMetadata
    • Data
      • Subset
      • get_all_folds
      • get_fold_names
      • get_fold_intervals
      • Strand
        • from_str
      • VariantFormat
        • to_regex
      • Interval
        • as_unstranded
        • binary_mask
        • binary_mask_stranded
        • boundary_shift
        • center
        • contains
        • copy
        • coverage
        • coverage_stranded
        • from_interval_dict
        • from_str
        • intersect
        • overlap_ranges
        • overlaps
        • pad
        • resize
        • shift
        • swap_strand
        • to_interval_dict
        • truncate
        • within_reference
      • Variant
        • alternate_overlaps
        • as_truncated_str
        • copy
        • from_dict
        • from_str
        • reference_overlaps
        • split
        • to_dict
      • Junction
        • acceptor_region
        • as_unstranded
        • binary_mask
        • binary_mask_stranded
        • boundary_shift
        • center
        • contains
        • copy
        • coverage
        • coverage_stranded
        • dinucleotide_region
        • donor_region
        • from_interval_dict
        • from_str
        • intersect
        • overlap_ranges
        • overlaps
        • pad
        • resize
        • shift
        • swap_strand
        • to_interval_dict
        • truncate
        • within_reference
      • normalize_variant
      • intersect_intervals
      • merge_overlapping_intervals
      • union_intervals
      • TranscriptType
      • extract_tss
      • filter_transcript_type
      • filter_protein_coding
      • filter_to_longest_transcript
      • filter_to_mane_select_transcript
      • filter_transcript_support_level
      • get_gene_interval
      • get_gene_intervals
      • FastaExtractor
        • extract
        • get_length_for_sequence_name
      • reverse_complement
      • JunctionData
        • filter_by_name
        • filter_by_ontology
        • filter_by_tissue
        • filter_to_negative_strand
        • filter_to_observed
        • filter_to_positive_strand
        • filter_to_strand
        • filter_tracks
        • intersect_with_interval
        • normalize_values
        • with_metadata_column
        • with_name_suffix
      • get_junctions_to_plot
      • OntologyType
      • OntologyTerm
      • from_curie
      • from_curies
      • AggregationType
      • TrackData
        • bin_index
        • change_resolution
        • copy
        • downsample
        • filter_to_negative_strand
        • filter_to_nonnegative_strand
        • filter_to_nonpositive_strand
        • filter_to_observed
        • filter_to_positive_strand
        • filter_to_stranded
        • filter_to_unstranded
        • filter_tracks
        • groupby
        • pad
        • resize
        • reverse_complement
        • select_tracks_by_index
        • select_tracks_by_name
        • slice_by_interval
        • slice_by_positions
        • upsample
        • with_metadata_column
        • with_name_suffix
      • concat
      • interleave
      • GeneExpressionData
        • copy
        • filter_to_negative_strand
        • filter_to_nonnegative_strand
        • filter_to_nonpositive_strand
        • filter_to_observed
        • filter_to_positive_strand
        • filter_to_protein_coding
        • filter_to_stranded
        • filter_to_unstranded
        • filter_tracks
        • get_genes_as_intervals
        • resize
        • select_tracks_by_index
        • slice_by_interval
        • to_anndata
        • with_metadata_column
        • with_name_suffix
      • concat
      • Transcript
        • fix_truncation
        • from_gtf_df
        • offset_in_cds
      • TranscriptExtractor
        • cache_transcripts
        • extract
    • Interpretation
      • ism_variants
      • ism_matrix
      • tile_interval
      • score_enhancers
      • get_active_enhancers
      • assign_consensus_enhancers
    • Visualization
      • seqlogo
      • plot_contact_map
      • plot_track
      • plot_tracks
      • sashimi_plot
      • enhancer_arcs_plot
      • pad_track
      • plot
      • AbstractComponent
        • get_ax_height
        • plot_ax
      • Tracks
        • get_ax_height
        • plot_ax
      • OverlaidTracks
        • get_ax_height
        • plot_ax
      • ContactMaps
        • get_ax_height
        • plot_ax
      • ContactMapsDiff
        • get_ax_height
        • plot_ax
      • GeneExpression
        • get_ax_height
        • plot_ax
      • OverlaidGeneExpression
        • get_ax_height
        • plot_ax
      • TranscriptAnnotation
        • get_ax_height
        • plot_ax
      • SeqLogo
        • get_ax_height
        • plot_ax
      • Sashimi
        • get_ax_height
        • plot_ax
      • FeatureContribution
        • get_ax_height
        • plot_ax
      • ScoreBar
        • get_ax_height
        • plot_ax
      • EnhancerArcs
        • get_ax_height
        • plot_ax
      • EmptyComponent
        • get_ax_height
        • plot_ax
      • AbstractAnnotation
        • add_label
        • plot_ax
        • plot_labels
      • IntervalAnnotation
        • add_label
        • plot_ax
        • plot_labels
      • VariantAnnotation
        • add_label
        • plot_ax
        • plot_labels
      • TranscriptStyle
      • TranscriptStylePreset
      • plot_transcripts
      • draw_interval
      • draw_transcript
  • FAQs
  • Resources
  • References
  • Community
  • Colab logo Colab
  • .ipynb

Navigating data ontologies

Contents

  • Setup and imports
  • Interactively view output metadata
    • How many tracks are there per output type?

Navigating data ontologies#

Note

This notebook uses the legacy AlphaGenome 1 API (alphagenome.models.v1). For AlphaGenome 2 (alphagenome.models.v2), see 1. Choosing a condition and Migrating from AlphaGenome 1.

Tip

Open this tutorial in Google Colab for interactive viewing.

# @title Install AlphaGenome

# @markdown Run this cell to install AlphaGenome.
from IPython.display import clear_output
! pip install alphagenome
clear_output()

Setup and imports#

from alphagenome import colab_utils
from alphagenome.models.v1 import dna_client
from google.colab import data_table
import pandas as pd

data_table.enable_dataframe_formatter()

Interactively view output metadata#

First, we load the model.

dna_model = dna_client.create(colab_utils.get_api_key())

output_metadata = dna_model.output_metadata(
    dna_client.Organism.HOMO_SAPIENS
).concatenate()

Click Filter on the upper right hand side of the interactive dataframe and type a cell or tissue name like “brain” into the Search by all fields box to find the ontology_curie term corresponding to a tissue and output type of interest:

output_metadata
name strand Assay title ontology_curie biosample_name biosample_type biosample_life_stage data_source endedness genetically_modified nonzero_mean output_type gtex_tissue histone_mark transcription_factor
0 CL:0000084 ATAC-seq . ATAC-seq CL:0000084 T-cell primary_cell adult encode paired False 0.739741 OutputType.ATAC NaN NaN NaN
1 CL:0000100 ATAC-seq . ATAC-seq CL:0000100 motor neuron in_vitro_differentiated_cells adult encode paired False 0.273136 OutputType.ATAC NaN NaN NaN
2 CL:0000236 ATAC-seq . ATAC-seq CL:0000236 B cell primary_cell adult encode paired False 4.700081 OutputType.ATAC NaN NaN NaN
3 CL:0000623 ATAC-seq . ATAC-seq CL:0000623 natural killer cell primary_cell adult encode paired False 0.938715 OutputType.ATAC NaN NaN NaN
4 CL:0000624 ATAC-seq . ATAC-seq CL:0000624 CD4-positive, alpha-beta T cell primary_cell adult encode paired False 4.365206 OutputType.ATAC NaN NaN NaN
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
7 ENCSR182QNJ - PRO-cap EFO:0001099 Caco-2 cell_line NaN encode NaN False 14.002803 OutputType.PROCAP NaN NaN NaN
8 ENCSR740IPL - PRO-cap EFO:0002067 K562 cell_line NaN encode NaN False 15.765458 OutputType.PROCAP NaN NaN NaN
9 ENCSR797DEF - PRO-cap EFO:0002819 Calu3 cell_line NaN encode NaN False 12.281321 OutputType.PROCAP NaN NaN NaN
10 ENCSR801ECP - PRO-cap CL:0002618 endothelial cell of umbilical vein primary_cell NaN encode NaN False 13.973692 OutputType.PROCAP NaN NaN NaN
11 ENCSR860TYZ - PRO-cap EFO:0001200 MCF 10A cell_line NaN encode NaN False 8.229502 OutputType.PROCAP NaN NaN NaN

5563 rows × 15 columns

How many tracks are there per output type?#

# Count human tracks
human_tracks = (
    dna_model.output_metadata(dna_client.Organism.HOMO_SAPIENS)
    .concatenate()
    .groupby('output_type')
    .size()
    .rename('# Human tracks')
)

# Count mouse tracks
mouse_tracks = (
    dna_model.output_metadata(dna_client.Organism.MUS_MUSCULUS)
    .concatenate()
    .groupby('output_type')
    .size()
    .rename('# Mouse tracks')
)

pd.concat([human_tracks, mouse_tracks], axis=1).astype(pd.Int64Dtype())
# Human tracks # Mouse tracks
output_type
OutputType.ATAC 167 18
OutputType.CAGE 546 188
OutputType.DNASE 305 67
OutputType.RNA_SEQ 667 173
OutputType.CHIP_HISTONE 1116 183
OutputType.CHIP_TF 1617 127
OutputType.SPLICE_SITES 4 4
OutputType.SPLICE_SITE_USAGE 734 180
OutputType.SPLICE_JUNCTIONS 367 90
OutputType.CONTACT_MAPS 28 8
OutputType.PROCAP 12 <NA>

Note that PROCAP outputs are not available for mouse.

Contents
  • Setup and imports
  • Interactively view output metadata
    • How many tracks are there per output type?

By Google LLC

© Copyright 2024, Google LLC.