Repository 'corr_table'
hg clone https://toolshed.g2.bx.psu.edu/repos/melpetera/corr_table

Changeset 2:2173ad5e7750 (2019-10-16)
Previous changeset 1:29ec7e3afdd4 (2019-08-01)
Commit message:
Uploaded
modified:
CorrTable/Corr_Script_samples_row.R
CorrTable/Corr_wrap.r
CorrTable/README.md
CorrTable/test-data/output1_CorrTable.tabular
CorrTable/test-data/output2_CorrTable.tabular
b
diff -r 29ec7e3afdd4 -r 2173ad5e7750 CorrTable/Corr_Script_samples_row.R
--- a/CorrTable/Corr_Script_samples_row.R Thu Aug 01 11:30:58 2019 -0400
+++ b/CorrTable/Corr_Script_samples_row.R Wed Oct 16 03:12:55 2019 -0400
[
@@ -254,23 +254,23 @@
   
   if (test.corr == "yes"){
     
-    pvalue <- vector()
-    for (i in 1:dim(tab.corr)[1]){
-      for (j in 1:dim(tab.corr)[2]){
-        suppressWarnings(corrtest <- cor.test(tab2[,i], tab1[,j], method = corr.method))
-        pvalue <- c(pvalue, corrtest$p.value)
-        if (multi.name == "none"){
-          if (corrtest$p.value > alpha){
-            tab.corr[i,j] <- 0
-          }
-        }
-      }
-    }
-  
+ repcorrtest1 <- function(vari1,vari2,corrmeth){
+   suppressWarnings(corrtest <- cor.test(vari2, vari1, method = corrmeth))
+   return(corrtest$p.value)
+ }
+ repcorrtest2 <- function(stab,ftab,cormeth){
+   listp <- apply(X=ftab,2,repcorrtest1,vari2=stab,corrmeth=cormeth)
+   return(listp)
+ }
+ pvalue <- apply(X=tab1,2,repcorrtest2,ftab=tab2,cormeth=corr.method)
+
+
     if(multi.name != "none"){
-      adjust <- matrix(p.adjust(pvalue, method = multi.name), nrow = dim(tab.corr)[1], ncol = dim(tab.corr)[2], byrow = T)
-      tab.corr[adjust > alpha] <- 0
-    }
+      pvalue <- matrix(p.adjust(pvalue, method = multi.name), nrow = dim(tab.corr)[1], ncol = dim(tab.corr)[2])
+    } 
+
+ tab.corr[pvalue > alpha] <- 0 
+
   }  
   
   
@@ -416,17 +416,14 @@
     }
     
     # Assign an interval to each correlation coefficient
