diff --git a/Dockerfile b/Dockerfile index c2c8c19..aa13bf0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ -FROM tripalproject/tripaldocker:latest +ARG drupalversion='10.2.x-dev' +ARG phpversion='8.3' +ARG pgsqlversion="16" +FROM tripalproject/tripaldocker:drupal${drupalversion}-php${phpversion}-pgsql${pgsqlversion}-noChado -COPY . /var/www/drupal9/web/modules/contrib/tripal_blast +COPY . /var/www/drupal/web/modules/contrib/tripal_blast ## Install NCBI Blast+. RUN cd / \ @@ -8,11 +11,7 @@ RUN cd / \ && tar xzf ncbi-blast-2.2.30+-x64-linux.tar.gz \ && cp ncbi-blast-2.2.30+/bin/* /usr/local/bin -## Download libraries API dependency. -RUN cd /var/www/drupal9 \ - && composer require 'drupal/libraries:^4.0' - ## Enable module -WORKDIR /var/www/drupal9/web/modules/contrib/tripal_blast +WORKDIR /var/www/drupal/web/modules/contrib/tripal_blast RUN service postgresql restart \ && drush en tripal_blast --yes diff --git a/src/Services/TripalBlastJobService.php b/src/Services/TripalBlastJobService.php index 1c0a492..dae2c60 100644 --- a/src/Services/TripalBlastJobService.php +++ b/src/Services/TripalBlastJobService.php @@ -56,15 +56,15 @@ public function jobsGetRecentJobs($programs = []) { } else { return []; - } + } } /** * Create a table listing recent BLAST jobs. - * + * * @param $program * An array of program to filter from the jobs history. - * + * * @return array * Form API table type. */ @@ -72,13 +72,14 @@ public function jobsCreateTable($program = []) { $jobs = self::jobsGetRecentJobs($program); $jobs_table = []; $headers = ['Query Information', 'Search Target', 'Date Requested', '-']; - + + $rows = []; foreach($jobs as $job) { $result_link = '/blast/report/' . self::jobsBlastMakeSecret($job->job_id); $rows[] = [ - $job->query_summary, - $job->blastdb->db_name, + $job->query_summary, + $job->blastdb->db_name, \Drupal::service('date.formatter')->format($job->date_submitted, 'medium'), Markup::create('See Results') ]; @@ -211,10 +212,10 @@ public function jobsBlastMapSecret($reveal = FALSE) { /** * Get BLAST job by job_id. - * + * * @param $job_id * Unique id of BLAST job request. - * + * * @retrun object * Job record matching the job id. */ @@ -222,7 +223,7 @@ public function jobsGetJobByJobId($job_id) { $query = \Drupal::database()->select('blastjob', 'jobs'); $query->fields('jobs'); $query->condition('jobs.job_id', $job_id); - + $blastjob = $query->execute()->fetchObject(); if (!$blastjob) { return FALSE; @@ -249,9 +250,9 @@ public function jobsGetJobByJobId($job_id) { $job->blastdb->db_name = $config['name']; $job->blastdb->db_path = $config['path']; $job->blastdb->linkout = new \stdClass(); - $job->blastdb->linkout->none = $config['dbxref_linkout_type']; - $job->blastdb->db_dbtype = $config['dbtype']; - } + $job->blastdb->linkout->none = $config['dbxref_linkout_type']; + $job->blastdb->db_dbtype = $config['dbtype']; + } else { // Otherwise the user uploaded their own database so provide what information we can. $job->blastdb = new \stdClass(); @@ -284,7 +285,7 @@ public function jobsGetJobByJobId($job_id) { /** * Save job information/parameters into blastjob table. - * + * * @param $job_parameters * Parameters used to execute the job. */ @@ -455,12 +456,12 @@ public function jobsConvertTSVtoGFF3($blast_tsv, $blast_gff){ fclose($tsv); fclose($gff); } - + /** * Prints the GFF parent feature and all of its children features * * @param $blast_feature_array - * an array of the all the child features which is used to generate the smallest + * an array of the all the child features which is used to generate the smallest * and largest coordinates for the parent */ public function jobsPrintGFFParentChildren($gff, $blast_feature_array){ @@ -469,9 +470,9 @@ public function jobsPrintGFFParentChildren($gff, $blast_feature_array){ $evalue = $blast_feature_array["$s,$q"]['E']; $parent = join("\t", array($s, "BLASTRESULT" , "match" , $blast_feature_array["$s,$q"]['SS'] , $blast_feature_array["$s,$q"]['SE'] , $blast_feature_array["$s,$q"]['E'] , $blast_feature_array["$s,$q"]['strand'] , '.' , "ID=$s.$q;Name=$q($evalue)")) . "\n"; $child = join("\n",$blast_feature_array["$s,$q"]['HSPs']) . "\n"; - + fwrite($gff,$parent); fwrite($gff,$child); } } -} \ No newline at end of file +} diff --git a/tripal_blast.info.yml b/tripal_blast.info.yml index 97746cf..b6ea9d5 100644 --- a/tripal_blast.info.yml +++ b/tripal_blast.info.yml @@ -1,9 +1,7 @@ name: 'Tripal BLAST (Basic Local Alignment Search Tool)' type: module description: 'Provides a user interface to allow your users to utilize NCBI BLAST+ on your server' -core_version_requirement: ^9.2 || ^10 +core_version_requirement: ^10 package: 'Tripal Extensions' project: tripal_blast configure: tripal_blast.configuration -dependencies: - - libraries:libraries diff --git a/tripal_blast.links.task.yml b/tripal_blast.links.task.yml index df7adff..c72dad2 100644 --- a/tripal_blast.links.task.yml +++ b/tripal_blast.links.task.yml @@ -11,14 +11,14 @@ tripal_blast.tab1: title: 'Configuration' route_name: tripal_blast.configuration - base_route: tripal_blast.configuration + base_route: entity.tripal_blast.blast_database weight: 0 # Tripal BLAST Entity Configuration Tab. tripal_blast.tab2: - title: 'Query Database' - route_name: entity.tripal_blast.blast_database - base_route: tripal_blast.configuration + title: 'Query Databases' + route_name: entity.tripal_blast.blast_database + base_route: entity.tripal_blast.blast_database weight: 1 # Tripal BLAST Help Tab. @@ -27,5 +27,5 @@ tripal_blast.tab2: tripal_blast.tab3: title: 'Help' route_name: tripal_blast.help - base_route: tripal_blast.configuration + base_route: entity.tripal_blast.blast_database weight: 2 diff --git a/tripal_blast.routing.yml b/tripal_blast.routing.yml index bb919eb..76abca1 100644 --- a/tripal_blast.routing.yml +++ b/tripal_blast.routing.yml @@ -56,18 +56,18 @@ tripal_blast.help: _permission: 'administer tripal' -# Route set below defines routes for the management of -# configuration entity (list, add, edit and delete). +# Route set below defines routes for the management of +# configuration entity (list, add, edit and delete). entity.tripal_blast.blast_database: - path: '/admin/tripal/extension/tripal_blast/configuration/tripalblastdatabase' + path: '/admin/tripal/extension/tripal_blast' defaults: _entity_list: 'tripalblastdatabase' - _title: 'Tripal BLAST Query Database' + _title: 'Tripal BLAST UI' requirements: - _permission: 'administer tripal' + _permission: 'administer tripal,_access_admin_menu_block_page' entity.tripal_blast.blast_database.add: - path: '/admin/tripal/extension/tripal_blast/configuration/tripalblastdatabase/add' + path: '/admin/tripal/extension/tripal_blast/add' defaults: _entity_form: 'tripalblastdatabase.add' _title: 'Tripal BLAST Add Query Database' @@ -75,7 +75,7 @@ entity.tripal_blast.blast_database.add: _permission: 'administer tripal' entity.tripalblastdatabase.edit_form: - path: '/admin/tripal/extension/tripal_blast/configuration/tripalblastdatabase/edit/{tripalblastdatabase}' + path: '/admin/tripal/extension/tripal_blast/edit/{tripalblastdatabase}' defaults: _entity_form: 'tripalblastdatabase.edit' _title: 'Tripal BLAST Edit Query Database' @@ -83,7 +83,7 @@ entity.tripalblastdatabase.edit_form: _permission: 'administer tripal' entity.tripalblastdatabase.delete_form: - path: '/admin/tripal/extension/tripal_blast/configuration/tripalblastdatabase/{tripalblastdatabase}/delete' + path: '/admin/tripal/extension/tripal_blast/delete/{tripalblastdatabase}' defaults: _entity_form: 'tripalblastdatabase.delete' _title: 'Tripal BLAST Delete Query Database'