Knowledge base

Sushi package draws gene structure diagram

Introduction

The plotGenes of the Sushi package can plot gene structures, such as the visualization of several transcriptome structures.

Code explanation

Input
  • bed format data frame
head(Sushi_genes.bed)

 The structure is as follows

chrom    start     stop  gene score strand1 
chr15 73017309 73017438 COX5A     .     - 
chr15 72999672 72999836 COX5A     .     - 
chr15 73003042 73003164 COX5A     .     - 
chr15 73006160 73006281 COX5A     .     - 
chr15 73008510 73008626 COX5A     .     -
Sushi_transcripts.bed[1:20,]

  The structure is as follows

  chrom start stop gene score strand type
 chr15 73062668 73062770 ENST00000362710 0.000000 -1 exon
 chr15 73097788 73097929 ENST00000361900 0.000000 1 exon
 chr15 73097264 73097365 ENST00000361900 0.000000 1 exon
 chr15 73095987 73096143 ENST00000361900 0.000000 1 exon
 chr15 73092071 73092199 ENST00000361900 0.000000 1 exon
 chr15 73091234 73091240 ENST00000361900 0.000000 1 exon
 chr15 73017309 73017408 ENST00000322347 31.488695 -1 exon
 chr15 73006160 73006281 ENST00000322347 31.488695 -1 exon 
Code example
library('Sushi')  # Load Sushi包

Sushi_data = data(package ='Sushi') # List Sushi own data
data(list = Sushi_data$results[,3]) # Load data

chrom = "chr15"
chromstart  = 72998000
chromend = 73020000

 pg = plotGenes(Sushi_genes.bed,chrom,chromstart,chromend,
   types=Sushi_genes.bed$type,maxrows=1,bheight=0.2,
   plotgenetype="arrow",bentline=FALSE,labeloffset=.4,
   fontsize=1.2,arrowlength = 0.025,labeltext=TRUE)
   # Because our typse input is Sushi_genes.bed$type, which is actually NULL, the default "exon" will be used, and exon and utr are optional

 labelgenome( chrom, chromstart,chromend,n=3,scale="Mb")  #Add genome coordinates

plotgenetype="box" can display the area whose type is exon and utr in the form of box

library('Sushi')  # Load Sushi bag

Sushi_data = data(package ='Sushi') # List Sushi's own data
data(list = Sushi_data$results[,3]) # Load data

chrom = "chr15"
chromstart = 72965000
chromend = 72990000

pg = plotGenes(Sushi_transcripts.bed,chrom,chromstart,chromend ,
types = Sushi_transcripts.bed$type,
colorby=log10(Sushi_transcripts.bed$score+0.001),
colorbycol= SushiColors(5),colorbyrange=c(0,1.0),
labeltext=TRUE,maxrows=50,height=0.4,plotgenetype="box")
# colorby is the column that specifies the color change, and colorbycol is the color palette that specifies the color change

labelgenome( chrom, chromstart,chromend,n=3,scale="Mb") #Add genome coordinates

addlegend(pg[[1]],palette=pg[[2]],title="log10(FPKM)",side="right",
bottominset=0.4,topinset=0,xoffset=-.035,labelside="left",
width=0.025,title.offset=0.055)  #Add legend

Reference

https://www.bioconductor.org/packages/release/bioc/vignettes/Sushi/inst/doc/Sushi.pdf

Leave a Reply

Your email address will not be published. Required fields are marked *

Close Bitnami banner
Bitnami