annotate vsnp_statistics.py @ 3:321a8259e3f9 draft

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