How to use snps - 10 common examples

To help you get started, we’ve selected a few snps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apriha / snps / tests / io / test_reader.py View on Github external
def _setup_gsa_test(resources_dir):
        # reset resource if already loaded
        r = Resources()
        r._resources_dir = resources_dir
        r._gsa_resources = {}

        gzip_file(
            "tests/resources/gsa_rsid_map.txt",
            os.path.join(resources_dir, "gsa_rsid_map.txt.gz"),
        )
        gzip_file(
            "tests/resources/gsa_chrpos_map.txt",
            os.path.join(resources_dir, "gsa_chrpos_map.txt.gz"),
        )
github apriha / snps / tests / io / test_reader.py View on Github external
def _teardown_gsa_test():
        r = Resources()
        r._resources_dir = "resources"
        r._gsa_resources = {}
github apriha / snps / tests / io / test_reader.py View on Github external
def _setup_gsa_test(resources_dir):
        # reset resource if already loaded
        r = Resources()
        r._resources_dir = resources_dir
        r._gsa_resources = {}

        gzip_file(
            "tests/resources/gsa_rsid_map.txt",
            os.path.join(resources_dir, "gsa_rsid_map.txt.gz"),
        )
        gzip_file(
            "tests/resources/gsa_chrpos_map.txt",
            os.path.join(resources_dir, "gsa_chrpos_map.txt.gz"),
        )
github apriha / snps / tests / io / test_reader.py View on Github external
def _setup_gsa_test(resources_dir):
        # reset resource if already loaded
        r = Resources()
        r._resources_dir = resources_dir
        r._gsa_resources = {}

        gzip_file(
            "tests/resources/gsa_rsid_map.txt",
            os.path.join(resources_dir, "gsa_rsid_map.txt.gz"),
        )
        gzip_file(
            "tests/resources/gsa_chrpos_map.txt",
            os.path.join(resources_dir, "gsa_chrpos_map.txt.gz"),
        )
github apriha / snps / tests / test_snps.py View on Github external
def f():
            s = SNPs("tests/input/GRCh37.csv")
            chromosomes_remapped, chromosomes_not_remapped = s.remap_snps(38)
            self.assertEqual(s.build, 38)
            self.assertEqual(s.assembly, "GRCh38")
            self.assertEqual(len(chromosomes_remapped), 2)
            self.assertEqual(len(chromosomes_not_remapped), 0)
            pd.testing.assert_frame_equal(s.snps, self.snps_GRCh38(), check_exact=True)
github apriha / snps / tests / test_snps.py View on Github external
def f():
            s = SNPs("tests/input/NCBI36.csv", parallelize=True)
            chromosomes_remapped, chromosomes_not_remapped = s.remap_snps(37)
            self.assertEqual(s.build, 37)
            self.assertEqual(s.assembly, "GRCh37")
            self.assertEqual(len(chromosomes_remapped), 2)
            self.assertEqual(len(chromosomes_not_remapped), 0)
            pd.testing.assert_frame_equal(s.snps, self.snps_GRCh37(), check_exact=True)
github apriha / snps / tests / test_snps.py View on Github external
def test_chromosomes(self):
        s = SNPs("tests/input/chromosomes.csv")
        self.assertListEqual(s.chromosomes, ["1", "2", "3", "5", "PAR", "MT"])
github apriha / snps / tests / io / test_writer.py View on Github external
def test_save_snps_specify_file(self):
        s = SNPs("tests/input/generic.csv")
        self.assertEqual(os.path.relpath(s.save_snps("snps.csv")), "output/snps.csv")
        self.run_parsing_tests("output/snps.csv", "generic")
github apriha / snps / tests / test_snps.py View on Github external
def test_save_snps_no_snps_vcf(self):
        s = SNPs()
        self.assertFalse(s.save_snps(vcf=True))
github apriha / snps / tests / __init__.py View on Github external
def parse_file(self, file, rsids=()):
        return SNPs(file, rsids=rsids)