Create Sequence Chromatogram from Data Frame
1
0
Entering edit mode
17 months ago

Hello!

I have information of a sequence in this data frame:

enter image description here

I would like to make a Seq chromatogram like this:

test

Edited by GenoMax : Since the chromatogram image was not showing up in final display (it showed up in edit preview) I am including a screencap of what OP had included as an embedded image.

chromat

I didn't find any tutorial.

Thanks!

nucleotide graph sequencing chromatogram sequence • 641 views
ADD COMMENT
0
Entering edit mode

I think this function in R should be of some help: https://rdrr.io/bioc/sangerseqR/man/chromatogram.html .

ADD REPLY
0
Entering edit mode
17 months ago

Can you please elaborate what you want to achieve with this type of plot?

A very primitive approach would be something like shown here:

# simulate some data
seqdata <- as.data.frame(matrix(rbinom(200,1,0.25),ncol=4))
colnames(seqdata) <- c("A","C","G","T")
seqdata[,"pos"] <- as.numeric(rownames(seqdata))

# plot
library(tidyverse)
seqdata  %>% gather("base", "count", -pos) %>% filter(count > 0) %>% ggplot(aes(x=pos,color=base)) + geom_density(adjust=1/dim(seqdata)[1]) + facet_grid(base~.)

However, this just represents an ideal chromatogram. A real one measured one by capillary electrophoresis would exhibit e.g. noise at the start, broad merged peaks at base repeats, a decreasing signal towards the end etc.

ADD COMMENT

Login before adding your answer.

Traffic: 2670 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