tripal_bulk_loader.module 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <?php
  2. /**
  3. * @file
  4. * The functions for the Tripal bulk loader.
  5. *
  6. *
  7. *
  8. */
  9. include('tripal_bulk_loader.loader.inc');
  10. include('tripal_bulk_loader.constants.inc');
  11. include('tripal_bulk_loader.admin.inc');
  12. include('tripal_bulk_loader.admin.templates.inc');
  13. // API
  14. include('api/tripal_bulk_loader.api.templates.inc');
  15. /**
  16. * Implements hook_init
  17. * Used to add stylesheets and javascript files to the header
  18. */
  19. function tripal_bulk_loader_init() {
  20. // Add javascript and style sheet
  21. drupal_add_css(drupal_get_path('theme', 'tripal') . '/css/tripal_bulk_loader.css');
  22. drupal_add_js(drupal_get_path('theme', 'tripal') . '/js/tripal_bulk_loader.js');
  23. }
  24. /**
  25. * Implements hook_menu
  26. */
  27. function tripal_bulk_loader_menu() {
  28. $items = array();
  29. // Bulk Loading Job Node
  30. $items['node/%node/constants/%/edit'] = array(
  31. 'title' => 'Edit Constant Set',
  32. 'description' => 'Edit a group of constants associated with the current bulk loader',
  33. 'page callback' => 'drupal_get_form',
  34. 'page arguments' => array('tripal_bulk_loader_edit_constant_set_form', 1, 3),
  35. 'access arguments' => array('administer site configuration'),
  36. 'type' => MENU_CALLBACK,
  37. );
  38. $items['node/%node/constants/%/delete'] = array(
  39. 'title' => 'Delete Constant Set',
  40. 'description' => 'Delete a group of constants associated with the current bulk loader',
  41. 'page callback' => 'drupal_get_form',
  42. 'page arguments' => array('tripal_bulk_loader_delete_constant_set_form', 1, 3),
  43. 'access arguments' => array('administer site configuration'),
  44. 'type' => MENU_CALLBACK,
  45. );
  46. // Admin pages -----------------
  47. $items['admin/tripal/tripal_bulk_loader_template'] = array(
  48. 'title' => 'Bulk Loader',
  49. 'description' => 'Templates for loading tab-delimited data',
  50. 'page callback' => 'tripal_bulk_loader_admin_template',
  51. 'access arguments' => array('administer site configuration'),
  52. 'type' => MENU_NORMAL_ITEM,
  53. );
  54. $items['admin/tripal/tripal_bulk_loader_template/configure'] = array(
  55. 'title' => 'Configure',
  56. 'description' => 'Configuration of global options related to bulk loading jobs',
  57. 'page callback' => 'drupal_get_form',
  58. 'page arguments' => array('tripal_bulk_loader_configuration_form'),
  59. 'access arguments' => array('administer site configuration'),
  60. 'type' => MENU_NORMAL_ITEM,
  61. );
  62. $items['admin/tripal/tripal_bulk_loader_template/manage_templates'] = array(
  63. 'title' => 'Manage Templates',
  64. 'description' => 'Create/Update/Delete/Import/Export Templates',
  65. 'page callback' => 'tripal_bulk_loader_admin_manage_templates',
  66. 'access arguments' => array('administer site configuration'),
  67. 'type' => MENU_NORMAL_ITEM,
  68. );
  69. $items['admin/tripal/tripal_bulk_loader_template/jobs'] = array(
  70. 'title' => 'Bulk Loader Jobs',
  71. 'description' => 'Listing of Bulk Loading Jobs',
  72. 'page callback' => 'tripal_bulk_loader_admin_jobs',
  73. 'access arguments' => array('administer site configuration'),
  74. 'type' => MENU_NORMAL_ITEM,
  75. );
  76. // Create/Edit Template --------
  77. $items['admin/tripal/tripal_bulk_loader_template/manage_templates/create'] = array(
  78. 'title' => 'Create Template',
  79. 'description' => 'Create loader template for loading tab-delimited data',
  80. 'page callback' => 'drupal_get_form',
  81. 'page arguments' => array('tripal_bulk_loader_modify_template_base_form', 'create'),
  82. 'access arguments' => array('administer site configuration'),
  83. 'type' => MENU_NORMAL_ITEM,
  84. );
  85. $items['admin/tripal/tripal_bulk_loader_template/manage_templates/edit'] = array(
  86. 'title' => 'Edit Template',
  87. 'description' => 'Edit loader template for loading tab-delimited data',
  88. 'page callback' => 'drupal_get_form',
  89. 'page arguments' => array('tripal_bulk_loader_modify_template_base_form', 'edit'),
  90. 'access arguments' => array('administer site configuration'),
  91. 'type' => MENU_NORMAL_ITEM,
  92. );
  93. $items['admin/tripal/tripal_bulk_loader_template/edit_record'] = array(
  94. 'title' => 'Edit Template Record',
  95. 'description' => 'Edit a record in an existing tripal bulk loader template.',
  96. 'page callback' => 'drupal_get_form',
  97. 'page arguments' => array('tripal_bulk_loader_edit_template_record_form'),
  98. 'access arguments' => array('administer site configuration'),
  99. 'type' => MENU_CALLBACK,
  100. );
  101. $items['admin/tripal/tripal_bulk_loader_template/add_field'] = array(
  102. 'title' => 'Add Template Field',
  103. 'description' => 'Add a template field to an existing tripal bulk loader template.',
  104. 'page callback' => 'drupal_get_form',
  105. 'page arguments' => array('tripal_bulk_loader_add_template_field_form'),
  106. 'access arguments' => array('administer site configuration'),
  107. 'type' => MENU_CALLBACK,
  108. );
  109. $items['admin/tripal/tripal_bulk_loader_template/edit_field'] = array(
  110. 'title' => 'Edit Template Field',
  111. 'description' => 'Edit an existing field from a tripal bulk loader template.',
  112. 'page callback' => 'drupal_get_form',
  113. 'page arguments' => array('tripal_bulk_loader_edit_template_field_form'),
  114. 'access arguments' => array('administer site configuration'),
  115. 'type' => MENU_CALLBACK,
  116. );
  117. // Delete Template -----
  118. $items['admin/tripal/tripal_bulk_loader_template/manage_templates/delete'] = array(
  119. 'title' => 'Delete Template',
  120. 'description' => 'Delete bulk loader template',
  121. 'page callback' => 'drupal_get_form',
  122. 'page arguments' => array('tripal_bulk_loader_delete_template_base_form'),
  123. 'access arguments' => array('administer site configuration'),
  124. 'type' => MENU_NORMAL_ITEM,
  125. );
  126. // Import/Export ---------
  127. $items['admin/tripal/tripal_bulk_loader_template/manage_templates/import'] = array(
  128. 'title' => 'Import Template',
  129. 'description' => 'Import Loaders',
  130. 'page callback' => 'drupal_get_form',
  131. 'page arguments' => array('tripal_bulk_loader_import_export_template_form', 'import'),
  132. 'access arguments' => array('administer site configuration'),
  133. 'type' => MENU_NORMAL_ITEM,
  134. );
  135. $items['admin/tripal/tripal_bulk_loader_template/manage_templates/export'] = array(
  136. 'title' => 'Export Template',
  137. 'description' => 'Export Loaders',
  138. 'page callback' => 'drupal_get_form',
  139. 'page arguments' => array('tripal_bulk_loader_import_export_template_form', 'export'),
  140. 'access arguments' => array('administer site configuration'),
  141. 'type' => MENU_NORMAL_ITEM,
  142. );
  143. // AHAH ---------
  144. $items['admin/tripal/tripal_bulk_loader_template/add_field_ahah'] = array(
  145. 'page callback' => 'tripal_bulk_loader_add_field_ahah',
  146. 'access arguments' => array('administer site configuration'),
  147. 'type' => MENU_CALLBACK,
  148. );
  149. $items['admin/tripal/tripal_bulk_loader_template/edit_field_ahah'] = array(
  150. 'page callback' => 'tripal_bulk_loader_edit_field_ahah',
  151. 'access arguments' => array('administer site configuration'),
  152. 'type' => MENU_CALLBACK,
  153. );
  154. return $items;
  155. }
  156. /**
  157. * Implements hook_theme
  158. */
  159. function tripal_bulk_loader_theme() {
  160. return array(
  161. 'tripal_bulk_loader_set_constants_form' => array(
  162. 'arguments' => array('form' => NULL),
  163. ),
  164. 'tripal_bulk_loader_template' => array(
  165. 'arguments' => array('template_id' => NULL),
  166. 'template' => 'tripal_bulk_loader_template'
  167. ),
  168. 'tripal_bulk_loader_modify_template_base_form' => array(
  169. 'arguments' => array('form' => NULL),
  170. 'template' => 'tripal_bulk_loader_modify_template_base_form',
  171. ),
  172. 'tripal_bulk_loader_edit_template_field_form' => array(
  173. 'arguments' => array('form' => NULL),
  174. 'template' => 'tripal_bulk_loader_edit_template_field_form',
  175. ),
  176. 'tripal_bulk_loader_add_template_field_form' => array(
  177. 'arguments' => array('form' => NULL),
  178. 'template' => 'tripal_bulk_loader_add_template_field_form',
  179. ),
  180. );
  181. }
  182. /**
  183. * Implements hook_access
  184. */
  185. function tripal_bulk_loader_access($op, $node, $account) {
  186. if ($op == 'create') {
  187. if (!user_access('create tripal_bulk_loader', $account)) {
  188. return FALSE;
  189. }
  190. }
  191. if ($op == 'update') {
  192. if (!user_access('edit tripal_bulk_loader', $account)) {
  193. return FALSE;
  194. }
  195. }
  196. if ($op == 'delete') {
  197. if (!user_access('delete tripal_bulk_loader', $account)) {
  198. return FALSE;
  199. }
  200. }
  201. if ($op == 'view') {
  202. if (!user_access('access tripal_bulk_loader', $account)) {
  203. return FALSE;
  204. }
  205. }
  206. return NULL;
  207. }
  208. /**
  209. * Implements hook_perm
  210. */
  211. function tripal_bulk_loader_perm() {
  212. return array(
  213. 'access tripal_bulk_loader',
  214. 'create tripal_bulk_loader',
  215. 'delete tripal_bulk_loader',
  216. 'edit tripal_bulk_loader',
  217. );
  218. }
  219. //////////////////////////////////////////////////////////////////////////////////////////////
  220. // Node Functions
  221. //////////////////////////////////////////////////////////////////////////////////////////////
  222. /**
  223. * Implements hook_node_info
  224. */
  225. function tripal_bulk_loader_node_info() {
  226. $nodes = array();
  227. $nodes['tripal_bulk_loader'] = array(
  228. 'name' => t('Bulk Loading Job'),
  229. 'module' => 'tripal_bulk_loader',
  230. 'description' => t('A bulk loader for inserting tab-delimited data into chado database'),
  231. 'has_title' => TRUE,
  232. 'has_body' => FALSE,
  233. 'locked' => TRUE
  234. );
  235. return $nodes;
  236. }
  237. /**
  238. * Implements node_form
  239. * Used to gather the extra details stored with a Bulk Loading Job Node
  240. */
  241. function tripal_bulk_loader_form($node, $form_state) {
  242. $form = array();
  243. if (isset($form_state['values'])) {
  244. $node = $form_state['values'] + (array)$node;
  245. $node = (object) $node;
  246. }
  247. $sql = "SELECT * FROM {tripal_bulk_loader_template}";
  248. $results = db_query($sql);
  249. $templates = array();
  250. while ($template = db_fetch_object ($results)) {
  251. $templates [$template->template_id] = $template->name;
  252. }
  253. if (!$templates) {
  254. $form['label'] = array(
  255. '#type' => 'item',
  256. '#description' => t("Loader template needs to be created before any bulk loader can be added. Go to 'Tripal Management > Bulk Loader Template' to create the template."),
  257. '#weight' => -10,
  258. );
  259. return $form;
  260. }
  261. $form['loader'] = array(
  262. '#type' => 'fieldset',
  263. '#title' => t('Basic Details'),
  264. );
  265. $form['loader']['loader_name'] = array(
  266. '#type' => 'textfield',
  267. '#title' => t('Loading Job Name'),
  268. '#weight' => -10,
  269. '#required' => TRUE,
  270. '#default_value' => $node->loader_name
  271. );
  272. $form['loader']['template_id'] = array(
  273. '#type' => 'select',
  274. '#title' => t('Template'),
  275. '#description' => t('Please specify a template for this loader'),
  276. '#options' => $templates,
  277. '#weight' => -9,
  278. '#required' => TRUE,
  279. '#default_value' => $node->template_id,
  280. );
  281. $form['loader']['file']= array(
  282. '#type' => 'textfield',
  283. '#title' => t('Data File'),
  284. '#description' => t('Please specify the data file to be loaded. This must be a tab-delimited text file with UNIX line endings.'),
  285. '#weight' => -8,
  286. '#default_value' => $node->file,
  287. '#maxlength' => 1024,
  288. );
  289. $form['loader']['has_header'] = array(
  290. '#type' => 'radios',
  291. '#title' => t('File has a Header'),
  292. '#options' => array( 1 => 'Yes', 2 => 'No'),
  293. '#weight' => -7,
  294. '#default_value' => $node->file_has_header,
  295. );
  296. $form['loader']['keep_track_inserted'] = array(
  297. '#type' => 'radios',
  298. '#title' => t('Keep track of inserted record IDs'),
  299. '#description' => t('This enables the ability to revert an entire loading job even if '
  300. .'it completed successfully. Furthermore, it displays the number of records '
  301. .'successfully inserted into each table.'),
  302. '#options' => array( 1 => 'Yes', 0 => 'No'),
  303. '#weight' => -7,
  304. '#default_value' => (isset($node->keep_track_inserted)) ? $node->keep_track_inserted : variable_get('tripal_bulk_loader_keep_track_inserted', FALSE),
  305. );
  306. return $form;
  307. }
  308. /**
  309. * Implements node_load
  310. */
  311. function tripal_bulk_loader_load($node) {
  312. $sql = "SELECT * FROM {tripal_bulk_loader} WHERE nid = %d";
  313. $node = db_fetch_object(db_query($sql, $node->nid));
  314. $node->title = 'Bulk Loading Job: ' . $node->loader_name;
  315. // Add job details
  316. $progress = tripal_bulk_loader_progess_file_get_progress($node->job_id);
  317. $sql = "SELECT * FROM {tripal_jobs} WHERE job_id=%d";
  318. $node->job = db_fetch_object(db_query($sql, $node->job_id));
  319. // Add the loader template
  320. $sql = "SELECT * FROM {tripal_bulk_loader_template} WHERE template_id=%d";
  321. $results = db_fetch_object(db_query($sql, $node->template_id));
  322. $template = unserialize($results->template_array);
  323. $node->template = $results;
  324. $node->template->template_array = $template;
  325. // Add inserted records
  326. $sql = 'SELECT * FROM {tripal_bulk_loader_inserted} WHERE nid=%d';
  327. $resource = db_query($sql, $node->nid);
  328. while ($r = db_fetch_object($resource)) {
  329. $r->num_inserted = sizeof(preg_split('/,/', $r->ids_inserted));
  330. $node->inserted_records->{$r->table_inserted_into} = $r;
  331. }
  332. // Add exposed field list
  333. $node->exposed_fields = array();
  334. if ($template) {
  335. foreach ($template as $record_id => $record) {
  336. foreach ($record['fields'] as $field_id => $field) {
  337. if ($field['exposed']) {
  338. $node->exposed_fields[] = array(
  339. 'record_id' => $record_id,
  340. 'field_id' => $field_id,
  341. 'title' => $field['title'],
  342. );
  343. }
  344. }
  345. }
  346. if (empty($node->exposed_fields)) {
  347. $node->exposed_fields[] = array();
  348. }
  349. }
  350. // Add constants
  351. $sql = 'SELECT * FROM {tripal_bulk_loader_constants} WHERE nid=%d ORDER BY group_id, record_id, field_id';
  352. $resource = db_query($sql, $node->nid);
  353. while ($r = db_fetch_object($resource)) {
  354. $node->constants[$r->group_id][$r->record_id][$r->field_id] = array(
  355. 'constant_id' => $r->constant_id,
  356. 'group_id' => $r->group_id,
  357. 'chado_table' => $r->chado_table,
  358. 'chado_field' => $r->chado_field,
  359. 'record_id' => $r->record_id,
  360. 'field_id' => $r->field_id,
  361. 'value' => $r->value
  362. );
  363. }
  364. if (!$node->constants) {
  365. $node->constants[] = array();
  366. }
  367. return $node;
  368. }
  369. /**
  370. * Implements node_insert
  371. * Insert the data from the node form on Create content
  372. */
  373. function tripal_bulk_loader_insert($node) {
  374. // Insert into tripal_bulk_loader
  375. $sql = "INSERT INTO {tripal_bulk_loader} (nid, loader_name, template_id, file, file_has_header, job_status, keep_track_inserted) VALUES (%d, '%s', %d, '%s', %d, '%s', %d)";
  376. db_query($sql, $node->nid, $node->loader_name, $node->template_id, $node->file, $node->has_header, 'Initialized', $node->keep_track_inserted);
  377. // Update title
  378. $node->title =$node->loader_name;
  379. drupal_write_record('node', $node, 'nid');
  380. drupal_write_record('node_revision', $node, 'nid');
  381. drupal_set_message(t('After reviewing the details, please Submit this Job (by clicking the "Submit Job" button below). No data will be loaded until the submitted job is reached in the queue.'));
  382. }
  383. /**
  384. * Implements node_delete
  385. * Deletes the data when the delete button on the node form is clicked
  386. */
  387. function tripal_bulk_loader_delete($node) {
  388. $sql = "DELETE FROM {tripal_bulk_loader} WHERE nid = %d";
  389. db_query($sql, $node->nid);
  390. }
  391. /**
  392. * Implements node_update
  393. * Updates the data submitted by the node form on edit
  394. */
  395. function tripal_bulk_loader_update($node) {
  396. // Update tripal_bulk_loader
  397. $sql = "UPDATE {tripal_bulk_loader} SET nid = %d, loader_name = '%s', template_id = %d, file = '%s', file_has_header = '%s', keep_track_inserted = %d WHERE nid = %d";
  398. db_query($sql, $node->nid, $node->loader_name, $node->template_id, $node->file, $node->has_header, $node->keep_track_inserted, $node->nid);
  399. // Add a job if the user want to load the data
  400. global $user;
  401. if ($node->job) {
  402. $job_args[0] =$node->loader_name;
  403. $job_args[1] = $node->template_id;
  404. $job_args[2] = $node->file;
  405. if (is_readable($node->file)) {
  406. $fname = preg_replace("/.*\/(.*)/", "$1", $node->file);
  407. tripal_add_job("Bulk Load: $fname", 'tripal_bulk_loader', 'tripal_bulk_loader_load_data', $job_args, $user->uid);
  408. }
  409. else {
  410. drupal_set_message(t("Can not open %file. Job not scheduled.", array('%file' => $node->file)));
  411. }
  412. }
  413. }
  414. ///////////////////////////////////////////////////////////
  415. /**
  416. * Preprocessor function for the tripal_bulk_loader template
  417. */
  418. function tripal_bulk_loader_preprocess_tripal_bulk_loader_template(&$variables) {
  419. $sql = "SELECT * FROM {tripal_bulk_loader_template} WHERE template_id=%d";
  420. $template = db_fetch_object(db_query($sql, $variables['template_id']));
  421. $template->template_array = unserialize($template->template_array);
  422. $variables['template'] = $template;
  423. }
  424. /**
  425. * Get the progress of the current constant set from the progress file
  426. *
  427. * When transactions are used, database updates to drupal cannot be made. Thus a separate
  428. * method to keep track of progress was implemented: save a period to the file for each
  429. * record successfully inserted; each line in the file represents a processed line.
  430. *
  431. * @param $job_id
  432. * The id of the tripal job to check the progress of
  433. * @param $node
  434. * The tripal_bulk_loader node associated with the job
  435. *
  436. * @return
  437. * An array with the following keys:
  438. * num_lines = the number of lines in the file processed so far
  439. * total_lines = the total number of lines in the input file
  440. * percent_file = the percent the input file has been loaded
  441. * num_records = the number of records successfully inserted
  442. */
  443. function tripal_bulk_loader_progess_file_get_progress($job_id, $update_progress = TRUE) {
  444. $filename = '/tmp/tripal_bulk_loader_progress-' . $job_id . '.out';
  445. if (!file_exists($filename)) {
  446. return (object) array();
  447. }
  448. $num_lines = trim(`wc --lines < $filename`);
  449. $num_records = trim(`grep -o "." $filename | wc --lines`);
  450. $job = db_fetch_object(db_query("SELECT j.*, b.file, b.file_has_header, c.num as num_constant_sets
  451. FROM {tripal_jobs} j
  452. LEFT JOIN {tripal_bulk_loader} b ON b.job_id=j.job_id
  453. LEFT JOIN (
  454. SELECT nid, count(distinct(group_id)) as num
  455. FROM {tripal_bulk_loader_constants}
  456. GROUP BY nid
  457. ) c ON c.nid=b.nid
  458. WHERE j.job_id=%d", $job_id));
  459. if ($job->num_constant_sets) {
  460. $num_constant_sets_loaded = round($job->progress / (100 / $job->num_constant_sets), 4);
  461. // If the next constant set has started loading
  462. if ($job->num_constant_sets != $num_constant_sets_loaded) {
  463. // total lines in input file
  464. $total_lines = trim(`wc --lines < $job->file`);
  465. if ($job->file_has_header) {
  466. $total_lines--;
  467. }
  468. // percent of the current constant set loaded
  469. $percent = round($num_lines/$total_lines * 100, 2);
  470. // percent of the total job = (<# fully loaded constant sets> * 100 )
  471. // + <percent of current constant set>
  472. // / <total number of constant sets>
  473. $total_percent = (($num_constant_sets_loaded * 100) + $percent) / $job->num_constant_sets;
  474. // update the progress of the job
  475. if ($update_progress AND ($percent != 0 OR $percent != 100)) {
  476. tripal_job_set_progress($job_id, round($total_percent, 0));
  477. }
  478. }
  479. }
  480. return (object) array(
  481. 'num_lines' => $num_lines,
  482. 'total_lines' => $total_lines,
  483. 'percent_file' => $percent,
  484. 'num_constant_sets_loaded' => $num_constant_sets_loaded,
  485. 'total_percent' => $total_percent,
  486. 'num_records' => $num_records
  487. );
  488. }
  489. /**
  490. * Implements hook_job_describe_args()
  491. * Specifically to make viewing past tripal jobs more readable for jobs registered by this module
  492. *
  493. * @params $callback
  494. * The callback passed into tripal_add_job()
  495. * @param $args
  496. * The arguements passed into tripal_add_job()
  497. * @return
  498. * An array where keys are the human readable headers describing each arguement
  499. * and the value is the aguement passed in after formatting
  500. */
  501. function tripal_bulk_loader_job_describe_args($callback, $args) {
  502. $new_args = array();
  503. if ($callback == 'tripal_bulk_loader_load_data') {
  504. //1st arg is the nid for a bulk loader node
  505. $node = node_load($args[0]);
  506. $new_args['Bulk Loading Job'] = l($node->title, 'node/' . $args[0]);
  507. return $new_args;
  508. }
  509. }
  510. /**
  511. * Implements hook_coder_ignore().
  512. * Defines the path to the file (tripal_bulk_loader.coder_ignores.txt) where ignore rules for coder are stored
  513. */
  514. function tripal_bulk_loader_coder_ignore() {
  515. return array(
  516. 'path' => drupal_get_path('module', 'tripal_bulk_loader'),
  517. 'line prefix' => drupal_get_path('module', 'tripal_bulk_loader'),
  518. );
  519. }