
> require(NMF) 

> catalog <- read.delim('COSMIC_plus_cisplatin_DT40.tsv', sep = '\t') 

> # New code: We attach rownames to catalog
> rownames(catalog) <-
+   paste0(catalog$Before,catalog$Ref,catalog$After,">",catalog$Var)

> H <- data.matrix(catalog[,5:ncol(catalog)]) 

> inputfiles <- Sys.glob('input catalogs/*') 

> for (f in inputfiles){   
+   cat(sprintf('\nProcessing %s \n', basename(f)))   
+   # read the file
+   input <- read.delim(f, sep = '\t')
+   
+   .... [TRUNCATED] 

Processing ESAD catalog.txt 
   Cisplatin             DT40             DT40_noTA             DT40_TA         
 Min.   :0.000000   Min.   :0.0000000   Min.   :-0.0001156   Min.   :0.0000000  
 1st Qu.:0.000000   1st Qu.:0.0000000   1st Qu.: 0.0000000   1st Qu.:0.0000000  
 Median :0.000000   Median :0.0000000   Median : 0.0000000   Median :0.0000000  
 Mean   :0.001346   Mean   :0.0001499   Mean   : 0.0002931   Mean   :0.0005168  
 3rd Qu.:0.000000   3rd Qu.:0.0000000   3rd Qu.: 0.0000000   3rd Qu.:0.0000000  
 Max.   :0.067274   Max.   :0.0090533   Max.   : 0.0085955   Max.   :0.0115680  

Samples with more than 5% cisplatin
                    Cisplatin        DT40   DT40_noTA     DT40_TA
SA594320_postChemo 0.06727446 0.009053344 0.008595514 0.011567963
SA594775_postChemo 0.05328117 0.002553218 0.002611900 0.002230908

Processing Fujimoto et al catalog previous sort.tsv 
   Cisplatin             DT40             DT40_noTA           DT40_TA          
 Min.   :0.000000   Min.   :0.0000000   Min.   :0.000000   Min.   :-0.0026113  
 1st Qu.:0.000000   1st Qu.:0.0000000   1st Qu.:0.000000   1st Qu.: 0.0000000  
 Median :0.000000   Median :0.0000000   Median :0.000000   Median : 0.0000000  
 Mean   :0.005655   Mean   :0.0003891   Mean   :0.001517   Mean   : 0.0008182  
 3rd Qu.:0.000000   3rd Qu.:0.0000000   3rd Qu.:0.000000   3rd Qu.: 0.0000000  
 Max.   :0.281008   Max.   :0.0289126   Max.   :0.057659   Max.   : 0.0196087  

Samples with more than 5% cisplatin
       Cisplatin        DT40   DT40_noTA       DT40_TA
RK028 0.17461492 0.028912645 0.034652110 -2.611264e-03
RK056 0.24797348 0.016300754 0.034001009  0.000000e+00
RK074 0.13909023 0.000000000 0.000000000  0.000000e+00
RK093 0.06088510 0.000000000 0.000000000  1.490047e-02
RK205 0.05379389 0.000000000 0.000000000  0.000000e+00
RK223 0.05986148 0.000000000 0.001761494  0.000000e+00
RK225 0.06193746 0.000000000 0.000000000  0.000000e+00
RK241 0.28100771 0.000000000 0.008429452  0.000000e+00
RK243 0.14638415 0.000000000 0.000000000  0.000000e+00
RK256 0.09372303 0.003386464 0.004001122  1.045595e-05

Processing Kan et al catalog.tsv 
   Cisplatin             DT40             DT40_noTA           DT40_TA          
 Min.   :0.000000   Min.   :0.0000000   Min.   :0.000000   Min.   :-1.931e-05  
 1st Qu.:0.000000   1st Qu.:0.0000000   1st Qu.:0.000000   1st Qu.: 0.000e+00  
 Median :0.000000   Median :0.0000000   Median :0.000000   Median : 0.000e+00  
 Mean   :0.004741   Mean   :0.0006182   Mean   :0.003210   Mean   : 1.212e-03  
 3rd Qu.:0.000000   3rd Qu.:0.0000000   3rd Qu.:0.002967   3rd Qu.: 1.278e-03  
 Max.   :0.250438   Max.   :0.0104236   Max.   :0.066206   Max.   : 9.039e-03  

Samples with more than 5% cisplatin
      Cisplatin DT40   DT40_noTA DT40_TA
HK034 0.2504385    0 0.003248886       0
