Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sbgtengfei committed Jul 15, 2015
1 parent 88d16b9 commit 1ae2fee
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 2 deletions.
68 changes: 68 additions & 0 deletions R/00-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ setListClass <- function(elementType = NULL, suffix = "List",
}
}



## Function from IRanges
.dotargsAsList <- function(...) {
listData <- list(...)
Expand Down Expand Up @@ -95,3 +97,69 @@ addIdNum <- function(x){
return(x)
}
}

## ## How to de-bioc dependencies
## ## to do define a
## ## Acknowledgement to S4 vectors, to reduce the dependency, use simple approach
## ## So far I only need things:
## ## 1. validation of types
## ## 2. lappy



## SList <- setRefClass("SList",
## fields = list(elementType = "character",
## listData = "list"))

## setMethod("lapply", "SList",
## function(X, FUN, ...)
## lapply(as.list(X), FUN = FUN, ...))

## setMethod("length", "SList", function(x) length(as.list(x)))

## setMethod("names", "SList", function(x) names(as.list(x)))

## setReplaceMethod("names", "SimpleList",
## function(x, value) {
## names(x@listData) <- value
## x
## })

## setListClass <- function(elementType = NULL, suffix = "List",
## contains = NULL, where = topenv(parent.frame())){
## stopifnot(is.character(elementType))
## name <- paste0(elementType, suffix)
## res <- setRefClass(name, contains = c("SList", contains),
## where = where)
## ## setMethod("show", name, function(object){
## ## lapply(object, show)
## ## })
## function(...){
## x <- .dotargsAsList(...)
## ## validation
## if (!is.list(x))
## stop("'x' must be a list")
## if (is.array(x)) {
## tmp_names <- names(x)
## dim(x) <- NULL
## names(x) <- tmp_names
## }
## class(x) <- "list"
## if (!all(sapply(x,
## function(xi)
## extends(class(xi),
## elementType))))
## stop("all elements in 'x' must be ", elementType,
## " objects")
## res(elementType = elementType, listData = x)
## }
## }

## A <- setClass("A", slots = list(x = "character", y = "numeric"))
## a <- A(x = "a", y = 123)

## AList <- setListClass("A")
## AList()$elementType
## lapply(AList(a, a, a), is)


16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Reference please check

Please pay attention that the github project name is **NOT** `cwl`, but `cwl.R'

### From github
#### From github
Directly install from github, need to install Bioc dependency first.

```{r}
Expand All @@ -19,7 +19,7 @@ biocLite("S4Vectors")
library(devtools)
install_github('tengfei/cwl.R')
```
### From Bioconductor
#### From Bioconductor

When it's on Bioconductor, to install released version

Expand All @@ -35,3 +35,15 @@ source("http://bioconductor.org/biocLite.R")
useDevel()
biocLite("cwl")
```

## Use the package
To load the pacakges
```{r}
library(cwl)
```

To read the vignette
```{r}
vignette("cwl-intro")
```

File renamed without changes.

0 comments on commit 1ae2fee

Please sign in to comment.