function chado_get_location_string

3.x tripal_chado.feature.api.inc chado_get_location_string($featureloc)

Returns a string representing a feature location in an alignment.

Parameters

$featureloc: A single featureloc object generated using chado_generate_var that contains a record from the chado.featureloc table.

@return A string of the format: uniquename:featurelocmin..featurelocmax.strand

Related topics

2 calls to chado_get_location_string()
chado_get_fasta_defline in tripal_chado/api/modules/tripal_chado.feature.api.inc
Returns a definition line that can be used in a FASTA file.
tripal_get_location_string in tripal_chado/api/modules/tripal_chado.module.DEPRECATED.api.inc
Returns a string representing a feature location in an alignment.

File

tripal_chado/api/modules/tripal_chado.feature.api.inc, line 775
Provides API functions specificially for managing feature records in Chado.

Code

function chado_get_location_string($featureloc) {
  $feature = $featureloc->feature_id;

  $strand = '';
  if ($featureloc->strand == 1) {
    $strand = '+';
  }
  elseif ($featureloc->strand == -1) {
    $strand = '-';
  }

  return $featureloc->srcfeature_id->name . ":" . ($featureloc->fmin + 1) . ".." . $featureloc->fmax . $strand;
}