Question: Add aa sites altered by SNPs
0
gravatar for Tiphaine Martin
12 months ago by
France
Tiphaine Martin40 wrote:

Hi,

 

I would like to add in the plot which aa have mutations in my data with different colors if they alter the structure of my protein or not, like Pathogene, like pathogene from ClinVar.

How can I add easily new features with my choice of colors ?

Can we draw them below the plot of protein in not on the proteins also ?

Thanks,

Tiphaine

drawproteins • 175 views
ADD COMMENTlink modified 8 months ago by Paul Brennan10 • written 12 months ago by Tiphaine Martin40
Answer: Add aa sites altered by SNPs
1
gravatar for Paul Brennan
8 months ago by
Paul Brennan10
Cardiff, UK
Paul Brennan10 wrote:

Hello Tiphaine, Sorry for the slow response to this question. Yes you can easily add new features with your choice of colors and they can be added below or above the protein. There is some code here that shows how to plot variants: https://rforbiochemists.blogspot.com/2018/02/my-drawproteins-package-has-been.html To illustrate more of what is possible below is some code. Please see if it works. Feel free to email with question/comments (brennanpincardiff@gmail.com) or add as issues on Github (https://github.com/brennanpincardiff/drawProteins/issues/). Best wishes, Paul

library(drawProteins)
library(ggplot2)
# pulling down data for MYO7A
prot_data <- drawProteins::get_features("Q13402")
# produce data frame
prot_data <- drawProteins::feature_to_dataframe(prot_data)

# make protein schematic
p <- draw_canvas(prot_data)
p <- draw_chains(p, prot_data)
p

# take one amino acid as example...
x_ample <- prot_data[50,]
x_ample$type <- "SNP"

# check what's in x_ample
x_ample

# plot the protein chain...
p + geom_rect(data = x_ample,
    aes(xmin=begin,
    xmax=end,
    ymin=order-0.2,
    ymax=order+0.2),
  colour = "red"
)

# add protein variant above the chain as a yellow circle...
p + geom_point(data = x_ample,
    aes(x = begin,
      y = order+0.25),
  shape = 21,
  colour = "black",
  size = 10,
  fill = "yellow"
)

# add protein variant below the chain as a red triangle...
p + geom_point(data = x_ample,
  aes(x = begin,
    y = order-0.25),
  shape = 24,
  colour = "black",
  size = 10,
  fill = "red"
)

# duplicate the row...
x_ample[2,] <- x_ample[1,]
# change the location to what amino acid you want
x_ample[2,]$begin <- 1000
x_ample[2,]$end <- 1000

# plot both variants as diamonds below the chain...
p + geom_point(data = x_ample,
  aes(x = begin,
    y = order-0.25),
  shape = 23,
  colour = "black",
  size = 10,
  fill = "green"
)
ADD COMMENTlink modified 8 months ago • written 8 months ago by Paul Brennan10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 417 users visited in the last hour