Fork me on GitHub"

# skbio.sequence.RNA.complement

RNA.complement(reverse=False)

  Return the complement of the nucleotide sequence.

  State: Stable as of 0.4.0.

  Parameters

    reverse (bool, optional) – If `True`, return the reverse complement. If positional and/or interval metadata are present, they will be reversed.

  Returns

    The (reverse) complement of the nucleotide sequence. The type and metadata of the result will be the same as the nucleotide sequence. If reverse is `True`, positional or interval metadata will be reversed if it is present.

  Return type

    NucleotideMixin

  See also

  `reverse_complement`, `complement_map`

  Examples

      >>> from skbio import DNA
      >>> seq = DNA('TTCATT', positional_metadata={'quality':range(6)})
      >>> seq
      DNA
      -----------------------------
      Positional metadata:
          'quality': <dtype: int64>
      Stats:
          length: 6
          has gaps: False
          has degenerates: False
          has definites: True
          GC-content: 16.67%
      -----------------------------
      0 TTCATT
      >>> seq.complement()
      DNA
      -----------------------------
      Positional metadata:
          'quality': <dtype: int64>
      Stats:
          length: 6
          has gaps: False
          has degenerates: False
          has definites: True
          GC-content: 16.67%
      -----------------------------
      0 AAGTAA
      >>> rc = seq.complement(reverse=True)
      >>> rc
      DNA
      -----------------------------
      Positional metadata:
          'quality': <dtype: int64>
      Stats:
          length: 6
          has gaps: False
          has degenerates: False
          has definites: True
          GC-content: 16.67%
      -----------------------------
      0 AATGAA
      >>> rc.positional_metadata['quality'].values
      array([5, 4, 3, 2, 1, 0])