Esempio n. 1
0
def test_get_daligner_job_descriptions():
    result = f.get_daligner_job_descriptions(
            example_HPCdaligner, 'raw_reads')
    assert result
    eq_(result[(1, 1)], "daligner -v -h1 -t16 -H1 -e0.7 -l1 -s1000 raw_reads.1 raw_reads.1\nLAsort -v raw_reads.1.raw_reads.1.C0 raw_reads.1.raw_reads.1.N0 && LAmerge -v L1.1.1 raw_reads.1.raw_reads.1.C0.S raw_reads.1.raw_reads.1.N0.S && rm raw_reads.1.raw_reads.1.C0.S.las raw_reads.1.raw_reads.1.N0.S.las\n")
    eq_(result[(2, 1, 2)], "daligner -v -h1 -t16 -H1 -e0.7 -l1 -s1000 raw_reads.2 raw_reads.1 raw_reads.2\nLAsort -v raw_reads.1.raw_reads.2.C0 raw_reads.1.raw_reads.2.N0 && LAmerge -v L1.1.2 raw_reads.1.raw_reads.2.C0.S raw_reads.1.raw_reads.2.N0.S && rm raw_reads.1.raw_reads.2.C0.S.las raw_reads.1.raw_reads.2.N0.S.las\nLAsort -v raw_reads.2.raw_reads.1.C0 raw_reads.2.raw_reads.1.N0 && LAmerge -v L1.2.1 raw_reads.2.raw_reads.1.C0.S raw_reads.2.raw_reads.1.N0.S && rm raw_reads.2.raw_reads.1.C0.S.las raw_reads.2.raw_reads.1.N0.S.las\nLAsort -v raw_reads.2.raw_reads.2.C0 raw_reads.2.raw_reads.2.N0 && LAmerge -v L1.2.2 raw_reads.2.raw_reads.2.C0.S raw_reads.2.raw_reads.2.N0.S && rm raw_reads.2.raw_reads.2.C0.S.las raw_reads.2.raw_reads.2.N0.S.las\n")
    eq_(len(result), 2)
Esempio n. 2
0
def test_get_daligner_job_descriptions():
    result = f.get_daligner_job_descriptions(
            example_HPCdaligner, 'raw_reads')
    assert result
    eq_(result[(1, 1)], "daligner -v -h1 -t16 -H1 -e0.7 -l1 -s1000 raw_reads.1 raw_reads.1\nLAsort -v raw_reads.1.raw_reads.1.C0 raw_reads.1.raw_reads.1.N0 && LAmerge -v L1.1.1 raw_reads.1.raw_reads.1.C0.S raw_reads.1.raw_reads.1.N0.S && rm raw_reads.1.raw_reads.1.C0.S.las raw_reads.1.raw_reads.1.N0.S.las\n")
    eq_(result[(2, 1, 2)], "daligner -v -h1 -t16 -H1 -e0.7 -l1 -s1000 raw_reads.2 raw_reads.1 raw_reads.2\nLAsort -v raw_reads.1.raw_reads.2.C0 raw_reads.1.raw_reads.2.N0 && LAmerge -v L1.1.2 raw_reads.1.raw_reads.2.C0.S raw_reads.1.raw_reads.2.N0.S && rm raw_reads.1.raw_reads.2.C0.S.las raw_reads.1.raw_reads.2.N0.S.las\nLAsort -v raw_reads.2.raw_reads.1.C0 raw_reads.2.raw_reads.1.N0 && LAmerge -v L1.2.1 raw_reads.2.raw_reads.1.C0.S raw_reads.2.raw_reads.1.N0.S && rm raw_reads.2.raw_reads.1.C0.S.las raw_reads.2.raw_reads.1.N0.S.las\nLAsort -v raw_reads.2.raw_reads.2.C0 raw_reads.2.raw_reads.2.N0 && LAmerge -v L1.2.2 raw_reads.2.raw_reads.2.C0.S raw_reads.2.raw_reads.2.N0.S && rm raw_reads.2.raw_reads.2.C0.S.las raw_reads.2.raw_reads.2.N0.S.las\n")
    eq_(len(result), 2)
