Tripal
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter Class Reference
Inheritance diagram for Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter:
Collaboration graph
[legend]

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition, ChadoBuddyPluginManager $buddy_manager, ChadoConnection $connection, Messenger $messenger, TripalLogger $logger, TripalFileRetriever $fileretriever, TripalBackendPublishManager $publish_manager,)
 
 form ($form, &$form_state)
 
 formValidate ($form, &$form_state)
 
 run ()
 
 formSubmit ($form, &$form_state)
 
- Public Member Functions inherited from Drupal\tripal_chado\TripalImporter\ChadoImporterBase
 __construct (array $configuration, $plugin_id, $plugin_definition, ChadoConnection $connection, ?Messenger $messenger=NULL, ?TripalLogger $logger=NULL, ?TripalFileRetriever $fileretriever=NULL, ?TripalBackendPublishManager $publish_manager=NULL,)
 
 getChadoConnection ()
 
 startTransactions ()
 
 addAnalysis ($form, &$form_state)
 
 postRun ()
 
- Public Member Functions inherited from Drupal\tripal\TripalImporter\TripalImporterBase
 __construct (array $configuration, $plugin_id, $plugin_definition, ?Messenger $messenger=NULL, ?TripalLogger $logger=NULL, ?TripalFileRetriever $fileretriever=NULL, ?TripalBackendPublishManager $publish_manager=NULL,)
 
 describeUploadFileFormat ()
 
 setJob ($job)
 
 rollbackTransaction (string $stage)
 
 createImportJob ($run_args, $file_details=[])
 
 load ($import_id)
 
 submitJob ()
 
 prepareFiles ()
 
 cleanFile ()
 
 setArguments (array $arguments)
 
 getArguments ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 
static tripal_taxon_importer_set_ncbi_api_key ($form, &$form_state)
 

Protected Member Functions

 updateExisting ($root_taxon=NULL)
 
 findOrganism ($taxid, $sci_name)
 
 addOrganism ($sci_name, $rank)
 
 importRecord ($taxid, $root_taxon=NULL, $organism=NULL)
 
 addProperty ($organism_id, $term_name, $value, $rank=0)
 
 addDbxref ($organism_id, $taxId)
 
- Protected Member Functions inherited from Drupal\tripal_chado\TripalImporter\ChadoImporterBase
 addBundleTypeProperty (string $pkey, int $record_id, string $property_table, string $termIdSpace, string $termAccession, string $value='', ?int $rank=NULL)
 
- Protected Member Functions inherited from Drupal\tripal\TripalImporter\TripalImporterBase
 setTotalItems ($total_items)
 
 addItemsHandled ($num_handled)
 
 setItemsHandled ($total_handled)
 
 setInterval ($interval)
 
 xmlIsValid (string $xml)
 

Protected Attributes

 $all_orgs = []
 
 $ncbitaxon_db_id = NULL
 
object $buddy_manager
 
object $dbxref_buddy
 
object $property_buddy
 
array $retrieval_options
 
- Protected Attributes inherited from Drupal\tripal_chado\TripalImporter\ChadoImporterBase
 $chado_schema_main
 
 $messenger = NULL
 
 $connection
 
array $bundle_type_id = []
 
- Protected Attributes inherited from Drupal\tripal\TripalImporter\TripalImporterBase
 $messenger = NULL
 
 $logger = NULL
 
 $fileretriever = NULL
 
 $publish_manager = NULL
 
 $job
 
 $arguments
 
 $import_id
 
 $is_prepared
 
 $reported
 
 $plugin_id
 
 $plugin_definition
 

Constructor & Destructor Documentation

◆ __construct()

Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition,
ChadoBuddyPluginManager  $buddy_manager,
ChadoConnection  $connection,
Messenger  $messenger,
TripalLogger  $logger,
TripalFileRetriever  $fileretriever,
TripalBackendPublishManager  $publish_manager 
)

{}

Member Function Documentation

◆ addDbxref()

Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::addDbxref (   $organism_id,
  $taxId 
)
protected
Parameters
unknown$organism_id
unknown$taxId

◆ addOrganism()

Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::addOrganism (   $sci_name,
  $rank 
)
protected

