예제 #1
0
def test_fast_versus_slow():
    df = pd.DataFrame({"Sample": "001", "epitope": ["AAAAL"] * 1000, "iedb_epitope": ["AGGGT"] * 1000})
    from timeit import Timer

    slow_timer = Timer(lambda: calculate_similarity_from_df(df, ignore_seqalign=True))
    slow_time = slow_timer.timeit(number=3)
    fast_timer = Timer(lambda: calculate_similarity_from_df(df, ignore_seqalign=False))
    fast_time = fast_timer.timeit(number=3)
    ok_(
        slow_time > fast_time * 5,
        ("The fast similarity calculation (%0.2f) should be at least " "5x faster than the slower version (%0.2f).")
        % (fast_time, slow_time),
    )
예제 #2
0
def test_fast_versus_slow():
    df = pd.DataFrame({'Sample': '001',
                       'epitope': ['AAAAL'] * 1000,
                       'iedb_epitope': ['AGGGT'] * 1000})
    from timeit import Timer
    slow_timer = Timer(lambda: calculate_similarity_from_df(df, ignore_seqalign=True))
    slow_time = slow_timer.timeit(number=3)
    fast_timer = Timer(lambda: calculate_similarity_from_df(df, ignore_seqalign=False))
    fast_time = fast_timer.timeit(number=3)
    ok_(slow_time > fast_time * 5,
        ("The fast similarity calculation (%0.2f) should be at least "
         "5x faster than the slower version (%0.2f).") % (
             fast_time, slow_time))
예제 #3
0
def test_single_comparison_ignore_seqalign():
    df = pd.DataFrame({'Sample': '001',
                       'epitope': ['AAALPGKCGV'],
                       'iedb_epitope': ['EFKEFAAGRR']})
    df_scores = calculate_similarity_from_df(df, ignore_seqalign=True)

    # TODO: This score is currently unverified
    eq_(df_scores.score.max(), 2.38)
예제 #4
0
def test_single_comparison():
    # TODO: Figure out why this doesn't work when trim_seq isn't used
    # Error: https://github.com/ekg/vcflib/blob/master/src/ssw.c#L556
    df = pd.DataFrame({'Sample': '001',
                       'epitope': ['AAALPGKCGV'],
                       'iedb_epitope': ['EFKEFAAGRR']})
    df_scores = calculate_similarity_from_df(df)

    # TODO: This score is currently unverified
    eq_(df_scores.score.max(), 2.38)
예제 #5
0
def test_single_comparison_ignore_seqalign():
    df = pd.DataFrame({
        'Sample': '001',
        'epitope': ['AAALPGKCGV'],
        'iedb_epitope': ['EFKEFAAGRR']
    })
    df_scores = calculate_similarity_from_df(df, ignore_seqalign=True)

    # TODO: This score is currently unverified
    eq_(df_scores.score.max(), 2.38)
예제 #6
0
def test_single_comparison():
    # TODO: Figure out why this doesn't work when trim_seq isn't used
    # Error: https://github.com/ekg/vcflib/blob/master/src/ssw.c#L556
    df = pd.DataFrame({
        'Sample': '001',
        'epitope': ['AAALPGKCGV'],
        'iedb_epitope': ['EFKEFAAGRR']
    })
    df_scores = calculate_similarity_from_df(df)

    # TODO: This score is currently unverified
    eq_(df_scores.score.max(), 2.38)