示例#1
0
def test_run_VEPannotations_Pathogenic_VEP_SpAI_08():
    ''' '''
    # Variables
    args = {
        'inputfile': 'tests/files/input_VEPannotation_Pathogenic.vcf',
        'outputfile': 'tests/files/main_test.out',
        'SpliceAI': '0.8',
        'CLINVAR': None,
        'CLINVARonly': None,
        'VEP': True,
        'VEPrescue': None,
        'VEPremove': ['missense_mutation'],
        'BEDfile': None,
        'VEPtag': None,
        'CLINVARtag': None,
        'verbose': None,
        'VEPsep': None,
        'SpliceAItag': None
    }
    # Run
    main_whiteList(args)
    # Tests
    assert [row for row in open('tests/files/main_test.out')] == [
        row for row in open(
            'tests/files/input_VEPannotation_Pathogenic_VEP_SpAI_08.out')
    ]
    # Clean
    os.remove('tests/files/main_test.out')
示例#2
0
def test_run_whiteList_VEP_CLINVAR():
    ''' '''
    # Variables
    args = {
        'inputfile': 'tests/files/input_whiteList_VEP.vcf',
        'outputfile': 'tests/files/main_test.out',
        'SpliceAI': None,
        'CLINVAR': True,
        'CLINVARonly': None,
        'VEP': True,
        'VEPrescue': None,
        'VEPremove': None,
        'BEDfile': None,
        'VEPtag': 'VEP',
        'CLINVARtag': None,
        'verbose': None,
        'VEPsep': '~',
        'SpliceAItag': None
    }
    # Run
    main_whiteList(args)
    # Tests
    assert [row for row in open('tests/files/main_test.out')] == [
        row for row in open('tests/files/input_whiteList_VEP_CLINVAR.out')
    ]
    # Clean
    os.remove('tests/files/main_test.out')
示例#3
0
def test_run_VEPannotations_CLINVAR_risk():
    ''' '''
    # Variables
    args = {
        'inputfile': 'tests/files/input_VEPannotation.vcf',
        'outputfile': 'tests/files/main_test.out',
        'SpliceAI': None,
        'CLINVAR': True,
        'CLINVARonly': ['pathogenic', 'risk_factor'],
        'VEP': None,
        'VEPrescue': None,
        'VEPremove': None,
        'BEDfile': None,
        'VEPtag': None,
        'CLINVARtag': None,
        'verbose': None,
        'VEPsep': None,
        'SpliceAItag': None
    }
    # Run
    main_whiteList(args)
    # Tests
    assert [row for row in open('tests/files/main_test.out')] == [
        row for row in open('tests/files/input_VEPannotation_CLINVAR_risk.out')
    ]
    # Clean
    os.remove('tests/files/main_test.out')
示例#4
0
def test_run_whiteList_microannot_VEP_remove_double_BED():
    ''' '''
    # Variables
    args = {
        'inputfile': 'tests/files/input_whiteList_microannot_BED.vcf',
        'outputfile': 'tests/files/main_test.out',
        'SpliceAI': None,
        'CLINVAR': None,
        'CLINVARonly': None,
        'VEP': True,
        'VEPrescue': ['non_coding_transcript_exon_variant'],
        'VEPremove': ['mature_miRNA_variant'],
        'BEDfile': 'tests/files/input_BED_whiteList.bed',
        'VEPtag': 'VEP',
        'CLINVARtag': None,
        'verbose': None,
        'VEPsep': None,
        'SpliceAItag': None
    }
    # Run
    main_whiteList(args)
    # Tests
    assert [row for row in open('tests/files/main_test.out')] == [
        row for row in open(
            'tests/files/input_whiteList_microannot_VEP_remove_double_BED.out')
    ]
    # Clean
    os.remove('tests/files/main_test.out')
示例#5
0
def test_args_CLINVAR_conflict():
    ''' '''
    # Variables
    args = {
        'inputfile': 'tests/files/input_whiteList.vcf',
        'outputfile': 'tests/files/main_test.out',
        'SpliceAI': None,
        'CLINVAR': None,
        'CLINVARonly': ['Pathogenic'],
        'VEP': None,
        'VEPrescue': None,
        'VEPremove': None,
        'BEDfile': None,
        'VEPtag': 'VEP',
        'CLINVARtag': None,
        'verbose': None,
        'VEPsep': None,
        'SpliceAItag': None
    }
    # Run and Tests
    with pytest.raises(SystemExit) as e:
        assert main_whiteList(args)
    assert str(
        e.value
    ) == '\nERROR in parsing arguments: specify the flag "--CLINVAR" to filter by CLINVAR annotations to specify tags or keywords to whitelist\n'
    # Clean
    os.remove('tests/files/main_test.out')
示例#6
0
def test_args_VEP_conflict():
    ''' '''
    # Variables
    args = {
        'inputfile': 'tests/files/input_whiteList.vcf',
        'outputfile': 'tests/files/main_test.out',
        'SpliceAI': None,
        'CLINVAR': None,
        'CLINVARonly': None,
        'VEP': None,
        'VEPrescue':
        ['splice_region_variant', 'non_coding_transcript_variant'],
        'VEPremove': None,
        'BEDfile': None,
        'VEPtag': 'VEP',
        'CLINVARtag': None,
        'verbose': None,
        'VEPsep': None,
        'SpliceAItag': None
    }
    # Run and Tests
    with pytest.raises(SystemExit) as e:
        assert main_whiteList(args)
    assert str(
        e.value
    ) == '\nERROR in parsing arguments: specify the flag "--VEP" to filter by VEP annotations to apply rescue terms or remove additional terms\n'
    # Clean
    os.remove('tests/files/main_test.out')
示例#7
0
def test_run_whiteList_VEP_rescue():
    ''' '''
    # Variables
    args = {
        'inputfile':
        'tests/files/input_whiteList_VEP.vcf',
        'outputfile':
        'tests/files/main_test.out',
        'SpliceAI':
        None,
        'CLINVAR':
        None,
        'CLINVARonly':
        None,
        'VEP':
        True,
        'VEPrescue': [
            'TF_binding_site_variant', 'splice_region_variant',
            'non_coding_transcript_variant'
        ],
        'VEPremove':
        None,
        'BEDfile':
        None,
        'VEPtag':
        'VEP',
        'CLINVARtag':
        None,
        'verbose':
        None,
        'VEPsep':
        '~',
        'SpliceAItag':
        None
    }
    # Run
    main_whiteList(args)
    # Tests
    assert [row for row in open('tests/files/main_test.out')] == [
        row for row in open('tests/files/input_whiteList_VEP_rescue.out')
    ]
    # Clean
    os.remove('tests/files/main_test.out')