Adds a new organism record to Chado.

Parameters
sci_nameThe scientific name as provied by NCBI Taxonomy.
$rankThe rank of the organism as provied by NCBI Taxonomy.

◆ addProperty()

Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::addProperty (   $organism_id,
  $term_name,
  $value,
  $rank = 0 
)
protected

Adds a property to an organism node.

Parameters
$organism_idThe organism ID to which the property is added.
$term_nameThe name of the organism property term. This term must be present in the 'local' cv.
$valueThe value of the property.
$rankThe order for this property. The first instance of this term for this organism should be zero. Defaults to zero.

◆ create()

static Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

Implements ContainerFactoryPluginInterface->create().

We are injecting an additional dependency here, the ChadoBuddyPluginManager.

Since we have implemented the ContainerFactoryPluginInterface this static function will be called behind the scenes when a Plugin Manager uses createInstance(). Specifically this method is used to determine the parameters to pass to the constructor.

Parameters
Symfony\Component\DependencyInjection\ContainerInterface$containerThe container.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static

Reimplemented from Drupal\tripal_chado\TripalImporter\ChadoImporterBase.

◆ findOrganism()

Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::findOrganism (   $taxid,
  $sci_name 
)
protected

Checks the Chado database to see if the organism already exists.

Parameters
$taxidThe taxonomic ID for the organism.
$sci_nameThe scientific name for the organism as returned by NCBI

◆ form()

Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::form (   $form,
$form_state 
)
See also
TripalImporter::form()

Reimplemented from Drupal\tripal_chado\TripalImporter\ChadoImporterBase.

◆ formSubmit()

Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::formSubmit (   $form,
$form_state 
)

{Handles submission of the form elements.The form elements provided in the implementation of the form() function can be used for special submit if needed.

Parameters
array$formThe form array definition.
\Drupal\Core\Form\FormStateInterface$form_stateThe form state object.
}

Implements Drupal\tripal\TripalImporter\Interfaces\TripalImporterInterface.

◆ formValidate()

Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::formValidate (   $form,
$form_state 
)
See also
TripalImporter::formValidate()

Implements Drupal\tripal\TripalImporter\Interfaces\TripalImporterInterface.

◆ importRecord()

Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::importRecord (   $taxid,
  $root_taxon = NULL,
  $organism = NULL 
)
protected

Imports an organism from the NCBI taxonomy DB by its taxonomy ID

Parameters
$taxidThe NCBI Taxonomy ID.
$root_taxonAn optional taxon name for the root node if generating a sub-tree.
$organismThe organism object to which this taxonomy belongs. If the organism is NULL then it will be created.

◆ run()

Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::run ( )

◆ tripal_taxon_importer_set_ncbi_api_key()

static Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::tripal_taxon_importer_set_ncbi_api_key (   $form,
$form_state 
)
static

Ajax callback for the TaxonomyImporter::form() function.

It is called when the user makes a change to the NCBI API key field and then moves their cursor out of the field.

Parameters
array$formThe new form element.
\Drupal\Core\Form\FormStateInterface$form_stateThe state of the new form element.
Returns
array The new api key field.

◆ updateExisting()

Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::updateExisting (   $root_taxon = NULL)
protected

Imports details from NCBI Taxonomy for organisms that already exist.

Member Data Documentation

◆ $all_orgs

Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::$all_orgs = []
protected

Holds the list of all organisms currently in Chado. This list is needed when checking to see if an organism has already been loaded.

◆ $buddy_manager

object Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::$buddy_manager
protected

Used to store the manager so we can create various buddies

◆ $dbxref_buddy

object Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::$dbxref_buddy
protected

Provide the dbxref buddy instance

◆ $ncbitaxon_db_id

Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::$ncbitaxon_db_id = NULL
protected

ID of the NCBITaxon database in Chado

◆ $property_buddy

object Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::$property_buddy
protected

Provide the property buddy instance

◆ $retrieval_options

array Drupal\tripal_chado\Plugin\TripalImporter\TaxonomyImporter::$retrieval_options
protected
Initial value:
= [
'rate_limit' => 0.334,
'retry_delay' => 1.0,
]

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