function tripal_reverse_compliment_sequence

2.x tripal_feature.api.inc tripal_reverse_compliment_sequence($sequence)

Performs a reverse compliment of a nucleotide sequence

Parameters

$sequence: The nucelotide sequence

Return value

an upper-case reverse complemented sequence

Related topics

3 calls to tripal_reverse_compliment_sequence()
tripal_feature_load_featureloc_sequences in tripal_feature/theme/tripal_feature.theme.inc
Get the sequence this feature is located on
tripal_feature_reverse_complement in tripal_feature/api/tripal_feature.DEPRECATED.inc
tripal_get_feature_sequences in tripal_feature/api/tripal_feature.api.inc
Retrieves the sequences for a given feature.
1 string reference to 'tripal_reverse_compliment_sequence'

File

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

Code

function tripal_reverse_compliment_sequence($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);
}