MyNixOS website logo
Description

Generate Cofeature Matrices.

Generate cofeature (feature by sample) matrices. The package utilizes ggplot2::geom_tile() to generate the matrix allowing for easy additions from the base matrix.

cofeatureR

CRAN_Status_Badge Travis-CI BuildStatus Downloads permonth Totaldownloads Anaconda-ServerBadge SayThanks!

cofeatureR is an R Package that provides functions for plotting cofeature matrices (aka. feature-sample matrices). For example:

Installation

To get the released version from CRAN:

install.packages("cofeatureR")

You can also get cofeatureR through conda:

conda install -c fongchun r-cofeaturer

To install the latest developmental version from github:

devtools::install_github("tinyheero/cofeatureR")

How to Use

The main function of cofeatureR is the plot_cofeature_mat function. It will produce a matrix plot (feature x sample) showing how the different “types” correlate between samples and features. This function only has one required input which is a data.frame containing 3 columns:

  • feature: Feature name
  • sampleID: Sample name
  • type: Type associated with the feature-sample.

For instance in the field of cancer genomics, we are often interested in knowing how different mutations (type) in different samples (sampleID) correlate between genes (feature). The input data.frame would have this format:

library("cofeatureR")
v1 <- c("RCOR1", "NCOR1", "LCOR", "RCOR1", "RCOR1", "RCOR1", "RCOR1")
v2 <- c("sampleA", "sampleC", "sampleB", "sampleC", "sampleA", "sampleC", "sampleC")
v3 <- c("Deletion", "Deletion", "SNV", "Rearrangement", "SNV", "Rearrangement", "SNV")

in.df <- dplyr::data_frame(feature = v1, sampleID = v2, type = v3)
knitr::kable(in.df)
featuresampleIDtype
RCOR1sampleADeletion
NCOR1sampleCDeletion
LCORsampleBSNV
RCOR1sampleCRearrangement
RCOR1sampleASNV
RCOR1sampleCRearrangement
RCOR1sampleCSNV

This input data.frame can now be used as input into plot_cofeature_mat:

plot_cofeature_mat(in.df, tile.col = "black")

Notice how we are NOT restricted to having only one type per feature-sample. In other words, a feature-sample may have multiple types and plot_cofeature_mat will display all of the types.

There are many different parameters that can be passed into the plot_cofeature_mat for customization of the plot. For instance:

  • fill.colors: Custom colors for each type.
  • feature.order and sample.id.order: Custom ordering of features and samples respectively.
  • tile.col: Add borders around each type.

Citing cofeatureR

#> Warning in citation(package = "cofeatureR"): no date field in DESCRIPTION
#> file of package 'cofeatureR'
#> Warning in citation(package = "cofeatureR"): could not determine year for
#> 'cofeatureR' from package DESCRIPTION file

To cite package ‘cofeatureR’ in publications use:

Fong Chun Chan (NA). cofeatureR: Generate Cofeature Matrices. R package version 1.1.0. https://github.com/tinyheero/cofeatureR

A BibTeX entry for LaTeX users is

@Manual{, title = {cofeatureR: Generate Cofeature Matrices}, author = {Fong Chun Chan}, note = {R package version 1.1.0}, url = {https://github.com/tinyheero/cofeatureR}, }

Metadata

Version

1.1.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows