Plotting transposons start and end positions
1
0
Entering edit mode
10.4 years ago

I have multiple transposons start and end positions in a chromosome.

I want to plot it. I want it without using any bioconductor packages.

Can anyone suggest me how to do?

R chromosome • 2.0k views
ADD COMMENT
0
Entering edit mode

Is there a reason why you don't want to use any bioconductor packages?

ADD REPLY
0
Entering edit mode

I have already plotted in my required scale some other plots without using any packages.

So I felt bit confusing integrating packages with the normal plots.

ADD REPLY
1
Entering edit mode
10.4 years ago

A very rudimentary R script might use plot() and segments():

#!/usr/bin/env Rscript

tpStarts  <- c(5, 10, 20, 25)
tpEnds    <- c(7, 14, 22, 28)
tpYIndex1 <- c(1,  2,  3,  4)
tpYIndex2 <- c(1,  2,  3,  4)
df <- data.frame(tpStarts, tpEnds, tpYIndex1, tpYIndex2)

pdf("graph.pdf", width=5, height=3)
plot(NA, xlim=c(min(df$tpStarts),max(df$tpEnds)), ylim=c(1,4), xlab="Transposon Position", ylab="Transposon Index")
segments(df$tpStarts, df$tpYIndex1, df$tpEnds, df$tpYIndex2, lwd=2)
dev.off()
ADD COMMENT
0
Entering edit mode

Thank you Alex . Is there any other way to get an enlarged view of the positions?

Since the positions looks a bit small in size.

ADD REPLY
0
Entering edit mode

You could edit the tpYIndex2 value to be something like c(1.5, 2.5, 3.5, 4.5), etc. also adjusting the ylim maximum to 4.5. You could also edit the lwd parameter upwards to draw thicker lines. Read the R docs on plot() and segments() to see what parameters you can adjust.

ADD REPLY
0
Entering edit mode

Thank you so much.

ADD REPLY

Login before adding your answer.

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