123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <?php
- function tripal_analysis_blast_install() {
-
- tripal_create_moddir('tripal_analysis_blast');
-
-
-
-
-
-
-
- tripal_analysis_register_child('tripal_analysis_blast');
-
-
- tripal_add_cvterms('analysis_blast_output_iteration_hits', 'Hits of a blast '.
- 'output iteration. Each iteration corresponds to a chado feature, and is '.
- 'the content between <iteration> and </iteration> tags in the blast xml '.
- 'output file. This cvterm represents all hits in the iteration');
-
- tripal_add_cvterms('analysis_blast_settings', 'Settings of a blast analysis, '.
- 'including db_id, output file, and run parameters separated by a bar |');
-
-
- drupal_install_schema('tripal_analysis_blast');
-
-
- $sql_db = "SELECT db_id, name FROM {db} WHERE name like '%s'";
- $sql_parser = "INSERT INTO {tripal_analysis_blast} ".
- " (db_id, displayname, regex_hit_id, regex_hit_def, regex_hit_accession, genbank_style) ".
- "VALUES (%d, '%s', '%s', '%s', '%s', %d)";
-
-
- $previous_db = tripal_db_set_active ('chado');
- $results = db_query($sql_db, "%swissprot%");
- tripal_db_set_active($previous_db);
- while ($db = db_fetch_object($results)) {
- db_query($sql_parser, $db->db_id, 'ExPASy Swissprot', '^sp\|.*?\|(.*?)\s.*?$', '^sp\|.*?\|.*?\s(.*)$', 'sp\|(.*?)\|.*?\s.*?$', 0);
- }
-
-
- $previous_db = tripal_db_set_active ('chado');
- $results = db_query($sql_db, "%trembl%");
- tripal_db_set_active($previous_db);
- while ($db = db_fetch_object($results)) {
- db_query($sql_parser, $db->db_id, 'ExPASy TrEMBL', '^.*?\|(.*?)\s.*?$', '^.*?\|.*?\s(.*)$', '^(.*?)\|.*?\s.*?$', 0);
- }
-
-
- $previous_db = tripal_db_set_active ('chado');
- $results = db_query($sql_db, "%genbank%");
- tripal_db_set_active($previous_db);
- while ($db = db_fetch_object($results)) {
- db_query($sql_parser, $db->db_id, 'Genbank', '', '', '', 1);
- }
- }
- function tripal_analysis_blast_uninstall() {
-
-
-
-
-
-
-
-
- tripal_analysis_unregister_child('tripal_analysis_blast');
-
- db_query("DELETE FROM {variable} WHERE name='%s'",
- 'tripal_analysis_blast_setting');
-
-
- drupal_uninstall_schema('tripal_analysis_blast');
- }
- function tripal_analysis_blast_schema() {
- $schema = array();
- $schema['tripal_analysis_blast'] = array(
- 'fields' => array(
- 'db_id' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0
- ),
- 'displayname' => array(
- 'type' => 'varchar',
- 'length' => 100,
- 'not null' => TRUE,
- ),
- 'regex_hit_id' => array(
- 'type' => 'varchar',
- 'length' => 30,
- ),
- 'regex_hit_def' => array(
- 'type' => 'varchar',
- 'length' => 30,
- ),
- 'regex_hit_accession' => array(
- 'type' => 'varchar',
- 'length' => 30,
- ),
- 'genbank_style' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'default' => 0
- ),
- ),
- 'indexes' => array(
- 'db_id' => array('db_id')
- ),
- 'primary key' => array('db_id'),
- );
- return $schema;
- }
- function tripal_analysis_blast_requirements($phase) {
- $requirements = array();
- if ($phase == 'install') {
- if (!function_exists('tripal_create_moddir') || !function_exists('tripal_analysis_register_child')) {
- $requirements ['tripal_analysis_blast'] = array(
- 'title' => "tripal_analysis_blast",
- 'value' => "error. Some required modules are just being installed. Please try again.",
- 'severity' => REQUIREMENT_ERROR,
- );
- }
- }
- return $requirements;
- }
|