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?
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?
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()
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Is there a reason why you don't want to use any bioconductor packages?
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.