-    for (i in 1:dim(melted.tab.corr)[1]){
       for (j in 1:(length(cl))){
         if (vect[j] == -1){
-          melted$classe[i][melted$value[i] >= vect[j] 
-                           && melted$value[i] <= vect[j+1]] <- cl[j]
+          melted$classe[melted$value >= vect[j] & melted$value <= vect[j+1]] <- cl[j]
         } else {
-          melted$classe[i][melted$value[i] > vect[j] 
-                           && melted$value[i] <= vect[j+1]] <- cl[j]
+          melted$classe[melted$value > vect[j] & melted$value <= vect[j+1]] <- cl[j]
         }
       }
-    }
+
     
     # Find the 0 and assign it the white as name
     if (length(which(vect == 0)) == 1) {
@@ -493,5 +490,5 @@
   
   # Function call
   # correlation.tab(tab1.name, tab2.name, param1.samples, param2.samples, corr.method, test.corr, alpha, multi.name, filter,
-  #                             filters.choice, threshold, reorder.var, color.heatmap, type.classes,
+  #                             filters.choice, threshold, reorder.var, plot.choice, color.heatmap, type.classes,
   #                             reg.value, irreg.vect, output1, output2)
b
diff -r 29ec7e3afdd4 -r 2173ad5e7750 CorrTable/Corr_wrap.r
--- a/CorrTable/Corr_wrap.r Thu Aug 01 11:30:58 2019 -0400
+++ b/CorrTable/Corr_wrap.r Wed Oct 16 03:12:55 2019 -0400
b
@@ -33,7 +33,8 @@
 if(length(args) < 10){ stop("NOT enough argument !!!") }
 
 
-cat('\n--------------------------------------------------------------------', 
+cat('\nJob starting time:\n',format(Sys.time(), "%a %d %b %Y %X"),
+'\n\n--------------------------------------------------------------------', 
 '\nParameters used in "Between-table Correlation":\n\n')
 print(args)
 cat('--------------------------------------------------------------------\n\n')
@@ -76,7 +77,8 @@
 cat('\n--------------------------------------------------------------------',
 '\nInformation about R (version, Operating System, attached or loaded packages):\n\n')
 sessionInfo()
-cat('--------------------------------------------------------------------\n\n')
+cat('--------------------------------------------------------------------\n',
+'\nJob ending time:\n',format(Sys.time(), "%a %d %b %Y %X"))
 
 
 #delete the parameters to avoid the passage to the next tool in .RData image
b
diff -r 29ec7e3afdd4 -r 2173ad5e7750 CorrTable/README.md
--- a/CorrTable/README.md Thu Aug 01 11:30:58 2019 -0400
+++ b/CorrTable/README.md Wed Oct 16 03:12:55 2019 -0400
b
@@ -43,3 +43,9 @@
 -----------
 
  * Help and support: support@workflow4metabolomics.org
+
+
+License
+-----------
+
+ * Cea Cnrs Inria Logiciel Libre License, version 2.1 (CECILL-2.1)
b
diff -r 29ec7e3afdd4 -r 2173ad5e7750 CorrTable/test-data/output1_CorrTable.tabular
--- a/CorrTable/test-data/output1_CorrTable.tabular Thu Aug 01 11:30:58 2019 -0400
+++ b/CorrTable/test-data/output1_CorrTable.tabular Wed Oct 16 03:12:55 2019 -0400
b
@@ -1,6 +1,6 @@
-name M200T2618 M108T2759 M253T1601 M562T393 M140T2817 M317T2417 M498T712 M897T2828 M879T105 M413T2867 M782T2391 M835T963 M324T1666 M79T1303 M567T390 M207T2257 M232T997 M997T2834 M295T842 M958T481 M150T423 M964T1077 M510T148 M454T809
-Meta01 -0.0381099621034071 -0.0308771792251864 0.335303270663461 0.340984721652527 -0.392239536011236 0.308531863601226 -0.38276470907866 0.192781243616334 0.316953616678778 0.153455904743321 -0.145045084107932 -0.364896936594001 0.320967727079532 -0.377104415194285 0.373071418741227 0.352800416562518 0.319463412900551 0.324078173113261 0.306620047017588 0.326582168629611 0.0172092079575711 0.304807387613331 0.316450509570112 0.376440463645976
-Meta09 -0.0767546658101883 -0.129626792377785 0.101928911670895 0.115483290871375 -0.0234245956756988 0.0904474725214124 -0.024461194882052 -0.121320087678368 0.130125017347287 0.308155645217747 0.0831122451923826 0.0506561387912013 0.117292511090864 -0.0123538963682085 0.0267655184532761 -0.0161389675179283 0.0993591777883074 0.107454649875267 0.136562668239795 0.10755851274508 0.254034021197444 0.130672738299945 0.11062439577984 0.0687702584250841
-Meta15 0.0272019471781163 0.0310419371165683 -0.136260855677388 -0.0630013735941506 -0.0545937867718303 -0.135844925260746 -0.00952598537394389 -0.0207933370871036 -0.0524941400856259 -0.0369194221976208 0.354806184152381 -0.0056322067135378 -0.108772516379943 -0.0277111328940591 -0.171696474385562 -0.158841609776784 -0.0384562204512248 -0.0881771505485084 -0.0210940775418372 -0.060166862529553 -0.00276367086310437 -0.0471787341544353 -0.0764277784424161 -0.0977299103436893
-Meta22 0.120785153157455 0.0749336584503277 -0.0270536732280649 -0.0536052973820058 -0.150016784385942 -0.0632347476656861 -0.132863877612795 0.303035673758439 -0.133995542749929 0.000998502460650215 -0.139343133878119 -0.116656852987757 -0.0993268136599691 -0.128198216041191 -0.0553520708094436 0.0371066253540359 -0.0465298462059366 -0.05907858722759 -0.0866948285493421 -0.0495558714805468 0.203647127547309 -0.0528204949117596 -0.071940864021075 0.0345675482658712
-Meta23 0.326485225265319 0.304169001191892 0.00115369881122672 0.0301042258910735 -0.103162606015147 0.0537101596905055 -0.0783558303219841 0.0274704272882075 0.114237409683009 -0.0967931551436498 0.0975083134993656 -0.102156817498172 0.00470481879378514 -0.116990014334093 -0.0211850133509491 -0.0299843961961325 -0.103705033450308 0.0145444087397323 0.0736370908927353 -0.0767582436873565 0.32405558752902 0.0067286262747507 -0.0126106752475632 -0.0716433234564737
+name M200T2618 M108T2759 M253T1601 M562T393 M140T2817 M317T2417 M498T712 M897T2828 M879T105 M413T2867 M782T2391 M835T963 M324T1666 M79T1303 M567T390 M207T2257 M232T997 M997T2834 M295T842 M958T481 M150T423 M964T1077 M510T148 M454T809
+Meta01 -0.0381099621034071 -0.0308771792251864 0.335303270663461 0.340984721652527 -0.392239536011236 0.308531863601226 -0.38276470907866 0.192781243616334 0.316953616678778 0.153455904743321 -0.145045084107932 -0.364896936594001 0.320967727079532 -0.377104415194285 0.373071418741227 0.352800416562518 0.319463412900551 0.324078173113261 0.306620047017588 0.326582168629611 0.0172092079575711 0.304807387613331 0.316450509570112 0.376440463645976
+Meta09 -0.0767546658101883 -0.129626792377785 0.101928911670895 0.115483290871375 -0.0234245956756988 0.0904474725214124 -0.024461194882052 -0.121320087678368 0.130125017347287 0.308155645217747 0.0831122451923826 0.0506561387912013 0.117292511090864 -0.0123538963682085 0.0267655184532761 -0.0161389675179283 0.0993591777883074 0.107454649875267 0.136562668239795 0.10755851274508 0.254034021197444 0.130672738299945 0.11062439577984 0.0687702584250841
+Meta15 0.0272019471781163 0.0310419371165683 -0.136260855677388 -0.0630013735941506 -0.0545937867718303 -0.135844925260746 -0.00952598537394389 -0.0207933370871036 -0.0524941400856259 -0.0369194221976208 0.354806184152381 -0.0056322067135378 -0.108772516379943 -0.0277111328940591 -0.171696474385562 -0.158841609776784 -0.0384562204512248 -0.0881771505485084 -0.0210940775418372 -0.060166862529553 -0.00276367086310437 -0.0471787341544353 -0.0764277784424161 -0.0977299103436893
+Meta22 0.120785153157455 0.0749336584503277 -0.0270536732280649 -0.0536052973820058 -0.150016784385942 -0.0632347476656861 -0.132863877612795 0.303035673758439 -0.133995542749929 0.000998502460650215 -0.139343133878119 -0.116656852987757 -0.0993268136599691 -0.128198216041191 -0.0553520708094436 0.0371066253540359 -0.0465298462059366 -0.05907858722759 -0.0866948285493421 -0.0495558714805468 0.203647127547309 -0.0528204949117596 -0.071940864021075 0.0345675482658712
+Meta23 0.326485225265319 0.304169001191892 0.00115369881122672 0.0301042258910735 -0.103162606015147 0.0537101596905055 -0.0783558303219841 0.0274704272882075 0.114237409683009 -0.0967931551436498 0.0975083134993656 -0.102156817498172 0.00470481879378514 -0.116990014334093 -0.0211850133509491 -0.0299843961961325 -0.103705033450308 0.0145444087397323 0.0736370908927353 -0.0767582436873565 0.32405558752902 0.0067286262747507 -0.0126106752475632 -0.0716433234564737
b
diff -r 29ec7e3afdd4 -r 2173ad5e7750 CorrTable/test-data/output2_CorrTable.tabular
--- a/CorrTable/test-data/output2_CorrTable.tabular Thu Aug 01 11:30:58 2019 -0400
+++ b/CorrTable/test-data/output2_CorrTable.tabular Wed Oct 16 03:12:55 2019 -0400
b
b'@@ -1,344 +1,344 @@\n-name\tp156.079T4.8\tp830.106T10.1\tp723.593T11.7\tp700.548T18.3\tp820.752T16.1\tp530.243T24.2\tp522.830T9.2\tp1021.72T21.3\tp917.579T13.5\tp1004.50T14.4\tp1014.19T14.3\tp479.759T23.4\tp836.499T11.5\tp731.206T20.6\tp924.191T17.0\tp1006.44T16.9\tp610.686T9.4\tp682.356T19.4\tp497.397T18.6\tp592.756T18.2\tp325.277T16.5\tp849.200T10.3\tp529.079T20.8\tp689.640T17.3\tp389.879T22.0\tp513.701T18.4\tp599.242T18.3\tp910.336T13.7\tp415.602T11.5\tp306.270T18.0\tp629.970T9.9\tp544.711T21.3\tp423.308T13.8\tp241.766T8.2\tp983.754T19.8\tp534.263T18.4\tp793.296T20.2\tp815.259T16.1\tp377.184T15.7\tp326.603T13.6\tp275.450T18.6\tp460.420T23.4\tp310.185T18.5\tp295.505T19.5\tp558.743T23.8\tp588.742T19.3\tp802.484T19.4\tp605.858T16.1\tp326.196T11.0\tp585.154T22.3\tp985.514T10.6\tp386.553T26.3\tp711.338T13.8\tp1013.05T19.8\tp914.534T14.8\tp301.823T2.7\tp648.986T12.5\tp209.261T15.6\tp1066.67T14.3\tp1052.39T12.3\tp356.436T23.0\tp219.721T1.9\tp307.263T1.2\tp371.665T16.8\tp587.285T9.2\tp191.609T13.2\tp930.850T11.5\tp670.905T16.5\tp807.718T16.7\tp766.273T14.6\tp557.404T24.9\tp286.296T12.6\tp1039.93T19.5\tp1041.98T18.8\tp342.252T24.3\tp1011.53T15.5\tp527.519T21.2\tp592.821T15.1\tp360.645T16.0\tp1063.27T21.1\tp1039.76T17.9\tp721.501T20.2\tp370.615T25.4\tp655.572T19.0\tp318.827T18.1\tp587.025T23.3\tp878.633T17.4\tp863.952T16.6\tp144.690T6.3\tp994.431T12.0\tp824.808T11.0\tp288.732T19.2\tp481.099T17.9\tp954.749T13.2\tp397.393T13.0\tp628.320T25.5\tp343.125T19.2\tp581.538T16.4\tp727.446T19.7\tp296.250T17.7\tp497.093T25.7\tp288.703T19.0\tp715.902T19.4\tp636.248T26.5\tp861.055T11.2\tp164.954T8.0\tp228.782T9.8\tp600.048T11.4\tp1022.47T20.9\tp864.022T13.3\tp691.388T14.8\tp937.474T11.5\tp374.269T15.3\tp947.228T17.5\tp416.047T13.8\tp1033.01T16.8\tp963.768T15.7\tp651.700T16.8\tp999.112T19.8\tp408.537T18.2\tp307.354T14.1\tp621.179T23.3\tp891.151T14.8\tp263.844T17.9\tp737.340T19.1\tp643.167T20.6\tp356.345T22.0\tp885.335T16.5\tp545.669T24.0\tp738.617T21.0\tp677.806T19.6\tp993.453T18.0\tp624.790T20.6\tp387.339T16.7\tp291.501T17.5\tp979.863T12.8\tp192.442T0.9\tp526.837T29.6\tp529.248T23.5\tp775.452T15.1\tp640.989T23.9\tp296.395T18.4\tp166.299T21.1\tp686.356T15.5\tp995.471T16.7\tp591.068T16.5\tp640.669T26.5\tp632.599T23.0\tp376.173T16.7\tp387.337T14.3\tp706.230T25.3\tp580.480T14.6\tp260.604T16.9\tp340.313T19.5\tp336.696T20.3\tp300.346T20.6\tp180.485T11.9\tp562.287T19.0\tp605.767T24.4\tp1065.14T13.2\tp917.737T13.1\tp98.4318T0.9\tp453.257T18.3\tp329.032T15.2\tp883.164T20.1\tp148.168T11.2\tp693.291T16.0\tp632.400T17.0\tp983.783T19.8\tp601.681T21.1\tp625.815T18.5\tp160.998T1.8\tp201.895T5.7\tp521.704T12.3\tp688.150T17.0\tp136.122T9.2\tp850.526T14.9\tp745.769T12.0\tp881.841T16.5\tp227.190T10.2\tp670.599T17.0\tp354.013T17.3\tp975.370T12.8\tp677.321T17.1\tp144.263T8.4\tp273.446T12.7\tp616.846T13.4\tp344.793T9.5\tp733.667T16.6\tp544.371T20.3\tp866.803T21.1\tp990.796T15.4\tp977.615T16.3\tp446.259T14.3\tp856.431T16.5\tp374.057T19.5\tp793.879T19.5\tp943.318T20.9\tp568.168T11.0\tp889.798T17.6\tp905.607T15.8\tp615.066T23.1\tp315.285T20.2\tp1051.78T14.5\tp639.305T19.0\tp357.250T10.8\tp994.457T12.6\tp702.056T19.3\tp965.140T16.3\tp561.003T13.1\tp736.462T11.0\tp429.664T21.4\tp711.363T8.1\tp532.243T14.5\tp335.689T19.4\tp868.518T13.2\tp887.907T10.7\tp302.743T9.7\tp144.352T3.9\tp592.883T12.1\tp682.262T18.4\tp264.625T15.1\tp91.2616T11.3\tp770.702T16.6\tp699.482T11.6\tp680.602T20.7\tp682.943T16.4\tp989.558T21.2\tp743.191T15.1\tp535.161T13.1\tp473.625T15.0\tp512.755T21.1\tp494.065T28.8\tp653.672T20.8\tp723.050T5.5\tp641.696T21.6\tp634.231T14.3\tp585.154T17.9\tp1025.08T17.0\tp270.981T14.8\tp685.324T16.4\tp353.179T26.5\tp1040.26T17.5\tp203.753T18.2\tp552.138T19.2\tp1064.48T12.5\tp727.720T14.4\tp201.935T17.2\tp904.856T10.2\tp1025.15T16.5\tp710.406T11.7\tp693.656T12.2\tp707.743T12.3\tp287.438T10.0\tp543.505T20.0\tp362.157T20.3\tp206.524T15.9\tp742.343T14.6\tp197.212T6.8\tp498.636T16.0\tp927.969T17.2\tp1065.60T16.3\tp771.784T15.2\tp323.047T16.8\tp276.411T16.1\tp331.582T24.9\tp582.941T18.5\tp295.808T23.9\tp1075.65T19.9\tp308.117T15.5\tp808.473T18.2\tp833.288T10.2\tp469.708T15.5\tp1052.85T16.3\tp968.524T14.2\tp1019.11T11.7\tp937.201T16.9\tp293.183T7.4\tp991.049T12.8\tp398.183T23.3\tp516.118T20.0\tp400.783T14.9\tp1038.17T13.9\tp826.230T14.9\tp539.105T23.0\tp168.549'..b'35345\t0.0712549588163313\t0.113451934656963\t0.0689139622281608\t0.108689953958712\t-0.0714910454625855\t-0.023940183924679\t0.0266939698129486\t-0.213017791573578\t-0.213099079749635\t-0.382110303897076\t0.977776277508313\t0.962305053562793\t0.142644884748894\t-0.0201922540975135\t0.0658188469044305\t-0.134974773675939\t0.00898972507219314\t-0.381528386762763\t0.0908635198591418\t0.0392787800969549\t-0.394091179620052\t0.143882541378143\t-0.0591836517756248\t-0.0235808611346452\t-0.0842678588654411\t0.057647618622851\t-0.170092729303255\t0.0206489742542137\t0.0561713392080551\t-0.0206290232320246\t-0.146201939592778\t-0.391764014231326\t0.125881458281216\t-0.0769111957448963\t0.984865712655018\t-0.196194531956761\t0.0752589718539618\t-0.173893607010596\t0.10191584554657\t-0.0247286056187748\t0.00248300207497247\t0.126466124133809\t0.109421417730549\t0.00124941351161873\t0.0465034353244592\t0.948346865513353\t-0.0962761984357881\t-0.00736411891527669\t0.0157579096573274\t-0.0206458923336196\t0.125387091773917\t0.948069339141004\t-0.0813666807588288\t-0.397883789028895\t0.00270746885481236\t-0.0650049327280885\t0.970995578181396\t0.102259295103886\t0.0680876104289247\t0.0537845273617249\t0.0637825662942068\t-0.0730207320326005\t0.774701117263232\t0.143250357855822\t0.145570869144814\t0.0504297968413347\t-0.0839602205601543\t0.0375364830740552\t0.0909162582621858\t0.154718966040914\t0.0969693419872003\t0.075191875423734\t0.979772724868521\t0.237252871643776\t-0.0168673377856891\t0.982086037171997\t0.0779084029627812\t-0.16407357670789\t-0.221271929425569\t-0.389830635690166\t-0.0349460793612874\t0.0761468534068529\t-0.407543773279183\t0.0427505038146191\t0.137511449941939\t-0.387386451068765\t-0.0755491277796355\t-0.00611914788519164\t0.94854660569036\t-0.263966503641708\t-0.361358023783816\t0.976055090917847\t0.0954589997026725\t0.0786151266334656\t-0.114634658509578\t0.0613542350901641\t0.95639772954471\t0.0386501066134228\t-0.0408078703704657\t0.0674738811548926\t-0.0140732921524716\t0.0563079719855238\t-0.0286395064454287\t0.0772224613010572\t-0.0113548940123571\t-0.0041060067625021\t0.112789830889578\t-0.382802448875085\t0.976278801694959\t0.110996654554373\t0.0532207905632526\t0.0856389282546113\t0.0982390387184531\t0.0893520734761749\t-0.0746528309105477\t-0.0327606326999675\t0.0387209942073469\t0.0842968656652712\t0.191883946088094\t0.974056015381141\t0.970536385052995\t-0.0138328530122089\t-0.00867112192168448\t-0.0180107229653134\t0.0591120313587514\t0.980235761061055\t-0.263427018539801\t-0.202312831861571\t-0.0896470252155958\t0.0934024770526733\t0.00753201231998164\t0.168226412010844\t-0.0128214565103999\t0.127096184269412\t-0.0572412243593418\t0.103815465408326\t0.0416204532492822\t-0.0146624487823657\t-0.0391894553722596\t-0.0739818478992469\t0.0990141713587819\t-0.113597493575928\t0.132012595933154\t0.0993377221161583\t0.0416980798163542\t-0.0256417190419296\t0.00777851607558417\t0.169141452105696\t0.0703510753877992\t-0.396028289171293\t0.096623127612863\t0.0463250552417397\t0.00107461031408984\t-0.0579578387127301\t0.974016995678885\t0.0866607185633306\t0.0605169153555918\t0.0217619711987366\t-0.190247270615952\t0.0296689902496678\t0.0660022459292106\t0.150384239932277\t-0.00615339138625473\t-0.168170576342136\t0.0530135384732448\t0.0588233492105722\t0.0557295749733618\t-0.0703170494097726\t-0.12166978066693\t-0.0204734293216955\t-0.341902973781123\t-0.125014997791197\t0.0409751304826794\t0.0345802834153728\t-0.218353646804978\t0.0917312992707194\t0.199276406182528\t-0.0502392191221257\t0.159058110700942\t-0.390520710852679\t-0.389482587801548\t0.969226195214219\t-0.162038632844446\t0.155625317946174\t0.00627765210208861\t-0.038020905151606\t-0.0306322658033264\t0.0201268217791247\t0.0323574802940882\t-0.0319024110767261\t0.960943120134763\t0.127299530063702\t-0.386818240449465\t-0.0620928043444932\t-0.172443084072515\t-0.0564937945370614\t0.0327737388332275\t0.959666619829416\t-0.401343167872829\t0.171993338047661\t-0.0164362748403256\t0.98106376316426\t-0.0867426852843022\t0.0444805626540933\t-0.169334029223865\t0.0563064166805418\t0.0514400764261885\t-0.417245674914248\t0.0354451000478197\t0.0168519528771422\t1\r\n'