|
140 | 140 | variant_lines = csv.reader(csvfile, delimiter=',', quotechar='"') |
141 | 141 |
|
142 | 142 | # skip header if there |
143 | | - has_header = csv.Sniffer().has_header(csvfile.read(100)) |
| 143 | + has_header = csv.Sniffer().has_header(csvfile.read(25)) # 100 |
144 | 144 | csvfile.seek(0) # rewind |
145 | 145 | incsv = csv.reader(csvfile) |
146 | 146 | if has_header: |
|
163 | 163 | variant_line[4], context, consequences, variant_line[7], variant_line[8], variant_line[9], |
164 | 164 | int(variant_line[10]), variant_line[11], variant_line[12], variant_line[13], |
165 | 165 | variant_line[14], variant_line[15])) |
166 | | - elif len(variant_line) < 16: |
| 166 | + elif 16 > len(variant_line) > 4: |
167 | 167 | success_count += 1 |
168 | 168 | # context = variant_line[5].split(",") |
169 | 169 | # consequences = variant_line[6].split(",") |
170 | 170 | snps.append(SNP(l_count, variant_line[0], int(variant_line[1]), variant_line[2], variant_line[3], |
171 | | - ".", ".", ".", ".", ".", ".", ".", ".", ".", ".", ".", ".")) |
| 171 | + variant_line[4], variant_line[5], ".", ".", ".", ".", ".", ".", ".", ".", ".", ".")) |
172 | 172 | else: |
173 | | - print "INVALID DATA (length < 16) in Line {}".format(l_count) |
| 173 | + print "INVALID DATA (16 >= length > 4) in Line {}".format(l_count) |
174 | 174 | print variant_line |
175 | 175 | fail_count += 1 |
176 | 176 | l_count += 1 |
|
230 | 230 | databases = ["-buildver " + buildversion + " -downdb -webfrom annovar refGene " + buildversion, |
231 | 231 | "-buildver " + buildversion + " -downdb cytoBand " + buildversion, |
232 | 232 | "-buildver " + buildversion + " -downdb -webfrom annovar esp6500siv2_all " + buildversion, |
233 | | - "-buildver " + buildversion + " -downdb -webfrom annovar avsnp147 " + buildversion, # snp138 |
| 233 | + "-buildver " + buildversion + " -downdb -webfrom annovar avsnp147 " + buildversion, # avsnp147 |
234 | 234 | "-buildver " + buildversion + " -downdb -webfrom annovar dbnsfp30a " + buildversion |
235 | 235 | ] |
236 | 236 |
|
|
294 | 294 | else: |
295 | 295 | params = "amplicon_variants_tab.csv " + buildversion + " -buildver " + buildversion + " -out myanno -remove -protocol " \ |
296 | 296 | "refGene,cytoBand,esp6500siv2_all,avsnp147,dbnsfp30a " \ |
297 | | - "-operation g,r,f,f,f -nastring . " #snp138 |
| 297 | + "-operation g,r,f,f,f -nastring . " #avsnp147 |
298 | 298 | if args.quiet: |
299 | 299 | FNULL = open(os.devnull, 'w') |
300 | 300 | p = subprocess.Popen([annovar_pl + params], shell=True, stdout=FNULL, stderr=subprocess.STDOUT) |
|
0 commit comments