Abstract
The structure of RNA is often the key to its function and there is a close relationship between structure and function in biology. In this paper, we present a new algorithm for generating the possible shapes of a single-stranded RNA molecule of length ℓ. We use a bijection between the secondary structure and specific ordered trees. Hence, generating different types of RNA becomes equivalent to the generation of these trees. The generated trees are encoded as integer sequences and are produced in A-order. The time complexity of the presented algorithm is O(ℓ−k) where ℓ is the number of bases and k, the number of pairings. Ranking and unranking algorithms with O(kℓ−k 2) and O(ℓ2+k 2) time complexity are also presented.
Acknowledgements
The authors would like to thank the anonymous referees for their helpful suggestions. This research was in part supported by a grant from I.P.M. (No. 84920018). We also thank the University of Tehran for the partial support of this research.