Skip to content

Instantly share code, notes, and snippets.

@lwaldron
Created February 27, 2018 22:06
Show Gist options
  • Save lwaldron/39554a07c6d1f052023490b24bd1e427 to your computer and use it in GitHub Desktop.
Save lwaldron/39554a07c6d1f052023490b24bd1e427 to your computer and use it in GitHub Desktop.
Comparing two exome sequencing capture kits
url1 <- "https://support.illumina.com/content/dam/illumina-support/documents/documentation/chemistry_documentation/samplepreps_nextera/nexterarapidcapture/nexterarapidcapture_exome_targetedregions.bed"
url2 <- "https://support.illumina.com/content/dam/illumina-support/documents/documentation/chemistry_documentation/samplepreps_nextera/nexterarapidcapture/nexterarapidcapture_expandedexome_targetedregions.bed"
library(rtracklayer)
rapidgr <- import(url1, genome="hg19")
expandedgr <- import(url2, genome="hg19")
library(GenomicRanges)
table(countOverlaps(rapidgr, expandedgr))
rapidgr <- rapidgr[countOverlaps(rapidgr, expandedgr) == 6]
expandedgr <- expandedgr[expandedgr %over% rapidgr]
session <- browserSession("UCSC")
track(session, "rapid") <- rapidgr
track(session, "expanded") <- expandedgr
browserView(session, range=rapidgr*0.75)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment