functions for NGS analysis