calcHornMatrix: Calculate a Horn distance matrix

Description Usage Arguments Value Author(s) References Examples

Description

This function calculates the pairwise Horn distance between samples based on relative presence of observed variables.

Usage

1
calcHornMatrix(inputTable)

Arguments

inputTable

A matrix or data.frame of relative frequencies of whatever is being measured. Each row is a variable (e.g. gene) and each column is a sample (e.g. individual). The algorithm expects each column to sum to 1. That is, each entry should be the portion of observations (e.g. reads) representing the variable (gene) from the total observations for a sample (individual).

Value

Returns a matrix of pair-wise similarity scores for each column.

Author(s)

Mark Peterson

References

This was (heavily) modified from a script provided by a collaborator of Gina Lamendella's. I need to get more information

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Only run if DESeq is available
if(require(DESeq)){

## Create sample counts
## Thes could be the reads or FPKM from input data instead
require(DESeq)
exampleCounts <- counts(makeExampleCountDataSet())

testHorn <- calcHornMatrix(exampleCounts)
head(testHorn)


## Plot the results
distMat <-as.dist( (1-testHorn), diag=FALSE, upper=FALSE)

# scores to plot MDS (ecodist)
scores_ADNA <-nmds(distMat, mindim=2, maxdim=2) 
scores_ADNA <- nmds.min(scores_ADNA)

# Set colors to match treatments
treatCol <- c("red","red","blue","blue","blue")

plot(scores_ADNA[,1:2],pch=19,col=treatCol)

}

rnaseqWrapper documentation built on May 2, 2019, 5:58 a.m.