diff --git a/merge_bed.py b/merge_bed.py index fc3710c..f4e80c2 100755 --- a/merge_bed.py +++ b/merge_bed.py @@ -52,7 +52,7 @@ def main(): if args['prefix']==None: inputPrefix = "." else: inputPrefix = args['prefix'] stemList = pm.findBedStems(inputPrefix) - if args['no-validate']==True: validate = False + if args['no_validate']==True: validate = False # argparse changes - to _ else: validate = True pm.merge(stemList, args['out'], args['bim'], validate, args['verbose']) diff --git a/plink.py b/plink.py index 25cb419..08fd3c7 100644 --- a/plink.py +++ b/plink.py @@ -817,7 +817,7 @@ def __init__(self): def plinkAvailable(self): """Check that Plink executable is available on PATH""" - status = os.system('which plink') + status = os.system('which plink > /dev/null') if (status!=0): return False else: return True diff --git a/test.py b/test.py index 60e6305..833a313 100644 --- a/test.py +++ b/test.py @@ -29,6 +29,7 @@ class TestPlink(unittest.TestCase): def setUp(self): self.dataDir = '/nfs/gapi/data/genotype/plinktools_test' self.outDir = os.path.abspath(mkdtemp(dir='.')) + print "Output: "+self.outDir self.checksum = ChecksumFinder() self.validator = PlinkValidator() @@ -43,6 +44,13 @@ def test_equivalence(self): match = pet.compareBinary(stem1, stem3) self.assertFalse(match) + def test_executables(self): + """Check that executable scripts compile without crashing""" + scripts = ['compare.py', 'het_by_maf.py', 'merge_bed.py'] + for script in scripts: + status = os.system(script+' --help > /dev/null') + self.assertEqual(status, 0) + def test_maf_het(self): """Test het calculation on high/low maf""" stem = os.path.join(self.dataDir, 'samples_part_100_small')