Skip to content

Commit

Permalink
Merge pull request #13 from wtsi-npg/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
Iain Bancarz committed Oct 11, 2013
2 parents b5016a2 + 927996a commit 0f04961
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion merge_bed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

Expand Down
2 changes: 1 addition & 1 deletion plink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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')
Expand Down

0 comments on commit 0f04961

Please sign in to comment.