Skip to content

Commit

Permalink
improved documentation - cidr input
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Lin authored and Paul Lin committed Aug 11, 2016
1 parent 1cc7aec commit e0cfd91
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
13 changes: 9 additions & 4 deletions R/CIDR.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
#' N=3 ## 3 cell types
#' k=50 ## 50 cells per cell type
#' sData <- scSimulator(N=N, k=k)
#' ## tags - the tag matrix
#' tags <- as.matrix(sData$tags)
#' cols <- c(rep("RED",k), rep("BLUE",k), rep("GREEN",k))
#' ## Standard principal component analysis.
#' ltpm <- log2(t(t(sData$tags)/colSums(sData$tags))*1000000+1)
#' ltpm <- log2(t(t(tags)/colSums(tags))*1000000+1)
#' pca <- prcomp(t(ltpm))
#' plot(pca$x[,c(1,2)],col=cols,pch=1,xlab="PC1",ylab="PC2",main="prcomp")
#' ## Use cidr to analyse the simulated dataset.
#' sData <- scDataConstructor(as.matrix(sData$tags))
#' ## The input for cidr should be a tag matrix.
#' sData <- scDataConstructor(tags)
#' sData <- determineDropoutCandidates(sData)
#' sData <- wThreshold(sData)
#' sData <- scDissim(sData)
Expand Down Expand Up @@ -89,7 +92,7 @@ setClass("scData", representation(tags="matrix",
#' Properties of the class include scalar, vector and matrix
#' data types necessary for the CIDR analysis - such as gene counts, library
#' sizes, thresholds, dropouts, and clustering data. Raw counts are converted
#' to log2 per million, normalised by dividing each gene count for a
#' to log2 per million, normalised by dividing each gene count for a
#' particular cell by the total count for all genes in that cell.
#'
#' @param tags a matrix of tags where the rows crrespond to features (genes, transcripts, etc) and the columns correspond to cells
Expand All @@ -100,8 +103,10 @@ setClass("scData", representation(tags="matrix",
#' N=3 ## 3 cell types
#' k=50 ## 50 cells per cell type
#' sData <- scSimulator(N=N, k=k)
#' ## The input for cidr should be a tag matrix.
#' tags <- as.matrix(sData$tags)
#' ## create a new scData object
#' sData <- scDataConstructor(as.matrix(sData$tags))
#' sData <- scDataConstructor(tags)
#' ## print the first 5 library sizes
#' sData@librarySizes[1:5]
#' ## print a portion of the data matrix of the class - contains raw tags
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ example("cidr")
#>
#> cidr> sData <- scSimulator(N=N, k=k)
#>
#> cidr> ## tags - the tag matrix
#> cidr> tags <- as.matrix(sData$tags)
#>
#> cidr> cols <- c(rep("RED",k), rep("BLUE",k), rep("GREEN",k))
#>
#> cidr> ## Standard principal component analysis.
#> cidr> ltpm <- log2(t(t(sData$tags)/colSums(sData$tags))*1000000+1)
#> cidr> ltpm <- log2(t(t(tags)/colSums(tags))*1000000+1)
#>
#> cidr> pca <- prcomp(t(ltpm))
#>
Expand All @@ -60,7 +63,8 @@ example("cidr")

#>
#> cidr> ## Use cidr to analyse the simulated dataset.
#> cidr> sData <- scDataConstructor(as.matrix(sData$tags))
#> cidr> ## The input for cidr should be a tag matrix.
#> cidr> sData <- scDataConstructor(tags)
#>
#> cidr> sData <- determineDropoutCandidates(sData)
#>
Expand Down
7 changes: 5 additions & 2 deletions man/cidr-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/scDataConstructor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e0cfd91

Please sign in to comment.