Skip to content

Commit

Permalink
Merge pull request #5 from danro9685/development
Browse files Browse the repository at this point in the history
A better use of the NMF Package
  • Loading branch information
luca-dex authored Sep 22, 2018
2 parents ad8edb6 + 1d8cb8b commit 6165cce
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 23 deletions.
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.

0 comments on commit 6165cce

Please sign in to comment.