tripal_phenotype.views.inc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. <?php
  2. /**
  3. * @file
  4. * This file contains the basic functions for views integration of
  5. * chado/tripal_phenotype tables. Supplementary functions can be found in
  6. * ./views/
  7. *
  8. * Documentation on views integration can be found at
  9. * http://views2.logrus.com/doc/html/index.html.
  10. */
  11. /**
  12. * @defgroup tripal_phenotype_views Phenotype Views Integration
  13. * @ingroup views
  14. */
  15. /**
  16. *
  17. *
  18. * @ingroup tripal_phenotype_views
  19. */
  20. function tripal_phenotype_views_default_views() {
  21. $views = array();
  22. if (!module_exists('tripal_views')) {
  23. return $views;
  24. }
  25. // Main default view
  26. $view = new view;
  27. $view->name = 'phenotype_listing';
  28. $view->description = 'A listing of chado phenotypes';
  29. $view->tag = 'chado default';
  30. $view->base_table = 'phenotype';
  31. $view->core = 6;
  32. $view->api_version = '2';
  33. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  34. $handler = $view->new_display('default', 'Defaults', 'default');
  35. $handler->override_option('relationships', array(
  36. 'assay_id' => array(
  37. 'label' => 'assay_id to cvterm',
  38. 'required' => 0,
  39. 'id' => 'assay_id',
  40. 'table' => 'phenotype',
  41. 'field' => 'assay_id',
  42. 'relationship' => 'none',
  43. ),
  44. 'attr_id' => array(
  45. 'label' => 'attr_id to cvterm',
  46. 'required' => 0,
  47. 'id' => 'attr_id',
  48. 'table' => 'phenotype',
  49. 'field' => 'attr_id',
  50. 'relationship' => 'none',
  51. ),
  52. 'cvalue_id' => array(
  53. 'label' => 'cvalue_id to cvterm',
  54. 'required' => 0,
  55. 'id' => 'cvalue_id',
  56. 'table' => 'phenotype',
  57. 'field' => 'cvalue_id',
  58. 'relationship' => 'none',
  59. ),
  60. 'observable_id' => array(
  61. 'label' => 'observable_id to cvterm',
  62. 'required' => 0,
  63. 'id' => 'observable_id',
  64. 'table' => 'phenotype',
  65. 'field' => 'observable_id',
  66. 'relationship' => 'none',
  67. ),
  68. ));
  69. $handler->override_option('fields', array(
  70. 'uniquename' => array(
  71. 'label' => 'Unique Name',
  72. 'alter' => array(
  73. 'alter_text' => 0,
  74. 'text' => '',
  75. 'make_link' => 0,
  76. 'path' => '',
  77. 'absolute' => 0,
  78. 'link_class' => '',
  79. 'alt' => '',
  80. 'rel' => '',
  81. 'prefix' => '',
  82. 'suffix' => '',
  83. 'target' => '',
  84. 'help' => '',
  85. 'trim' => 0,
  86. 'max_length' => '',
  87. 'word_boundary' => 1,
  88. 'ellipsis' => 1,
  89. 'html' => 0,
  90. 'strip_tags' => 0,
  91. ),
  92. 'empty' => '',
  93. 'hide_empty' => 0,
  94. 'empty_zero' => 0,
  95. 'hide_alter_empty' => 1,
  96. 'type' => 'separator',
  97. 'separator' => ', ',
  98. 'exclude' => 0,
  99. 'id' => 'uniquename',
  100. 'table' => 'phenotype',
  101. 'field' => 'uniquename',
  102. 'relationship' => 'none',
  103. ),
  104. 'name_1' => array(
  105. 'label' => 'Phenotypic Attribute',
  106. 'alter' => array(
  107. 'alter_text' => 0,
  108. 'text' => '',
  109. 'make_link' => 0,
  110. 'path' => '',
  111. 'absolute' => 0,
  112. 'link_class' => '',
  113. 'alt' => '',
  114. 'rel' => '',
  115. 'prefix' => '',
  116. 'suffix' => '',
  117. 'target' => '',
  118. 'help' => '',
  119. 'trim' => 0,
  120. 'max_length' => '',
  121. 'word_boundary' => 1,
  122. 'ellipsis' => 1,
  123. 'html' => 0,
  124. 'strip_tags' => 0,
  125. ),
  126. 'empty' => '',
  127. 'hide_empty' => 0,
  128. 'empty_zero' => 0,
  129. 'hide_alter_empty' => 1,
  130. 'type' => 'separator',
  131. 'separator' => ', ',
  132. 'exclude' => 0,
  133. 'id' => 'name_1',
  134. 'table' => 'cvterm',
  135. 'field' => 'name',
  136. 'relationship' => 'attr_id',
  137. ),
  138. 'name_3' => array(
  139. 'label' => 'Controlled Value',
  140. 'alter' => array(
  141. 'alter_text' => 0,
  142. 'text' => '',
  143. 'make_link' => 0,
  144. 'path' => '',
  145. 'absolute' => 0,
  146. 'link_class' => '',
  147. 'alt' => '',
  148. 'rel' => '',
  149. 'prefix' => '',
  150. 'suffix' => '',
  151. 'target' => '',
  152. 'help' => '',
  153. 'trim' => 0,
  154. 'max_length' => '',
  155. 'word_boundary' => 1,
  156. 'ellipsis' => 1,
  157. 'html' => 0,
  158. 'strip_tags' => 0,
  159. ),
  160. 'empty' => '',
  161. 'hide_empty' => 0,
  162. 'empty_zero' => 0,
  163. 'hide_alter_empty' => 1,
  164. 'type' => 'separator',
  165. 'separator' => ', ',
  166. 'exclude' => 0,
  167. 'id' => 'name_3',
  168. 'table' => 'cvterm',
  169. 'field' => 'name',
  170. 'relationship' => 'cvalue_id',
  171. ),
  172. 'value' => array(
  173. 'label' => 'Value',
  174. 'alter' => array(
  175. 'alter_text' => 0,
  176. 'text' => '',
  177. 'make_link' => 0,
  178. 'path' => '',
  179. 'absolute' => 0,
  180. 'link_class' => '',
  181. 'alt' => '',
  182. 'rel' => '',
  183. 'prefix' => '',
  184. 'suffix' => '',
  185. 'target' => '',
  186. 'help' => '',
  187. 'trim' => 0,
  188. 'max_length' => '',
  189. 'word_boundary' => 1,
  190. 'ellipsis' => 1,
  191. 'html' => 0,
  192. 'strip_tags' => 0,
  193. ),
  194. 'empty' => '',
  195. 'hide_empty' => 0,
  196. 'empty_zero' => 0,
  197. 'hide_alter_empty' => 1,
  198. 'type' => 'separator',
  199. 'separator' => ', ',
  200. 'exclude' => 0,
  201. 'id' => 'value',
  202. 'table' => 'phenotype',
  203. 'field' => 'value',
  204. 'relationship' => 'none',
  205. ),
  206. 'name_2' => array(
  207. 'label' => 'Observation Type',
  208. 'alter' => array(
  209. 'alter_text' => 0,
  210. 'text' => '',
  211. 'make_link' => 0,
  212. 'path' => '',
  213. 'absolute' => 0,
  214. 'link_class' => '',
  215. 'alt' => '',
  216. 'rel' => '',
  217. 'prefix' => '',
  218. 'suffix' => '',
  219. 'target' => '',
  220. 'help' => '',
  221. 'trim' => 0,
  222. 'max_length' => '',
  223. 'word_boundary' => 1,
  224. 'ellipsis' => 1,
  225. 'html' => 0,
  226. 'strip_tags' => 0,
  227. ),
  228. 'empty' => '',
  229. 'hide_empty' => 0,
  230. 'empty_zero' => 0,
  231. 'hide_alter_empty' => 1,
  232. 'type' => 'separator',
  233. 'separator' => ', ',
  234. 'exclude' => 0,
  235. 'id' => 'name_2',
  236. 'table' => 'cvterm',
  237. 'field' => 'name',
  238. 'relationship' => 'observable_id',
  239. ),
  240. 'name' => array(
  241. 'label' => 'Evidence Type',
  242. 'alter' => array(
  243. 'alter_text' => 0,
  244. 'text' => '',
  245. 'make_link' => 0,
  246. 'path' => '',
  247. 'absolute' => 0,
  248. 'link_class' => '',
  249. 'alt' => '',
  250. 'rel' => '',
  251. 'prefix' => '',
  252. 'suffix' => '',
  253. 'target' => '',
  254. 'help' => '',
  255. 'trim' => 0,
  256. 'max_length' => '',
  257. 'word_boundary' => 1,
  258. 'ellipsis' => 1,
  259. 'html' => 0,
  260. 'strip_tags' => 0,
  261. ),
  262. 'empty' => '',
  263. 'hide_empty' => 0,
  264. 'empty_zero' => 0,
  265. 'hide_alter_empty' => 1,
  266. 'type' => 'separator',
  267. 'separator' => ', ',
  268. 'exclude' => 0,
  269. 'id' => 'name',
  270. 'table' => 'cvterm',
  271. 'field' => 'name',
  272. 'relationship' => 'assay_id',
  273. ),
  274. ));
  275. $handler->override_option('filters', array(
  276. 'search_results' => array(
  277. 'operator' => '=',
  278. 'value' => '',
  279. 'group' => '0',
  280. 'exposed' => FALSE,
  281. 'expose' => array(
  282. 'operator' => FALSE,
  283. 'label' => '',
  284. ),
  285. 'id' => 'search_results',
  286. 'table' => 'views',
  287. 'field' => 'search_results',
  288. 'relationship' => 'none',
  289. 'apply_button' => 'Show',
  290. 'no_results_text' => 'Click "Show" to see a list of all phenotypes matching the entered criteria. If you leave a any of the criteria blank then the phenotypes will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all phenotypes will be listed.',
  291. ),
  292. 'attr_id' => array(
  293. 'operator' => '=',
  294. 'value' => '',
  295. 'group' => '0',
  296. 'exposed' => TRUE,
  297. 'expose' => array(
  298. 'use_operator' => 0,
  299. 'operator' => 'attr_id_op',
  300. 'identifier' => 'attr_id',
  301. 'label' => 'Phenotypic Attribute',
  302. 'remember' => 0,
  303. ),
  304. 'case' => 1,
  305. 'id' => 'attr_id',
  306. 'table' => 'phenotype',
  307. 'field' => 'attr_id',
  308. 'relationship' => 'none',
  309. 'agg' => array(
  310. 'records_with' => 1,
  311. 'aggregates_with' => 1,
  312. ),
  313. 'values_form_type' => 'select',
  314. 'multiple' => 1,
  315. 'optional' => 0,
  316. 'show_all' => 0,
  317. ),
  318. 'cvalue_id' => array(
  319. 'operator' => '=',
  320. 'value' => '',
  321. 'group' => '0',
  322. 'exposed' => TRUE,
  323. 'expose' => array(
  324. 'use_operator' => 0,
  325. 'operator' => 'cvalue_id_op',
  326. 'identifier' => 'cvalue_id',
  327. 'label' => 'Controlled Value',
  328. 'remember' => 0,
  329. ),
  330. 'case' => 1,
  331. 'id' => 'cvalue_id',
  332. 'table' => 'phenotype',
  333. 'field' => 'cvalue_id',
  334. 'relationship' => 'none',
  335. 'agg' => array(
  336. 'records_with' => 1,
  337. 'aggregates_with' => 1,
  338. ),
  339. 'values_form_type' => 'select',
  340. 'multiple' => 1,
  341. 'optional' => 0,
  342. 'show_all' => 0,
  343. ),
  344. 'observable_id' => array(
  345. 'operator' => '=',
  346. 'value' => '',
  347. 'group' => '0',
  348. 'exposed' => TRUE,
  349. 'expose' => array(
  350. 'use_operator' => 0,
  351. 'operator' => 'observable_id_op',
  352. 'identifier' => 'observable_id',
  353. 'label' => 'Observation Type',
  354. 'remember' => 0,
  355. ),
  356. 'case' => 1,
  357. 'id' => 'observable_id',
  358. 'table' => 'phenotype',
  359. 'field' => 'observable_id',
  360. 'relationship' => 'none',
  361. 'agg' => array(
  362. 'records_with' => 1,
  363. 'aggregates_with' => 1,
  364. ),
  365. 'values_form_type' => 'select',
  366. 'multiple' => 1,
  367. 'optional' => 0,
  368. 'show_all' => 0,
  369. ),
  370. 'assay_id' => array(
  371. 'operator' => '=',
  372. 'value' => '',
  373. 'group' => '0',
  374. 'exposed' => TRUE,
  375. 'expose' => array(
  376. 'use_operator' => 0,
  377. 'operator' => 'assay_id_op',
  378. 'identifier' => 'assay_id',
  379. 'label' => 'Evidence Type',
  380. 'remember' => 0,
  381. ),
  382. 'case' => 1,
  383. 'id' => 'assay_id',
  384. 'table' => 'phenotype',
  385. 'field' => 'assay_id',
  386. 'relationship' => 'none',
  387. 'agg' => array(
  388. 'records_with' => 1,
  389. 'aggregates_with' => 1,
  390. ),
  391. 'values_form_type' => 'select',
  392. 'multiple' => 1,
  393. 'optional' => 0,
  394. 'show_all' => 0,
  395. ),
  396. 'uniquename' => array(
  397. 'operator' => '~',
  398. 'value' => '',
  399. 'group' => '0',
  400. 'exposed' => TRUE,
  401. 'expose' => array(
  402. 'use_operator' => 0,
  403. 'operator' => 'uniquename_op',
  404. 'identifier' => 'uniquename',
  405. 'label' => 'Unique Name Contains',
  406. 'remember' => 0,
  407. ),
  408. 'case' => 0,
  409. 'id' => 'uniquename',
  410. 'table' => 'phenotype',
  411. 'field' => 'uniquename',
  412. 'relationship' => 'none',
  413. 'agg' => array(
  414. 'records_with' => 1,
  415. 'aggregates_with' => 1,
  416. ),
  417. ),
  418. 'value' => array(
  419. 'operator' => '~',
  420. 'value' => '',
  421. 'group' => '0',
  422. 'exposed' => TRUE,
  423. 'expose' => array(
  424. 'use_operator' => 0,
  425. 'operator' => 'value_op',
  426. 'identifier' => 'phen_value',
  427. 'label' => 'Value Contains',
  428. 'remember' => 0,
  429. ),
  430. 'case' => 0,
  431. 'id' => 'value',
  432. 'table' => 'phenotype',
  433. 'field' => 'value',
  434. 'relationship' => 'none',
  435. 'agg' => array(
  436. 'records_with' => 1,
  437. 'aggregates_with' => 1,
  438. ),
  439. ),
  440. ));
  441. $handler->override_option('access', array(
  442. 'type' => 'perm',
  443. 'perm' => 'access content',
  444. ));
  445. $handler->override_option('cache', array(
  446. 'type' => 'none',
  447. ));
  448. $handler->override_option('title', 'Phenotypes');
  449. $handler->override_option('header', 'Click "Show" to see a list of all phenotypes matching the entered criteria. If you leave a any of the criteria blank then the phenotypes will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all phenotypes will be listed.');
  450. $handler->override_option('header_format', '2');
  451. $handler->override_option('header_empty', 0);
  452. $handler->override_option('empty', 'No phenotypes match the supplied criteria.');
  453. $handler->override_option('empty_format', '2');
  454. $handler->override_option('items_per_page', 50);
  455. $handler->override_option('use_pager', '1');
  456. $handler->override_option('style_plugin', 'table');
  457. $handler->override_option('style_options', array(
  458. 'grouping' => '',
  459. 'override' => 1,
  460. 'sticky' => 0,
  461. 'order' => 'asc',
  462. 'summary' => '',
  463. 'columns' => array(
  464. 'uniquename' => 'uniquename',
  465. 'value' => 'value',
  466. ),
  467. 'info' => array(
  468. 'uniquename' => array(
  469. 'sortable' => 1,
  470. 'separator' => '',
  471. ),
  472. 'value' => array(
  473. 'sortable' => 1,
  474. 'separator' => '',
  475. ),
  476. ),
  477. 'default' => 'uniquename',
  478. ));
  479. $handler = $view->new_display('page', 'Page', 'page_1');
  480. $handler->override_option('path', 'chado/phenotypes');
  481. $handler->override_option('menu', array(
  482. 'type' => 'normal',
  483. 'title' => 'Phenotypes',
  484. 'description' => 'A phenotypic statement, or a single atomic phenotypic observation, is a controlled sentence describing observable effects of non-wild type function.',
  485. 'weight' => '10',
  486. 'name' => 'navigation',
  487. ));
  488. $handler->override_option('tab_options', array(
  489. 'type' => 'none',
  490. 'title' => '',
  491. 'description' => '',
  492. 'weight' => 0,
  493. 'name' => 'navigation',
  494. ));
  495. $views[$view->name] = $view;
  496. return $views;
  497. }