Exemple #1
0
    def setUp(self):
        if not pysam.config.HAVE_LIBCURL or not check_url(self.url):
            self.remote_file = None
        else:
            self.remote_file = pysam.TabixFile(self.url, "r")

        self.local_file = pysam.TabixFile(self.local, "r")
    def setUp(self):
        if not check_url(self.url):
            self.remote_file = None
        else:
            self.remote_file = pysam.TabixFile(self.url, "r")

        self.local_file = pysam.TabixFile(self.local, "r")
Exemple #3
0
    def testFTPView(self):
        if not check_url(self.url):
            return

        try:
            with pysam.Fastafile(self.url) as f:
                self.assertEqual(len(f.fetch("chr1", 0, 1000)), 1000)
        except (OSError, IOError):
            pass
Exemple #4
0
    def test_sequence_lengths_are_available(self):
        if not check_url(self.url):
            return

        with pysam.Fastafile(self.url) as f:
            self.assertEqual(len(f.references), 3366)
            self.assertTrue("chr1" in f.references)
            self.assertEqual(f.lengths[0], 248956422)
            self.assertEqual(f.get_reference_length("chr1"), 248956422)
Exemple #5
0
    def testFTPView(self):
        if not check_url(self.url):
            return

        with pysam.Fastafile(self.url) as f:
            self.assertEqual(len(f.fetch("chr1", 0, 1000)), 1000)