Model for folding and aggregation in RNA secondary structures.