34 jobinfo = subprocess.Popen([
'sam_metadata_dumper', inputfile],
35 stdout=subprocess.PIPE,
36 stderr=subprocess.PIPE)
37 jobout, joberr = jobinfo.communicate()
42 raise RuntimeError(
'sam_metadata_dumper failed with status %d' % rc)
48 n = jobout.find(
'"runs"')
50 m = jobout.rfind(
'\n', 0, n)
52 json_str = jobout[:m+1]
53 k = jobout.find(
'\n', n)
55 json_str += jobout[k+1:]
61 js = json.loads(json_str)
66 if 'data_stream' in md:
67 result = md[
'data_stream']
69 raise RuntimeError(
'Sam metadata does not contain stream.')