if (FALSE) {
# suggestion to visualize dup.validate output
library(ggplot2)
library(dplyr)
dvs<-dupGet(alleleINF,test=c("z.05","chi.05"))
dvd<-dup.validate(dvs,window.size = 1000)
# Example data frame
df <- data.frame(dvd[,3:5])
df$cnv.ratio<-as.numeric(df$cnv.ratio)
# Calculate midpoints
df <- df %>%
mutate(midpoint = (start + end) / 2)
ggplot() +
# Horizontal segments for each start-end range
geom_segment(data = df, aes(x = start, xend = end,
y = cnv.ratio, yend = cnv.ratio), color = "blue") +
# Midpoints line connecting midpoints of each range
geom_path(data = df, aes(x = midpoint, y = cnv.ratio), color = "red") +
geom_point(data = df, aes(x = midpoint, y = cnv.ratio), color = "red") +
# Aesthetic adjustments
theme_minimal() +
labs(title = "CNV Ratio along a Continuous Axis with Midpoint Fluctuation",
x = "Genomic Position",
y = "CNV Ratio")
}
Run the code above in your browser using DataLab