raerose01 / deconstructSigs

deconstructSigs
138 stars 47 forks source link

Plotting the signatures gives error #54

Closed beginner984 closed 4 years ago

beginner984 commented 4 years ago

Hi

I normalized signature like this

> sample_1 = whichSignatures(tumor.ref = sigs.input, 
+                            signatures.ref = signatures.nature2013, 
+                            sample.id = 1, 
+                            contexts.needed = TRUE,
+                            tri.counts.method  = 'genome')
> head(sample_1)
$weights
  Signature.1A Signature.1B Signature.2 Signature.3 Signature.4 Signature.5 Signature.6 Signature.7 Signature.8
1    0.5370653            0           0           0           0           0           0           0           0
  Signature.9 Signature.10 Signature.11 Signature.12 Signature.13 Signature.14 Signature.15 Signature.16 Signature.17
1           0            0            0            0            0            0            0            0    0.3383947
  Signature.18 Signature.19 Signature.20 Signature.21 Signature.R1 Signature.R2 Signature.R3 Signature.U1 Signature.U2
1    0.1123409            0            0            0            0            0            0            0            0

$tumor
     A[C>A]A     A[C>A]C     A[C>A]G     A[C>A]T     C[C>A]A     C[C>A]C     C[C>A]G     C[C>A]T    G[C>A]A     G[C>A]C
1 0.01159165 0.009192864 0.005609799 0.008142708 0.009777289 0.006344191 0.007020297 0.007805916 0.02536979 0.006812719

But for plotting I am getting error

> plot_example <- whichSignatures(tumor.ref = sigs.input, 
+                                 signatures.ref = signatures.nature2013, 
+                                 sample.id = 1)
Error in whichSignatures(tumor.ref = sigs.input, signatures.ref = signatures.nature2013,  : 
  Sample:  1  is not normalized
 Consider using "contexts.needed = TRUE"
> plot_example <- whichSignatures(tumor.ref = sample_1, 
+                                 signatures.ref = signatures.nature2013, 
+                                 sample.id = 1)
Error in whichSignatures(tumor.ref = sample_1, signatures.ref = signatures.nature2013,  : 
  1 not found in rownames of tumor.ref

Can you please help me?

Thanks

raerose01 commented 4 years ago

I think you need to use a different function for plotting -- not whichSignatures() again. Try this: plotSignatures(sample_1)