Title: | Visualize Transcript Structures in Elegant Way |
Version: | 0.0.2 |
Description: | To visualize the gene structure with multiple isoforms better, I developed this package to draw different transcript structures easily. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.1 |
Imports: | cowplot, dplyr, ggplot2, purrr, magrittr, ggarchery, geomtextpath, stats |
Depends: | R (≥ 3.5.0), tidyverse |
URL: | https://github.com/junjunlab/transPlotR |
BugReports: | https://github.com/junjunlab/transPlotR/issues |
LazyData: | true |
NeedsCompilation: | no |
Packaged: | 2022-08-29 02:02:39 UTC; admin |
Author: | Junjun Lao |
Maintainer: | Junjun Lao <3219030654@stu.cpu.edu.cn> |
Repository: | CRAN |
Date/Publication: | 2022-08-30 12:20:02 UTC |
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
Arguments
lhs |
A value or the magrittr placeholder. |
rhs |
A function call using the magrittr semantics. |
Value
The result of calling rhs(lhs)
.
This is a test data for this package test data describtion
Description
This is a test data for this package test data describtion
Usage
gtf
Format
An object of class data.frame
with 1987 rows and 31 columns.
Author(s)
Junjun Lao
trancriptVis
Description
This package is to visualize gene diffrent isoforms.
Arguments
gtfFile |
GTF file. |
gene |
Target gene to plot. |
myTranscript |
Specify which transcripts to plot use transcipt id. |
Chr |
Chromosome number. |
posStart |
Region start position on genome. |
posEnd |
Region end position on genome. |
collapse |
Whether to collapse multiple transcripts into one, default(FALSE). |
exonWidth |
Exon width to plot, default(0.3). |
relTextDist |
Transcripts name or gene name relative to exon, default(0.3). |
intronSize |
Intron line size, default(0.5). |
arrowBreak |
How many gap distance to draw arrows, the smaller the more arrows, default(0.15). |
exonColorBy |
Whether color group by "transcript_id" or "gene_name", default(NULL). |
exonFill |
Exon fill color, default('#333399'). |
circle |
Whether make plot into a circle plot, default(FALSE). |
cicStart |
Circle plot start position, default(pi). |
circSegCol |
Circle sgement color, default('#333399'). |
text_only |
When circle plot labeled by gene name, whether remove the line connected with gene name, default(FALSE). |
ylimLow |
The Y axis lower limitation of Circle plot, default(-10). |
openAngle |
The gap of the circle plot, default(0.5). |
arrowCol |
Normal arrow color, default('#333399'). |
arrowAngle |
Normal arrow angle, default(30). |
arrowLength |
Normal arrow length, default(0.1). |
arrowType |
Normal arrow type, default('open'). |
addNormalArrow |
Whether add normal arrow on plot, default(TRUE). |
newStyleArrow |
Whether add new style arrow on plot, default(FALSE). |
absSpecArrowLen |
Whether make new style arrow length to be relative to each transcript length or absolute length to the longest transcript, default(FALSE). |
speArrowRelPos |
The relative position to the transcript on horizontal direction of new style arrow, default(0). |
speArrowRelLen |
The relative length to the transcript length of new style arrow, default(0.05). |
speArrowStart |
The new style arrow start position on the vertical direction, default(-0.15). |
speArrowRelHigh |
The relative height of new style arrow to the vertical length, default(2). |
speArrowLineSize |
The new style arrow line size, default(0.5). |
speArrowCol |
The new style arrow line color, default('black'). |
speArrowAngle |
The new style arrow angle, default(30). |
speArrowLen |
The new style arrow length, default(0.1). |
speArrowType |
The new style arrow type, default('closed'). |
textLabel |
The text label aesthetic mappings, default('transcript_id'). |
textLabelSize |
The text label size, default(5). |
textLabelColor |
The text label color, default('black'). |
base_size |
Theme basesize, default(14). |
marginX |
Plot left and right margins, default(0.2). |
marginY |
Plot top and bottomn margins, default(0.2). |
aspect.ratio |
Plot ratio, default(NULL). |
facetByGene |
Whether facet by gene to plot, this useful for your genes which are far away from each other or not located on the same chromosome, default(FALSE). |
ncolGene |
The column numbers to plot, default(NULL). |
scales |
Facet plot scales, same as "facet_wrap" function, default('free'). |
strip.position |
Facet plot strip.position, same as "facet_wrap" function, default('top'). |
forcePosRel |
Whether force the genome coordinate to relative position to transcript start/end position, default('FALSE'). |
panel.spacing |
Facet plot panel space, default(0.3). |
revNegStrand |
Whether reverse the negtive strand when set "forcePosRel=TRUE", default('FALSE'). |
Value
A ggplot object.
Author(s)
Junjun Lao
Examples
##############################################################
# test function
########################################################
# load data
data(gtf)
# non-coding gene
trancriptVis(gtfFile = gtf,
gene = 'Xist')
# coding gene
trancriptVis(gtfFile = gtf,
gene = 'Nanog')
# change fill color
trancriptVis(gtfFile = gtf,
gene = 'Nanog',
exonFill = '#CCFF00')
# change inrton line size
trancriptVis(gtfFile = gtf,
gene = 'Nanog',
intronSize = 1)
# change label size,color and position
trancriptVis(gtfFile = gtf,
gene = 'Nanog',
textLabelSize = 4,
textLabelColor = 'red',
relTextDist = 0)
# aes by gene name
trancriptVis(gtfFile = gtf,
gene = 'Nanog',
textLabel = 'gene_name')
# color aes by transcript
trancriptVis(gtfFile = gtf,
gene = 'Tpx2',
exonColorBy = 'transcript_id')
# change arrow color and type
trancriptVis(gtfFile = gtf,
gene = 'Nanog',
arrowCol = 'orange',
arrowType = 'closed')
# no intron gene and add arrow color
# change arrow color and type
trancriptVis(gtfFile = gtf,
gene = 'Jun',
textLabel = 'gene_name',
arrowCol = 'white',
arrowType = 'closed') +
theme_void()
# add arrow breaks
trancriptVis(gtfFile = gtf,
gene = 'Nanog',
arrowCol = 'orange',
arrowType = 'closed',
arrowBreak = 0.1)
# draw specific transcript
p1 <- trancriptVis(gtfFile = gtf,
gene = 'Commd7')
p2 <- trancriptVis(gtfFile = gtf,
gene = 'Commd7',
myTranscript = c('ENSMUST00000071852','ENSMUST00000109782'))
# combine
cowplot::plot_grid(p1,p2,ncol = 2,align = 'hv')