Skip to content

Commit

Permalink
Adding files
Browse files Browse the repository at this point in the history
  • Loading branch information
adeschen committed Aug 24, 2018
1 parent b0cdc0b commit 3b3e8ef
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 1 deletion.
17 changes: 17 additions & 0 deletions CNVMetrics.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 4
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
19 changes: 19 additions & 0 deletions R/CNVMetrics.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#' CNVMetrics: Copy number variant metrics
#'
#' This package implements metrics to facilite copy number variant
#' comparison among samples and/or methods.
#'
#' @docType package
#'
#' @name CNVMetrics-package
#'
#' @aliases CNVMetrics-package CNVMetrics
#'
#' @author Astrid Deschênes and
#' Pascal Belleau
#'
#' Maintainer:
#' Astrid Deschenes <[email protected]>
#'
#' @keywords package
NULL
41 changes: 41 additions & 0 deletions R/readFiles.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#' @param filepath a \code{character} string, the path to the file to
#' read. Alternatively can be a connection.
#'
#' @param uniqueTag a \code{character} string, the unique name assigned to
#' the segment data associated to this file. Each imported file should
#' have a unique tag.
#'
#' @param header a \code{logical}, when \code{TRUE}, the
#' file has a header that should not be imported. Default: \code{FALSE}.
#'
#' @return a \code{GRanges} containing the segment information from the file.
#'
#' @examples
#'
#' # TODO
#'
#' @author Astrid Deschenes, Pascal Belleau
#' @importFrom GenomicRanges GRanges
#' @export
readSEGFile <- function(filepath, uniqueTag, header=FALSE) {

if (!is.character(uniqueTag)) {
stop("uniqueTag must be a character string.")
}

if (!is.logical(header)) {
stop("header must be a logical value.")
}

data <- read.table(filepath, header=header)

if (nrow(data) < 6) {
stop("The segment file must have at least 6 columns.")
}

dataRanges <- GRanges(seqnames = data$V2,
ranges=IRanges(start=data$V3, end=data$V4),
score=data$V6, source=uniqueTag)

return(dataRanges)
}
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@

# CNVMetrics
R Package to compare copy number variant (CNV) results from multiple samples

A R package to compare copy number variant (CNV) results from multiple samples/methods.


## Authors ##

[Astrid Desch&ecirc;nes](http://ca.linkedin.com/in/astriddeschenes "Astrid Desch&ecirc;nes") and
[Pascal Belleau](http://ca.linkedin.com/in/pascalbelleau "Pascal Belleau")


## License ##

This package and the underlying CNVMetrics code are distributed under
the Artistic license 2.0. You are free to use and redistribute this software.

For more information on Artistic 2.0 License see
[http://opensource.org/licenses/Artistic-2.0](http://opensource.org/licenses/Artistic-2.0)

0 comments on commit 3b3e8ef

Please sign in to comment.