BlastCoordPlotly: Compute the elements that represent the blast configuration...

Description Usage Arguments Value Examples

View source: R/BlastCoordPlotly.R

Description

Compute the elements that represent the blast configuration for a interactive plotly graph

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
BlastCoordPlotly(
  QuerySeqId,
  QueryLength,
  QueryStart,
  QueryEnd,
  SubjectSeqId,
  SubjectStart,
  SubjectEnd,
  SubjectLength,
  Length,
  Height = 0.5,
  Step = 10,
  LineDots = 100
)

Arguments

QuerySeqId

Name of the query (submitted sequence)

QueryLength

Length of the query (full length not the mapped part)

QueryStart

Beggining postition of the matching part in the query

QueryEnd

Ending position of the matching part in the query

SubjectSeqId

Name of the subject (reference sequence)

SubjectStart

Beggining postition of the matching part in the subject

SubjectEnd

Ending position of the matching part in the subject

SubjectLength

Length of the query (full length not the mapped part)

Length

Length of the matching part between subject and query

Height

height of the widget

Step

fraction of the gap between the shared parts and the specific parts

LineDots

inneer graduation set in AA

Value

List of Dataframes for a plotly graph

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
library(plotly)
library(viridisLite)
BlastPalette<-viridis(3)
R_FilePath <- system.file("extdata",
 "blast_rescue.example.txt",
  package = "isoformnspectRe")
Rescue<-read.table(
 R_FilePath,
 header=TRUE)
 Infos <- Rescue[1,]
 DFs <- BlastCoordPlotly(Infos$QuerySeqId, Infos$QueryLength, Infos$QueryStart,
 Infos$QueryEnd, Infos$SubjectSeqId, Infos$SubjectStart, Infos$SubjectEnd,
 Infos$SubjectLength, Infos$Length)
 names(BlastPalette) <- c(as.vector(Infos$QuerySeqId) ,
 paste( as.vector(Infos$QuerySeqId), "<br>", as.vector(Infos$SubjectSeqId), sep = "" ),
 as.vector(Infos$SubjectSeqId))
 P<-plotly::plot_ly()
 P <- plotly::add_trace(P,
 x = DFs$MatchBlock$x,
 y = DFs$MatchBlock$y,
 color = I(as.vector(BlastPalette[2])), type = "scatter", mode = "lines",
 fill = "toself", name = paste( as.vector(Infos$QuerySeqId), "<br>",
 as.vector(Infos$SubjectSeqId), sep = ""), hoverinfo="name",hoverlabel=list(namelength=-1))
 P
 P <- plotly::add_trace(P, x = DFs$SubjectBlock$x, y = DFs$SubjectBlock$y,
 color = I(as.vector(BlastPalette[3])), type = "scatter", mode = "lines", fill = "toself",
 name = Infos$SubjectSeqId, hoverinfo="name", hoverlabel=list(namelength=-1))
 P
 P <- plotly::add_trace(P, x = DFs$QueryBlock$x, y = DFs$QueryBlock$y,
 color = I(as.vector(BlastPalette[1])), type = "scatter", mode = "lines", fill = "toself",
  name = Infos$SubjectSeqId,
 hoverinfo="name", hoverlabel=list(namelength=-1))
 P
 P<-plotly::add_segments(P, x=~x, y=~y, xend=~xend, yend=~yend,
 hoverinfo="text", color=I(BlastPalette[3]), text=~text,
 data=DFs$SubjectConnectors)
 P
 P<-plotly::add_segments(P, x=~x, y=~y, xend=~xend, yend=~yend,
 hoverinfo="text", color=I(BlastPalette[1]), text=~text,
 data=DFs$QueryConnectors)
 P
 P<-plotly::hide_legend(P)
 P

47Lies/isoformnspectRe documentation built on May 29, 2021, 3 p.m.