Exemplo n.º 1
0
 def test_bad_file_name(self):
     """
     Raise error if bad filename given as input.
     """
     message = r"File .* not found."
     with self.assertRaisesRegex(ValueError, message):
         merge_bed('outfile_name', ['/bad/path/to/unexisting/file'])
Exemplo n.º 2
0
 def test_no_inputs(self):
     """
     Raise if no files are given.
     """
     message = "At least one element expected in files list, but none found."
     with self.assertRaisesRegex(ValueError, message):
         merge_bed('outfile_name', [])
Exemplo n.º 3
0
def merge_bed_wrapper(data):
    """
    TODO
    """
    files = []
    for file_ in data:
        files.append(make_file_from_list(file_))
    out_file = get_temp_file_name()
    merge_bed(out_file, files)
    return make_list_from_file(out_file, fields_separator='\t')
Exemplo n.º 4
0
def merge_bed_wrapper(data):
    """
    TODO
    """
    files = []
    for file_ in data:
        files.append(make_file_from_list(file_))
    out_file = tempfile.NamedTemporaryFile(delete=False).name
    return make_list_from_file(merge_bed(out_file, files),
                               fields_separator='\t')