annotate vsnp_statistics.py @ 1:14e29f7d59ca draft

Uploaded
author greg
date Wed, 29 Apr 2020 16:56:10 -0400
parents c21d338dbdc4
children 321a8259e3f9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
1 #!/usr/bin/env python
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
2
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
3 import argparse
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
4 import gzip
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
5 import numpy
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
6 import os
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
7 import pandas
1
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
8 import shutil
0
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
9
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
10 INPUT_IDXSTATS_DIR = 'input_idxstats'
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
11 INPUT_METRICS_DIR = 'input_metrics'
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
12 INPUT_READS_DIR = 'input_reads'
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
13 QUALITYKEY = {'!':'0', '"':'1', '#':'2', '$':'3', '%':'4', '&':'5', "'":'6', '(':'7', ')':'8', '*':'9', '+':'10', ',':'11', '-':'12', '.':'13', '/':'14', '0':'15', '1':'16', '2':'17', '3':'18', '4':'19', '5':'20', '6':'21', '7':'22', '8':'23', '9':'24', ':':'25', ';':'26', '<':'27', '=':'28', '>':'29', '?':'30', '@':'31', 'A':'32', 'B':'33', 'C':'34', 'D':'35', 'E':'36', 'F':'37', 'G':'38', 'H':'39', 'I':'40', 'J':'41', 'K':'42', 'L':'43', 'M':'44', 'N':'45', 'O':'46', 'P':'47', 'Q':'48', 'R':'49', 'S':'50', 'T':'51', 'U':'52', 'V':'53', 'W':'54', 'X':'55', 'Y':'56', 'Z':'57', '_':'1', ']':'1', '[':'1', '\\':'1', '\n':'1', '`':'1', 'a':'1', 'b':'1', 'c':'1', 'd':'1', 'e':'1', 'f':'1', 'g':'1', 'h':'1', 'i':'1', 'j':'1', 'k':'1', 'l':'1', 'm':'1', 'n':'1', 'o':'1', 'p':'1', 'q':'1', 'r':'1', 's':'1', 't':'1', 'u':'1', 'v':'1', 'w':'1', 'x':'1', 'y':'1', 'z':'1', ' ':'1'}
1
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
14
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
15
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
16 def fastq_to_df(fastq_file, gzipped):
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
17 if gzipped.lower() == "true":
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
18 return pandas.read_csv(gzip.open(fastq_file, "r"), header=None, sep="^")
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
19 else:
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
20 return pandas.read_csv(open(fastq_file, "r"), header=None, sep="^")
0
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
21
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
22
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
23 def get_base_file_name(file_path):
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
24 base_file_name = os.path.basename(file_path)
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
25 if base_file_name.find(".") > 0:
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
26 # Eliminate the extension.
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
27 return os.path.splitext(base_file_name)[0]
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
28 elif base_file_name.find("_") > 0:
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
29 # The dot extension was likely changed to
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
30 # the " character.
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
31 items = base_file_name.split("_")
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
32 return "_".join(items[0:-1])
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
33 else:
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
34 return base_file_name
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
35
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
36
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
37 def nice_size(size):
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
38 # Returns a readably formatted string with the size
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
39 words = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB']
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
40 prefix = ''
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
41 try:
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
42 size = float(size)
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
43 if size < 0:
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
44 size = abs(size)
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
45 prefix = '-'
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
46 except Exception:
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
47 return '??? bytes'
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
48 for ind, word in enumerate(words):
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
49 step = 1024 ** (ind + 1)
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
50 if step > size:
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
51 size = size / float(1024 ** ind)
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
52 if word == 'bytes': # No decimals for bytes
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
53 return "%s%d bytes" % (prefix, size)
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
54 return "%s%.1f %s" % (prefix, size, word)
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
55 return '??? bytes'
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
56
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
57
1
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
58 def output_statistics(reads_files, idxstats_files, metrics_files, output_file, gzipped, dbkey):
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
59 # Produce an Excel spreadsheet that
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
60 # contains a row for each sample.
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
61 columns = ['Reference', 'File Size', 'Mean Read Length', 'Mean Read Quality', 'Reads Passing Q30',
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
62 'Total Reads', 'All Mapped Reads', 'Unmapped Reads', 'Unmapped Reads Percentage of Total',
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
63 'Reference with Coverage', 'Average Depth of Coverage', 'Good SNP Count']
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
64 data_frames = []
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
65 for i, fastq_file in enumerate(reads_files):
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
66 idxstats_file = idxstats_files[i]
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
67 metrics_file = metrics_files[i]
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
68 file_name_base = os.path.basename(fastq_file)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
69 # Read fastq_file into a data frame.
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
70 fastq_df = fastq_to_df(fastq_file, gzipped)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
71 total_reads = int(len(fastq_df.index) / 4)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
72 current_sample_df = pandas.DataFrame(index=[file_name_base], columns=columns)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
73 # Reference
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
74 current_sample_df.at[file_name_base, 'Reference'] = dbkey
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
75 # File Size
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
76 current_sample_df.at[file_name_base, 'File Size'] = nice_size(os.path.getsize(fastq_file))
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
77 # Mean Read Length
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
78 sampling_size = 10000
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
79 if sampling_size > total_reads:
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
80 sampling_size = total_reads
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
81 fastq_df = fastq_df.iloc[3::4].sample(sampling_size)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
82 dict_mean = {}
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
83 list_length = []
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
84 for index, row in fastq_df.iterrows():
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
85 base_qualities = []
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
86 for base in list(row.array[0]):
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
87 base_qualities.append(int(QUALITYKEY[base]))
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
88 dict_mean[index] = numpy.mean(base_qualities)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
89 list_length.append(len(row.array[0]))
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
90 current_sample_df.at[file_name_base, 'Mean Read Length'] = "%.1f" % numpy.mean(list_length)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
91 # Mean Read Quality
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
92 df_mean = pandas.DataFrame.from_dict(dict_mean, orient='index', columns=['ave'])
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
93 current_sample_df.at[file_name_base, 'Mean Read Quality'] = "%.1f" % df_mean['ave'].mean()
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
94 # Reads Passing Q30
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
95 reads_gt_q30 = len(df_mean[df_mean['ave'] >= 30])
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
96 reads_passing_q30 = "{:10.2f}".format(reads_gt_q30 / sampling_size)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
97 current_sample_df.at[file_name_base, 'Reads Passing Q30'] = reads_passing_q30
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
98 # Total Reads
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
99 current_sample_df.at[file_name_base, 'Total Reads'] = total_reads
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
100 # All Mapped Reads
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
101 all_mapped_reads, unmapped_reads = process_idxstats_file(idxstats_file)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
102 current_sample_df.at[file_name_base, 'All Mapped Reads'] = all_mapped_reads
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
103 # Unmapped Reads
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
104 current_sample_df.at[file_name_base, 'Unmapped Reads'] = unmapped_reads
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
105 # Unmapped Reads Percentage of Total
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
106 if unmapped_reads > 0:
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
107 unmapped_reads_percentage = "{:10.2f}".format(unmapped_reads / total_reads)
0
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
108 else:
1
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
109 unmapped_reads_percentage = 0
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
110 current_sample_df.at[file_name_base, 'Unmapped Reads Percentage of Total'] = unmapped_reads_percentage
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
111 # Reference with Coverage
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
112 ref_with_coverage, avg_depth_of_coverage, good_snp_count = process_metrics_file(metrics_file)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
113 current_sample_df.at[file_name_base, 'Reference with Coverage'] = ref_with_coverage
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
114 # Average Depth of Coverage
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
115 current_sample_df.at[file_name_base, 'Average Depth of Coverage'] = avg_depth_of_coverage
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
116 # Good SNP Count
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
117 current_sample_df.at[file_name_base, 'Good SNP Count'] = good_snp_count
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
118 data_frames.append(current_sample_df)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
119 excel_df = pandas.concat(data_frames)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
120 excel_file_name = "output.xlsx"
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
121 writer = pandas.ExcelWriter(excel_file_name, engine='xlsxwriter')
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
122 excel_df.to_excel(writer, sheet_name='Sheet1')
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
123 writer.save()
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
124 shutil.move(excel_file_name, output_file)
0
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
125
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
126
1
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
127 def process_idxstats_file(idxstats_file):
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
128 all_mapped_reads = 0
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
129 unmapped_reads = 0
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
130 with open(idxstats_file, "r") as fh:
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
131 for i, line in enumerate(fh):
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
132 items = line.split("\t")
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
133 if i == 0:
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
134 # NC_002945.4 4349904 213570 4047
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
135 all_mapped_reads = int(items[2])
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
136 elif i == 1:
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
137 # * 0 0 82774
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
138 unmapped_reads = int(items[3])
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
139 return all_mapped_reads, unmapped_reads
0
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
140
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
141
1
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
142 def process_metrics_file(metrics_file):
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
143 ref_with_coverage = '0%'
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
144 avg_depth_of_coverage = 0
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
145 good_snp_count = 0
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
146 with open(metrics_file, "r") as ifh:
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
147 for i, line in enumerate(ifh):
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
148 if i == 0:
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
149 # Skip comments.
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
150 continue
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
151 items = line.split("\t")
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
152 if i == 1:
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
153 # MarkDuplicates 10.338671 98.74%
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
154 ref_with_coverage = items[3]
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
155 avg_depth_of_coverage = items[2]
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
156 elif i == 2:
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
157 # VCFfilter 611
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
158 good_snp_count = items[1]
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
159 return ref_with_coverage, avg_depth_of_coverage, good_snp_count
0
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
160
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
161
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
162 if __name__ == '__main__':
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
163 parser = argparse.ArgumentParser()
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
164
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
165 parser.add_argument('--read1', action='store', dest='read1', required=False, default=None, help='Required: single read')
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
166 parser.add_argument('--read2', action='store', dest='read2', required=False, default=None, help='Optional: paired read')
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
167 parser.add_argument('--dbkey', action='store', dest='dbkey', help='Reference dbkey')
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
168 parser.add_argument('--gzipped', action='store', dest='gzipped', help='Input files are gzipped')
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
169 parser.add_argument('--samtools_idxstats', action='store', dest='samtools_idxstats', required=False, default=None, help='Output of samtools_idxstats')
1
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
170 parser.add_argument('--output', action='store', dest='output', help='Output Excel statistics file')
0
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
171 parser.add_argument('--vsnp_azc', action='store', dest='vsnp_azc', required=False, default=None, help='Output of vsnp_add_zero_coverage')
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
172
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
173 args = parser.parse_args()
1
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
174 print("args:\n%s\n" % str(args))
0
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
175
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
176 reads_files = []
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
177 idxstats_files = []
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
178 metrics_files = []
1
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
179 # Accumulate inputs.
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
180 if args.read1 is not None:
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
181 # The inputs are not dataset collections, so
0
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
182 # read1, read2 (possibly) and vsnp_azc will also
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
183 # not be None.
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
184 reads_files.append(args.read1)
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
185 idxstats_files.append(args.samtools_idxstats)
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
186 metrics_files.append(args.vsnp_azc)
1
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
187 if args.read2 is not None:
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
188 reads_files.append(args.read2)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
189 idxstats_files.append(args.samtools_idxstats)
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
190 metrics_files.append(args.vsnp_azc)
0
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
191 else:
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
192 for file_name in sorted(os.listdir(INPUT_READS_DIR)):
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
193 file_path = os.path.abspath(os.path.join(INPUT_READS_DIR, file_name))
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
194 reads_files.append(file_path)
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
195 base_file_name = get_base_file_name(file_path)
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
196 for file_name in sorted(os.listdir(INPUT_IDXSTATS_DIR)):
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
197 file_path = os.path.abspath(os.path.join(INPUT_IDXSTATS_DIR, file_name))
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
198 idxstats_files.append(file_path)
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
199 for file_name in sorted(os.listdir(INPUT_METRICS_DIR)):
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
200 file_path = os.path.abspath(os.path.join(INPUT_METRICS_DIR, file_name))
c21d338dbdc4 Uploaded
greg
parents:
diff changeset
201 metrics_files.append(file_path)
1
14e29f7d59ca Uploaded
greg
parents: 0
diff changeset
202 output_statistics(reads_files, idxstats_files, metrics_files, args.output, args.gzipped, args.dbkey)