<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save_snps(self, filename=None):
 """ Save SNPs to file. Parameters filename : str filename for file to save Returns ------- str path to file in output directory if SNPs were saved, else empty str """

        comment = (
            "# Source(s): {}\n"
            "# Assembly: {}\n"
            "# SNPs: {}\n"
            "# Chromosomes: {}\n".format(
                self.source, self.assembly, self.snp_count, self.chromosomes_summary
            )
        )

        if filename is None:
            filename = self.get_var_name() + "_lineage_" + self.assembly + ".csv"

        return lineage.save_df_as_csv(
            self._snps,
            self._output_dir,
            filename,
            comment=comment,
            header=["chromosome", "position", "genotype"],
        )