# Calculate P-values of Differential Expression

### Description

A function called within SimData. Calculates the P-value of differential expression for each gene under either Wilcoxin signed rank test (paired data) or rank sum test (unpaired data). The vector of differences used in the test is based off of the log of the counts for each gene plus 1 divided by their respective multiplicative normalization factors provided by the user.

### Usage

1 2 | ```
CalcPvalWilcox(counts, treatment, replic = NULL, sort.method,
sorted = FALSE, norm.factors, exact = FALSE)
``` |

### Arguments

`counts` |
A matrix of counts where each row specifies a gene and each column specifies a replicate. |

`treatment` |
A vector specifying the treatment group for each column of the counts matrix. Only two treatment groups of either paired or unpaired data are allowed. |

`replic` |
A vector specifying the replicate for each column of the counts matrix when there is paired data; optional if data is unpaired. |

`sort.method` |
Character vector specifying one of "unpaired" or "paired", depending on the structure of the data. |

`sorted` |
logical vector specifying whether data has already gone through SortData function. Defaults to FALSE. |

`norm.factors` |
A positive numeric vector of multiplicative normalization factors for each column of the counts matrix. |

`exact` |
Specifies whether an exact signed rank test (paired) or exact ranksum test (unpaired) should be used. |

### Value

probs: a vector of p-values of differential expression for each gene.

### Author(s)

Samuel Benidt <sgbenidt@gmail.com>

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.