Do anyone know about the algorithms or built-in library functions in java to find the RNA substructures (ex: hairpin loop, an internal loop, bulge loop)? If anyone knows anything related to this, please let me know.
That's a very specific problem. If there's no third-party library out there that allows you to perform these tasks, then you have to write your own. We can help you when you run into programming problems, but I doubt a lot of the members here know that much about biochemistry, so you'll have to come up with the algorithm yourself.
Agree with Stephan: you should start by explaining how you identify a hairpin from the sequence of bases. Is it single or double stranded? That difference probably doesn't call for different algorithms however. If you do write your own library, you may be able to publish it
posted 2 years ago
Thank you for your valuable information.
Hairpin loop in RAB format looks like +X 0 0 0... -X (i.e In between +X and -X there will be at least one zero or the consecutive number of zeros). where X is any number in the given structure but ending number is the negative of the beginning number. Example : +5 0 0 0 -5 or +2 0 -2 or +11 0 0 0 0 0 0 0 0 -11.
This is what I did for hairpin loop in my research. But I need suggestions from you that is there any better way to write this program other than this and better explanation for this program? And can you tell me how can I read the .txt file form computer and perform this logic for each structure to find out the number of hairpin loops in each structure in the text file?
posted 2 years ago
That code should all come out ot the main method. And don't make anything static without a good reason.
I have never seen RNA sequences written out as number, only as bases, as you said yesterday.
There must be a more elegant way to do that without going into quadratic time. Once you hit a number, consider going into a while loop, looking for 0s: while (array[i] == 0)... Note that loop is incomplete and you need to take precautions so as not to run off the end of the array. I think that sort of seeking 0s will run in linear time.
Never close a Scanner pointing to System.in. Not even if your IDE suggests you should.
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad: