Classification of loops in protein structures : applications on loop modeling and protein function