1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53:
<?php
namespace DispatchModule\Tools;
class AnnotationDbTool extends \DispatchModule\Tools\DbTool {
public function __construct(\Nette\DI\Container $container) {
parent::__construct($container,
'Annotation',
'Standard search using annotations stored in database',
array(
'molecule_type' => array('select', 'Molecule type', array(
'items' => array('' => 'any'),
'multiplicators' => array('or' => 5))),
'description' => array('text', 'Description contains',
array('placeholder' => '18S sequenced from gene...')),
'accession' => array('text', 'Accession number', array(
'multiplicators' => array('or' => 10),
'placeholder' => 'AC091632'
)),
'firstpublished' => array('text', 'First published', array(
'date' => true,
'modifiers' => array('firstpublished_direction' => array('select', '', array('items' => array(self::RULE_LT => 'before', self::RULE_GT => 'after')))),
'multiplicators' => array('and' => 2)
)),
'sequence_quality' => array('select', 'Minimal sequence quality', array('items' => array('' => '0%', '50' => '50%', '90' => '90%', '95' => '95%', '99' => '99%'))),
'region_length' => array('text', 'Length', array(
'modifiers' => array('region_length_direction' => array('select', '', array('items' => array(self::RULE_LT => '<', self::RULE_GT => '>')))),
'multiplicators' => array('and' => 2)
)),
));
$base = $this->chooseBaseTable();
$result = $this->prepareCriteria('DISTINCT dataset', $base);
$result->order('dataset');
foreach ($result as $res) {
$type = $res['dataset'];
$this->wantedParameters['molecule_type'][2]['items'][$type] = $type;
}
}
}