Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
^Makefile$
^coverage\.txt$
^coverage\.r$
^\.github$
^NEWS$
25 changes: 19 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
Package: ribiosExpression
Type: Package
Title: Expression Analysis with RibiosExpression
Title: Data Structures and Utilities for Gene Expression Analysis
Version: 1.3.5
Date: 2025-01-30
Authors@R:
person(given = "Jitao David",
family = "Zhang",
role = c("aut", "cre", "ctb"),
role = c("aut", "cre"),
email = "jitao_david.zhang@roche.com",
comment = c(ORCID="0000-0002-3085-0909"))
Description: Data structures and functions for expression analysis.
Depends: R (>= 3.5.0)
Description: Provides data structures and utility functions for gene expression
analysis. It includes the DesignContrast class for representing study
designs and contrasts used in differential expression analysis, functions
for importing and exporting expression data in GCT/CLS formats, tools for
probeset summarization and filtering, and interfaces to limma-based
differential gene expression workflows. The package works with Biobase
ExpressionSet objects and integrates with the limma framework.
Depends: R (>= 4.4.0)
Imports:
methods,
stats,
Expand All @@ -28,9 +33,17 @@ Imports:
openxlsx
Suggests:
testthat,
grid
grid,
BiocStyle,
knitr,
rmarkdown
License: GPL-3
Encoding: UTF-8
URL: https://github.com/bedapub/ribiosExpression
BugReports: https://github.com/bedapub/ribiosExpression/issues
biocViews: GeneExpression, DifferentialExpression, Microarray,
DataImport, Visualization
VignetteBuilder: knitr
RoxygenNote: 7.3.2
Collate:
'AllClasses.R'
Expand Down
175 changes: 175 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# Changes in ribiosExpression

## Changes in version 1.3.5

### Bioconductor preparation
- Added `biocViews` to DESCRIPTION.
- Added BiocStyle vignette.
- Updated R dependency to >= 4.4.0.
- Added `@return` tags to all exported functions.
- Fixed typos in documentation.
- Replaced `class(x) %in%` with `is.numeric()`.
- Converted NEWS to NEWS.md format.

## Changes in version 1.0-39

- `parseDesignContrast` adds new parameter `expSampleNames` to allow sample
name consistency check with input matrix.

## Changes in version 1.0-34

- `DesignContrast` prints error message if validity is violated.
- `parseDesignContrastFile` fixes a mistake of assigning group levels.
- `parseDesignContrastFile` now accepts the `dispLevelStr` option.

## Changes in version 1.0-33

- `parseDesignContrastStr` fixes two errors.

## Changes in version 1.0-32

- Add `DesignContrast` object.

## Changes in version 1.0-29

- Add new functionality in keepMaxMeanProbes.Rscript: able to read from .CHIP
file.
- keepMaxMeanProbes.Rscript now does not depend on the S4 class ExpressionSet
anymore, therefore much faster.

## Changes in version 1.0-28

- Debug keepMaxMeanProbes.Rscript: `extname` returns NA if not found, therefore
an additional check is added.

## Changes in version 1.0-27

- Function extension in `ChipFetcher2ExpressionSet`: now non-Affymetrix
probesets are supported as well.

## Changes in version 1.0-26

- The main body of `readCls` has been moved to `ribiosIO::read_cls`. `readCls`
becomes a synonym for compatibility.

## Changes in version 1.0-25

- Improvement in `readCls`: error messages provide more informative details for
mal-formatted files.

## Changes in version 1.0-24

- Bug fix in `writeEset`: expression matrix is written without quotes.
- New script: keepMaxMeanProbes.Rscript filters duplicated genes by taking the
one with maximum average expression.

## Changes in version 1.0-23

- Bug fix in `readGct`: if input feature names have duplicates, the exprs
matrix row names are changed.

## Changes in version 1.0-22

- Move exprsMat2gct.Rscript to the ribiosIO package.
- `writeGct` has been refactored for matrix in ribiosIO, and re-implemented as
an S4-method for matrix and ExpressionSet.

## Changes in version 1.0-21

- Add exprsMat2gct.Rscript to convert between expression matrix files and GCT
files.

## Changes in version 1.0-20

- `ChipFetcher2ExpressionSet`: add option orthologue.
- `keepMaxStatProbe` uses `function(x) mean(x, na.rm=TRUE)` as default
function.

## Changes in version 1.0-19

