rbbt-marq 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (485) hide show
  1. data/LICENSE +20 -0
  2. data/R/CustomDS.R +80 -0
  3. data/R/GEO.R +249 -0
  4. data/R/MA.R +359 -0
  5. data/README.rdoc +58 -0
  6. data/bin/marq_config +209 -0
  7. data/install_scripts/CustomDS/Rakefile +223 -0
  8. data/install_scripts/GEO/Rakefile +272 -0
  9. data/install_scripts/GEO/platforms/GPL100.yaml +7 -0
  10. data/install_scripts/GEO/platforms/GPL1002.yaml +7 -0
  11. data/install_scripts/GEO/platforms/GPL1007.yaml +7 -0
  12. data/install_scripts/GEO/platforms/GPL101.yaml +7 -0
  13. data/install_scripts/GEO/platforms/GPL1010.yaml +7 -0
  14. data/install_scripts/GEO/platforms/GPL1073.yaml +7 -0
  15. data/install_scripts/GEO/platforms/GPL1074.yaml +4 -0
  16. data/install_scripts/GEO/platforms/GPL1090.yaml +7 -0
  17. data/install_scripts/GEO/platforms/GPL1104.yaml +7 -0
  18. data/install_scripts/GEO/platforms/GPL118.yaml +7 -0
  19. data/install_scripts/GEO/platforms/GPL1205.yaml +4 -0
  20. data/install_scripts/GEO/platforms/GPL1211.yaml +7 -0
  21. data/install_scripts/GEO/platforms/GPL1213.yaml +7 -0
  22. data/install_scripts/GEO/platforms/GPL1219.yaml +4 -0
  23. data/install_scripts/GEO/platforms/GPL1223.yaml +7 -0
  24. data/install_scripts/GEO/platforms/GPL1226.yaml +7 -0
  25. data/install_scripts/GEO/platforms/GPL1229.yaml +7 -0
  26. data/install_scripts/GEO/platforms/GPL1230.yaml +7 -0
  27. data/install_scripts/GEO/platforms/GPL1231.yaml +7 -0
  28. data/install_scripts/GEO/platforms/GPL1232.yaml +7 -0
  29. data/install_scripts/GEO/platforms/GPL1260.yaml +4 -0
  30. data/install_scripts/GEO/platforms/GPL1261.yaml +4 -0
  31. data/install_scripts/GEO/platforms/GPL127.yaml +4 -0
  32. data/install_scripts/GEO/platforms/GPL128.yaml +7 -0
  33. data/install_scripts/GEO/platforms/GPL1290.yaml +7 -0
  34. data/install_scripts/GEO/platforms/GPL1292.yaml +7 -0
  35. data/install_scripts/GEO/platforms/GPL1293.yaml +7 -0
  36. data/install_scripts/GEO/platforms/GPL1294.yaml +7 -0
  37. data/install_scripts/GEO/platforms/GPL1295.yaml +7 -0
  38. data/install_scripts/GEO/platforms/GPL13.yaml +4 -0
  39. data/install_scripts/GEO/platforms/GPL1310.yaml +7 -0
  40. data/install_scripts/GEO/platforms/GPL1313.yaml +7 -0
  41. data/install_scripts/GEO/platforms/GPL1323.yaml +7 -0
  42. data/install_scripts/GEO/platforms/GPL1331.yaml +7 -0
  43. data/install_scripts/GEO/platforms/GPL1352.yaml +4 -0
  44. data/install_scripts/GEO/platforms/GPL1355.yaml +4 -0
  45. data/install_scripts/GEO/platforms/GPL1382.yaml +7 -0
  46. data/install_scripts/GEO/platforms/GPL1387.yaml +7 -0
  47. data/install_scripts/GEO/platforms/GPL1397.yaml +4 -0
  48. data/install_scripts/GEO/platforms/GPL14.yaml +7 -0
  49. data/install_scripts/GEO/platforms/GPL1412.yaml +7 -0
  50. data/install_scripts/GEO/platforms/GPL1415.yaml +7 -0
  51. data/install_scripts/GEO/platforms/GPL1420.yaml +7 -0
  52. data/install_scripts/GEO/platforms/GPL144.yaml +7 -0
  53. data/install_scripts/GEO/platforms/GPL1449.yaml +7 -0
  54. data/install_scripts/GEO/platforms/GPL1458.yaml +7 -0
  55. data/install_scripts/GEO/platforms/GPL1523.yaml +7 -0
  56. data/install_scripts/GEO/platforms/GPL1524.yaml +7 -0
  57. data/install_scripts/GEO/platforms/GPL1528.yaml +7 -0
  58. data/install_scripts/GEO/platforms/GPL153.yaml +7 -0
  59. data/install_scripts/GEO/platforms/GPL1530.yaml +7 -0
  60. data/install_scripts/GEO/platforms/GPL1535.yaml +4 -0
  61. data/install_scripts/GEO/platforms/GPL155.yaml +7 -0
  62. data/install_scripts/GEO/platforms/GPL163.yaml +7 -0
  63. data/install_scripts/GEO/platforms/GPL168.yaml +7 -0
  64. data/install_scripts/GEO/platforms/GPL169.yaml +7 -0
  65. data/install_scripts/GEO/platforms/GPL1704.yaml +4 -0
  66. data/install_scripts/GEO/platforms/GPL1708.yaml +7 -0
  67. data/install_scripts/GEO/platforms/GPL1739.yaml +7 -0
  68. data/install_scripts/GEO/platforms/GPL1740.yaml +4 -0
  69. data/install_scripts/GEO/platforms/GPL1749.yaml +7 -0
  70. data/install_scripts/GEO/platforms/GPL177.yaml +7 -0
  71. data/install_scripts/GEO/platforms/GPL1790.yaml +7 -0
  72. data/install_scripts/GEO/platforms/GPL1792.yaml +7 -0
  73. data/install_scripts/GEO/platforms/GPL181.yaml +7 -0
  74. data/install_scripts/GEO/platforms/GPL1818.yaml +7 -0
  75. data/install_scripts/GEO/platforms/GPL1820.yaml +4 -0
  76. data/install_scripts/GEO/platforms/GPL1823.yaml +7 -0
  77. data/install_scripts/GEO/platforms/GPL1826.yaml +7 -0
  78. data/install_scripts/GEO/platforms/GPL183.yaml +7 -0
  79. data/install_scripts/GEO/platforms/GPL1831.yaml +7 -0
  80. data/install_scripts/GEO/platforms/GPL1833.yaml +7 -0
  81. data/install_scripts/GEO/platforms/GPL1872.yaml +4 -0
  82. data/install_scripts/GEO/platforms/GPL1911.yaml +7 -0
  83. data/install_scripts/GEO/platforms/GPL1914.yaml +4 -0
  84. data/install_scripts/GEO/platforms/GPL1928.yaml +7 -0
  85. data/install_scripts/GEO/platforms/GPL1942.yaml +7 -0
  86. data/install_scripts/GEO/platforms/GPL1945.yaml +7 -0
  87. data/install_scripts/GEO/platforms/GPL1964.yaml +7 -0
  88. data/install_scripts/GEO/platforms/GPL198.yaml +4 -0
  89. data/install_scripts/GEO/platforms/GPL1981.yaml +4 -0
  90. data/install_scripts/GEO/platforms/GPL200.yaml +7 -0
  91. data/install_scripts/GEO/platforms/GPL2006.yaml +7 -0
  92. data/install_scripts/GEO/platforms/GPL201.yaml +4 -0
  93. data/install_scripts/GEO/platforms/GPL2011.yaml +7 -0
  94. data/install_scripts/GEO/platforms/GPL2026.yaml +7 -0
  95. data/install_scripts/GEO/platforms/GPL205.yaml +7 -0
  96. data/install_scripts/GEO/platforms/GPL207.yaml +7 -0
  97. data/install_scripts/GEO/platforms/GPL2136.yaml +7 -0
  98. data/install_scripts/GEO/platforms/GPL220.yaml +7 -0
  99. data/install_scripts/GEO/platforms/GPL226.yaml +7 -0
  100. data/install_scripts/GEO/platforms/GPL24.yaml +4 -0
  101. data/install_scripts/GEO/platforms/GPL246.yaml +4 -0
  102. data/install_scripts/GEO/platforms/GPL247.yaml +7 -0
  103. data/install_scripts/GEO/platforms/GPL2507.yaml +4 -0
  104. data/install_scripts/GEO/platforms/GPL2529.yaml +4 -0
  105. data/install_scripts/GEO/platforms/GPL2531.yaml +7 -0
  106. data/install_scripts/GEO/platforms/GPL254.yaml +7 -0
  107. data/install_scripts/GEO/platforms/GPL2569.yaml +7 -0
  108. data/install_scripts/GEO/platforms/GPL257.yaml +7 -0
  109. data/install_scripts/GEO/platforms/GPL2598.yaml +7 -0
  110. data/install_scripts/GEO/platforms/GPL260.yaml +7 -0
  111. data/install_scripts/GEO/platforms/GPL2614.yaml +4 -0
  112. data/install_scripts/GEO/platforms/GPL2622.yaml +7 -0
  113. data/install_scripts/GEO/platforms/GPL2623.yaml +7 -0
  114. data/install_scripts/GEO/platforms/GPL2660.yaml +7 -0
  115. data/install_scripts/GEO/platforms/GPL2670.yaml +7 -0
  116. data/install_scripts/GEO/platforms/GPL2677.yaml +7 -0
  117. data/install_scripts/GEO/platforms/GPL2700.yaml +4 -0
  118. data/install_scripts/GEO/platforms/GPL2721.yaml +7 -0
  119. data/install_scripts/GEO/platforms/GPL2727.yaml +7 -0
  120. data/install_scripts/GEO/platforms/GPL273.yaml +7 -0
  121. data/install_scripts/GEO/platforms/GPL2763.yaml +7 -0
  122. data/install_scripts/GEO/platforms/GPL2824.yaml +7 -0
  123. data/install_scripts/GEO/platforms/GPL284.yaml +7 -0
  124. data/install_scripts/GEO/platforms/GPL287.yaml +4 -0
  125. data/install_scripts/GEO/platforms/GPL2872.yaml +7 -0
  126. data/install_scripts/GEO/platforms/GPL288.yaml +4 -0
  127. data/install_scripts/GEO/platforms/GPL2883.yaml +7 -0
  128. data/install_scripts/GEO/platforms/GPL289.yaml +4 -0
  129. data/install_scripts/GEO/platforms/GPL2895.yaml +4 -0
  130. data/install_scripts/GEO/platforms/GPL2897.yaml +7 -0
  131. data/install_scripts/GEO/platforms/GPL2902.yaml +7 -0
  132. data/install_scripts/GEO/platforms/GPL2987.yaml +4 -0
  133. data/install_scripts/GEO/platforms/GPL2995.yaml +7 -0
  134. data/install_scripts/GEO/platforms/GPL3039.yaml +4 -0
  135. data/install_scripts/GEO/platforms/GPL3050.yaml +7 -0
  136. data/install_scripts/GEO/platforms/GPL3084.yaml +7 -0
  137. data/install_scripts/GEO/platforms/GPL3113.yaml +7 -0
  138. data/install_scripts/GEO/platforms/GPL317.yaml +7 -0
  139. data/install_scripts/GEO/platforms/GPL319.yaml +7 -0
  140. data/install_scripts/GEO/platforms/GPL32.yaml +4 -0
  141. data/install_scripts/GEO/platforms/GPL3222.yaml +7 -0
  142. data/install_scripts/GEO/platforms/GPL3295.yaml +7 -0
  143. data/install_scripts/GEO/platforms/GPL3305.yaml +4 -0
  144. data/install_scripts/GEO/platforms/GPL3306.yaml +7 -0
  145. data/install_scripts/GEO/platforms/GPL3307.yaml +7 -0
  146. data/install_scripts/GEO/platforms/GPL333.yaml +4 -0
  147. data/install_scripts/GEO/platforms/GPL3341.yaml +7 -0
  148. data/install_scripts/GEO/platforms/GPL3349.yaml +7 -0
  149. data/install_scripts/GEO/platforms/GPL339.yaml +4 -0
  150. data/install_scripts/GEO/platforms/GPL340.yaml +4 -0
  151. data/install_scripts/GEO/platforms/GPL3408.yaml +7 -0
  152. data/install_scripts/GEO/platforms/GPL341.yaml +4 -0
  153. data/install_scripts/GEO/platforms/GPL3415.yaml +4 -0
  154. data/install_scripts/GEO/platforms/GPL3423.yaml +7 -0
  155. data/install_scripts/GEO/platforms/GPL3440.yaml +7 -0
  156. data/install_scripts/GEO/platforms/GPL3457.yaml +4 -0
  157. data/install_scripts/GEO/platforms/GPL3504.yaml +4 -0
  158. data/install_scripts/GEO/platforms/GPL3506.yaml +4 -0
  159. data/install_scripts/GEO/platforms/GPL355.yaml +7 -0
  160. data/install_scripts/GEO/platforms/GPL3558.yaml +7 -0
  161. data/install_scripts/GEO/platforms/GPL3607.yaml +7 -0
  162. data/install_scripts/GEO/platforms/GPL368.yaml +4 -0
  163. data/install_scripts/GEO/platforms/GPL3695.yaml +7 -0
  164. data/install_scripts/GEO/platforms/GPL371.yaml +7 -0
  165. data/install_scripts/GEO/platforms/GPL3834.yaml +4 -0
  166. data/install_scripts/GEO/platforms/GPL4006.yaml +7 -0
  167. data/install_scripts/GEO/platforms/GPL4055.yaml +7 -0
  168. data/install_scripts/GEO/platforms/GPL409.yaml +7 -0
  169. data/install_scripts/GEO/platforms/GPL4191.yaml +7 -0
  170. data/install_scripts/GEO/platforms/GPL4226.yaml +7 -0
  171. data/install_scripts/GEO/platforms/GPL4371.yaml +7 -0
  172. data/install_scripts/GEO/platforms/GPL4567.yaml +4 -0
  173. data/install_scripts/GEO/platforms/GPL4685.yaml +4 -0
  174. data/install_scripts/GEO/platforms/GPL483.yaml +7 -0
  175. data/install_scripts/GEO/platforms/GPL49.yaml +7 -0
  176. data/install_scripts/GEO/platforms/GPL50.yaml +7 -0
  177. data/install_scripts/GEO/platforms/GPL500.yaml +7 -0
  178. data/install_scripts/GEO/platforms/GPL507.yaml +4 -0
  179. data/install_scripts/GEO/platforms/GPL51.yaml +7 -0
  180. data/install_scripts/GEO/platforms/GPL513.yaml +7 -0
  181. data/install_scripts/GEO/platforms/GPL519.yaml +7 -0
  182. data/install_scripts/GEO/platforms/GPL52.yaml +7 -0
  183. data/install_scripts/GEO/platforms/GPL529.yaml +7 -0
  184. data/install_scripts/GEO/platforms/GPL53.yaml +7 -0
  185. data/install_scripts/GEO/platforms/GPL5356.yaml +7 -0
  186. data/install_scripts/GEO/platforms/GPL538.yaml +7 -0
  187. data/install_scripts/GEO/platforms/GPL54.yaml +7 -0
  188. data/install_scripts/GEO/platforms/GPL543.yaml +7 -0
  189. data/install_scripts/GEO/platforms/GPL544.yaml +7 -0
  190. data/install_scripts/GEO/platforms/GPL545.yaml +7 -0
  191. data/install_scripts/GEO/platforms/GPL546.yaml +7 -0
  192. data/install_scripts/GEO/platforms/GPL547.yaml +7 -0
  193. data/install_scripts/GEO/platforms/GPL549.yaml +7 -0
  194. data/install_scripts/GEO/platforms/GPL550.yaml +4 -0
  195. data/install_scripts/GEO/platforms/GPL56.yaml +7 -0
  196. data/install_scripts/GEO/platforms/GPL560.yaml +4 -0
  197. data/install_scripts/GEO/platforms/GPL564.yaml +7 -0
  198. data/install_scripts/GEO/platforms/GPL57.yaml +7 -0
  199. data/install_scripts/GEO/platforms/GPL570.yaml +4 -0
  200. data/install_scripts/GEO/platforms/GPL571.yaml +4 -0
  201. data/install_scripts/GEO/platforms/GPL576.yaml +7 -0
  202. data/install_scripts/GEO/platforms/GPL58.yaml +7 -0
  203. data/install_scripts/GEO/platforms/GPL5823.yaml +4 -0
  204. data/install_scripts/GEO/platforms/GPL59.yaml +7 -0
  205. data/install_scripts/GEO/platforms/GPL5915.yaml +4 -0
  206. data/install_scripts/GEO/platforms/GPL5947.yaml +7 -0
  207. data/install_scripts/GEO/platforms/GPL61.yaml +7 -0
  208. data/install_scripts/GEO/platforms/GPL64.yaml +7 -0
  209. data/install_scripts/GEO/platforms/GPL6419.yaml +7 -0
  210. data/install_scripts/GEO/platforms/GPL6424.yaml +7 -0
  211. data/install_scripts/GEO/platforms/GPL65.yaml +7 -0
  212. data/install_scripts/GEO/platforms/GPL6574.yaml +4 -0
  213. data/install_scripts/GEO/platforms/GPL6649.yaml +4 -0
  214. data/install_scripts/GEO/platforms/GPL67.yaml +7 -0
  215. data/install_scripts/GEO/platforms/GPL6720.yaml +7 -0
  216. data/install_scripts/GEO/platforms/GPL7054.yaml +4 -0
  217. data/install_scripts/GEO/platforms/GPL737.yaml +7 -0
  218. data/install_scripts/GEO/platforms/GPL738.yaml +7 -0
  219. data/install_scripts/GEO/platforms/GPL74.yaml +4 -0
  220. data/install_scripts/GEO/platforms/GPL75.yaml +4 -0
  221. data/install_scripts/GEO/platforms/GPL76.yaml +4 -0
  222. data/install_scripts/GEO/platforms/GPL764.yaml +7 -0
  223. data/install_scripts/GEO/platforms/GPL772.yaml +7 -0
  224. data/install_scripts/GEO/platforms/GPL782.yaml +7 -0
  225. data/install_scripts/GEO/platforms/GPL783.yaml +7 -0
  226. data/install_scripts/GEO/platforms/GPL784.yaml +7 -0
  227. data/install_scripts/GEO/platforms/GPL80.yaml +4 -0
  228. data/install_scripts/GEO/platforms/GPL81.yaml +4 -0
  229. data/install_scripts/GEO/platforms/GPL82.yaml +4 -0
  230. data/install_scripts/GEO/platforms/GPL83.yaml +4 -0
  231. data/install_scripts/GEO/platforms/GPL85.yaml +4 -0
  232. data/install_scripts/GEO/platforms/GPL86.yaml +4 -0
  233. data/install_scripts/GEO/platforms/GPL87.yaml +4 -0
  234. data/install_scripts/GEO/platforms/GPL870.yaml +7 -0
  235. data/install_scripts/GEO/platforms/GPL875.yaml +7 -0
  236. data/install_scripts/GEO/platforms/GPL884.yaml +7 -0
  237. data/install_scripts/GEO/platforms/GPL887.yaml +7 -0
  238. data/install_scripts/GEO/platforms/GPL89.yaml +4 -0
  239. data/install_scripts/GEO/platforms/GPL890.yaml +7 -0
  240. data/install_scripts/GEO/platforms/GPL891.yaml +7 -0
  241. data/install_scripts/GEO/platforms/GPL90.yaml +7 -0
  242. data/install_scripts/GEO/platforms/GPL91.yaml +4 -0
  243. data/install_scripts/GEO/platforms/GPL92.yaml +4 -0
  244. data/install_scripts/GEO/platforms/GPL920.yaml +7 -0
  245. data/install_scripts/GEO/platforms/GPL922.yaml +7 -0
  246. data/install_scripts/GEO/platforms/GPL924.yaml +7 -0
  247. data/install_scripts/GEO/platforms/GPL93.yaml +4 -0
  248. data/install_scripts/GEO/platforms/GPL96.yaml +4 -0
  249. data/install_scripts/GEO/platforms/GPL968.yaml +4 -0
  250. data/install_scripts/GEO/platforms/GPL97.yaml +4 -0
  251. data/install_scripts/GEO/platforms/GPL98.yaml +7 -0
  252. data/install_scripts/GEO/platforms/GPL981.yaml +7 -0
  253. data/install_scripts/GEO/platforms/GPL99.yaml +7 -0
  254. data/install_scripts/GEO/platforms/GPL999.yaml +7 -0
  255. data/install_scripts/GEO/series/GSE10018.yaml +61 -0
  256. data/install_scripts/GEO/series/GSE1002.yaml +135 -0
  257. data/install_scripts/GEO/series/GSE10066.yaml +31 -0
  258. data/install_scripts/GEO/series/GSE10073.yaml +19 -0
  259. data/install_scripts/GEO/series/GSE10091.yaml +15 -0
  260. data/install_scripts/GEO/series/GSE101.yaml +17 -0
  261. data/install_scripts/GEO/series/GSE10100.yaml +15 -0
  262. data/install_scripts/GEO/series/GSE10101.yaml +15 -0
  263. data/install_scripts/GEO/series/GSE10102.yaml +15 -0
  264. data/install_scripts/GEO/series/GSE10267.yaml +37 -0
  265. data/install_scripts/GEO/series/GSE10268.yaml +115 -0
  266. data/install_scripts/GEO/series/GSE10279.yaml +23 -0
  267. data/install_scripts/GEO/series/GSE103.yaml +19 -0
  268. data/install_scripts/GEO/series/GSE104.yaml +19 -0
  269. data/install_scripts/GEO/series/GSE10514.yaml +27 -0
  270. data/install_scripts/GEO/series/GSE10521.yaml +56 -0
  271. data/install_scripts/GEO/series/GSE10554.yaml +19 -0
  272. data/install_scripts/GEO/series/GSE1073.yaml +127 -0
  273. data/install_scripts/GEO/series/GSE10860.yaml +25 -0
  274. data/install_scripts/GEO/series/GSE10930.yaml +15 -0
  275. data/install_scripts/GEO/series/GSE10933.yaml +15 -0
  276. data/install_scripts/GEO/series/GSE10944.yaml +21 -0
  277. data/install_scripts/GEO/series/GSE10947.yaml +21 -0
  278. data/install_scripts/GEO/series/GSE10948.yaml +21 -0
  279. data/install_scripts/GEO/series/GSE11061.yaml +19 -0
  280. data/install_scripts/GEO/series/GSE11071.yaml +67 -0
  281. data/install_scripts/GEO/series/GSE11111.yaml +25 -0
  282. data/install_scripts/GEO/series/GSE11236.yaml +25 -0
  283. data/install_scripts/GEO/series/GSE11282.yaml +19 -0
  284. data/install_scripts/GEO/series/GSE11377.yaml +19 -0
  285. data/install_scripts/GEO/series/GSE11380.yaml +13 -0
  286. data/install_scripts/GEO/series/GSE11397.yaml +55 -0
  287. data/install_scripts/GEO/series/GSE11412.yaml +11 -0
  288. data/install_scripts/GEO/series/GSE11452.yaml +354 -0
  289. data/install_scripts/GEO/series/GSE11620.yaml +33 -0
  290. data/install_scripts/GEO/series/GSE11621.yaml +31 -0
  291. data/install_scripts/GEO/series/GSE11651.yaml +94 -0
  292. data/install_scripts/GEO/series/GSE11754.yaml +29 -0
  293. data/install_scripts/GEO/series/GSE11799.yaml +59 -0
  294. data/install_scripts/GEO/series/GSE11856.yaml +11 -0
  295. data/install_scripts/GEO/series/GSE11878.yaml +19 -0
  296. data/install_scripts/GEO/series/GSE11983.yaml +15 -0
  297. data/install_scripts/GEO/series/GSE12004.yaml +41 -0
  298. data/install_scripts/GEO/series/GSE12055.yaml +109 -0
  299. data/install_scripts/GEO/series/GSE12061.yaml +13 -0
  300. data/install_scripts/GEO/series/GSE12104.yaml +10 -0
  301. data/install_scripts/GEO/series/GSE12138.yaml +13 -0
  302. data/install_scripts/GEO/series/GSE12150.yaml +32 -0
  303. data/install_scripts/GEO/series/GSE12684.yaml +47 -0
  304. data/install_scripts/GEO/series/GSE12685.yaml +34 -0
  305. data/install_scripts/GEO/series/GSE1365.yaml +14 -0
  306. data/install_scripts/GEO/series/GSE1404.yaml +596 -0
  307. data/install_scripts/GEO/series/GSE1492.yaml +15 -0
  308. data/install_scripts/GEO/series/GSE15222.yaml +731 -0
  309. data/install_scripts/GEO/series/GSE1553.yaml +23 -0
  310. data/install_scripts/GEO/series/GSE1617.yaml +39 -0
  311. data/install_scripts/GEO/series/GSE1688.yaml +36 -0
  312. data/install_scripts/GEO/series/GSE1693.yaml +60 -0
  313. data/install_scripts/GEO/series/GSE1752.yaml +32 -0
  314. data/install_scripts/GEO/series/GSE1753.yaml +16 -0
  315. data/install_scripts/GEO/series/GSE1754.yaml +19 -0
  316. data/install_scripts/GEO/series/GSE1758.yaml +15 -0
  317. data/install_scripts/GEO/series/GSE1759.yaml +18 -0
  318. data/install_scripts/GEO/series/GSE1760.yaml +18 -0
  319. data/install_scripts/GEO/series/GSE1763.yaml +19 -0
  320. data/install_scripts/GEO/series/GSE1915.yaml +39 -0
  321. data/install_scripts/GEO/series/GSE1927.yaml +14 -0
  322. data/install_scripts/GEO/series/GSE1941.yaml +23 -0
  323. data/install_scripts/GEO/series/GSE1942.yaml +31 -0
  324. data/install_scripts/GEO/series/GSE1944.yaml +58 -0
  325. data/install_scripts/GEO/series/GSE1975.yaml +65 -0
  326. data/install_scripts/GEO/series/GSE20.yaml +24 -0
  327. data/install_scripts/GEO/series/GSE2107.yaml +14 -0
  328. data/install_scripts/GEO/series/GSE2159.yaml +31 -0
  329. data/install_scripts/GEO/series/GSE2246.yaml +157 -0
  330. data/install_scripts/GEO/series/GSE2263.yaml +57 -0
  331. data/install_scripts/GEO/series/GSE2267.yaml +155 -0
  332. data/install_scripts/GEO/series/GSE23.yaml +58 -0
  333. data/install_scripts/GEO/series/GSE2329.yaml +43 -0
  334. data/install_scripts/GEO/series/GSE2330.yaml +55 -0
  335. data/install_scripts/GEO/series/GSE2349.yaml +19 -0
  336. data/install_scripts/GEO/series/GSE2412.yaml +58 -0
  337. data/install_scripts/GEO/series/GSE2419.yaml +27 -0
  338. data/install_scripts/GEO/series/GSE2420.yaml +29 -0
  339. data/install_scripts/GEO/series/GSE2434.yaml +37 -0
  340. data/install_scripts/GEO/series/GSE2526.yaml +23 -0
  341. data/install_scripts/GEO/series/GSE2579.yaml +19 -0
  342. data/install_scripts/GEO/series/GSE2806.yaml +11 -0
  343. data/install_scripts/GEO/series/GSE2831.yaml +35 -0
  344. data/install_scripts/GEO/series/GSE2832.yaml +17 -0
  345. data/install_scripts/GEO/series/GSE29.yaml +16 -0
  346. data/install_scripts/GEO/series/GSE3006.yaml +35 -0
  347. data/install_scripts/GEO/series/GSE3043.yaml +18 -0
  348. data/install_scripts/GEO/series/GSE3122.yaml +12 -0
  349. data/install_scripts/GEO/series/GSE3130.yaml +12 -0
  350. data/install_scripts/GEO/series/GSE3151.yaml +118 -0
  351. data/install_scripts/GEO/series/GSE3160.yaml +31 -0
  352. data/install_scripts/GEO/series/GSE3190.yaml +14 -0
  353. data/install_scripts/GEO/series/GSE3205.yaml +36 -0
  354. data/install_scripts/GEO/series/GSE3206.yaml +23 -0
  355. data/install_scripts/GEO/series/GSE3315.yaml +13 -0
  356. data/install_scripts/GEO/series/GSE3335.yaml +15 -0
  357. data/install_scripts/GEO/series/GSE34.yaml +31 -0
  358. data/install_scripts/GEO/series/GSE3470.yaml +15 -0
  359. data/install_scripts/GEO/series/GSE35.yaml +80 -0
  360. data/install_scripts/GEO/series/GSE3503.yaml +19 -0
  361. data/install_scripts/GEO/series/GSE3683.yaml +83 -0
  362. data/install_scripts/GEO/series/GSE3684.yaml +19 -0
  363. data/install_scripts/GEO/series/GSE3685.yaml +31 -0
  364. data/install_scripts/GEO/series/GSE3686.yaml +63 -0
  365. data/install_scripts/GEO/series/GSE3687.yaml +83 -0
  366. data/install_scripts/GEO/series/GSE3802.yaml +19 -0
  367. data/install_scripts/GEO/series/GSE3803.yaml +19 -0
  368. data/install_scripts/GEO/series/GSE3804.yaml +19 -0
  369. data/install_scripts/GEO/series/GSE3805.yaml +19 -0
  370. data/install_scripts/GEO/series/GSE3813.yaml +9 -0
  371. data/install_scripts/GEO/series/GSE3814.yaml +71 -0
  372. data/install_scripts/GEO/series/GSE3815.yaml +75 -0
  373. data/install_scripts/GEO/series/GSE3817.yaml +13 -0
  374. data/install_scripts/GEO/series/GSE3818.yaml +15 -0
  375. data/install_scripts/GEO/series/GSE3819.yaml +13 -0
  376. data/install_scripts/GEO/series/GSE3820.yaml +61 -0
  377. data/install_scripts/GEO/series/GSE3821.yaml +55 -0
  378. data/install_scripts/GEO/series/GSE3844.yaml +11 -0
  379. data/install_scripts/GEO/series/GSE3853.yaml +31 -0
  380. data/install_scripts/GEO/series/GSE3935.yaml +12 -0
  381. data/install_scripts/GEO/series/GSE3969.yaml +14 -0
  382. data/install_scripts/GEO/series/GSE4049.yaml +80 -0
  383. data/install_scripts/GEO/series/GSE4144.yaml +9 -0
  384. data/install_scripts/GEO/series/GSE4261.yaml +59 -0
  385. data/install_scripts/GEO/series/GSE4295.yaml +63 -0
  386. data/install_scripts/GEO/series/GSE4398.yaml +50 -0
  387. data/install_scripts/GEO/series/GSE4719.yaml +76 -0
  388. data/install_scripts/GEO/series/GSE4720.yaml +78 -0
  389. data/install_scripts/GEO/series/GSE4721.yaml +14 -0
  390. data/install_scripts/GEO/series/GSE4807.yaml +67 -0
  391. data/install_scripts/GEO/series/GSE4826.yaml +39 -0
  392. data/install_scripts/GEO/series/GSE4934.yaml +23 -0
  393. data/install_scripts/GEO/series/GSE5027.yaml +31 -0
  394. data/install_scripts/GEO/series/GSE5070.yaml +25 -0
  395. data/install_scripts/GEO/series/GSE5238.yaml +31 -0
  396. data/install_scripts/GEO/series/GSE5267.yaml +55 -0
  397. data/install_scripts/GEO/series/GSE5281.yaml +492 -0
  398. data/install_scripts/GEO/series/GSE5290.yaml +24 -0
  399. data/install_scripts/GEO/series/GSE5376.yaml +107 -0
  400. data/install_scripts/GEO/series/GSE5575.yaml +13 -0
  401. data/install_scripts/GEO/series/GSE5835.yaml +25 -0
  402. data/install_scripts/GEO/series/GSE5836.yaml +37 -0
  403. data/install_scripts/GEO/series/GSE5837.yaml +37 -0
  404. data/install_scripts/GEO/series/GSE5938.yaml +187 -0
  405. data/install_scripts/GEO/series/GSE600.yaml +29 -0
  406. data/install_scripts/GEO/series/GSE6018.yaml +55 -0
  407. data/install_scripts/GEO/series/GSE6066.yaml +20 -0
  408. data/install_scripts/GEO/series/GSE6067.yaml +31 -0
  409. data/install_scripts/GEO/series/GSE6068.yaml +55 -0
  410. data/install_scripts/GEO/series/GSE6070.yaml +31 -0
  411. data/install_scripts/GEO/series/GSE6071.yaml +30 -0
  412. data/install_scripts/GEO/series/GSE6072.yaml +37 -0
  413. data/install_scripts/GEO/series/GSE6101.yaml +26 -0
  414. data/install_scripts/GEO/series/GSE6111.yaml +20 -0
  415. data/install_scripts/GEO/series/GSE6190.yaml +30 -0
  416. data/install_scripts/GEO/series/GSE6277.yaml +19 -0
  417. data/install_scripts/GEO/series/GSE6331.yaml +51 -0
  418. data/install_scripts/GEO/series/GSE6346.yaml +49 -0
  419. data/install_scripts/GEO/series/GSE6358.yaml +22 -0
  420. data/install_scripts/GEO/series/GSE6405.yaml +36 -0
  421. data/install_scripts/GEO/series/GSE6450.yaml +51 -0
  422. data/install_scripts/GEO/series/GSE6687.yaml +15 -0
  423. data/install_scripts/GEO/series/GSE6705.yaml +19 -0
  424. data/install_scripts/GEO/series/GSE6801.yaml +27 -0
  425. data/install_scripts/GEO/series/GSE6847.yaml +18 -0
  426. data/install_scripts/GEO/series/GSE6870.yaml +23 -0
  427. data/install_scripts/GEO/series/GSE7103.yaml +28 -0
  428. data/install_scripts/GEO/series/GSE7140.yaml +19 -0
  429. data/install_scripts/GEO/series/GSE7188.yaml +23 -0
  430. data/install_scripts/GEO/series/GSE7261.yaml +16 -0
  431. data/install_scripts/GEO/series/GSE7337.yaml +19 -0
  432. data/install_scripts/GEO/series/GSE7338.yaml +19 -0
  433. data/install_scripts/GEO/series/GSE7362.yaml +123 -0
  434. data/install_scripts/GEO/series/GSE7369.yaml +15 -0
  435. data/install_scripts/GEO/series/GSE7525.yaml +33 -0
  436. data/install_scripts/GEO/series/GSE7537.yaml +27 -0
  437. data/install_scripts/GEO/series/GSE7645.yaml +152 -0
  438. data/install_scripts/GEO/series/GSE7660.yaml +41 -0
  439. data/install_scripts/GEO/series/GSE7820.yaml +30 -0
  440. data/install_scripts/GEO/series/GSE79.yaml +32 -0
  441. data/install_scripts/GEO/series/GSE8035.yaml +19 -0
  442. data/install_scripts/GEO/series/GSE8088.yaml +13 -0
  443. data/install_scripts/GEO/series/GSE8089.yaml +19 -0
  444. data/install_scripts/GEO/series/GSE8111.yaml +15 -0
  445. data/install_scripts/GEO/series/GSE8237.yaml +35 -0
  446. data/install_scripts/GEO/series/GSE8326.yaml +37 -0
  447. data/install_scripts/GEO/series/GSE8399.yaml +13 -0
  448. data/install_scripts/GEO/series/GSE850.yaml +15 -0
  449. data/install_scripts/GEO/series/GSE8506.yaml +32 -0
  450. data/install_scripts/GEO/series/GSE8542.yaml +47 -0
  451. data/install_scripts/GEO/series/GSE8558.yaml +19 -0
  452. data/install_scripts/GEO/series/GSE8559.yaml +47 -0
  453. data/install_scripts/GEO/series/GSE8613.yaml +19 -0
  454. data/install_scripts/GEO/series/GSE8629.yaml +18 -0
  455. data/install_scripts/GEO/series/GSE8729.yaml +19 -0
  456. data/install_scripts/GEO/series/GSE8761.yaml +55 -0
  457. data/install_scripts/GEO/series/GSE8765.yaml +15 -0
  458. data/install_scripts/GEO/series/GSE8805.yaml +64 -0
  459. data/install_scripts/GEO/series/GSE8825.yaml +79 -0
  460. data/install_scripts/GEO/series/GSE8895.yaml +31 -0
  461. data/install_scripts/GEO/series/GSE8897.yaml +17 -0
  462. data/install_scripts/GEO/series/GSE8898.yaml +18 -0
  463. data/install_scripts/GEO/series/GSE8900.yaml +43 -0
  464. data/install_scripts/GEO/series/GSE8982.yaml +106 -0
  465. data/install_scripts/GEO/series/GSE920.yaml +20 -0
  466. data/install_scripts/GEO/series/GSE960.yaml +10 -0
  467. data/install_scripts/GEO/series/GSE961.yaml +14 -0
  468. data/install_scripts/GEO/series/GSE962.yaml +20 -0
  469. data/install_scripts/GEO/series/GSE963.yaml +14 -0
  470. data/install_scripts/GEO/series/GSE964.yaml +14 -0
  471. data/install_scripts/GEO/series/GSE965.yaml +14 -0
  472. data/install_scripts/GEO/series/GSE966.yaml +14 -0
  473. data/install_scripts/GEO/series/GSE993.yaml +9 -0
  474. data/lib/MARQ.rb +79 -0
  475. data/lib/MARQ/CustomDS.rb +99 -0
  476. data/lib/MARQ/GEO.rb +588 -0
  477. data/lib/MARQ/ID.rb +144 -0
  478. data/lib/MARQ/MADB.rb +238 -0
  479. data/lib/MARQ/annotations.rb +740 -0
  480. data/lib/MARQ/fdr.rb +177 -0
  481. data/lib/MARQ/main.rb +227 -0
  482. data/lib/MARQ/rankproduct.rb +146 -0
  483. data/lib/MARQ/score.rb +395 -0
  484. data/tasks/install.rake +21 -0
  485. metadata +588 -0
