コード例 #1
0
def test_async_mappable_regions_50_hisat(tests_config, chrom, hisat2):

    filename = os.path.join('sgains/tests/data',
                            "{}.50mer.mappable.regions.txt.gz".format(chrom))
    gold_df = pd.read_csv(filename,
                          sep='\t',
                          compression='gzip',
                          header=None,
                          names=['chrom', 'start', 'end'])
    with io.StringIO() as outfile:
        pipeline = MappableRegionsPipeline(tests_config, hisat2)
        pipeline.generate_mappable_regions([chrom], 50, outfile=outfile)
        outfile.flush()

        infile = io.StringIO(outfile.getvalue())
        df = pd.read_csv(infile,
                         sep='\t',
                         header=None,
                         names=['chrom', 'start', 'end'])
        print(df.head())
    assert np.all(df.columns == gold_df.columns)
    assert len(df) == len(gold_df)

    assert np.all(df.start == gold_df.start)
    assert np.all(df.end == gold_df.end)
コード例 #2
0
def test_generate_mappable_regions_hisat(tests_config, hisat2):

    assert hisat2 is not None
    pipeline = MappableRegionsPipeline(tests_config, hisat2)

    pipeline.generate_mappable_regions(['chrM'], 100)
コード例 #3
0
def test_generate_mappable_regions_bwa(tests_config, bwa):

    assert bwa is not None
    pipeline = MappableRegionsPipeline(tests_config, bwa)

    pipeline.generate_mappable_regions(['chrM'], 100)
コード例 #4
0
def test_generate_mappable_regions(tests_config):
    pipeline = MappableRegionsPipeline(tests_config)
    pipeline.generate_mappable_regions(['chrM'], 100)