Question: RNA to protein in bash?
2
gravatar for enrique
2.5 years ago by
enrique30
enrique30 wrote:

Hello everybody.

I'm new in this and I need to do a script in bash that translate a sequence from RNA to protein.

I was using this:

    #!/bin/bash

    echo "sequence of RNA: $rna "
    while read rna ; do

    cut=$(echo "${rna}" | sed -n -e 's/\(...\)/\\n/gp'| sed -f dna.sed)
    echo "$cut" | tr

dna.sed is another file with the codons.

s/UUU /F /g
s/CUU /L /g
s/AUU /I /g
s/GUU /V /g

...

 

But i don't know why doesn't work.

Thanks in advance.

homework translate protein rna • 1.3k views
ADD COMMENTlink modified 2.5 years ago by Devon Ryan81k • written 2.5 years ago by enrique30
2

Is this a homework? Because there are a huge ways to get a protein sequence from a dna one. Furthermore this type of tasks can be done much more easy with bioperl or biopython packages. If you're still interested in writing this kind of script in bash for learning or whatever, you should start writing step by step, and understanding each line code, like:

1) Read rna sequence 3 nt by 3nt
2) Look the 3bp codon in a table/hash/file where the codon -- aa conversion is specified.
3) Write output protein sequence.

ADD REPLYlink modified 2.5 years ago • written 2.5 years ago by iraun3.4k

Yes, this is a homework. I'm learning to program in different languages and one of the exercises is this.

ADD REPLYlink written 2.5 years ago by enrique30

This is how you ask for help on homework! Other people who just post the question and expect us to do the work for them, take note.

ADD REPLYlink written 2.5 years ago by Emily_Ensembl15k
0
gravatar for rioualen
2.5 years ago by
rioualen270
France
rioualen270 wrote:

Hi,

Does it have to be in shell scripting?
Because there are already existing solutions, see R package Biostrings or Biopython for example.

ADD COMMENTlink written 2.5 years ago by rioualen270

Yes, it's an exercise that has sent me the teacher.

ADD REPLYlink written 2.5 years ago by enrique30
0
gravatar for b.nota
2.5 years ago by
b.nota4.3k
Netherlands
b.nota4.3k wrote:

Why don't you use EMBOSS in bash? It has transeq or sixpack methods for translation to proteins.

ADD COMMENTlink written 2.5 years ago by b.nota4.3k

Because it's an exercise that has sent the teacher. I'm learning to program in different languages and one of the exercises is this.

ADD REPLYlink written 2.5 years ago by enrique30
3

Okay, does your teacher allow you to ask help on this forum?

ADD REPLYlink written 2.5 years ago by b.nota4.3k
1

He told us that we can look for information anywhere as long as we knew what we were doing. haha

ADD REPLYlink modified 2.5 years ago • written 2.5 years ago by enrique30

LOL! :D
 

ADD REPLYlink written 2.5 years ago by b.nota4.3k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 939 users visited in the last hour