if(interactive()) {
# Get the gene for 'tp53'
gene = symbolToGene( 'tp53' )
# And the transcripts for this gene
transcripts = geneToTranscript( symbolToGene( 'tp53' ) )
# And the proteins for this transcript
proteins = transcriptToProtein( transcripts )
# get the transcript coords for the transcripts of this gene, at the start of this gene
genomeToTranscriptCoords( start( gene ), transcripts, as.vector=TRUE )
#Returns a vector:
# ENST00000413465 ENST00000359597 ENST00000504290 ENST00000510385 ENST00000504937
# 1018 NA NA NA NA
# ENST00000269305 ENST00000455263 ENST00000420246 ENST00000445888 ENST00000396473
# NA NA NA NA NA
# ENST00000545858 ENST00000419024 ENST00000509690 ENST00000514944 ENST00000505014
# NA NA NA NA NA
# ENST00000414315 ENST00000508793 ENST00000503591
# NA NA NA
# With as.vector=FALSE
genomeToTranscriptCoords( start( gene ), transcripts )
# RangedData with 1 row and 1 value column across 1 space
# space ranges | coord.space
# <character> <IRanges> | <character>
# 1 ENST00000413465 [1018, 1018] | transcript
genomeToProteinCoords( start( gene ), proteins, as.vector=TRUE )
# ENSP00000410739 ENSP00000352610 ENSP00000269305 ENSP00000398846 ENSP00000391127
# 340 NA NA NA NA
# ENSP00000391478 ENSP00000379735 ENSP00000437792 ENSP00000402130 ENSP00000425104
# NA NA NA NA NA
# ENSP00000423862 ENSP00000394195 ENSP00000424104 ENSP00000426252
# NA NA NA NA
# With as.vector=FALSE
genomeToProteinCoords( start( gene ), proteins )
# RangedData with 1 row and 2 value columns across 1 space
# space ranges | frame coord.space
# <character> <IRanges> | <numeric> <character>
# 1 ENSP00000410739 [340, 340] | 0 protein
}
Run the code above in your browser using DataLab