data clean up and organization for trait histogram plotting