This is a test version of Biostars. For the public version, visit https://www.biostars.org.
convert DNA FASTA file to RNA FASTA file

Hi, All,

Is there a tool to convert a DNA FASTA file to an RNA FASTA file? I know there are online servers that could accept DNA sequences and do the conversion, however, it seems that these servers do not accept DNA FASTA files.

Thanks,

Xiao

rna-seq chip-seq sequence

There is no such thing as DNA FASTA and RNA FASTA. What operations are referring to here? Is it reverse complement + changing Ts to Us? If so, you'll need to chain those two operations.

Can you show us some online tools that do what you want "but not on files"?

Hi, Ram,

Sorry for the confusion. I mean changing T s to U s (not reverse complement). Basically, I have a DNA file in FASTA format, and I would like to change the T s in the DNA to U s.

Thanks. Xiao

2 answers

esl-reformat from the easel package - also gets compiled as part of HMMer - will do all kinds of biological sequence conversions, including what you need.

Hi, Mensur,

Thank you very much for introducing the esl-reformat.

Xiao

The servers I am aware can accept DNA/RNA with autodetection, but you can convert it as:

$ cat test.fa
>seq_0
ATGCTTACTGGGTGATC
>seq_1
TTGCCTCACCGNACTGC
>seq_2
ACTGATTCGCCTAATAA
$ perl -pe 'tr/tT/uU/ unless(/>/)' < test.fa
>seq_0
AUGCUUACUGGGUGAUC
>seq_1
UUGCCUCACCGNACUGC
>seq_2
ACUGAUUCGCCUAAUAA

Hi, JC, Your Perl script works well! Thanks.

Xiao

Log in to answer this question.