- limma2gsea.Rscript is updated.

## Changes in version 1.0-18

- Refactor GSEA-related functions that are not dependent on the Biobase data
structure to the ribiosGSEA package.

## Changes in version 1.0-17

- limma2gsea.Rscript guarantees no replicated gene symbols after orthologue
mapping.

## Changes in version 1.0-16

- Add limma2gsea.Rscript to inst/Rscript.

## Changes in version 1.0-15

- The ribiosAnnotation package has been removed from the dependency list.
- Add comp_diff.Rscript to inst/Rscript.

## Changes in version 1.0-14

- The deprecation message of `remainHighestVarProbe` and `keepHighestVarProbe`
have been updated.

## Changes in version 1.0-13

- The `rowscale` method warns if the input ExpressionSet does not have
'lockedEnvironment' as storageMode.

## Changes in version 1.0-12

- Low-level functions for computational drug repositioning refactored into
ribiosReposition.

## Changes in version 1.0-11

- Add feature in `summarizeProbesets`: option `keep.featureNames`.
- Rename and rewrite `sprintGmt` to `formatGmt` as S4 method.

## Changes in version 1.0-10

- Bugfix in `readEset` for numeric column names.
- Add `annotate` and `reannotate` methods.
- Add documentation for the `ribios.ExpressionSet` object.

## Changes in version 1.0-9

- Add `kendallW` function and `kendallWmat` S4-method.

## Changes in version 1.0-8

- PCA-related data structures and functions are refactored into the ribiosPCA
package.

## Changes in version 1.0-7

- Add `summarizeProbesets` to summarize probesets.
- NAMESPACE are now explicitly stated.

## Changes in version 1.0-6

- Add dependency on the ribiosAnnotation package.
- Add `writeEset` and `readEset` functions.
- `readFKdata` was renamed as `readFKtable`.

## Changes in version 1.0-5

- Add git version control.

## Changes in version 1.0-4

- Move data.frame and matrix functions to the ribiosUtils package.

## Changes in version 1.0-3

- Refactor `read_gct` into ribiosIO for efficiency.

## Changes in version 1.0-2

- Change `keepHighestVarProbe` to more generalized `keepMaxStatProbe`.

## Changes in version 1.0-1

- Remove the path option from the `readGctCls` function.
21 changes: 15 additions & 6 deletions R/AllGenerics.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ setGeneric("exprsToLong", function(x,...) standardGeneric("exprsToLong"))

#' Extract contrastNames from an object
#' @param object An object, see supported methods below
#' @return A character vector of contrast names
#' @aliases contrastNames,DesignContrast-method
#' @exportMethod contrastNames
setGeneric("contrastNames", function(object) standardGeneric("contrastNames"))

