Main Content

dna2rna

Convert DNA sequence to RNA sequence

Description

SeqRNA = dna2rna(SeqDNA) converts a DNA sequence to an RNA sequence by replacing thymine (T) nucleotides with uracil (U) nucleotides.

example

Examples

collapse all

Generate a random DNA sequence.

dna = randseq(100)
dna = 
'TTATGACGTTATTCTACTTTGATTGTGCGAGACAATGCTACCTTACCGGTCGGAACTCGATCGGTTGAACTCTATCACGCCTGGTCTTCGAAGTTAGCAC'

Convert the DNA sequence to an RNA sequence.

rna = dna2rna(dna)
rna = 
'UUAUGACGUUAUUCUACUUUGAUUGUGCGAGACAAUGCUACCUUACCGGUCGGAACUCGAUCGGUUGAACUCUAUCACGCCUGGUCUUCGAAGUUAGCAC'

Read the nucleotide sequence information of the human p53 tumor gene.

p53nt = fastaread("p53nt.txt")
p53nt = struct with fields:
      Header: 'gi|8400737|ref|NM_000546.2| Homo sapiens tumor protein p53 (Li-Fraumeni syndrome) (TP53), mRNA'
    Sequence: 'ACTTGTCATGGCGACTGTCCAGCTTTGTGCCAGGAGCCTCGCAGGGGTTGATGGGATTGGGGTTTTCCCCTCCCATGTGCTCAAGACTGGCGCTAAAAGTTTTGAGCTTCTCAAAAGTCTAGAGCCACCGTCCAGGGAGCAGGTAGCTGCTGGGCTCCGGGGACACTTTGCGTTCGGGCTGGGAGCGTGCTTTCCACGACGGTGACACGCTTCCCTGGATTGGCAGCCAGACTGCCTTCCGGGTCACTGCCATGGAGGAGCCGCAGTCAGATCCTAGCGTCGAGCCCCCTCTGAGTCAGGAAACATTTTCAGACCTATGGAAACTACTTCCTGAAAACAACGTTCTGTCCCCCTTGCCGTCCCAAGCAATGGATGATTTGATGCTGTCCCCGGACGATATTGAACAATGGTTCACTGAAGACCCAGGTCCAGATGAAGCTCCCAGAATGCCAGAGGCTGCTCCCCGCGTGGCCCCTGCACCAGCAGCTCCTACACCGGCGGCCCCTGCACCAGCCCCCTCCTGGCCCCTGTCATCTTCTGTCCCTTCCCAGAAAACCTACCAGGGCAGCTACGGTTTCCGTCTGGGCTTCTTGCATTCTGGGACAGCCAAGTCTGTGACTTGCACGTACTCCCCTGCCCTCAACAAGATGTTTTGCCAACTGGCCAAGACCTGCCCTGTGCAGCTGTGGGTTGATTCCACACCCCCGCCCGGCACCCGCGTCCGCGCCATGGCCATCTACAAGCAGTCACAGCACATGACGGAGGTTGTGAGGCGCTGCCCCCACCATGAGCGCTGCTCAGATAGCGATGGTCTGGCCCCTCCTCAGCATCTTATCCGAGTGGAAGGAAATTTGCGTGTGGAGTATTTGGATGACAGAAACACTTTTCGACATAGTGTGGTGGTGCCCTATGAGCCGCCTGAGGTTGGCTCTGACTGTACCACCATCCACTACAACTACATGTGTAACAGTTCCTGCATGGGCGGCATGAACCGGAGGCCCATCCTCACCATCATCACACTGGAAGACTCCAGTGGTAATCTACTGGGACGGAACAGCTTTGAGGTGCGTGTTTGTGCCTGTCCTGGGAGAGACCGGCGCACAGAGGAAGAGAATCTCCGCAAGAAAGGGGAGCCTCACCACGAGCTGCCCCCAGGGAGCACTAAGCGAGCACTGCCCAACAACACCAGCTCCTCTCCCCAGCCAAAGAAGAAACCACTGGATGGAGAATATTTCACCCTTCAGATCCGTGGGCGTGAGCGCTTCGAGATGTTCCGAGAGCTGAATGAGGCCTTGGAACTCAAGGATGCCCAGGCTGGGAAGGAGCCAGGGGGGAGCAGGGCTCACTCCAGCCACCTGAAGTCCAAAAAGGGTCAGTCTACCTCCCGCCATAAAAAACTCATGTTCAAGACAGAAGGGCCTGACTCAGACTGACATTCTCCACTTCTTGTTCCCCACTGACAGCCTCCCACCCCCATCTCTCCCTCCCCTGCCATTTTGGGTTTTGGGTCTTTGAACCCTTGCTTGCAATAGGTGTGCGTCAGAAGCACCCAGGACTTCCATTTGCTTTGTCCCGGGGCTCCACTGAACAAGTTGGCCTGCACTGGTGTTTTGTTGTGGGGAGGAGGATGGGGAGTAGGACATACCAGCTTAGATTTTAAGGTTTTTACTGTGAGGGATGTTTGGGAGATGTAAGAAATGTTCTTGCAGTTAAGGGTTAGTTTACAATCAGCCACATTCTAGGTAGGTAGGGGCCCACTTCACCGTACTAACCAGGGAAGCTGTCCCTCATGTTGAATTTTCTCTAACTTCAAGGCCCATATCTGTGAAATGCTGGCATTTGCACCTACCTCACAGAGTGCATTGTGAGGGTTAATGAAATAATGTACATCTGGCCTTGAAACCACCTTTTATTACATGGGGTCTAAAACTTGACCCCCTTGAGGGTGCCTGTTCCCTCTCCCTCTCCCTGTTGGCTGGTGGGTTGGTAGTTTCTACAGTTGGGCAGCTGGTTAGGTAGAGGGAGTTGTCAAGTCTTGCTGGCCCAGCCAAACCCTGTCTGACAACCTCTTGGTCGACCTTAGTACCTAAAAGGAAATCTCACCCCATCCCACACCCTGGAGGATTTCATCTCTTGTATATGATGATCTGGATCCACCAAGACTTGTTTTATGCTCAGGGTCAATTTCTTTTTTCTTTTTTTTTTTTTTTTTTCTTTTTCTTTGAGACTGGGTCTCGCTTTGTTGCCCAGGCTGGAGTGGAGTGGCGTGATCTTGGCTTACTGCAGCCTTTGCCTCCCCGGCTCGAGCAGTCCTGCCTCAGCCTCCGGAGTAGCTGGGACCACAGGTTCATGCCACCATGGCCAGCCAACTTTTGCATGTTTTGTAGAGATGGGGTCTCACAGTGTTGCCCAGGCTGGTCTCAAACTCCTGGGCTCAGGCGATCCACCTGTCTCAGCCTCCCAGAGTGCTGGGATTACAATTGTGAGCCACCACGTGGAGCTGGAAGGGTCAACATCTTTTACATTCTGCAAGCACATCTGCATTTTCACCCCACCCTTCCCCTCCTTCTCCCTTTTTATATCCCATTTTTATATCGATCTCTTATTTTACAATAAAACTTTGCTGCCA'

