Tripal
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Drupal\tripal_chado\Task\ChadoPreparer Class Reference
Inheritance diagram for Drupal\tripal_chado\Task\ChadoPreparer:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal_chado\Task\ChadoPreparer:
Collaboration graph
[legend]

Public Member Functions

 validateParameters ()
 
 performTask ()
 
 createCustomTable_tripal_gffcds_temp ()
 
 createCustomTable_tripal_gffprotein_temp ()
 
 createCustomTable_tripal_obo_temp ()
 
 getProgress ()
 
 getStatus ()
 
- Public Member Functions inherited from Drupal\tripal_chado\Task\ChadoTaskBase
 getTripalDbxClass ($class)
 
- Public Member Functions inherited from Drupal\tripal_biodb\Task\BioTaskBase
 __construct (?\Drupal\Core\Database\Connection $database=NULL, ?\Psr\Log\LoggerInterface $logger=NULL, ?\Drupal\tripal_biodb\Lock\SharedLockBackendInterface $locker=NULL, ?\Drupal\Core\State\StateInterface $state=NULL)
 
 setParameters (array $parameters=[])
 
 getId ()
 
 getLogger ()
 

Public Attributes

const TASK_NAME = 'preparer'
 
- Public Attributes inherited from Drupal\tripal_chado\Task\ChadoTaskBase
const TASK_NAME = 'chado'
 
- Public Attributes inherited from Drupal\tripal_biodb\Task\BioTaskBase
const TASK_NAME = 'task'
 
const STATE_KEY_DATA_PREFIX = 'tripal_biodb_'
 

Protected Member Functions

 createCustomTables ()
 
 createCustomTable_tripal_gff_temp ()
 
 createMviews ()
 
 setProgress (float $value)
 
 importOntologies ()
 
- Protected Member Functions inherited from Drupal\tripal_biodb\Task\BioTaskBase
 prepareSchemas (array $schema_list)
 
 getSchemaLockName (\Drupal\tripal\TripalDBX\TripalDbxConnection $db)
 
 initId ()
 
 acquireTaskLocks ()
 
 releaseTaskLocks ()
 

Protected Attributes

 $chado_schema_main
 
- Protected Attributes inherited from Drupal\tripal_biodb\Task\BioTaskBase
 $id
 
 $connection
 
 $logger
 
 $locker
 
 $state
 
 $parameters = ['input_schemas' => [], 'output_schemas' => [], ]
 
 $inputSchemas = []
 
 $outputSchemas = []
 

Detailed Description

Chado preparer.

Usage:

// Where 'chado' is the name of the Chado schema to prepare.
$preparer = \Drupal::service('tripal_chado.preparer');
$preparer->setParameters([
'output_schemas' => ['chado'],
]);
if (!$preparer->performTask()) {
// Display a message telling the user the task failed and details are in
// the site logs.
}

Member Function Documentation

◆ createCustomTable_tripal_gff_temp()

Drupal\tripal_chado\Task\ChadoPreparer::createCustomTable_tripal_gff_temp ( )
protected

Creates the tripal_gff_temp table.

This table is used by the GFF Importer.

◆ createCustomTable_tripal_gffcds_temp()

Drupal\tripal_chado\Task\ChadoPreparer::createCustomTable_tripal_gffcds_temp ( )

Creates the tripal_gffcds_temp table.

This table is used by the GFF Importer.

◆ createCustomTable_tripal_gffprotein_temp()

Drupal\tripal_chado\Task\ChadoPreparer::createCustomTable_tripal_gffprotein_temp ( )

Create the tripal_gffproptein_temp table.

This table is used by the GFF Importer.

◆ createCustomTable_tripal_obo_temp()

Drupal\tripal_chado\Task\ChadoPreparer::createCustomTable_tripal_obo_temp ( )

Create the tripal_obo_temp table.

This table is used by the OBO Importer.

◆ createCustomTables()

Drupal\tripal_chado\Task\ChadoPreparer::createCustomTables ( )
protected

Create the custom tables this module needs.

These are tables that Chado uses to manage the site (i.e. temporary loading tables) and not for primary data storage.

◆ createMviews()

Drupal\tripal_chado\Task\ChadoPreparer::createMviews ( )
protected

Creates the materialized views used by this module.

◆ getProgress()

Drupal\tripal_chado\Task\ChadoPreparer::getProgress ( )

{Returns the percent of progress of current task.This method can also be used to check if a task is currently running if it has a > 0 value. A negative value means an error occured while running.

Returns
float A value between -1 and 1, 0 meaning the task has not been started yet, 1 meaning the task is completed with success and a negative value meaning that the task failed. The negative value may be used as a code to identify the error.
}

Implements Drupal\tripal_biodb\Task\BioTaskInterface.

◆ getStatus()

Drupal\tripal_chado\Task\ChadoPreparer::getStatus ( )

{{Returns a string describing current status of the performed task.This function returns the last known status, even if the task ended. In case of failure, this function may return the reason of the failure.

Returns
string A localized description.
}}

Reimplemented from Drupal\tripal_biodb\Task\BioTaskBase.

◆ importOntologies()

Drupal\tripal_chado\Task\ChadoPreparer::importOntologies ( )
protected

Imports ontologies into Chado.

◆ performTask()

Drupal\tripal_chado\Task\ChadoPreparer::performTask ( )

Prepare a given chado schema by inserting minimal data.

Task parameter array provided to the class constructor includes:

  • 'input_schemas' array: no input schema
  • 'output_schemas' array: one output Chado schema that must exist (required)

Example:

['output_schemas' => ['chado_schema'], ]
Returns
bool TRUE if the task was performed with success and FALSE if the task was completed but without the expected success.
Exceptions
Drupal

Reimplemented from Drupal\tripal_biodb\Task\BioTaskBase.

◆ setProgress()

Drupal\tripal_chado\Task\ChadoPreparer::setProgress ( float  $value)
protected

Set progress value.

Parameters
float$valueNew progress value.

◆ validateParameters()

Drupal\tripal_chado\Task\ChadoPreparer::validateParameters ( )

Validate task parameters.

Parameter array provided to the class constructor must include one output schema and no input schema as shown:

['output_schemas' => ['schema_name'], ]
Exceptions

Implements Drupal\tripal_biodb\Task\BioTaskInterface.

Member Data Documentation

◆ TASK_NAME

const Drupal\tripal_chado\Task\ChadoPreparer::TASK_NAME = 'preparer'

Name of the task.


The documentation for this class was generated from the following file: