<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def recalibrate_quality(bam_file, sam_ref, dbsnp_file, picard_dir):
 """Recalibrate alignments with GATK and provide pdf summary. """

    cl = ["picard_gatk_recalibrate.py", picard_dir, sam_ref, bam_file]
    if dbsnp_file:
        cl.append(dbsnp_file)
    subprocess.check_call(cl)
    out_file = glob.glob("%s*gatkrecal.bam" % os.path.splitext(bam_file)[0])[0]
    return out_file