Taken from readblast_mini.py and adjusted