Exemplo n.º 1
0
 def test_toExternalFiles(self):
     bogusDS = DataSet("bam1.bam", "bam2.bam", strict=False)
     self.assertEqual(['bam1.bam', 'bam2.bam'],
                      bogusDS.externalResources.resourceIds)
     self.assertEquals(DataSet("bam1.bam", "bam2.bam",
                               strict=False).toExternalFiles(),
                       ['bam1.bam', 'bam2.bam'])
     realDS = DataSet(data.getXml(8))
     files = realDS.toExternalFiles()
     self.assertEqual(len(files), 1)
     self.assertTrue(os.path.exists(files[0]))
     self.assertTrue(os.path.isabs(files[0]))
Exemplo n.º 2
0
 def test_toExternalFiles(self):
     bogusDS = DataSet("bam1.bam", "bam2.bam", strict=False)
     self.assertEqual(['bam1.bam', 'bam2.bam'],
                      bogusDS.externalResources.resourceIds)
     self.assertEquals(
         DataSet("bam1.bam", "bam2.bam", strict=False).toExternalFiles(),
         ['bam1.bam', 'bam2.bam'])
     realDS = DataSet(data.getXml(8))
     files = realDS.toExternalFiles()
     self.assertEqual(len(files), 1)
     self.assertTrue(os.path.exists(files[0]))
     self.assertTrue(os.path.isabs(files[0]))
Exemplo n.º 3
0
    def test_referenceInfoTableMerging(self):
        log.info("Testing refIds, etc. after merging")
        ds = DataSet(data.getXml(17))
        also_lambda = ds.toExternalFiles()[0]
        aln = AlignmentSet(data.getBam(0), data.getBam(0), also_lambda)
        readers = aln.resourceReaders()

        ids = sorted([i for _, i in aln.refInfo('ID')])
        self.assertEqual(range(len(ids)), ids)

        accNames = aln.refNames
        expNames = reduce(np.append,
                          [reader.referenceInfoTable['Name']
                           for reader in readers])
        expNames = np.unique(expNames)
        self.assertEqual(sorted(expNames), sorted(accNames))

        accNames = aln.fullRefNames
        expNames = reduce(np.append,
                          [reader.referenceInfoTable['FullName']
                           for reader in readers])
        expNames = np.unique(expNames)
        self.assertEqual(sorted(expNames), sorted(accNames))
Exemplo n.º 4
0
    def test_referenceInfoTableMerging(self):
        log.info("Testing refIds, etc. after merging")
        ds = DataSet(data.getXml(17))
        also_lambda = ds.toExternalFiles()[0]
        aln = AlignmentSet(data.getBam(0), data.getBam(0), also_lambda)
        readers = aln.resourceReaders()

        ids = sorted([i for _, i in aln.refInfo('ID')])
        self.assertEqual(range(len(ids)), ids)

        accNames = aln.refNames
        expNames = reduce(
            np.append,
            [reader.referenceInfoTable['Name'] for reader in readers])
        expNames = np.unique(expNames)
        self.assertEqual(sorted(expNames), sorted(accNames))

        accNames = aln.fullRefNames
        expNames = reduce(
            np.append,
            [reader.referenceInfoTable['FullName'] for reader in readers])
        expNames = np.unique(expNames)
        self.assertEqual(sorted(expNames), sorted(accNames))