123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
- class so__cds extends TripalField {
-
-
-
-
-
-
-
-
-
-
-
-
- public static $term = 'SO:0000316';
-
- public static $label = 'Coding Sequence';
-
- public static $description = 'A contiguous sequence which begins with, and includes, a start codon and ends with, and includes, a stop codon.';
-
-
-
- public static $settings = array(
- 'chado_table' => '',
- 'chado_column' => '',
- 'base_table' => '',
- );
-
-
-
-
- public static $instance_settings = array();
-
-
- public static $storage = 'tripal_no_storage';
-
- public static $default_widget = 'so__cds_widget';
-
- public static $default_formatter = 'so__cds_formatter';
-
- public function load($entity, $details = array()) {
- $field_name = $this->field['field_name'];
- $feature = $details['record'];
- $num_seqs = 0;
- $feature = chado_expand_var($feature, 'table', 'featureloc', $options);
- $featureloc_sequences = chado_get_featureloc_sequences($feature->feature_id, $feature->featureloc->feature_id);
- foreach($featureloc_sequences as $src => $attrs){
-
- $cds_sequence = tripal_get_feature_sequences(
- array(
- 'feature_id' => $feature->feature_id,
- 'parent_id' => $attrs['featureloc']->srcfeature_id->feature_id,
- 'name' => $feature->name,
- 'featureloc_id' => $attrs['featureloc']->featureloc_id,
- ),
- array(
-
-
- 'derive_from_parent' => 1,
-
- 'aggregate' => 1,
-
- 'sub_feature_types' => array('CDS'),
- 'is_html' => 0
- )
- );
- if (count($cds_sequence) > 0) {
- $defline = tripal_get_fasta_defline($feature, '', $attrs['featureloc'], 'CDS', strlen($attrs['residues']));
-
-
-
-
- if ($cds_sequence[0]['residues']) {
- $entity->{$field_name}['und'][$num_seqs++]['value'] = $defline . "\n" . $cds_sequence[0]['residues'];
- }
- }
- }
- }
- }
|