#' Extract design variable names from an object
#' @param object An object, see supported methods below
#' @return A character vector of variable names
#' @aliases designVariables,DesignContrast-method
#' @exportMethod designVariables
setGeneric("designVariables", function(object)
Expand All @@ -30,20 +32,23 @@ setGeneric("designVariables", function(object)
#' Extract sample groups from an object
#'
#' @param object An object, see supported methods below
#' @return A factor of sample groups
#' @exportMethod groups
#' @aliases groups,DesignContrast-method
setGeneric("groups", function(object) standardGeneric("groups"))

#' Extract displayed group labels from an object
#'
#' @param object An object, see supported methods below
#' @return A factor of display group labels
#' @exportMethod dispGroups
#' @aliases dispGroups,DesignContrast-method
setGeneric("dispGroups", function(object) standardGeneric("dispGroups"))

#' Extract the design matrix from an object
#'
#' @param object An object, see supported methods below
#' @return A numeric design matrix
#' @exportMethod designMatrix
#' @aliases designMatrix,DesignContrast-method
setGeneric("designMatrix", function(object) standardGeneric("designMatrix"))
Expand All @@ -52,13 +57,14 @@ setGeneric("designMatrix", function(object) standardGeneric("designMatrix"))
#'
#' @param object An object, see supported methods below
#' @param value Design matrix
#' @exportMethod `designMatrix<-`
#' @return The modified object
setGeneric("designMatrix<-", function(object, value) standardGeneric("designMatrix<-"))


#' Extract the contrast matrix from an object
#'
#' @param object An object, see supported methods below
#' @return A numeric contrast matrix
#' @exportMethod contrastMatrix
#' @aliases contrastMatrix,DesignContrast-method
setGeneric("contrastMatrix", function(object) standardGeneric("contrastMatrix"))
Expand All @@ -67,29 +73,31 @@ setGeneric("contrastMatrix", function(object) standardGeneric("contrastMatrix"))
#'
#' @param object An object, see supported methods below
#' @param value Contrast matrix
#' @exportMethod `contrastMatrix<-`
#' @return The modified object
setGeneric("contrastMatrix<-", function(object, value) standardGeneric("contrastMatrix<-"))


#' Extract the contrast annotation data.frame from an object
#'
#' @param object An object, see supported methods below
#' @return A data.frame annotating contrasts
#' @exportMethod contrastAnnotation
#' @aliases contrastAnnotation,DesignContrast-method
setGeneric("contrastAnnotation", function(object) standardGeneric("contrastAnnotation"))

#' Assign contrast annotaiton to an object
#' Assign contrast annotation to an object
#'
#' @param object An object, see supported methods below
#' @param value Contrast anaotation data.frame
#' @exportMethod `contrastAnnotation<-`
#' @param value Contrast annotation data.frame
#' @return The modified object
setGeneric("contrastAnnotation<-", function(object, value)
standardGeneric("contrastAnnotation<-"))


#' Extract the number of contrasts from an object
#'
#' @param object An object, see supported methods below
#' @return An integer, number of contrasts
#' @aliases nContrast,DesignContrast-method
#' @exportMethod nContrast
setGeneric("nContrast", function(object) standardGeneric("nContrast"))
Expand Down Expand Up @@ -240,12 +248,13 @@ setGeneric("annotate",
setGeneric("reannotate",
function(object, check.target,...) standardGeneric("reannotate"))

#' Export matrix or eEset that can be coereced as one into gct/cls files
#' Export matrix or eSet that can be coerced as one into gct/cls files
#' @keywords methods
#' @param obj The input object, see methods below for supported data types
#' @param file The output file
#' @param feat.name Specifying feature names
#' @param feat.desc Specifying feature descriptions
#' @return Used for its side effect of writing files; returns invisibly.
#' @aliases writeGct,matrix,ANY,ANY,ANY-method writeGct,eSet,ANY,ANY,ANY-method
#' @exportMethod writeGct
setGeneric("writeGct", function(obj, file, feat.name, feat.desc)
Expand Down
9 changes: 5 additions & 4 deletions R/AllMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ return(object@groups)
})

#' @describeIn dispGroups Return the sample groups from a DesignContrast object
#' , suing display labels
#' , using display labels
#' @export
setMethod("dispGroups", "DesignContrast", function(object) {
groups <- object@groups
Expand Down Expand Up @@ -68,7 +68,7 @@ setReplaceMethod("contrastAnnotation", "DesignContrast", function(object, value)
return(object)
})

#' @describeIn nContrast Return the number of contrast in a DesignContras
#' @describeIn nContrast Return the number of contrasts in a DesignContrast
#' object
#' @export
setMethod("nContrast", "DesignContrast", function(object) {
Expand Down Expand Up @@ -96,7 +96,7 @@ setMethod("exprsToLong", "matrix", function(x, idvar="illID",timevar="hybridID",
ids=rownames(x), valueType="raw") {
x <- as.data.frame(x)
colnames(x) <- paste(valuevar, colnames(x), sep=".")
va <- 1:ncol(x)
va <- seq_len(ncol(x))
x[,idvar] <- ids
xLong <- reshape(x, idvar=idvar, varying=va, timevar=timevar, direction="long")
rownames(xLong) <- NULL
Expand All @@ -115,6 +115,7 @@ setMethod("exprsToLong", "eSet", function(x) {
#' @param x An ExpressionSet object.
#' @param center Logical, whether the mean values of rows should be set to zero.
#' @param scale Logical, whether the standard deviations of rows should be normalised to one.
#' @return An ExpressionSet object with row-scaled expression values.
#'
#' @importFrom ribiosUtils rowscale
#' @export
Expand Down Expand Up @@ -190,7 +191,7 @@ setMethod("formatGmt",
if(length(comment)==1)
comment <- rep(comment, length(title))
stopifnot(identical(length(title), length(comment)))
sapply(1:length(genes),
sapply(seq_along(genes),
function(x) formatGmt(title[x], comment[x], genes[[x]])
)
})
Expand Down
Loading
Loading