fix of generate_sbatch.py: getting average frag length from statusdb + handeling .gz files