0

Ive been given a dataset thats already transformed by a previous user. When i try and create/plot an NMF using this code:

multiRankNMF <- nmf(dataset, seq(seq1,seq2), 
                method=usedmethod, nrun=noofrun, 
                seed=initseed, .options = "t")

I cant as I receive these errors:

 Error in (function (...)  : All the runs produced an error:
    -#1 [r=2] -> NMF::nmf - 20/20 fit(s) threw an error.
 Error(s) thrown:
  - run #1: NMF::nmf - Input matrix x contains some negative entries.
    -#2 [r=3] -> NMF::nmf - 20/20 fit(s) threw an error.
 Error(s) thrown:
  - run #1: NMF::nmf - Input matrix x contains some negative entries.
    -#3 [r=4] -> NMF::nmf - 20/20 fit(s) threw an error.
 Error(s) thrown:
  - run #1: NMF::nmf - Input matrix x contains some negative entries.
    -#4 [r=5] -> NMF::nmf - 20/20 fit(s) threw an error.
 Error(s) thrown:
  - run #1: NMF::nmf - Input matrix x contains some negative entries.
    -#5 [r=6] -> NMF::nmf - 20/20 fit(s) threw an error.
 Error(s) thrown:
  - run #1: NMF::nmf - Input matrix x contains some negative entries.
    -#6 [r=7] -> NMF::nmf - 20/20 fit(s) threw an error.

My thoughts are that the negative values being seen are due to the transformation used before as Gene expression data is inherently non-negative.

How would I undo the transformation done so I could create the NMF?

Andrew Gustar
  • 17,295
  • 1
  • 22
  • 32

1 Answers1

0

Assuming it was really just a straight log-transformation, the answer depends on what base (typically either e or 10) was used. If it was a natural logarithm (base e), exp() will do the trick:

data <- log(1:10)
exp(data)

If it was base 10, the solution is calculating 10 to the power of your data:

data <- log10(1:10)
10^data
Where's my towel
  • 561
  • 2
  • 12