PHP code example of omnilab / rhea

1. Go to this page and download the library: Download omnilab/rhea library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

omnilab / rhea example snippets


$rhea = (new RheaSourceFactory($http))->create(['mailto' => '[email protected]']);
$reaction = $rhea->entity('RHEA:18160');           // or '18157', 'rn:R00200', its page
$reaction->id->display();                          // RHEA:18157: the master of 18160
$reaction->label;                                  // pyruvate + ATP = phosphoenolpyruvate + ADP + H(+)
$reaction->properties('left');                     // pyruvate (CHEBI:15361), ATP (CHEBI:30616)
$reaction->identifiers->keys();                    // rhea:18158, rhea:18159, rhea:18160, kegg.reaction:R00200
$reaction->related('participant')->keys();         // chebi:15361, chebi:30616, chebi:58702, chebi:456216, chebi:15378
$reaction->related('enzyme')->keys();              // ec:2.7.1.40
$reaction->value('enzymes');                       // 111 reviewed UniProt proteins; the first 25 in related('protein')
$rhea->search(new Query('pyruvate kinase', limit: 3));



mnilab\Rhea\RheaSourceFactory;

$rhea = (new RheaSourceFactory())->create(['mailto' => '[email protected]']);   // your address, in the User-Agent
$reaction = $rhea->entity('RHEA:18157');
echo $reaction->id->display(), ': ', $reaction->label, "\n";