In vitro folding and twisting