Started converting sam tools python script into perl