Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A better use of the NMF Package #5

Merged
merged 9 commits into from
Sep 22, 2018
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
5 changes: 5 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
^README.md$
^LICENSE.md$
^.gitignore$
^.travis.yml$
^.git/.*$
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ branches:
only:
- master
- development

r_packages:
- covr

after_success:
- Rscript -e 'library(covr); codecov()'
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: SparseSignatures
Version: 1.0.2
Date: 2018-07-18
Version: 1.1.4
Date: 2018-09-21
Title: SparseSignatures
Authors@R: c(person("Daniele", "Ramazzotti", role=c("cre","aut"),email="[email protected]"),
person("Avantika", "Lal", role=c("aut")),
Expand All @@ -11,8 +11,8 @@ Authors@R: c(person("Daniele", "Ramazzotti", role=c("cre","aut"),email="daniele.
Maintainer: Luca De Sano <[email protected]>
Depends:
R (>= 3.5),
NMF
Imports:
NMF,
nnlasso,
nnls,
parallel,
Expand All @@ -31,7 +31,7 @@ Suggests:
testthat,
knitr,
Name:
An R package for the extraction sparse mutational signatures from whole genome sequencing data
An R package for the extraction of sparse mutational signatures from whole genome sequencing data
Description:
Point mutations occurring in a genome can be divided into 96 categories based on the base being mutated, the base it is mutated into and its two flanking bases. Therefore, for any patient, it is possible to represent all the point mutations occurring in that patient’s tumor as a vector of length 96, where each element represents the count of mutations for a given category in the patient. A mutational signature represents the pattern of mutations produced by a mutagen or mutagenic process inside the cell. Each signature can also be represented by a vector of length 96, where each element represents the probability that this particular mutagenic process generates a mutation of the 96 above mentioned categories. In this R package, we provide a set of functions to extract and visualize the mutational signatures that best explain the mutation counts of a large number of patients.
Encoding: UTF-8
Expand All @@ -41,5 +41,5 @@ URL: https://github.com/danro9685/SparseSignatures
BugReports: https://github.com/danro9685/SparseSignatures
biocViews: BiomedicalInformatics,
SomaticMutation
RoxygenNote: 6.0.1
RoxygenNote: 6.1.0
VignetteBuilder: knitr
12 changes: 6 additions & 6 deletions R/mutation_factor.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,19 @@

# set the initial random values for beta
if(is.null(background_signature)) {
curr_beta <- matrix(0,nrow=K,ncol=dim(x)[2])
for(i in 1:K) {
curr_beta <- matrix(0,nrow=k,ncol=dim(x)[2])
for(i in 1:k) {
curr_beta[i,] <- runif(dim(x)[2])
}
colnames(curr_beta) <- colnames(x)
}
else {
curr_beta <- matrix(0,nrow=(K+1),ncol=dim(x)[2])
curr_beta <- matrix(0,nrow=(k+1),ncol=dim(x)[2])
curr_beta[1,] <- background_signature
for(i in 2:(K+1)) {
for(i in 2:(k+1)) {
curr_beta[i,] <- runif(dim(x)[2])
}
rownames(curr_beta) <- c("background_signature",rep("",K))
rownames(curr_beta) <- c("background_signature",rep("",k))
colnames(curr_beta) <- colnames(x)
}

Expand Down Expand Up @@ -185,7 +185,7 @@
if(verbose) {
cat("Computing the initial values of beta by standard NMF...","\n")
}
curr_beta <- basis(nmf(t(x),rank=K,nrun=nmf_runs))
curr_beta <- basis(nmf(t(x),rank=k,nrun=nmf_runs))
curr_beta <- t(curr_beta)

# add a signature to beta (leading to K+1 signatures in total) to explicitly model noise
Expand Down
12 changes: 12 additions & 0 deletions inst/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
\title{News for the package \pkg{SparseSignatures}}
\encoding{UTF-8}

\section{Changes in Version 1.1.4}{
\itemize{
\item Move NMF to Depends section
}
}

\section{Changes in Version 1.1.3}{
\itemize{
\item Issue with the basis function solved
}
}

\section{Changes in Version 1.0.0}{
\itemize{
\item Package released on Bioconductor in May 2018.
Expand Down
8 changes: 4 additions & 4 deletions man/evaluate.lambda.range.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions man/nmf.LassoCV.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions man/nmf.LassoK.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.