Esempio n. 1
0
def test_multichange():

    # timing for performance test
    t0 = time.time()

    # sending data to main function
    data_path = "../data/result/test2_result"
    write_path = " ../data/result/test2_result"
    strain_num = 6268

    # calling the main function
    reader(data_path, write_path, strain_num)

    #   call(["bgzip","../data/result/test2_result_result.vcf"])

    # generatig checksums
    crossval_hash = hash("../data/test/test2.vcf.gz")
    result_hash = hash("../data/result/test2_result_result.vcf.gz")

    #validating checksums
    assert crossval_hash == result_hash

    # printing time outputs
    t1 = time.time()
    print " Extra test 1:" + str(t1 - t0)
Esempio n. 2
0
def test2_test():

    # timing for performance test
    t0 = time.time()

    #sending data to main function
    data_path = "../data/test/test2"
    write_path = "../data/result/test2"
    strain_num = 6268

    # calling main fucntion
    reader(data_path, write_path, strain_num)

    # compressing file to .vcf.gz
    call(["bgzip", "../data/result/test2_result.vcf"])

    # generating checksums
    crossval_hash = hash("../data/cross_validation/test2_crossval.vcf.gz")
    result_hash = hash("../data/result/test2_result.vcf.gz")

    # validating checksums
    assert crossval_hash == result_hash

    #printing time results
    t1 = time.time()
    print "Indel test time: " + str(t1 - t0)
Esempio n. 3
0
def test_multiChange():

    # timing the function for performance
    t0 = time.time()

    #sending data to main function
    data_path = "../data/result/test1_result"
    write_path = "../data/result/test1_result"
    strain_num = 6268

    #calling main function
    reader(data_path, write_path, strain_num)

    # compressing the results to .vcf.gz
    call(["bgzip", "../data/result/test1_result_result.vcf"])

    # generating checksum for validation
    test_hash = hash("../data/test/test1.vcf.gz")
    result_hash = hash("../data/result/test1_result_result.vcf.gz")

    # asserting test validation
    assert test_hash == result_hash

    #printing time results
    t1 = time.time()
    print "SNP Multichange time:" + str(t1 - t0)
Esempio n. 4
0
def test1_test():

    # timing the function for performance testing
    t0 = time.time()

    #sending data to main function
    data_path = "../data/test/test1"
    write_path = "../data/result/test1"
    strain_num = 6268

    #calling main function
    reader(data_path, write_path, strain_num)

    #compressing the file
    call(["bgzip", "../data/result/test1_result.vcf"])

    #asserting the results
    crossval_hash = hash("../data/cross_validation/test1_crossval.vcf.gz")
    result_hash = hash("../data/result/test1_result.vcf.gz")

    assert crossval_hash == result_hash

    #printing tie results
    t1 = time.time()
    print "Time for snp change :" + str(t1 - t0)
Esempio n. 5
0
def test3_test():

    #timing for performance test
    t0 = time.time()

    data_path = "../data/test/test3"
    write_path = " ../data/result/test3"
    strain_num = 6268

    print reader(data_path, write_path, strain_num)

    call(["bgzip","test3_result.vcf"])

    crossval_hash = hash("../data/cross_validation/test3_crossval.vcf.gz")
    result_hash = hash("../data/result/test3_result.vcf.gz")

    assert crossval_hash == result_hash
    
    t1 = time.time()
    print "Time for test 3:" + (t1-t0)
Esempio n. 6
0
def test31_test():

    # timing for performance test
    t0 = time.time()

    data_path = "../data/test/test3_result"
    write_path = " ../data/result/test3_cons"
    strain_num = 6269

    print reader(data_path, write_path, strain_num)

    call(["bgzip","test3_cons_result.vcf"])

    crossval_hash = hash("../data/cross_validation/test3_cons_crossval.vcf.gz")
    result_hash = hash("../data/result/test3_result.vcf.gz")

    assert crossval_hash == result_hash
    
    t1 = time.time()
    print "time for test 3.1 :" + (t1-t0)

    # Cleaning files created
    os.remove("../data/result/test3_result.vcf.gz")
    os.remove("../data/result/test3_cons_result.vcf.gz")