Esempio n. 3
0
def test_get_daligner_job_descriptions_small():
    # when there is only 1 block, a special case
    example_HPCdaligner = open(example_HPCdaligner_small_fn)
    result = f.get_daligner_job_descriptions(
            example_HPCdaligner, 'preads')
    assert result
    helpers.equal_multiline(result[('.1', '.1')], "daligner -v -h1 -t50 -H1 -e0.99 -l1 -s1000 preads.1 preads.1\nLAcheck -v preads *.las\nLAsort -v preads.1.preads.1.C0 preads.1.preads.1.N0 preads.1.preads.1.C1 preads.1.preads.1.N1 preads.1.preads.1.C2 preads.1.preads.1.N2 preads.1.preads.1.C3 preads.1.preads.1.N3 && LAmerge -v preads.1 preads.1.preads.1.C0.S preads.1.preads.1.N0.S preads.1.preads.1.C1.S preads.1.preads.1.N1.S preads.1.preads.1.C2.S preads.1.preads.1.N2.S preads.1.preads.1.C3.S preads.1.preads.1.N3.S\nLAcheck -vS preads preads.1\n")
    eq_(len(result), 1)
Esempio n. 4
0
def test_get_daligner_job_descriptions():
    example_HPCdaligner = open(example_HPCdaligner_fn)
    result = f.get_daligner_job_descriptions(
            example_HPCdaligner, 'raw_reads')
    assert result
    helpers.equal_multiline(result[('.1', '.1')], "daligner -v -h1 -t16 -H1 -e0.7 -l1 -s1000 raw_reads.1 raw_reads.1\nLAcheck -v raw_reads *.las\nLAsort -v raw_reads.1.raw_reads.1.C0 raw_reads.1.raw_reads.1.N0 && LAmerge -v L1.1.1 raw_reads.1.raw_reads.1.C0.S raw_reads.1.raw_reads.1.N0.S && rm raw_reads.1.raw_reads.1.C0.S.las raw_reads.1.raw_reads.1.N0.S.las\nLAcheck -vS raw_reads L1.1.1\n")
    helpers.equal_multiline(result[('.2', '.1', '.2')], "daligner -v -h1 -t16 -H1 -e0.7 -l1 -s1000 raw_reads.2 raw_reads.1 raw_reads.2\nLAcheck -v raw_reads *.las\nLAsort -v raw_reads.1.raw_reads.2.C0 raw_reads.1.raw_reads.2.N0 && LAmerge -v L1.1.2 raw_reads.1.raw_reads.2.C0.S raw_reads.1.raw_reads.2.N0.S && rm raw_reads.1.raw_reads.2.C0.S.las raw_reads.1.raw_reads.2.N0.S.las\nLAsort -v raw_reads.2.raw_reads.1.C0 raw_reads.2.raw_reads.1.N0 && LAmerge -v L1.2.1 raw_reads.2.raw_reads.1.C0.S raw_reads.2.raw_reads.1.N0.S && rm raw_reads.2.raw_reads.1.C0.S.las raw_reads.2.raw_reads.1.N0.S.las\nLAsort -v raw_reads.2.raw_reads.2.C0 raw_reads.2.raw_reads.2.N0 && LAmerge -v L1.2.2 raw_reads.2.raw_reads.2.C0.S raw_reads.2.raw_reads.2.N0.S && rm raw_reads.2.raw_reads.2.C0.S.las raw_reads.2.raw_reads.2.N0.S.las\nLAcheck -vS raw_reads L1.1.2\nLAcheck -vS raw_reads L1.2.1\nLAcheck -vS raw_reads L1.2.2\n")
    eq_(len(result), 2)
def test_get_daligner_job_descriptions_small():
    # when there is only 1 block, a special case
    example_HPCdaligner = open(example_HPCdaligner_small_fn)
    result = f.get_daligner_job_descriptions(
        example_HPCdaligner, 'preads', single=True)
    assert result
    helpers.equal_multiline(result[('.1', '.1')], 'daligner -v -h1 -t50 -H1 -e0.99 -l1 -s1000 preads.1 preads.1\nLAcheck -v preads *.las\n')
    eq_(len(result), 1)
