123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- /**
- * @file
- * Contains more generally applicable functions as well as some meant to help developers
- * Plug-in to the BLAST UI functionality
- */
- /**
- * Returns a list BLAST DATABASE options
- *
- * @param $type
- * The type of BLAST dabases to restrict the list to (ie: n: nucleotide or p: protein)
- *
- * @return
- * An array where the nid is the key and the value is the human-readable name of the option
- */
- function get_blast_database_options($type) {
- // Get all BlastDB nodes
- $nodes = node_load_multiple(array(), array('type'=> 'blastdb'));
- $options = array();
- foreach ($nodes as $node) {
- if ( isset($node) && isset($node->db_dbtype) ) {
- if ( ($node->db_dbtype == $type) ) {
- $options[$node->nid] = $node->db_name;
- }
- }
- }
- asort($options);
- $options[0] = 'Select a Dataset';
- return $options;
- }
|