cofeaturer

Plot Cofeature Matrices

https://github.com/tinyheero/cofeaturer

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.4%) to scientific vocabulary

Keywords

cofeature-matrices ggplot2 matrices r
Last synced: 6 months ago · JSON representation

Repository

Plot Cofeature Matrices

Basic Info
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
cofeature-matrices ggplot2 matrices r
Created about 10 years ago · Last pushed over 7 years ago
Metadata Files
Readme

README.Rmd

---
output:
  md_document:
    variant: markdown_github
---



```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/"
)
```

# cofeatureR

[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/cofeatureR)](http://cran.r-project.org/package=cofeatureR)
[![Travis-CI Build Status](https://travis-ci.org/tinyheero/cofeatureR.svg?branch=master)](https://travis-ci.org/tinyheero/cofeatureR)
[![Downloads per month](http://cranlogs.r-pkg.org/badges/cofeatureR)](https://cran.rstudio.com/web/packages/cofeatureR)
[![Total downloads](https://cranlogs.r-pkg.org/badges/grand-total/cofeatureR)](https://cran.rstudio.com/web/packages/cofeatureR)
[![Anaconda-Server Badge](https://anaconda.org/fongchun/r-cofeaturer/badges/version.svg)](https://anaconda.org/fongchun/r-cofeaturer)
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/tinyheero)

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

```{r example, dev = "png", echo = FALSE, message = FALSE}
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")
feature.order <- c("RCOR1", "NCOR1", "LCOR")
sample.id.order <- c("sampleA", "sampleB", "sampleC")
in.df <- dplyr::data_frame(feature = v1, sampleID = v2, type = v3)
fill.colors <- c("Deletion" = "Blue", "Rearrangement" = "Green", "SNV" = "Red")

plot_cofeature_mat(in.df, tile.col = "black",
                   feature.order = c("RCOR1", "LCOR", "NCOR1"),
                   sample.id.order = c("sampleA", "sampleB", "sampleC"))
```

# Installation

To get the released version from CRAN:

```{r, eval = FALSE}
install.packages("cofeatureR")
```

You can also get cofeatureR through conda:

```{bash, eval = FALSE}
conda install -c fongchun r-cofeaturer
```

To install the latest developmental version from github:

```{r, eval = FALSE}
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:

```{r}
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)
```

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

```{r how-to-use-example, message = FALSE}
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

```{r, results = "asis", echo = FALSE}
citation(package = "cofeatureR")
```

Owner

  • Name: Fong Chun Chan
  • Login: tinyheero
  • Kind: user
  • Location: London, United Kingdom
  • Company: Achilles Therapeutics

Associate Team Leader of Bioinformatics Research at Achilles Therapeutics

GitHub Events

Total
Last Year

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 73
  • Total Committers: 2
  • Avg Commits per committer: 36.5
  • Development Distribution Score (DDS): 0.315
Top Committers
Name Email Commits
Fong Chun Chan f****n@g****m 50
Fong Chun Chan f****n@a****a 23
Committer Domains (Top 20 + Academic)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 296 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
  • Total maintainers: 1
cran.r-project.org: cofeatureR

Generate Cofeature Matrices

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 296 Last month
Rankings
Forks count: 28.8%
Dependent packages count: 29.8%
Stargazers count: 35.2%
Dependent repos count: 35.5%
Average: 35.8%
Downloads: 49.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.1.0 depends
  • dplyr >= 0.4.3 imports
  • ggplot2 >= 1.0.0 imports
  • lazyeval >= 0.1.10 imports
  • tibble * imports
  • testthat * suggests