Hi everyone, how are you? In this time I want to discuss about one of the problems at rosalind.info's web. The title is "Transcribing DNA to RNA". For the reference, you can first check out the problem that will be discussed (here).
Overview
Transcribing DNA to RNA, like the name, in this problem we will try to transcribing the DNA compunds ('A', 'C', 'G', and 'T') to RNA compunds ('A', 'C', 'G', and 'U'). As what you know about DNA and RNA, their compunds is quite same but thymine ('T', found in DNA) will be transformed into uracil ('U', found in RNA). The input will be a DNA string.
The Code and Explaination
There is my code to solving this problem (in java language):
public void solve() {
String s = in.read();
out.println(s.replace('T', 'U'));
}
Like what you see, the code is quite simple. We just have to replace 'T' character in this string into 'U' with replace() function in java.
For another method, you can read each character (char) in this string with for loop (for (char ch : s.toCharArray())), while replacing 'T' character into 'U' manually.
And for the output I used function out.println(). That function is modification from function System.out.println() that is very familiar in java. You can see the additional code for that modification in my complete code at github.
If you asking me why I used java, the answer is because I like to write in java, I like the "code structure" in java. And in rosalind, we don't have to use the certain programming language to answering the problem because in here the requested answer is in the text form not the code form. Thus, you can pick any language whatever you want (or can) as long as your code are right.
That is true, in rosalind, we don't have to use the certain programming language to answering the problem. But, in reality, the bioinformatics world itself have had the most familiar and most used (in my opinion) language, it's called python language.
Python (or python language) arguably can be described as the most easiest language to be learned, especially for this writing style that more simple than other language. Now, so many resources out there that can be used as reference for learning this subject. One of them is rosalind. Rosalind's web itself has a particular problem genre specific for learning the python language. Thus, if you new in bioinformatics or want to learn programming with python you can visit at rosalind and do learn with us together.
That's from me. If you want to ask something, you can write it in the comment section below. I hope this article is useful and see you in the next article!
Reference :
Source of image 1 :https://www.facebook.com/ProjectRosalind/
No comments:
Post a Comment