Exemplo n.º 1
0
def run_fragments(options):
    """Wraps the sctools.fragments function for use on the command line
    """
    fragments.fragments(bam=options.bam,
                        fragment_path=options.fragments,
                        min_mapq=options.min_mapq,
                        nproc=options.nproc,
                        cellbarcode=options.barcodetag,
                        readname_barcode=options.barcode_regex,
                        chromosomes=options.use_chrom,
                        cells=options.cells,
                        max_distance=options.max_distance)
Exemplo n.º 2
0
Arquivo: cli.py Projeto: timoast/sinto
def run_fragments(options):
    """Wraps the sctools.fragments function for use on the command line
    """
    fragments.fragments(bam=options.bam,
                        fragment_path=options.fragments,
                        min_mapq=options.min_mapq,
                        nproc=options.nproc,
                        cellbarcode=options.barcodetag,
                        readname_barcode=options.barcode_regex,
                        chromosomes=options.use_chrom,
                        cells=options.cells,
                        max_distance=options.max_distance,
                        min_distance=options.min_distance,
                        chunksize=options.chunksize,
                        shifts=[options.shift_plus, options.shift_minus],
                        collapse_within=options.collapse_within)
Exemplo n.º 3
0
def test_fragments(tmpdir, collapse_within):
    basepath = os.path.dirname(os.path.realpath(__file__))
    bam = os.path.join(basepath, "data/test.bam")
    outf = tmpdir / "frags.bed"
    fragments.fragments(
        bam=bam,
        fragment_path=outf,
        collapse_within=collapse_within,
    )
    output = [line.strip("\n") for line in open(outf, "r")]
    if collapse_within:
        expected_path = os.path.join(basepath, "data/frags_within.bed")
    else:
        expected_path = os.path.join(basepath, "data/frags_across.bed")
    expected = [line.strip("\n") for line in open(expected_path, "r")]
    output.sort()
    expected.sort()
    assert output == expected