Add aa sites altered by SNPs
1
0
Entering edit mode
@tiphaine-martin-6416
Last seen 5.5 years ago
France

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 • 784 views
ADD COMMENT
1
Entering edit mode
Paul Brennan ▴ 10
@paul-brennan-14301
Last seen 5.2 years ago
Cardiff, UK

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 COMMENT

Login before adding your answer.

Traffic: 831 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6