Esempio n. 6
0
def test_get_daligner_job_descriptions_small():
    # when there is only 1 block, a special case
    example_HPCdaligner = open(example_HPCdaligner_small_fn)
    result = f.get_daligner_job_descriptions(
            example_HPCdaligner, 'preads', single=True)
    assert result
    helpers.equal_multiline(result[('.1', '.1')], "daligner -v -h1 -t50 -H1 -e0.99 -l1 -s1000 preads.1 preads.1\nLAcheck -v preads *.las\nLAsort -v preads.1.preads.1.C0 preads.1.preads.1.N0 preads.1.preads.1.C1 preads.1.preads.1.N1 preads.1.preads.1.C2 preads.1.preads.1.N2 preads.1.preads.1.C3 preads.1.preads.1.N3 && LAmerge -v preads.1 preads.1.preads.1.C0.S preads.1.preads.1.N0.S preads.1.preads.1.C1.S preads.1.preads.1.N1.S preads.1.preads.1.C2.S preads.1.preads.1.N2.S preads.1.preads.1.C3.S preads.1.preads.1.N3.S\nLAcheck -vS preads preads.1\n")
    eq_(len(result), 1)
Esempio n. 7
0
def test_get_daligner_job_descriptions():
    example_HPCdaligner = open(example_HPCdaligner_fn)
    result = f.get_daligner_job_descriptions(
            example_HPCdaligner, 'raw_reads')
    assert result
    helpers.equal_multiline(result[('.1', '.1')], "daligner -v -h1 -t16 -H1 -e0.7 -l1 -s1000 raw_reads.1 raw_reads.1\nLAcheck -v raw_reads *.las\nLAsort -v raw_reads.1.raw_reads.1.C0 raw_reads.1.raw_reads.1.N0 && LAmerge -v L1.1.1 raw_reads.1.raw_reads.1.C0.S raw_reads.1.raw_reads.1.N0.S && rm raw_reads.1.raw_reads.1.C0.S.las raw_reads.1.raw_reads.1.N0.S.las\nLAcheck -vS raw_reads L1.1.1\n")
    helpers.equal_multiline(result[('.2', '.1', '.2')], "daligner -v -h1 -t16 -H1 -e0.7 -l1 -s1000 raw_reads.2 raw_reads.1 raw_reads.2\nLAcheck -v raw_reads *.las\nLAsort -v raw_reads.1.raw_reads.2.C0 raw_reads.1.raw_reads.2.N0 && LAmerge -v L1.1.2 raw_reads.1.raw_reads.2.C0.S raw_reads.1.raw_reads.2.N0.S && rm raw_reads.1.raw_reads.2.C0.S.las raw_reads.1.raw_reads.2.N0.S.las\nLAsort -v raw_reads.2.raw_reads.1.C0 raw_reads.2.raw_reads.1.N0 && LAmerge -v L1.2.1 raw_reads.2.raw_reads.1.C0.S raw_reads.2.raw_reads.1.N0.S && rm raw_reads.2.raw_reads.1.C0.S.las raw_reads.2.raw_reads.1.N0.S.las\nLAsort -v raw_reads.2.raw_reads.2.C0 raw_reads.2.raw_reads.2.N0 && LAmerge -v L1.2.2 raw_reads.2.raw_reads.2.C0.S raw_reads.2.raw_reads.2.N0.S && rm raw_reads.2.raw_reads.2.C0.S.las raw_reads.2.raw_reads.2.N0.S.las\nLAcheck -vS raw_reads L1.1.2\nLAcheck -vS raw_reads L1.2.1\nLAcheck -vS raw_reads L1.2.2\n")
    eq_(len(result), 2)
def test_get_daligner_job_descriptions():
    example_HPCdaligner = open(example_HPCdaligner_fn)
    result = f.get_daligner_job_descriptions(
        example_HPCdaligner, 'raw_reads')
    assert result
    import sys, pprint
    sys.stderr.write(pprint.pformat(result))
    helpers.equal_multiline(result[('.1', '.1')], 'daligner -v -w1 -h1 -t50 -H2000 -e0.99 -l1 -s1000 -P=. -mdust raw_reads.1 raw_reads.1\nLAcheck -v raw_reads *.las\n')
    helpers.equal_multiline(result[('.2', '.1', '.2')], 'daligner -v -w1 -h1 -t50 -H2000 -e0.99 -l1 -s1000 -P=. -mdust raw_reads.2 raw_reads.1 raw_reads.2\nLAcheck -v raw_reads *.las\n')
    eq_(len(result), 2)
Esempio n. 9
0
def test_get_daligner_job_descriptions_small():
    # when there is only 1 block, a special case
    example_HPCdaligner = open(example_HPCdaligner_small_fn)
    result = f.get_daligner_job_descriptions(example_HPCdaligner,
                                             'preads',
                                             single=True)
    assert result
    helpers.equal_multiline(
        result[('.1', '.1')],
        'daligner -v -h1 -t50 -H1 -e0.99 -l1 -s1000 preads.1 preads.1\nLAcheck -v preads *.las\n'
    )
    eq_(len(result), 1)
