def find_shared_dna(
        self,
        individual1,
        individual2,
        cM_threshold=0.75,
        snp_threshold=1100,
        shared_genes=False,
        save_output=True,
    ):
        """ Find the shared DNA between two individuals.

        Computes the genetic distance in centiMorgans (cMs) between SNPs using the HapMap Phase II
        GRCh37 genetic map. Applies thresholds to determine the shared DNA. Plots shared DNA.
        Optionally determines shared genes (i.e., genes that are transcribed from the shared DNA).

        All output is saved to the output directory as `CSV` or `PNG` files.

        Parameters
        ----------
        individual1 : Individual
        individual2 : Individual
        cM_threshold : float
            minimum centiMorgans for each shared DNA segment
        snp_threshold : int
            minimum SNPs for each shared DNA segment
        shared_genes : bool
            determine shared genes
        save_output : bool
            specifies whether to save output files in the output directory

        Returns
        -------
        one_chrom_shared_dna : pandas.DataFrame
            segments of shared DNA on one chromosome
        two_chrom_shared_dna : pandas.DataFrame
            segments of shared DNA on two chromosomes
        one_chrom_shared_genes : pandas.DataFrame
            shared genes on one chromosome
        two_chrom_shared_genes : pandas.DataFrame
            shared genes on two chromosomes
        """
        one_chrom_shared_genes = pd.DataFrame()
        two_chrom_shared_genes = pd.DataFrame()

        self._remap_snps_to_GRCh37([individual1, individual2])

        df = individual1.snps

        df = df.join(individual2.snps["genotype"], rsuffix="2", how="inner")

        genotype1 = "genotype_" + individual1.get_var_name()
        genotype2 = "genotype_" + individual2.get_var_name()

        df = df.rename(columns={"genotype": genotype1, "genotype2": genotype2})

        one_x_chrom = self._is_one_individual_male([individual1, individual2])

        # determine the genetic distance between each SNP using the HapMap Phase II genetic map
        genetic_map, df = self._compute_snp_distances(df)

        # determine where individuals share an allele on one chromosome
        df["one_chrom_match"] = np.where(
            df[genotype1].isnull()
            | df[genotype2].isnull()
            | (df[genotype1].str[0] == df[genotype2].str[0])
            | (df[genotype1].str[0] == df[genotype2].str[1])
            | (df[genotype1].str[1] == df[genotype2].str[0])
            | (df[genotype1].str[1] == df[genotype2].str[1]),
            True,
            False,
        )

        # determine where individuals share alleles on both chromosomes
        df["two_chrom_match"] = np.where(
            df[genotype1].isnull()
            | df[genotype2].isnull()
            | (
                (df[genotype1].str.len() == 2)
                & (df[genotype2].str.len() == 2)
                & (
                    (df[genotype1] == df[genotype2])
                    | (
                        (df[genotype1].str[0] == df[genotype2].str[1])
                        & (df[genotype1].str[1] == df[genotype2].str[0])
                    )
                )
            ),
            True,
            False,
        )

        # compute shared DNA between individuals
        one_chrom_shared_dna = self._compute_shared_dna(
            df, genetic_map, "one_chrom_match", cM_threshold, snp_threshold, one_x_chrom
        )

        two_chrom_shared_dna = self._compute_shared_dna(
            df, genetic_map, "two_chrom_match", cM_threshold, snp_threshold, one_x_chrom
        )

        cytobands = self._resources.get_cytoBand_hg19()

        # plot data
        if save_output:
            if create_dir(self._output_dir):
                plot_chromosomes(
                    one_chrom_shared_dna,
                    two_chrom_shared_dna,
                    cytobands,
                    os.path.join(
                        self._output_dir,
                        "shared_dna_"
                        + individual1.get_var_name()
                        + "_"
                        + individual2.get_var_name()
                        + ".png",
                    ),
                    individual1.name + " / " + individual2.name + " shared DNA",
                    37,
                )

        one_chrom_shared_dna = self._convert_shared_dna_list_to_df(one_chrom_shared_dna)

        if len(one_chrom_shared_dna) > 0:
            if save_output:
                self._save_shared_dna_csv_format(
                    one_chrom_shared_dna,
                    "one",
                    individual1.get_var_name(),
                    individual2.get_var_name(),
                )
            if shared_genes:
                one_chrom_shared_genes = self._compute_shared_genes(
                    one_chrom_shared_dna,
                    "one",
                    individual1.get_var_name(),
                    individual2.get_var_name(),
                    save_output,
                )

        two_chrom_shared_dna = self._convert_shared_dna_list_to_df(two_chrom_shared_dna)

        if len(two_chrom_shared_dna) > 0:
            if save_output:
                self._save_shared_dna_csv_format(
                    two_chrom_shared_dna,
                    "two",
                    individual1.get_var_name(),
                    individual2.get_var_name(),
                )
            if shared_genes:
                two_chrom_shared_genes = self._compute_shared_genes(
                    two_chrom_shared_dna,
                    "two",
                    individual1.get_var_name(),
                    individual2.get_var_name(),
                    save_output,
                )

        return (
            one_chrom_shared_dna,
            two_chrom_shared_dna,
            one_chrom_shared_genes,
            two_chrom_shared_genes,
        )
Find the shared DNA between two individuals.

        Computes the genetic distance in centiMorgans (cMs) between SNPs using the HapMap Phase II
        GRCh37 genetic map. Applies thresholds to determine the shared DNA. Plots shared DNA.
        Optionally determines shared genes (i.e., genes that are transcribed from the shared DNA).

        All output is saved to the output directory as `CSV` or `PNG` files.

        Parameters
        ----------
        individual1 : Individual
        individual2 : Individual
        cM_threshold : float
            minimum centiMorgans for each shared DNA segment
        snp_threshold : int
            minimum SNPs for each shared DNA segment
        shared_genes : bool
            determine shared genes
        save_output : bool
            specifies whether to save output files in the output directory

        Returns
        -------
        one_chrom_shared_dna : pandas.DataFrame
            segments of shared DNA on one chromosome
        two_chrom_shared_dna : pandas.DataFrame
            segments of shared DNA on two chromosomes
        one_chrom_shared_genes : pandas.DataFrame
            shared genes on one chromosome
        two_chrom_shared_genes : pandas.DataFrame
            shared genes on two chromosomes