@@ -0,0 +1,99 @@
1
+ require 'rbbt/util/open'
2
+ require 'MARQ'
3
+ require 'MARQ/ID'
4
+ module CustomDS
5
+ @@r = nil
6
+
7
+ def self.customdir
8
+ File.join(MARQ.datadir,'CustomDS')
9
+ end
10
+
11
+ def self.r
12
+ if @@r.nil?
13
+ RSRuby.instance.source(MARQ.rootdir + '/R/MA.R')
14
+ RSRuby.instance.source(MARQ.rootdir + '/R/CustomDS.R')
15
+ @@r = RSRuby.instance
16
+ end
17
+ @@r
18
+ end
19
+
20
+ def self.info(dataset)
21
+ begin
22
+ text = Open.read(path(dataset) + '.description')
23
+ if text =~ /(.*)\n--\n(.*)/
24
+ {:title => $1.strip, :description => $2.strip}
25
+ elsif text.collect.length > 1 || text.length > 200
26
+ {:title => "", :description => text}
27
+ else
28
+ {:title => text, :description => ""}
29
+ end
30
+ rescue Exception
31
+ puts $!.message
32
+ {:title => "" , :description => "" }
33
+ end
34
+ end
35
+
36
+ def self.path(dataset)
37
+ files = Dir.glob(customdir + "/*/#{ dataset }.orders")
38
+ if files.length == 1
39
+ files.first.sub(/.orders/,'')
40
+ else
41
+ Dir.glob(customdir + "/*/#{ dataset }").first
42
+ end
43
+ end
44
+
45
+ def self.organism(dataset)
46
+ path(dataset).match(/#{ customdir }\/(.*?)\//)[1]
47
+ end
48
+
49
+ def self.is_cross_platform?(dataset)
50
+ dataset.match(/_cross_platform/)
51
+ end
52
+
53
+ def self.clean(dataset)
54
+ dataset.sub(/_cross_platform/,'')
55
+ end
56
+
57
+ def self.has_cross_platform?(dataset)
58
+ Dir.glob(path(clean(dataset)) + '_cross_platform.orders').any?
59
+ end
60
+
61
+ def self.datasets(org)
62
+ Dir.glob(File.join(customdir, org) + '/*.orders').collect{|f| clean(File.basename(f.sub(/.orders/,'')))}.uniq
63
+ end
64
+
65
+ def self.process(name)
66
+ puts "Processing #{ name }"
67
+ org = organism(name)
68
+ prefix = File.join(customdir, org, name)
69
+ conditions = Dir.glob(prefix + '/*').collect{|f| File.basename(f)} - %w(values codes info description cross_platform)
70
+ description = Open.read(File.join(prefix, 'description'))
71
+
72
+ info = YAML.load(File.open(File.join(prefix, 'info')))
73
+ r.CustomDS_process(prefix, false, conditions, description, info["two_channel"], !info["log2"])
74
+
75
+
76
+ codes = Open.read(File.join(prefix,'codes')).collect{|l| l.chomp}
77
+ cross_platform = ID.translate(org, codes)
78
+
79
+ if cross_platform.length > codes.length / 4
80
+ Open.write(File.join(prefix,'cross_platform'),cross_platform.collect{|c| c || "NO MATCH"}.join("\n"))
81
+ r.CustomDS_process(prefix, true, conditions, description, info["two_channel"], !info["log2"])
82
+ end
83
+ end
84
+
85
+ end
86
+
87
+
88
+ if __FILE__ == $0
89
+ p CustomDS::datasets('sgd')
90
+ p CustomDS::path('HaploidData')
91
+ p CustomDS::path('HaploidData_cross_platform')
92
+ exit
93
+
94
+ org = 'sgd'
95
+ process = Dir.glob(File.join(CustomDS::customdir, org) + '/*').select{|f| File.directory? f}.collect{|f| File.basename(f)} - CustomDS.datasets('sgd')
96
+ p process
97
+ process.each{|d| CustomDS::process(d)}
98
+
99
+ end
data/lib/MARQ/GEO.rb ADDED
@@ -0,0 +1,588 @@
1
+ require 'MARQ'
2
+ require 'rbbt/util/open'
3
+ require 'rbbt/sources/organism'
4
+
5
+ module GEO
6
+
7
+ CACHE_DIR = File.join(MARQ.cachedir,'GEO')
8
+ FileUtils.mkdir_p CACHE_DIR unless File.exists? CACHE_DIR
9
+
10
+ GEO_SOFT="http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?targ=self&view=full&form=text&acc="
11
+ def self.get_soft(item)
12
+ item = item.strip
13
+ cache_file = File.join(CACHE_DIR, item + '.soft')
14
+ if File.exist?( cache_file )
15
+ File.open(cache_file).read
16
+ else
17
+ content = Open.read(GEO_SOFT + item, :nocache => true)
18
+ fout = File.open(cache_file,'w')
19
+ fout.write content
20
+ fout.close
21
+ content
22
+ end
23
+ end
24
+
25
+ #{{{ Eutils
26
+ module Eutils
27
+ def self.organism_platforms(org)
28
+ name = Organism.name(org)
29
+ Open.read("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=gds&term=\"#{name}\"[Organism:exp]+AND+%22gpl%22[Filter]&retmax=10000").
30
+ scan(/<Id>(\d+?)<\/Id>/).collect{|id| id.first}.collect{|id| "GPL#{id.sub(/^100*/,'')}"}
31
+ end
32
+
33
+ def self.GPL_datasets(platform)
34
+ Open.read("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=gds&term=#{platform}[Accession]&retmax=2000").
35
+ scan(/<Id>(\d+?)<\/Id>/).collect{|id| id.first}.select{|id| !id.match(/^(1|2)000/) }.collect{|id| "GDS#{id}"}
36
+ end
37
+
38
+ def self.GSE_dataset?(gse)
39
+ Open.read("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=geo&term=#{gse}[Accession]&retmax=2000").
40
+ match(/<Id>(\d+?)<\/Id>/) != nil
41
+ end
42
+
43
+ end
44
+
45
+
46
+
47
+ #{{{ Helper functions
48
+
49
+
50
+ def self.consecutive?(ids)
51
+ ids.collect{|id| id.to_i}.sort[0..19] == (1..20).to_a
52
+ end
53
+
54
+ def self.numerical?(ids)
55
+ ids.compact.select{|id| ! id.match(/^\d+$/)}.uniq.length < ids.length.to_f / 10
56
+ end
57
+
58
+ def self.dna_sequence?(ids)
59
+ ids.compact.select{|id| ! id.strip.match(/^[ATCG]+$/i)}.empty?
60
+ end
61
+
62
+
63
+ ID_FIX = {
64
+ :mgi_unigene => proc{|gene| if gene then gene.match(/^Mm./) ? gene : "Mm." + gene end},
65
+ :human_unigene => proc{|gene| if gene then gene.match(/^Hs./) ? gene : "Hs." + gene end},
66
+ }
67
+
68
+ @@formats = {}
69
+ def self.guessIds(genes,org, name = nil)
70
+ @@formats[org] ||= Organism.id_formats(org)
71
+ if consecutive?(genes) || dna_sequence?(genes) || (numerical?(genes) && (name.nil? || !name.match(/entrez/i)))
72
+ id = nil
73
+ else
74
+ fix = ID_FIX[(org + "_" + name.downcase).to_sym] if name
75
+ if fix
76
+ genes = genes.collect{|gene| fix.call(gene)}
77
+ end
78
+ id = Organism.guessIdFormat(@@formats[org], genes)
79
+ end
80
+
81
+ id
82
+ end
83
+
84
+ @@r = nil
85
+ def self.r
86
+ if @@r.nil?
87
+
88
+ # FIXME: RSruby does not install very well, this require id hidden here.
89
+ require 'rsruby'
90
+
91
+ RSRuby.instance.source(MARQ.rootdir + '/R/MA.R')
92
+ RSRuby.instance.source(MARQ.rootdir + '/R/GEO.R')
93
+ @@r = RSRuby.instance
94
+ end
95
+ @@r
96
+ end
97
+
98
+
99
+ #{{{ Process
100
+
101
+ def self.get_GPL(name, prefix, id_field = nil)
102
+ r.GEO_GPL_process(name, prefix, id_field, CACHE_DIR)
103
+ end
104
+
105
+ def self.get_GDS(name, prefix, id_field = nil, id_file = nil)
106
+ r.GEO_GDS_process(name, prefix, id_field, id_file, CACHE_DIR)
107
+ end
108
+
109
+ def self.get_GSE(gsms, conditions, do_log, prefix, id_file = nil, fields= nil, title = nil, description = nil)
110
+ r.GEO_GSE_process(gsms, conditions, prefix, do_log, id_file, fields, title, description, CACHE_DIR)
111
+ end
112
+
113
+ def self.GSE_info(series)
114
+ soft = get_soft(series)
115
+ raise "SOFT file error" if soft !~ /!/
116
+
117
+ if match = soft.scan(/!Series_platform_id\s*=?\s*(.*)/)
118
+ platform = match.flatten.collect{|p| p.strip}
119
+ else
120
+ raise "No Platform information"
121
+ end
122
+
123
+ if soft.match(/!Series_title \s*=?\s*(.*)/)
124
+ title = $1
125
+ else
126
+ raise "No Title information"
127
+ end
128
+
129
+ if soft.match(/!Series_summary \s*=?\s*(.*)/)
130
+ matches = soft.scan(/!Series_summary \s*=?\s*(.*)/).to_a
131
+ description = matches.collect{|m| m.to_s.strip.sub(/!Series_summary \s*=?\s*/,'')}.join("\n")
132
+ else
133
+ raise "No Summary information"
134
+ end
135
+
136
+ if soft.match(/!Series_sample_id \s*=?\s*(.*)/)
137
+ matches = soft.scan(/!Series_sample_id \s*=?\s*(.*)/).to_a
138
+ samples = matches.collect{|m| m.to_s.strip.sub(/!Series_sample_id \s*=?\s*/,'')}
139
+ else
140
+ raise "No Summary information"
141
+ end
142
+
143
+ {
144
+ :platform => platform.join("_"),
145
+ :description =>description.strip,
146
+ :title => title.strip,
147
+ :samples => samples,
148
+ }
149
+ end
150
+
151
+ def self.GSM_info(array)
152
+ soft = get_soft(array)
153
+
154
+ if soft.match(/!Sample_title\s*=?\s*(.*)/)
155
+ title = $1
156
+ else
157
+ raise "No Title information"
158
+ end
159
+
160
+
161
+ if soft.match(/!Sample_description \s*=?\s*(.*)/)
162
+ description = $1
163
+ else
164
+ raise "No Description information"
165
+ end
166
+
167
+ {
168
+
169
+ :description =>description.strip,
170
+ :title => title.strip,
171
+ }
172
+ end
173
+
174
+ def self.GPL_id_fields(platform)
175
+ soft = get_soft(platform)
176
+ data = soft.split(/!platform_table_begin/s)[1].collect{|l| l.chomp.split(/\t/)}
177
+ data.shift
178
+ data.shift
179
+ end
180
+
181
+ def self.GPL_info(platform)
182
+ if !File.exist?(File.join(MARQ.datadir, 'GEO', 'platforms',"#{platform}.yaml")) &&
183
+ !File.exist?(File.join(MARQ.datadir, 'GEO', 'platforms',"#{platform}.skip"))
184
+ begin
185
+ if platform =~ /_/
186
+ organism = GPL_info(platform.match(/(.*?)_/)[1])[:organism]
187
+
188
+ info = {
189
+ :organism => organism,
190
+ :title => "Merged platforms #{ platform }",
191
+ }
192
+ return info
193
+ end
194
+ soft = get_soft(platform)
195
+
196
+
197
+ raise "SOFT file error" if soft !~ /!/
198
+
199
+ organisms = soft.scan(/!Platform_organism\s*=\s*(.*)/).collect{|v| v.first.strip}
200
+
201
+ if organisms.empty?
202
+ raise "No Organism information"
203
+ else
204
+ # This might happen actually GPL2529
205
+ organisms.delete('Schizosaccharomyces pombe') if organisms.include?('Saccharomyces cerevisiae')
206
+ org_name = organisms.first
207
+ end
208
+
209
+
210
+ title = ""
211
+ if soft.match(/!Platform_title\s*=\s*(.*)/)
212
+ title = $1
213
+ end
214
+
215
+ org = Organism.name2org(org_name)
216
+ raise "Organism not identified" if org.nil?
217
+
218
+ if soft.match(/!platform_table_begin/)
219
+ data = soft.split(/!platform_table_begin/s)[1].collect{|l| l.chomp.split(/\t/)}
220
+ data.shift
221
+ names = data.shift
222
+ total = data.first.length
223
+ genes = data.sort_by{ rand }[1..1000].collect{|v| v.first}
224
+
225
+ id = guessIds(genes,org, names.first)
226
+ other = nil
227
+ other_pos = 0
228
+ other_count = 0
229
+ other_name = 0
230
+ if id.nil?
231
+ (1..total - 1).to_a.each{|num|
232
+ genes = data.collect{|v| v[num]}
233
+ other = guessIds(genes,org, name = names[num])
234
+
235
+ if other && other[1] > other_count
236
+ other_pos = num
237
+ other_count = other[1]
238
+ other_name = names[num]
239
+ end
240
+ }
241
+ end
242
+ else
243
+ raise "Soft file incomplete"
244
+ end
245
+
246
+ info = {:organism => org, :BioMart_ID => id ? id.first : nil, :title => title }
247
+ info[:other_ID_field] = [other_pos + 1, other_name] if other_pos > 0
248
+
249
+
250
+ Open.write(File.join(MARQ.datadir, 'GEO', 'platforms',"#{platform}.yaml"), info.to_yaml)
251
+ rescue Exception
252
+ puts $!.message
253
+ puts $!.backtrace
254
+ Open.write(File.join(MARQ.datadir, 'GEO', 'platforms',"#{platform}.skip"), $!.message)
255
+ end
256
+ end
257
+
258
+ raise "Platform info for #{ platform } is not available and could not be automatically produced." if File.exist?(File.join(MARQ.datadir, 'GEO', 'platforms',"#{platform}.skip"))
259
+
260
+ YAML::load(File.open(File.join(MARQ.datadir, 'GEO', 'platforms',"#{platform}.yaml")))
261
+ end
262
+
263
+ def self.GDS_info(name)
264
+ begin
265
+ title, description = Open.read(dataset_path(name) + '.description').split(/\n--\n/).values_at(0,1)
266
+ {:title => title.strip, :description => description.strip}
267
+ rescue Exception
268
+ puts $!.message
269
+ {:title => "" , :description => "" }
270
+ end
271
+
272
+ end
273
+
274
+
275
+ #{{{ Misc Info
276
+
277
+ def self.clean(name)
278
+ name.sub(/_cross_platform/,'') if name
279
+ end
280
+
281
+ def self.platform_path(platform)
282
+ File.join(MARQ.datadir, "GEO/#{clean(platform)}")
283
+ end
284
+
285
+ def self.dataset_path(dataset, platform = nil)
286
+ if platform
287
+ return Dir.glob(File.join(platform_path(clean(platform)),"/*/#{ dataset }")).first.match(/(.*)\./)[1]
288
+ else
289
+ files = Dir.glob(File.join(MARQ.datadir, "GEO/GPL*/*/#{ dataset }.*"))
290
+ if files.any?
291
+ return files.first.match(/(.*)\./)[1]
292
+ else
293
+ return ""
294
+ end
295
+ end
296
+ end
297
+
298
+ def self.is_cross_platform?(dataset)
299
+ dataset =~ /_cross_platform/
300
+ end
301
+
302
+ def self.has_cross_platform?(dataset = nil, platform = nil)
303
+ platform = clean(platform)
304
+ raise "Dataset #{ dataset } not found" if dataset && dataset_path(dataset, platform).nil?
305
+ raise "Platform #{ platform } not found" if platform && platform_path(platform).nil?
306
+ if dataset
307
+ File.exists?(dataset_path(dataset, platform) + "_cross_platform.orders")
308
+ else
309
+ Dir.glob(File.join(platform_path(platform), '*', '*_cross_platform.orders')).any?
310
+ end
311
+ end
312
+
313
+
314
+ def self.platform_datasets(platform)
315
+ Dir.glob(File.join(platform_path(platform),"*/*.orders")).collect{|f| File.basename(f).sub(/.orders$/,'')}.select{|d| !is_cross_platform?(d)}
316
+ end
317
+
318
+ def self.dataset_platform(dataset)
319
+ dataset_path(dataset).match(/(GPL\d+)/)
320
+ $1
321
+ end
322
+
323
+ def self.organism_platforms(organism)
324
+ Dir.glob(File.join(MARQ.datadir, "GEO/GPL*")).collect{|f|
325
+ File.basename(f)
326
+ }.select{|platform|
327
+ GPL_info(platform)[:organism] == organism &&
328
+ platform_datasets(platform).any?
329
+ }
330
+ end
331
+
332
+ #{{{ Processing
333
+
334
+ def self.process_GDS(dataset, platform, field = nil)
335
+ puts "Processing GDS #{ dataset }. Platform #{ platform }"
336
+
337
+ puts "-- Original"
338
+ prefix = File.join(platform_path(platform), 'GDS', dataset.to_s)
339
+ GEO.get_GDS(dataset, prefix, field, nil)
340
+
341
+ # Was there an error?
342
+ if File.exist?(prefix + '.skip')
343
+ FileUtils.cp(prefix + '.skip', prefix + '_cross_platform.skip')
344
+ return
345
+ end
346
+
347
+ if File.exist?(File.join(platform,'cross_platform'))
348
+ puts "-- Translated to cross_platform format"
349
+ GEO.get_GDS(dataset, prefix + '_cross_platform', field, File.join(platform_path(platform), 'translations'))
350
+ end
351
+ end
352
+
353
+ # Rearange the lines of a file with the given order
354
+ def self.rearange(order, file, missing = "NA")
355
+ orig_lines = File.open(file).collect
356
+ return if orig_lines.empty?
357
+ columns = orig_lines.first.split(/\t/).length
358
+
359
+ lines = Array.new(order.length)
360
+
361
+ orig_lines.each_with_index{|l,i|
362
+ next if l.nil? || order[i].nil?
363
+ lines[order[i]] = l.chomp
364
+ }
365
+
366
+ lines = lines.collect{|l| l || [missing]*columns*"\t"}
367
+
368
+ fout = File.open(file, 'w')
369
+ fout.write(lines.join("\n"))
370
+ fout.close
371
+ end
372
+
373
+ # Fix possible discrepancies in ids between series and platforms
374
+ def self.fix_GSE_ids(platform_codes_file, prefix)
375
+ platform_codes = File.open(platform_codes_file).collect{|l| l.chomp}
376
+ platform_order = {}
377
+
378
+ platform_codes.each_with_index{|code, i|
379
+ platform_order[code] = i
380
+ }
381
+
382
+ series_codes = File.open(prefix + '.codes').collect{|l| l.chomp}
383
+
384
+ platform_positions = platform_order.values_at(*series_codes)
385
+
386
+ # Fill with nil for missing positions
387
+ platform_positions[platform_codes.length] ||= nil
388
+
389
+ %w(codes t logratios orders pvalues).each{|ext|
390
+ rearange(platform_positions, prefix + '.' + ext)
391
+ }
392
+
393
+ Open.write(prefix + '.swap', platform_positions.join("\n"))
394
+ end
395
+
396
+
397
+
398
+ def self.process_GSE(series, info)
399
+ return if Dir.glob(File.join(info[:platform], 'GSE', series) + '.*').any?
400
+
401
+ gsms = []
402
+ conditions = {}
403
+ info[:arrays].each{|gsm, cond|
404
+ gsms << gsm
405
+ cond.each{|condition, value|
406
+ conditions[condition] ||= []
407
+ conditions[condition] << value
408
+ }
409
+ }
410
+ platform = info[:platform]
411
+ do_log = nil
412
+ do_log = !info[:log2] if info[:log2]
413
+ fields = info[:fields]
414
+
415
+ puts "Processing GSE #{ series }. Platform #{ platform }"
416
+
417
+ prefix = File.join(platform_path(platform), 'GSE', series.to_s)
418
+ puts "-- Original"
419
+ GEO.get_GSE(gsms, conditions, do_log, prefix, nil, fields, info[:title], info[:description])
420
+
421
+ # Was there an error?
422
+ if File.exist?(prefix + '.skip')
423
+ FileUtils.cp(prefix + '.skip', prefix + '_cross_platform.skip')
424
+ return
425
+ end
426
+
427
+ if platform =~ /_/
428
+ FileUtils.cp(prefix + '.codes', File.join(platform_path(platform),'codes'))
429
+ codes = Open.read(File.join(platform_path(platform), 'codes')).collect{|l| l.chomp}
430
+ organism = GEO::GPL_info(platform.match(/(.*?)_/)[1])[:organism]
431
+ translations = ID.translate(organism, codes)
432
+ Open.write(File.join(platform_path(platform), 'translations'), translations.collect{|v| v || "NO MATCH"}.join("\n"))
433
+ Open.write(File.join(platform_path(platform), 'cross_platform'), translations.compact.sort.uniq.join("\n"))
434
+ else
435
+ # Are the codes of the series equivalent to the ones in the platform?
436
+ if File.open(File.join(platform_path(platform),'codes')).collect{|l| l.chomp} != File.open(prefix + '.codes').collect{|l| l.chomp}
437
+ fix_GSE_ids(File.join(platform_path(platform), 'codes'),prefix);
438
+ end
439
+ end
440
+
441
+
442
+ if File.exist?(File.join(platform,'translations'))
443
+ FileUtils.cp(File.join(platform,'translations'), prefix + '.translations')
444
+ if File.exist?(prefix + '.swap')
445
+ orders = Open.read(prefix + '.swap').collect{|l| l.chomp}
446
+ inverse_orders = Array.new(orders.length)
447
+ orders.each_with_index{|pos,i|
448
+ next if pos !~ /\d/
449
+ inverse_orders[pos.to_i] = i
450
+ }
451
+ rearange(inverse_orders, prefix + '.translations', "NO MATCH")
452
+ end
453
+ puts "-- Translated to cross_platform format"
454
+ GEO.get_GSE(gsms, conditions, do_log, prefix + '_cross_platform', prefix + '.translations',fields, info[:title], info[:description])
455
+ fix_GSE_ids(File.join(platform_path(platform), 'cross_platform'),prefix + '_cross_platform');
456
+ FileUtils.rm(prefix + '.translations') if File.exist?(prefix + '.translations')
457
+ end
458
+ FileUtils.rm(prefix + '.swap') if File.exist?(prefix + '.swap')
459
+ end
460
+
461
+ def self.process_platform(platform)
462
+ path = platform_path(platform)
463
+ return if File.exist? path
464
+
465
+ if platform =~ /_/
466
+ FileUtils.mkdir(path)
467
+ FileUtils.mkdir(path + '/GSE')
468
+ FileUtils.mkdir(path + '/GDS')
469
+ return
470
+ end
471
+
472
+ info = GEO::GPL_info(platform)
473
+ organism = info[:organism]
474
+
475
+ field = info[:other_ID_field]
476
+ id = info[:BioMart_ID]
477
+ org = info[:organism]
478
+ field = nil if field == ""
479
+ id = nil if id == ""
480
+
481
+
482
+ puts "Processing Platform #{ platform }"
483
+ [platform,
484
+ File.join(platform_path(platform), 'GDS'),
485
+ File.join(platform_path(platform), 'GSE'),
486
+ ].each{|d|
487
+ FileUtils.mkdir d unless File.exist? d
488
+ }
489
+
490
+ get_GPL(platform, platform_path(platform), nil)
491
+ FileUtils.mv platform_path(platform) + '.codes', File.join(platform_path(platform), 'codes')
492
+
493
+
494
+ # AILUN translations
495
+ codes = Open.read(File.join(platform_path(platform), 'codes')).collect{|l| l.chomp}
496
+ ailun = ID.AILUN_translate(platform, codes)
497
+ Open.write(File.join(platform_path(platform), 'ailun'), ailun.collect{|v| v || "NO MATCH"}.join("\n")) if ailun.compact.length > codes.length.to_f / 10
498
+
499
+ # BioMart translations
500
+ biomart = []
501
+ if id || field
502
+ if id
503
+ codes = Open.read(File.join(platform_path(platform), 'codes')).collect{|l| l.chomp}
504
+ else
505
+ if field
506
+ get_GPL(platform, platform_path(platform), field[0])
507
+ FileUtils.mv platform_path(platform) + '.codes', File.join(platform_path(platform), 'other')
508
+ end
509
+
510
+ fix = ID_FIX[(organism + "_" + field[1].downcase).to_sym]
511
+ codes = Open.read(File.join(platform_path(platform), 'other')).collect{|l|
512
+ code = l.chomp
513
+ code = fix.call(code) if fix
514
+ code
515
+ }
516
+ end
517
+
518
+ biomart = ID.translate(organism, codes)
519
+ Open.write(File.join(platform_path(platform), 'biomart'), biomart.collect{|v| v || "NO MATCH"}.join("\n")) if biomart.compact.length > codes.length.to_f / 10
520
+ end
521
+
522
+ # Select Best and save
523
+ translations = []
524
+ if ailun.compact.uniq.length > biomart.compact.uniq.length
525
+ id_type = ID::DEFAULT_FORMATS[organism] || ID::DEFAULT_FORMAT_ALL || id || field || "Entrez Gene Id"
526
+ if id_type.to_s !~ /Entrez/i
527
+ translations = ID.translate(org,ailun.collect{|gene| gene || "NO MATCH"})
528
+ else
529
+ translations = ailun
530
+ end
531
+ else
532
+ translations = biomart
533
+ end
534
+
535
+ if translations.compact.length > codes.length.to_f / 10
536
+ Open.write(File.join(platform_path(platform), 'translations'), translations.collect{|v| v || "NO MATCH"}.join("\n"))
537
+ Open.write(File.join(platform_path(platform), 'cross_platform'), translations.compact.sort.uniq.join("\n"))
538
+ end
539
+
540
+ end
541
+
542
+
543
+ def self.process_platform_datasets(platform, force = false)
544
+ raise "Platform #{ platform } not ready" unless File.exist? platform_path(platform)
545
+
546
+ info = YAML::load(File.open(File.join(MARQ.datadir, "GEO/platforms/#{platform}.yaml")))
547
+
548
+ datasets = GEO::Eutils::GPL_datasets(platform)
549
+ datasets.each{|dataset|
550
+ next if Dir.glob(File.join(platform_path(platform), 'GDS', dataset) + '.*').any? && ! force
551
+ process_GDS(dataset, platform, nil)
552
+ }
553
+ end
554
+
555
+ end
556
+
557
+ if __FILE__ == $0
558
+
559
+ p GEO.GPL_info('GPL920_GPL927')
560
+ p GEO.GPL_id_fields('GPL920')
561
+ puts GEO.GSE_info('GSE962')
562
+ puts GEO.GSE_info('GSE8982')
563
+ puts GEO::Eutils.GSE_dataset?('GSE8982')
564
+ puts GEO::Eutils.GSE_dataset?('GSE962')
565
+
566
+ exit
567
+
568
+ #puts GEO::dataset_path('GDS1103').inspect
569
+ #puts GEO::dataset_platform('GDS1103').inspect
570
+
571
+ # puts GEO.dataset_path('GDS2931')
572
+ # puts GEO.platform_datasets('GPL91')
573
+ # puts GEO.platform_datasets('GPL91').select{|d| GEO.has_cross_platform?(d)}
574
+ #
575
+ # gpls = Open.read('ftp://ftp.ncbi.nih.gov/pub/geo/DATA/supplementary/PLATFORMS.txt').collect{|l|
576
+ # l.chomp.split.first
577
+ # }
578
+ #
579
+ # %w(GPL85).each{|gpl|
580
+ # puts gpl
581
+ # puts GEO::GPL_info(gpl).inspect if gpl =~ /GPL/
582
+ # }
583
+ #
584
+ #puts GEO::GSM_info('GSM70604').inspect
585
+
586
+ p GEO::Eutils.organism_platforms('human')
587
+
588
+ end