rewrite the RefTR analysis pipeline with sjm