Building the analysis file (step 2: load and modify the phases)