示例#1
0
def test_load_one_file_04(insert_sequences_batch, info):
    """Load single end sequences from a file into the atram database."""
    cxn, args = set_up()
    db.BATCH_SIZE = 5

    file_1 = join('tests', 'data', 'load_seq1.txt')
    core_preprocessor.load_one_file(
        args, cxn, file_1, 'single_ends', '')

    msg = 'Loading "{}" into sqlite database'.format(file_1)
    info.assert_called_once_with(msg)

    calls = [
        call(cxn, [
            ('seq1', '', 'AAAAAAAAAA'),
            ('seq2', '', 'AAAAAAAAAAGGGGGGGGGG'),
            ('seq3', '', 'AAAAAAAAAA'),
            ('seq4', '', 'AAAAAAAAAA'),
            ('seq5/3', '', 'AAAAAAAAAAGGGGGGGGGG')]),
        call(cxn, [
            ('seq1', '', 'AAAAAAAAAA'),
            ('seq2', '', 'AAAAAAAAAAGGGGGGGGGG'),
            ('seq3', '', 'AAAAAAAAAA'),
            ('seq4', '', 'AAAAAAAAAAGGGGGGGGGG')])]
    insert_sequences_batch.assert_has_calls(calls)
示例#2
0
def test_load_one_file_05(insert_sequences_batch, info):
    """Load single end sequences from a file into the atram database."""
    cxn, args = set_up()
    db.BATCH_SIZE = 5

    file_1 = join('tests', 'data', 'load_seq2.txt')
    core_preprocessor.load_one_file(args, cxn, file_1, 'mixed_ends')

    msg = 'Loading "{}" into sqlite database'.format(file_1)
    info.assert_called_once_with(msg)

    calls = [
        call(cxn, [
            ('seq6', '1', 'TTTTTTTTTT'),
            ('seq7', '1', 'TTTTTTTTTTCCCCCCCCCC'),
            ('seq8/a', '1', 'TTTTTTTTTT'),
            ('seq8', '2', 'TTTTTTTTTTCCCCCCCCCC')])]
    insert_sequences_batch.assert_has_calls(calls)
示例#3
0
def test_load_one_file_05(insert_sequences_batch, info):
    """Load single end sequences from a file into the atram database."""
    cxn, args = set_up()
    db.BATCH_SIZE = 5

    file_1 = join('tests', 'data', 'load_seq2.txt')
    core_preprocessor.load_one_file(args, cxn, file_1, 'mixed_ends')

    msg = 'Loading "{}" into sqlite database'.format(file_1)
    info.assert_called_once_with(msg)

    calls = [
        call(cxn, [('seq6', '1', 'TTTTTTTTTT'),
                   ('seq7', '1', 'TTTTTTTTTTCCCCCCCCCC'),
                   ('seq8/a', '1', 'TTTTTTTTTT'),
                   ('seq8', '2', 'TTTTTTTTTTCCCCCCCCCC')])
    ]
    insert_sequences_batch.assert_has_calls(calls)
示例#4
0
def test_load_one_file_02(insert_sequences_batch, info):
    """Load end 1 sequences from a file into the atram database."""
    cxn, args = set_up()
    db.BATCH_SIZE = 5

    file_1 = join('tests', 'data', 'load_seq1.txt')
    core_preprocessor.load_one_file(args, cxn, file_1, 'end_1', '1')

    msg = 'Loading "{}" into sqlite database'.format(file_1)
    info.assert_called_once_with(msg)

    calls = [
        call(cxn, [('seq1', '1', 'AAAAAAAAAA'),
                   ('seq2', '1', 'AAAAAAAAAAGGGGGGGGGG'),
                   ('seq3', '1', 'AAAAAAAAAA'), ('seq4', '1', 'AAAAAAAAAA'),
                   ('seq5/3', '1', 'AAAAAAAAAAGGGGGGGGGG')]),
        call(cxn, [('seq1', '1', 'AAAAAAAAAA'),
                   ('seq2', '1', 'AAAAAAAAAAGGGGGGGGGG'),
                   ('seq3', '1', 'AAAAAAAAAA'),
                   ('seq4', '1', 'AAAAAAAAAAGGGGGGGGGG')])
    ]
    insert_sequences_batch.assert_has_calls(calls)