Esempio n. 10
0
def test_get_daligner_job_descriptions():
    example_HPCdaligner = open(example_HPCdaligner_fn)
    result = f.get_daligner_job_descriptions(example_HPCdaligner, 'raw_reads')
    assert result
    import sys, pprint
    sys.stderr.write(pprint.pformat(result))
    helpers.equal_multiline(
        result[('.1', '.1')],
        'daligner -v -w1 -h1 -t50 -H2000 -e0.99 -l1 -s1000 -P=. -mdust raw_reads.1 raw_reads.1\nLAcheck -v raw_reads *.las\n'
    )
    helpers.equal_multiline(
        result[('.2', '.1', '.2')],
        'daligner -v -w1 -h1 -t50 -H2000 -e0.99 -l1 -s1000 -P=. -mdust raw_reads.2 raw_reads.1 raw_reads.2\nLAcheck -v raw_reads *.las\n'
    )
    eq_(len(result), 2)
Esempio n. 11
0
 def chunk():
     # cmds is actually a list of small bash scripts, including linefeeds.
     cmds = get_daligner_job_descriptions(open(run_jobs_fn), db_prefix).values()
     if max_total_nchunks < len(cmds):
         log.debug("max_total_nchunks < # daligner cmds: %d < %d" %(
             max_total_nchunks, len(cmds)))
         cmds = joined_strs(cmds, max_total_nchunks)
     symlink_dazzdb(os.path.dirname(run_jobs_fn), db_prefix)
     for i, script in enumerate(cmds):
         chunk_id = '_'.join([chunk_base_name, str(i)])
         chunk_name = '.'.join([chunk_id, chunk_ext])
         chunk_path = os.path.join(dir_name, chunk_name)
         script = xform_script(script)
         open(chunk_path, 'w').write(script)
         d = {}
         d[chunk_keys[1]] = os.path.abspath(chunk_path)
         d[chunk_keys[0]] = config_json_fn
         c = PipelineChunk(chunk_id, **d)
         yield c
Esempio n. 12
0
 def chunk():
     # cmds is actually a list of small bash scripts, including linefeeds.
     cmds = get_daligner_job_descriptions(open(run_jobs_fn), db_prefix).values()
     if max_total_nchunks < len(cmds):
         log.debug("max_total_nchunks < # daligner cmds: %d < %d" %(
             max_total_nchunks, len(cmds)))
         cmds = joined_strs(cmds, max_total_nchunks)
     symlink_dazzdb(os.path.dirname(run_jobs_fn), db_prefix)
     for i, script in enumerate(cmds):
         chunk_id = '_'.join([chunk_base_name, str(i)])
         chunk_name = '.'.join([chunk_id, chunk_ext])
         chunk_path = os.path.join(dir_name, chunk_name)
         script = xform_script(script)
         open(chunk_path, 'w').write(script)
         d = {}
         d[chunk_keys[1]] = os.path.abspath(chunk_path)
         d[chunk_keys[0]] = config_json_fn
         c = PipelineChunk(chunk_id, **d)
         yield c
Esempio n. 13
0
def test_get_daligner_job_descriptions_se161():
    example_HPCdaligner = open(example_se161)
    result = f.get_daligner_job_descriptions(example_HPCdaligner,
                                             'raw_reads',
                                             single=False)
    assert result
Esempio n. 14
0
def test_get_daligner_job_descriptions_with_bad_arg():
    with pytest.raises(AssertionError) as excinfo:
        f.get_daligner_job_descriptions('fake_filename.txt', 'raw_reads')
    assert "['f', 'a', 'k', 'e'" in str(excinfo.value)
Esempio n. 15
0
def test_get_daligner_job_descriptions_se161():
    example_HPCdaligner = open(example_se161)
    result = f.get_daligner_job_descriptions(
        example_HPCdaligner, 'raw_reads', single=False)
    assert result
Esempio n. 16
0
def test_get_daligner_job_descriptions_with_bad_arg():
    with pytest.raises(AssertionError) as excinfo:
        f.get_daligner_job_descriptions(
            'fake_filename.txt', 'raw_reads')
    assert r"f\na\nk\ne" in str(excinfo.value)