Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work Item 2: Refactor from PyVCF to PyVCF3 #25

Open
crashfrog opened this issue Apr 24, 2023 · 0 comments
Open

Work Item 2: Refactor from PyVCF to PyVCF3 #25

crashfrog opened this issue Apr 24, 2023 · 0 comments
Assignees

Comments

@crashfrog
Copy link
Member

PyVCF is end-of-life and doesn't support Python 3; PyVCF3 is a fork that supports Python 3. Figure out why these tests don't pass:

======================================================================
ERROR: test_1_filter_regions (test.test_cfsan_snp_pipeline.SnpPipelineLambdaVirusTest)
Run filter_regions and verify var.flt_preserved.vcf and var.flt_removed.vcf contains expected contents for each sample.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 150, in setUp
    self.compare_file('metrics.tsv')
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 81, in compare_file
    match = filecmp.cmp(correct_result_file, result_file, shallow=False)
  File "/home/chet/.pyenv/versions/3.10.4/lib/python3.10/filecmp.py", line 54, in cmp
    s2 = _sig(os.stat(f2))
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpksh0rotb/testLambdaVirus/metrics.tsv'

======================================================================
ERROR: test_2_merge_sites (test.test_cfsan_snp_pipeline.SnpPipelineLambdaVirusTest)
Run merge_sites and verify snplist.txt contains expected contents.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 171, in test_2_merge_sites
    self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, 'snplist.txt')
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 96, in run_function_test
    funct(args)
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/cfsan_snp_pipeline.py", line 585, in run_command_from_args
    args.func(args)  # this executes the function previously associated with the subparser with set_defaults
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/merge_sites.py", line 83, in merge_sites
    utils.global_error("Error: all %d VCF files were missing or empty." % bad_file_count)
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/utils.py", line 572, in global_error
    sys.exit(100)
SystemExit: 100

======================================================================
ERROR: test_3_call_consensus (test.test_cfsan_snp_pipeline.SnpPipelineLambdaVirusTest)
Run call_consensus and verify consensus.fasta and consensus.vcf contain expected contents for each sample.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 189, in test_3_call_consensus
    self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, os.path.join(dir, 'consensus.fasta'))
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 96, in run_function_test
    funct(args)
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/cfsan_snp_pipeline.py", line 585, in run_command_from_args
    args.func(args)  # this executes the function previously associated with the subparser with set_defaults
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/call_consensus.py", line 109, in call_consensus
    utils.global_error("Error: cannot call consensus without the snplist file.")
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/utils.py", line 572, in global_error
    sys.exit(100)
SystemExit: 100

======================================================================
ERROR: test_4_create_snp_matrix (test.test_cfsan_snp_pipeline.SnpPipelineLambdaVirusTest)
Run snp_matrix and verify snpma.fasta contains expected contents.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 199, in test_4_create_snp_matrix
    self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, 'snpma.fasta')
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 96, in run_function_test
    funct(args)
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/cfsan_snp_pipeline.py", line 585, in run_command_from_args
    args.func(args)  # this executes the function previously associated with the subparser with set_defaults
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/snp_matrix.py", line 97, in create_snp_matrix
    utils.global_error("Error: all %d consensus fasta files were missing or empty." % bad_file_count)
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/utils.py", line 572, in global_error
    sys.exit(100)
SystemExit: 100

======================================================================
ERROR: test_5_create_snp_reference_seq (test.test_cfsan_snp_pipeline.SnpPipelineLambdaVirusTest)
Run create_snp_reference_seq and verify referenceSNP.fasta contains expected contents.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 208, in test_5_create_snp_reference_seq
    self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, 'referenceSNP.fasta')
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 96, in run_function_test
    funct(args)
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/cfsan_snp_pipeline.py", line 585, in run_command_from_args
    args.func(args)  # this executes the function previously associated with the subparser with set_defaults
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/snp_reference.py", line 64, in create_snp_reference_seq
    utils.global_error("Error: cannot create the snp reference sequence without the snplist file.")
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/utils.py", line 572, in global_error
    sys.exit(100)
SystemExit: 100

======================================================================
ERROR: test_6_calculate_snp_distances (test.test_cfsan_snp_pipeline.SnpPipelineLambdaVirusTest)
Run calculate_snp_distances and verify snp_distance_pairwise.tsv contains expected contents.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 216, in test_6_calculate_snp_distances
    self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, 'snp_distance_pairwise.tsv')
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 96, in run_function_test
    funct(args)
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/cfsan_snp_pipeline.py", line 585, in run_command_from_args
    args.func(args)  # this executes the function previously associated with the subparser with set_defaults
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/distance.py", line 61, in calculate_snp_distances
    utils.global_error("Error: cannot calculate sequence distances without the snp matrix file.")
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/utils.py", line 572, in global_error
    sys.exit(100)
SystemExit: 100

======================================================================
ERROR: test_7_calculate_snp_distances (test.test_cfsan_snp_pipeline.SnpPipelineLambdaVirusTest)
Run calculate_snp_distances and verify snp_distance_matrix.tsv contains expected contents.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 224, in test_7_calculate_snp_distances
    self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, 'snp_distance_matrix.tsv')
  File "/mnt/c/Users/crash/Documents/snp-pipeline/test/test_cfsan_snp_pipeline.py", line 96, in run_function_test
    funct(args)
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/cfsan_snp_pipeline.py", line 585, in run_command_from_args
    args.func(args)  # this executes the function previously associated with the subparser with set_defaults
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/distance.py", line 61, in calculate_snp_distances
    utils.global_error("Error: cannot calculate sequence distances without the snp matrix file.")
  File "/mnt/c/Users/crash/Documents/snp-pipeline/snppipeline/utils.py", line 572, in global_error
    sys.exit(100)
SystemExit: 100

----------------------------------------------------------------------
Ran 31 tests in 20.040s

FAILED (errors=7)
Test failed: <unittest.runner.TextTestResult run=31 errors=7 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=31 errors=7 failures=0>
@crashfrog crashfrog self-assigned this Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant