function tripal_feature_reverse_complement

2.x tripal_feature.DEPRECATED.inc tripal_feature_reverse_complement($sequence)
3.x tripal_feature.DEPRECATED.inc tripal_feature_reverse_complement($sequence)
1.x tripal_feature.api.inc tripal_feature_reverse_complement($sequence)

Performs a reverse compliment of a nucleotide sequence

Parameters

$sequence: The nucelotide sequence

Return value

an upper-case reverse complemented sequence

Related topics

2 calls to tripal_feature_reverse_complement()
tripal_feature_get_formatted_sequence in tripal_feature/api/tripal_feature.api.inc
Retrieves the sequence for a feature.
tripal_feature_load_featureloc_sequences in tripal_feature/tripal_feature.module

File

tripal_feature/api/tripal_feature.api.inc, line 419
Provides an application programming interface (API) for working with features

Code

function tripal_feature_reverse_complement($sequence) {

  $seq = strtoupper($sequence);
  $seq = strrev($seq);
  $seq = str_replace("A", "t", $seq);
  $seq = str_replace("T", "a", $seq);
  $seq = str_replace("G", "c", $seq);
  $seq = str_replace("C", "g", $seq);
  $seq = str_replace("Y", "r", $seq);
  $seq = str_replace("R", "y", $seq);
  $seq = str_replace("W", "w", $seq);
  $seq = str_replace("S", "s", $seq);
  $seq = str_replace("K", "m", $seq);
  $seq = str_replace("M", "k", $seq);
  $seq = str_replace("D", "h", $seq);
  $seq = str_replace("V", "b", $seq);
  $seq = str_replace("H", "d", $seq);
  $seq = str_replace("B", "v", $seq);
  return strtoupper($seq);
}