forked from lima1/PureCN
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/PureCN@119121 bc3139a8-67e5-0310-9ffc-ced21a209358
- Loading branch information
Showing
5 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
library(rtracklayer) | ||
library(data.table) | ||
library(PureCN) | ||
|
||
data(chr.hash) | ||
mySession <- browserSession("UCSC") | ||
genomes <- c("hg18", "hg19", "hg38") | ||
centromeres <- list() | ||
|
||
for (genome in genomes) { | ||
genome(mySession) <- genome | ||
if (genome == "hg38") { | ||
tbl.gaps <- getTable( ucscTableQuery(mySession,track="Centromeres", | ||
table="centromeres")) | ||
} else { | ||
tbl.gaps <- getTable( ucscTableQuery(mySession, track="Gap", | ||
table="gap")) | ||
tbl.gaps <- tbl.gaps[tbl.gaps$type=="centromere",] | ||
} | ||
tbl.gaps.dt <- data.table(tbl.gaps) | ||
tbl.centromeres <- as.data.frame(tbl.gaps.dt[, | ||
list(chromStart=min(chromStart),chromEnd=max(chromEnd)),by=chrom]) | ||
centromeres[[genome]] <- tbl.centromeres | ||
} | ||
|
||
centromeres <- lapply(centromeres, function(x) { | ||
x$chromNumerical <- chr.hash$number[match(x$chrom, chr.hash$chr)] | ||
x[order(x$chromNumerical),1:3] | ||
}) | ||
|
||
save(centromeres, file="data/centromeres.rda", compress="xz") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
\name{centromeres} | ||
\alias{centromeres} | ||
\docType{data} | ||
\title{ | ||
A list of data.frames containing centromere positions. | ||
} | ||
\description{ | ||
A list of data.frames containing centromere positions for hg18, hg19 and hg38. | ||
Downloaded from the UCSC genome browser. | ||
} | ||
\usage{data(centromeres)} | ||
\value{ | ||
A list with three data frames, "hg18", "hg19", and "hg38". Each containes | ||
three columns | ||
\describe{ | ||
\item{\code{chrom}}{a factor with levels \code{chr1} \code{chr10} \code{chr11} \code{chr12} \code{chr13} \code{chr14} \code{chr15} \code{chr16} \code{chr17} \code{chr18} \code{chr19} \code{chr2} \code{chr20} \code{chr21} \code{chr22} \code{chr3} \code{chr4} \code{chr5} \code{chr6} \code{chr7} \code{chr8} \code{chr9} \code{chrX} \code{chrY}} | ||
\item{\code{chromStart}}{a numeric vector} | ||
\item{\code{chromEnd}}{a numeric vector} | ||
} | ||
} | ||
\references{ | ||
The script downloadCentromeres.R in the extdata directory was used to generate | ||
the data.frames. | ||
} | ||
\examples{ | ||
data(centromeres) | ||
} | ||
\keyword{datasets} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters