Пример #1
0
def test_combine_hits():
  """this will ensure that all pairs of coordinates are in the correct order (lowest to
  highest for + strand hits; highest to lowest for - strand hits"""
  
  args = parse_args((os.path.join(test_dir, 'test.tblastn'), os.path.join(test_dir, 'test.fa')))
  results = top_query(args)
  for result in results:
    coords =  combine_hits(result)
    print coords
    if coords[0][0] < coords[0][1]:
      for x in range(len(coords)-1):
        assert coords[x][0] > coords[x+1][0]
    else:
      for x in range(len(coords)-1):
        assert coords[x][0] < coords[x+1][0]
Пример #2
0
def test_top_query():  #I can add to this to test the evalue filtering
  args = parse_args((os.path.join(test_dir, 'test.tblastn'), os.path.join(test_dir, 'test.fa')))
  results = top_query(args)
  assert len(results) == 11
  assert len(results[0]) == 12
  assert results[0][0]['pident'] == 61.77