-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functions to plot copy number segments #15
Comments
CopyNumberPlots is based on karyoploteR and it inherits it's flexibility, so I'm convinced it would be possible to plot pretty much anything you'd need :) Can you post an example of what you're trying to accomplish? or a hand drawing or similar? I can try to help you with that |
I made a PoC by "tricking" the existing functions: segment_bins = loadSNPData("bins.seg", chr.col="chr", start.col="start", end.col="end", lrr.col="logR", genome="hg38")
segment_cn = loadCopyNumberCallsSeg("calls.seg", chr.col="chr", start.col="start", end.col="end", segment.value.col="median", genome="hg38")
kp = plotKaryotype(plot.type=5, genome="hg38", chromosomes=c(paste0("chr", 1:22), "chrX"), cex=0.7)
plotLRR(kp, snps=segment_bins ymin=-2, ymax=2, labels="log2ratio", points.cex=0.4)
# Notice how I used the cn.column parameter below
plotCopyNumberCallsAsLines(kp, cn.calls=segment_cn style="segments", r=0, r1=1, cn.column="segment.value", ymin=-2, ymax=2, col="#fd0002", add.axis=F, labels=NA,lwd=4) Which gives, with my data: |
Hi @lbeltrame I was going to suggest you to dom just what you did! So it's possible to create the plot with CopyNumberPlots. How else you'd have expected the system to work? A different function for the segments? (you can use directly karyoploteR::kpSegments so it'd feel less as tricking the functions) |
I actually had issues with If you think this is the way to go, perhaps a mention in the documentation would suffice: these types of plots are quite used to see if segmentation is fine (and also for comparison purposes since karyotypeR is very flexible in this regard). |
Ok! It might make sense to create a specific function for that. It could even compute the median If you keep having issues with kpSegments just ask :) |
Currently you can plot either calls, or raw log2ratios. You can't, however, plot segments on top of the log2ratio raw data with the currently available functions.
The text was updated successfully, but these errors were encountered: