tripal_feature.module 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. <?php
  2. /**
  3. * @file
  4. * Basic functionality for the tripal module
  5. */
  6. /**
  7. * @defgroup tripal_feature Feature Module
  8. * @ingroup tripal_modules
  9. * @{
  10. * Integrates the Chado Sequence module with Drupal Nodes & Views
  11. * @}
  12. */
  13. require_once 'api/tripal_feature.api.inc';
  14. require_once 'api/tripal_feature.schema.api.inc';
  15. require_once 'api/tripal_feature.DEPRECATED.inc';
  16. require_once 'theme/tripal_feature.theme.inc';
  17. require_once 'includes/tripal_feature.admin.inc';
  18. require_once 'includes/tripal_feature.fasta_loader.inc';
  19. require_once 'includes/tripal_feature.gff_loader.inc';
  20. require_once 'includes/tripal_feature.seq_extract.inc';
  21. require_once 'includes/tripal_feature.delete.inc';
  22. require_once 'includes/tripal_feature.chado_node.inc';
  23. require_once 'includes/tripal_feature.blocks.inc';
  24. /**
  25. * Implements hook_views_api().
  26. *
  27. * Essentially this hook tells drupal that there is views support for
  28. * for this module which then includes tripal_db.views.inc where all the
  29. * views integration code is
  30. *
  31. * @ingroup tripal_feature
  32. */
  33. function tripal_feature_views_api() {
  34. return array(
  35. 'api' => 3.0,
  36. );
  37. }
  38. /**
  39. * Implements hook_help().
  40. *
  41. * Display help and module information
  42. *
  43. * @param
  44. * path which path of the site we're displaying help
  45. * @param
  46. * arg array that holds the current path as would be returned from arg() function
  47. *
  48. * @return
  49. * help text for the path
  50. *
  51. * @ingroup tripal_feature
  52. */
  53. function tripal_feature_help($path, $arg) {
  54. $output = '';
  55. switch ($path) {
  56. case "admin/help#tripal_feature":
  57. $output='<p>' . t("Displays links to nodes created on this date") . '</p>';
  58. break;
  59. }
  60. return $output;
  61. }
  62. /**
  63. * Implements hook_permission().
  64. *
  65. * Set the permission types that the chado module uses. Essentially we
  66. * want permissionis that protect creation, editing and deleting of chado
  67. * data objects
  68. *
  69. * @ingroup tripal_feature
  70. */
  71. function tripal_feature_permission() {
  72. return array(
  73. 'access chado_feature content' => array(
  74. 'title' => t('View Features'),
  75. 'description' => t('Allow users to view feature pages.'),
  76. ),
  77. 'create chado_feature content' => array(
  78. 'title' => t('Create Features'),
  79. 'description' => t('Allow users to create new feature pages.'),
  80. ),
  81. 'delete chado_feature content' => array(
  82. 'title' => t('Delete Features'),
  83. 'description' => t('Allow users to delete feature pages.'),
  84. ),
  85. 'edit chado_feature content' => array(
  86. 'title' => t('Edit Features'),
  87. 'description' => t('Allow users to edit feature pages.'),
  88. ),
  89. 'adminster tripal feature' => array(
  90. 'title' => t('Administer Features'),
  91. 'description' => t('Allow users to administer all features.'),
  92. ),
  93. );
  94. }
  95. /**
  96. * Implements hook_menu().
  97. *
  98. * Menu items are automatically added for the new node types created
  99. * by this module to the 'Create Content' Navigation menu item. This function
  100. * adds more menu items needed for this module.
  101. *
  102. * @ingroup tripal_feature
  103. */
  104. function tripal_feature_menu() {
  105. $items = array();
  106. // the administative settings menu
  107. $items['find/sequences'] = array(
  108. 'title' => 'Sequence Retrieval',
  109. 'description' => 'Download a file of sequences',
  110. 'page callback' => 'tripal_feature_seq_extract_page',
  111. 'access arguments' => array('access chado_feature content'),
  112. 'type' => MENU_CALLBACK,
  113. );
  114. $items['find/sequences/ajax'] = array(
  115. 'title' => 'Sequence Retrieval',
  116. 'page callback' => 'tripal_feature_seq_extract_form_ahah_update',
  117. 'access arguments' => array('access chado_feature content'),
  118. 'type' => MENU_CALLBACK,
  119. );
  120. // the menu link for addressing any feature (by name, uniquename, synonym)
  121. $items['feature/%'] = array(
  122. 'page callback' => 'tripal_feature_match_features_page',
  123. 'page arguments' => array(1),
  124. 'access arguments' => array('access chado_feature content'),
  125. 'type' => MENU_LOCAL_TASK,
  126. );
  127. // the administative settings menu
  128. $items['admin/tripal/chado/tripal_feature'] = array(
  129. 'title' => 'Features',
  130. 'description' => 'A biological sequence or a section of a biological sequence, or a collection of such sections.',
  131. 'page callback' => 'tripal_feature_admin_feature_view',
  132. 'access arguments' => array('administer tripal feature'),
  133. 'type' => MENU_NORMAL_ITEM,
  134. );
  135. $items['admin/tripal/chado/tripal_feature/delete'] = array(
  136. 'title' => ' Delete',
  137. 'description' => 'Delete multiple features from Chado',
  138. 'page callback' => 'drupal_get_form',
  139. 'page arguments' => array('tripal_feature_delete_form'),
  140. 'access arguments' => array('administer tripal feature'),
  141. 'type' => MENU_LOCAL_TASK,
  142. 'weight' => 2
  143. );
  144. $items['admin/tripal/chado/tripal_feature/sync'] = array(
  145. 'title' => ' Sync',
  146. 'description' => 'Create pages on this site for features stored in Chado',
  147. 'page callback' => 'drupal_get_form',
  148. 'page arguments' => array('chado_node_sync_form', 'tripal_feature', 'chado_feature'),
  149. 'access arguments' => array('administer tripal feature'),
  150. 'type' => MENU_LOCAL_TASK,
  151. 'weight' => 1
  152. );
  153. $items['admin/tripal/chado/tripal_feature/configuration'] = array(
  154. 'title' => 'Settings',
  155. 'description' => 'Configure the Tripal Feature module.',
  156. 'page callback' => 'drupal_get_form',
  157. 'page arguments' => array('tripal_feature_admin'),
  158. 'access arguments' => array('administer tripal feature'),
  159. 'type' => MENU_LOCAL_TASK,
  160. 'weight' => 5
  161. );
  162. $items['admin/tripal/chado/tripal_feature/help'] = array(
  163. 'title' => 'Help',
  164. 'description' => 'Help with the Tripal Feature module.',
  165. 'page callback' => 'theme',
  166. 'page arguments' => array('tripal_feature_help'),
  167. 'access arguments' => array('administer tripal feature'),
  168. 'type' => MENU_LOCAL_TASK,
  169. 'weight' => 10
  170. );
  171. /** Loaders */
  172. $items['admin/tripal/loaders/fasta_loader'] = array(
  173. 'title' => 'FASTA file Loader',
  174. 'description' => 'Load sequences from a multi-FASTA file into Chado',
  175. 'page callback' => 'drupal_get_form',
  176. 'page arguments' => array('tripal_feature_fasta_load_form'),
  177. 'access arguments' => array('administer tripal feature'),
  178. 'type' => MENU_NORMAL_ITEM,
  179. );
  180. $items['admin/tripal/loaders/gff3_load'] = array(
  181. 'title' => 'GFF3 file Loader',
  182. 'description' => 'Import a GFF3 file into Chado',
  183. 'page callback' => 'drupal_get_form',
  184. 'page arguments' => array('tripal_feature_gff3_load_form'),
  185. 'access arguments' => array('administer tripal feature'),
  186. 'type' => MENU_NORMAL_ITEM,
  187. );
  188. // Enable admin view
  189. $items['admin/tripal/chado/tripal_feature/views/features/enable'] = array(
  190. 'title' => 'Enable feature Administrative View',
  191. 'page callback' => 'tripal_views_admin_enable_view',
  192. 'page arguments' => array('tripal_feature_admin_features', 'admin/tripal/chado/tripal_feature'),
  193. 'access arguments' => array('administer tripal feature'),
  194. 'type' => MENU_CALLBACK,
  195. );
  196. return $items;
  197. }
  198. /**
  199. * Implements hook_search_biological_data_views().
  200. *
  201. * Adds the described views to the "Search Data" Page created by Tripal Views
  202. */
  203. function tripal_feature_search_biological_data_views() {
  204. return array(
  205. 'tripal_feature_user_features' => array(
  206. 'machine_name' => 'tripal_feature_user_features',
  207. 'human_name' => 'Features',
  208. 'description' => 'A biological sequence or a section of a biological sequence, or a collection of such sections.',
  209. 'link' => 'chado/feature'
  210. ),
  211. );
  212. }
  213. /**
  214. * Implements hook_theme().
  215. *
  216. * We need to let drupal know about our theme functions and their arguments.
  217. * We create theme functions to allow users of the module to customize the
  218. * look and feel of the output generated in this module
  219. *
  220. * @ingroup tripal_feature
  221. */
  222. function tripal_feature_theme($existing, $type, $theme, $path) {
  223. $core_path = drupal_get_path('module', 'tripal_core');
  224. $items = array(
  225. 'node__chado_feature' => array(
  226. 'template' => 'node--chado-generic',
  227. 'render element' => 'node',
  228. 'base hook' => 'node',
  229. 'path' => "$core_path/theme/templates",
  230. ),
  231. 'tripal_feature_alignments' => array(
  232. 'variables' => array('node' => NULL),
  233. 'template' => 'tripal_feature_alignments',
  234. 'path' => "$path/theme/templates",
  235. ),
  236. 'tripal_feature_analyses' => array(
  237. 'variables' => array('node' => NULL),
  238. 'template' => 'tripal_feature_analyses',
  239. 'path' => "$path/theme/templates",
  240. ),
  241. 'tripal_feature_base' => array(
  242. 'variables' => array('node' => NULL),
  243. 'template' => 'tripal_feature_base',
  244. 'path' => "$path/theme/templates",
  245. ),
  246. 'tripal_feature_sequence' => array(
  247. 'variables' => array('node' => NULL),
  248. 'template' => 'tripal_feature_sequence',
  249. 'path' => "$path/theme/templates",
  250. ),
  251. 'tripal_feature_proteins' => array(
  252. 'variables' => array('node' => NULL),
  253. 'template' => 'tripal_feature_proteins',
  254. 'path' => "$path/theme/templates",
  255. ),
  256. 'tripal_feature_publications' => array(
  257. 'variables' => array('node' => NULL),
  258. 'template' => 'tripal_feature_publications',
  259. 'path' => "$path/theme/templates",
  260. ),
  261. 'tripal_feature_synonyms' => array(
  262. 'variables' => array('node' => NULL),
  263. 'template' => 'tripal_feature_synonyms',
  264. 'path' => "$path/theme/templates",
  265. ),
  266. 'tripal_feature_references' => array(
  267. 'variables' => array('node' => NULL),
  268. 'template' => 'tripal_feature_references',
  269. 'path' => "$path/theme/templates",
  270. ),
  271. 'tripal_feature_properties' => array(
  272. 'variables' => array('node' => NULL),
  273. 'template' => 'tripal_feature_properties',
  274. 'path' => "$path/theme/templates",
  275. ),
  276. 'tripal_feature_terms' => array(
  277. 'variables' => array('node' => NULL),
  278. 'template' => 'tripal_feature_terms',
  279. 'path' => "$path/theme/templates",
  280. ),
  281. 'tripal_feature_relationships' => array(
  282. 'variables' => array('node' => NULL),
  283. 'template' => 'tripal_feature_relationships',
  284. 'path' => "$path/theme/templates",
  285. ),
  286. 'tripal_feature_help' => array(
  287. 'template' => 'tripal_feature_help',
  288. 'variables' => array(NULL),
  289. 'path' => "$path/theme/templates"
  290. ),
  291. // template for the organism page
  292. 'tripal_organism_feature_browser' => array(
  293. 'variables' => array('node' => NULL),
  294. 'template' => 'tripal_organism_feature_browser',
  295. 'path' => "$path/theme/templates",
  296. ),
  297. 'tripal_organism_feature_counts' => array(
  298. 'variables' => array('node' => NULL),
  299. 'template' => 'tripal_organism_feature_counts',
  300. 'path' => "$path/theme/templates",
  301. ),
  302. // themed forms
  303. 'tripal_feature_seq_extract_form' => array(
  304. 'arguments' => array('form'),
  305. ),
  306. // themed teaser
  307. 'tripal_feature_teaser' => array(
  308. 'variables' => array('node' => NULL),
  309. 'template' => 'tripal_feature_teaser',
  310. 'path' => "$path/theme/templates",
  311. ),
  312. );
  313. return $items;
  314. }
  315. /**
  316. * The CV module will create the JSON array necessary for buillding a
  317. * pie chart using jgChart and Google Charts. We have to pass to it
  318. * a table that contains count information, tell it which column
  319. * contains the cvterm_id and provide a filter for getting the
  320. * results we want from the table.
  321. *
  322. * @ingroup tripal_feature
  323. */
  324. function tripal_feature_cv_chart($chart_id) {
  325. // we only want the chart to show feature types setup by the admin
  326. $temp = rtrim(variable_get('tripal_feature_summary_report_mapping', ''));
  327. $where = '';
  328. if ($temp) {
  329. $temp = explode("\n", $temp);
  330. foreach ($temp as $key => $value) {
  331. $temp2 = explode("=", $value);
  332. $feature_type = rtrim($temp2[0]);
  333. $where .= "CNT.feature_type = '$feature_type' OR \n";
  334. }
  335. if ($where) {
  336. $where = drupal_substr($where, 0, -5); # remove OR from the end
  337. $where = "($where) AND";
  338. }
  339. }
  340. $organism_id = preg_replace("/^tripal_feature_cv_chart_(\d+)$/", "$1", $chart_id);
  341. $options = array(
  342. count_mview => 'organism_feature_count',
  343. cvterm_id_column => 'cvterm_id',
  344. count_column => 'num_features',
  345. size => '550x200',
  346. filter => "$where CNT.organism_id = $organism_id",
  347. );
  348. return $options;
  349. }
  350. /**
  351. * The CV module will create the JSON array necessary for buillding a
  352. * pie chart using jgChart and Google Charts. We have to pass to it
  353. * a table that contains count information, tell it which column
  354. * contains the cvterm_id and provide a filter for getting the
  355. * results we want from the table.
  356. *
  357. * @ingroup tripal_feature
  358. */
  359. function tripal_feature_cv_tree($tree_id) {
  360. $organism_id = preg_replace("/^tripal_feature_cv_tree_(\d+)$/", "$1", $tree_id);
  361. $options = array(
  362. cv_id => tripal_cv_get_cv_id('sequence'),
  363. count_mview => 'organism_feature_count',
  364. cvterm_id_column => 'cvterm_id',
  365. count_column => 'num_features',
  366. filter => "CNT.organism_id = $organism_id",
  367. label => 'Features',
  368. );
  369. return $options;
  370. }
  371. /**
  372. * Implements hook_job_describe_args() in order to describe the various feature jobs
  373. * to the tripal jobs interface.
  374. *
  375. * @ingroup tripal_feature
  376. */
  377. function tripal_feature_job_describe_args($callback, $args) {
  378. $new_args = array();
  379. if ($callback == 'tripal_feature_load_fasta') {
  380. $new_args['FASTA file'] = $args[0];
  381. $organism = chado_select_record('organism', array('genus', 'species'), array('organism_id' => $args[1]));
  382. $new_args['Organism'] = $organism[0]->genus . " " . $organism[0]->species;
  383. $new_args['Sequence Type'] = $args[2];
  384. $new_args['Name Match Type'] = $args[14];
  385. $new_args['Name RE'] = $args[4];
  386. $new_args['Unique Name RE'] = $args[5];
  387. // add in the relationship arguments
  388. $new_args['Relationship Type'] = $args[8];
  389. $new_args['Relationship Parent RE'] = $args[9];
  390. $new_args['Relationship Parent Type'] = $args[10];
  391. // add in the database reference arguments
  392. if ($args[7]) {
  393. $db = chado_select_record('db', array('name'), array('db_id' => $args[7]));
  394. }
  395. $new_args['Database Reference'] = $db[0]->name;
  396. $new_args['Accession RE'] = $args[6];
  397. $new_args['Method'] = $args[11];
  398. // add in the analysis
  399. if ($args[13]) {
  400. $analysis = chado_select_record('analysis', array('name'), array('analysis_id' => $args[13]));
  401. }
  402. $new_args['Analysis'] = $analysis[0]->name;
  403. }
  404. if ($callback == 'tripal_feature_delete_features') {
  405. if ($args[0]) {
  406. $organism = chado_select_record('organism', array('genus', 'species'), array('organism_id' => $args[0]));
  407. $new_args['Organism'] = $organism[0]->genus . " " . $organism[0]->species;
  408. }
  409. else {
  410. $new_args['Organism'] = '';
  411. }
  412. if ($args[1]) {
  413. $analysis = chado_select_record('analysis', array('name'), array('analysis_id' => $args[1]));
  414. $new_args['Analysis'] = $analysis[0]->name;
  415. }
  416. else {
  417. $new_args['Analysis'] = '';
  418. }
  419. $new_args['Sequence Type'] = $args[2];
  420. $new_args['Is Unique Name'] = $args[3];
  421. $new_args['Features Names'] = $args[4];
  422. }
  423. elseif ($callback == 'tripal_feature_load_gff3') {
  424. $new_args['GFF File'] = $args[0];
  425. $organism = chado_select_record('organism', array('genus', 'species'), array('organism_id' => $args[1]));
  426. $new_args['Organism'] = $organism[0]->genus . " " . $organism[0]->species;
  427. $analysis = chado_select_record('analysis', array('name'), array('analysis_id' => $args[2]));
  428. $new_args['Analysis'] = $analysis[0]->name;
  429. $new_args['Use a Transaction'] = ($args[7] == 1) ? "Yes" : "No";
  430. $new_args['Import only new features'] = ($args[3] == 1) ? "Yes" : "No";
  431. $new_args['Import all and update'] = ($args[4] == 1) ? "Yes" : "No";
  432. $new_args['Import all and replace'] = ($args[5] == 1) ? "Yes" : "No";
  433. $new_args['Delete features'] = ($args[6] == 1) ? "Yes" : "No";
  434. if ($args[8]) {
  435. $target_organism = chado_select_record('organism', array('genus', 'species'), array('organism_id' => $args[8]));
  436. $new_args['Target organism'] = $target_organism[0]->genus . " " . $target_organism[0]->species;
  437. }
  438. else {
  439. $new_args['Target organism'] = '';
  440. }
  441. $new_args['Target type'] = $args[9];
  442. $new_args['Create target'] = ($args[10] == 1) ? "Yes" : "No";
  443. $new_args['Starting line'] = $args[11];
  444. $new_args['Landmark Type'] = $args[12];
  445. $new_args['Alternate ID attribute'] = $args[13];
  446. $new_args['Create Organism'] = ($args[14] == 1) ? "Yes" : "No";
  447. }
  448. return $new_args;
  449. }
  450. /**
  451. * Implements hook_coder_ignore().
  452. *
  453. * Defines the path to the file (tripal_core.coder_ignores.txt) where ignore rules for
  454. * coder are stored
  455. *
  456. * @ingroup tripal_feature
  457. */
  458. function tripal_feature_coder_ignore() {
  459. return array(
  460. 'path' => drupal_get_path('module', 'tripal_feature'),
  461. 'line prefix' => drupal_get_path('module', 'tripal_feature'),
  462. );
  463. }
  464. /*
  465. * Uses the value provided in the $id argument to find all features that match
  466. * that ID by name, featurename or synonym. If it matches uniquenly to a single
  467. * feature it will redirect to that feature page, otherwise, a list of matching
  468. * features is shown.
  469. *
  470. * @ingroup tripal_feature
  471. */
  472. function tripal_feature_match_features_page($id) {
  473. // if the URL alias configuration is set such that the URL
  474. // always begins with 'feature' then we want to use the ID as it is and
  475. // forward it on. Otherwise, try to find the matching feature.
  476. $url_alias = variable_get('chado_feature_url_string', '/feature/[genus]/[species]/[type]/[uniquename]');
  477. if (!$url_alias) {
  478. $url_alias = '/feature/[genus]/[species]/[type]/[uniquename]';
  479. }
  480. $url_alias = preg_replace('/^\//', '', $url_alias); // remove any preceeding forward slash
  481. if (preg_match('/^feature\//', $url_alias)) {
  482. drupal_goto($id);
  483. }
  484. $sql = "
  485. SELECT
  486. F.name, F.uniquename, F.feature_id,
  487. O.genus, O.species, O.organism_id,
  488. CVT.cvterm_id, CVT.name as type_name,
  489. CF.nid,
  490. array_agg(S.name) as synonyms
  491. FROM {feature} F
  492. INNER JOIN {organism} O on F.organism_id = O.organism_id
  493. INNER JOIN {cvterm} CVT on CVT.cvterm_id = F.type_id
  494. LEFT JOIN {feature_synonym} FS on FS.feature_id = F.feature_id
  495. LEFT JOIN {synonym} S on S.synonym_id = FS.synonym_id
  496. INNER JOIN public.chado_feature CF on CF.feature_id = F.feature_id
  497. WHERE
  498. F.uniquename = :uname or
  499. F.name = :fname' or
  500. S.name = :sname
  501. GROUP BY F.name, F.uniquename, F.feature_id, O.genus, O.species,
  502. O.organism_id, CVT.cvterm_id, CVT.name, CF.nid
  503. ";
  504. $results = chado_query($sql, array(':uname' => $id, ':fname' => $id, ':sname' => $id));
  505. $num_matches = 0;
  506. // iterate through the matches and build the table for showing matches
  507. $header = array('Uniquename', 'Name', 'Type', 'Species', 'Synonyms');
  508. $rows = array();
  509. $curr_match;
  510. while ($match = $results->fetchObject()) {
  511. $curr_match = $match;
  512. $synonyms = $match->synonyms;
  513. $synonyms = preg_replace('/[\"\{\}]/', '', $synonyms);
  514. $rows[] = array(
  515. $match->uniquename,
  516. "<a href=\"" . url("node/" . $match->nid) . "\">" . $match->name . "</a>",
  517. $match->type_name,
  518. '<i>' . $match->genus . ' ' . $match->species . '</i>',
  519. $synonyms,
  520. );
  521. $num_matches++;
  522. }
  523. // if we have more than one match then generate the table, otherwise, redirect
  524. // to the matched feature
  525. if ($num_matches == 1) {
  526. drupal_goto("node/" . $curr_match->nid);
  527. }
  528. if ($num_matches == 0) {
  529. return "<p>No features matched the given name '$id'</p>";
  530. }
  531. $table_attrs = array('class' => 'tripal-data-table');
  532. $output = "<p>The following features match the name '$id'.</p>";
  533. $output .= theme_table($header, $rows, $table_attrs, $caption);
  534. return $output;
  535. }
  536. /**
  537. * Implementation of hook_form_alter()
  538. *
  539. * @param $form
  540. * @param $form_state
  541. * @param $form_id
  542. *
  543. * @ingroup tripal_feature
  544. */
  545. function tripal_feature_form_alter(&$form, &$form_state, $form_id) {
  546. if ($form_id == "tripal_feature_seq_extract_form") {
  547. // updating the form through the ahah callback sets the action of
  548. // the form to the ahah callback URL. We need to set it back
  549. // to the normal form URL
  550. $form['#action'] = url("find/sequences");
  551. }
  552. // turn off preview button for insert/updates
  553. if ($form_id == "chado_feature_node_form") {
  554. $form['actions']['preview']['#access'] = FALSE;
  555. }
  556. }