pseudo code for mGWAS