def test_homGeneMapping_without_hints(self):
        '''
        test without hints
        gtffilenames_without_hints.tbl - is gtffilenames.tbl with hints removed
        .../bin/homGeneMapping --noDupes --gtfs=.../gtffilenames_without_hints.tbl
            --halfile=aln.hal --tmpdir=.../tmp --outdir=...//outdir
            --printHomologs=.../homologs.txt > .../homGeneMapping.out)
        '''
        os.chdir(os.path.join(default_wd, testdir))
        refdir = os.path.join(referencedir, 'without_hints')
        outputdir = os.path.join(resultdir, 'without_hints')
        aug_path.mkdir_if_not_exists(refdir)
        aug_path.mkdir_if_not_exists(outputdir)
        resfile = os.path.join(outputdir, 'homGeneMapping.out')

        args = '--noDupes --gtfs=' + gtffilenames_without_hints + ' --halfile=aln.hal \
            --tmpdir=' + outputdir + '/tmp --outdir=' + outputdir + '/outdir \
            --printHomologs=' + outputdir + '/homologs.txt'

        aug_process.execute(self, hgmbin + ' ' + args, resfile)

        # compare results
        if TestHomGeneMapping.opt_compare:
            aug_assertions.assertEqualDirectory(self, refdir, outputdir,
                                                TestHomGeneMapping.opt_html,
                                                htmldir)
    def setUpClass(cls):
        os.chdir(default_wd)
        clean(force_tmp_dir=False, force_html_dir=True, force_result_dir=True)
        aug_path.mkdir_if_not_exists(resultdir)
        aug_path.mkdir_if_not_exists(tmpdir)

        # create file with gtf filenames without hint file references
        aug_process.execute(
            None,
            'cat ' + gtffilenames_with_hints + ' | sed "s/gtf\\t.*/gtf/g"',
            gtffilenames_without_hints)

        # create sqllite database
        out_load2sqlitedb = os.path.join(tmpdir, 'out_load2sqlitedb.txt')
        if os.path.exists(sqlitedb):
            os.remove(sqlitedb)

        aug_process.execute(
            None, load2sqlbin + ' --species=hg19 --dbaccess=' + sqlitedb +
            ' ' + examplesdir + '/cgp/human.fa', out_load2sqlitedb)
        aug_process.execute(
            None, load2sqlbin + ' --species=mm9 --dbaccess=' + sqlitedb + ' ' +
            examplesdir + '/cgp/mouse.fa', out_load2sqlitedb)
        aug_process.execute(
            None, load2sqlbin + ' --noIdx --species=hg19 --dbaccess=' +
            sqlitedb + ' ' + testdir + '/gtfs/human.hints.gff',
            out_load2sqlitedb)
        aug_process.execute(
            None, load2sqlbin + ' --noIdx --species=mm9 --dbaccess=' +
            sqlitedb + ' ' + testdir + '/gtfs/mouse.hints.gff',
            out_load2sqlitedb)
        aug_process.execute(None,
                            load2sqlbin + ' --makeIdx --dbaccess=' + sqlitedb,
                            out_load2sqlitedb)
Exemplo n.º 3
0
    def test_homGeneMapping_with_sql_hints(self):
        '''
        test with hints provided by SQLite databaseX
        .../bin/homGeneMapping --noDupes --gtfs=.../gtffilenames_without_hints.tbl
            --dbaccess=.../homGeneMapping_hints.db --halfile=aln.hal
            --tmpdir=.../tmp --outdir=.../outdir
            --printHomologs=.../homologs.txt > .../homGeneMapping.out
        '''
        os.chdir(os.path.join(default_wd, testdir))
        refdir = os.path.join(referencedir, 'with_hints')
        outputdir = os.path.join(resultdir, 'with_sql_hints')
        aug_path.mkdir_if_not_exists(refdir)
        aug_path.mkdir_if_not_exists(outputdir)
        resfile = os.path.join(outputdir, 'homGeneMapping.out')

        args = f'--noDupes --gtfs={gtffilenames_without_hints} \
            --dbaccess={sqlitedb} --halfile=aln.hal \
            --tmpdir={outputdir}/tmp --outdir={outputdir}/outdir \
            --printHomologs={outputdir}/homologs.txt'

        aug_process.execute(self, f'{hgmbin} {args}', resfile)

        # compare results
        if TestHomGeneMapping.opt_compare:
            aug_assertions.assertEqualDirectory(self, refdir, outputdir,
                                                TestHomGeneMapping.opt_html,
                                                htmldir)
Exemplo n.º 4
0
    def setUpClass(cls):
        os.chdir(default_wd)
        clean(force_tmp_dir=False, force_html_dir=True, force_result_dir=True)
        aug_path.mkdir_if_not_exists(resultdir)
        aug_path.mkdir_if_not_exists(tmpdir)

        inputfile = os.path.join(exampledir, testfilename)
        testfile = os.path.join(tmpdir, testfilename)
        shutil.copyfile(inputfile, testfile)
Exemplo n.º 5
0
    def setUpClass(cls):
        os.chdir(default_wd)
        clean(force_tmp_dir=False, force_html_dir=True, force_result_dir=True)
        aug_path.mkdir_if_not_exists(resultdir)
        aug_path.mkdir_if_not_exists(tmpdir)

        inputfile = os.path.join(exampledir, exampletestfile)
        testfile = os.path.join(tmpdir, exampletestfile)
        shutil.copyfile(inputfile, testfile)

        os.chdir(tmpdir)
        aug_process.execute(None, 'samtools index ' + exampletestfile)

        if os.path.isfile(os.path.join(tmpdir, f'{exampletestfile}.bai')):
            assert False, 'Test file not indexed.'
Exemplo n.º 6
0
 def setUpClass(cls):
     os.chdir(default_wd)
     clean(force_tmp_dir=False, force_html_dir=True, force_result_dir=True)
     aug_path.mkdir_if_not_exists(resultdir)
     aug_path.mkdir_if_not_exists(tmpdir)