Convert the DNA sequence in the Sequence field to an RNA sequence.

p53rna = dna2rna(p53nt)
p53rna = 
'ACUUGUCAUGGCGACUGUCCAGCUUUGUGCCAGGAGCCUCGCAGGGGUUGAUGGGAUUGGGGUUUUCCCCUCCCAUGUGCUCAAGACUGGCGCUAAAAGUUUUGAGCUUCUCAAAAGUCUAGAGCCACCGUCCAGGGAGCAGGUAGCUGCUGGGCUCC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GUAGCUGGGACCACAGGUUCAUGCCACCAUGGCCAGCCAACUUUUGCAUGUUUUGUAGAGAUGGGGUCUCACAGUGUUGCCCAGGCUGGUCUCAAACUCCUGGGCUCAGGCGAUCCACCUGUCUCAGCCUCCCAGAGUGCUGGGAUUACAAUUGUGAGCCACCACGUGGAGCUGGAAGGGUCAACAUCUUUUACAUUCUGCAAGCACAUCUGCAUUUUCACCCCACCCUUCCCCUCCUUCUCCCUUUUUAUAUCCCAUUUUUAUAUCGAUCUCUUAUUUUACAAUAAAACUUUGCUGCCA'

Input Arguments

collapse all

DNA sequence, specified as one of the following.

Example: SeqRNA = dna2rna("CGACTT") replaces the instances of T with U.

Data Types: double | char | string | struct

Output Arguments

collapse all

RNA sequence, returned as a character vector or a row vector of integers.

  • If SeqDNA is a character vector or string scalar, then the function returns a character vector.

  • If SeqDNA is a row vector of integers, then the function returns a row vector of integers.

  • If SeqDNA is a structure, then the function returns a character vector or a row vector of integers depending on the data type of the Sequence field.

Version History

Introduced before R2006a

See Also

| | |