Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Algorithm for identification of loops in rna

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,

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.



Thanks,
rahshan.
 
Saloon Keeper
Posts: 12295
259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch.

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.
 
Marshal
Posts: 70370
283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome again

Agree with Stephan: you shou‍ld 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
 
rahshan koll
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,

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?


Thank you,
Rahshan.





 
Campbell Ritchie
Marshal
Posts: 70370
283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 sh‍ould.
 
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic