def test_download_genome(): genome.main(["genome", "ncbi", "--ref", "F1L3"]) genome_files = [ x for x in listdir(expanduser("~/.genome/F1L3")) if x != ".DS_Store" ] print(genome_files) assert len(genome_files) >= 11
def test_template(): if not os.path.exists(os.path.expanduser("~/.genome/WBcel235/WBcel235.fa.gz")): genome.main(["genome","ncbi","--ref=WBcel235"]) with Capturing() as out: primer.main(["primer", "template", "--size=500", "--ref=WBcel235","--region=I:1-100000", "test_data/test.vcf.gz"]) t = eval(str(out))[1].split("\t")[6][0:20] assert t == "ATTTCCCTCTCCGGGAAATG"
def test_sanger(): if not os.path.exists(os.path.expanduser("~/.genome/WBcel235/WBcel235.fa.gz")): genome.main(["genome","ncbi","--ref=WBcel235"]) with Capturing() as out: primer.main(["primer", "sanger", "--ref=WBcel235","--region=I:542216-543215", "test_data/test.vcf.gz"]) t = eval(str(out))[1].split("\t")[8:10] assert t == ['GAGAAGGACGGGACCCTTTG', 'aGGCCAGAACCTCGTGAAAC']
def test_snip(): if not os.path.exists(os.path.expanduser("~/.genome/WBcel235/WBcel235.fa.gz")): genome.main(["genome","ncbi","--ref=WBcel235"]) with Capturing() as out: primer.main(["primer", "snip", "--size=500", "--ref=WBcel235","--region=I:542216-543215", "test_data/test.vcf.gz"]) t = eval(str(out))[1].split("\t")[7:9] assert t == ['496:496,184', '429,496:429,67,184']
def test_call_DL238(): if not os.path.exists(os.path.expanduser("~/.genome/WBcel235/WBcel235.fa.gz")): genome.main(["genome","ncbi","--ref=WBcel235"]) with Capturing() as out: call.main(["call", "test_data/DL238.ab1", "--ref=WBcel235", "--vcf-sites", "test_data/DL238.vcf.gz"]) out = eval(str(out)) assert len(out) == 5 out = out[1].split("\t") assert out[0] == "X" assert int(out[1]) == 14557228 assert out[2] == out[3] assert out[5] == out[6] assert out[9] == "TN"
def test_call_DL238(): if not os.path.exists( os.path.expanduser("~/.genome/WBcel235/WBcel235.fa.gz")): genome.main(["genome", "ncbi", "--ref=WBcel235"]) with Capturing() as out: call.main([ "call", "test_data/DL238.ab1", "--ref=WBcel235", "--vcf-sites", "test_data/DL238.vcf.gz" ]) out = eval(str(out)) assert len(out) == 5 out = out[1].split("\t") assert out[0] == "X" assert int(out[1]) == 14557228 assert out[2] == out[3] assert out[5] == out[6] assert out[9] == "TN"
def test_search_genome(): results = genome.main(["genome", "--search", "coli"]) search_result = [x for x in results if x[0] == "GCF_900042795.1"][0][3] assert search_result == "F1L3"
def test_set_genome_location(): directory = genome.main(["genome", "location", "."]) assert directory == os.getcwd() # Set genome location back to default genome.main(["genome", "location", "-"])
def test_genome_location(): directory = genome.main(["genome", "location"]) assert os.path.exists(os.path.expanduser("~/.genome"))
def test_download_genome(): genome.main(["genome", "ncbi", "--ref", "F1L3"]) genome_files = [x for x in listdir(expanduser("~/.genome/F1L3")) if x != ".DS_Store"] assert len(genome_files) == 11
def test_set_genome_location(): directory = genome.main(["genome","location", "."]) assert directory == os.getcwd() # Set genome location back to default genome.main(["genome","location", "-"])
def test_genome_location(): directory = genome.main(["genome","location"]) assert os.path.exists(os.path.expanduser("~/.genome"))