File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -370,7 +370,9 @@ def work_this_src_file_1(source_vcf, wrkf1): #
370
370
if (int ((Alt_reads / Sample_coverage )* 100 ) >= int (VPOT_conf .Hete_Balance )) : # Pas QC for coverage and balance
371
371
VPOT_conf .QC_PASS = True # Yes
372
372
# print ("QC_PASS",VPOT_conf.QC_PASS) #
373
- GT_values = re .split ('/' ,SAMPLE1 [VPOT_conf .sample_coverage_loc [VPOT_conf .GT_val ]]) # get the genotype fields
373
+ # allow for normal 0/1 vs phased 0|1 genotypes
374
+ GT_values = re .split ('[|/]' ,SAMPLE1 [VPOT_conf .sample_coverage_loc [VPOT_conf .GT_val ]]) # get the genotype fields
375
+ #GT_values=re.split('/',SAMPLE1[VPOT_conf.sample_coverage_loc[VPOT_conf.GT_val]]) # get the genotype fields
374
376
# print GT_values #
375
377
for j in range (len (GT_values )) : #
376
378
# print (GT_values[j]) #
@@ -418,7 +420,9 @@ def check_this_variant(src_line, wrkf1): #
418
420
#
419
421
src_line1 = re .split ('\t |\n |\r ' ,src_line ) # split into file location and sample id
420
422
SAMPLE1 = re .split (':' ,src_line1 [VPOT_conf .sample_loc ]) # split the sample's FORMAT fields
421
- GENOTYPE1 = re .split ('/' ,SAMPLE1 [VPOT_conf .sample_coverage_loc [VPOT_conf .GT_val ]]) # split the sample's GENOTYPE fields
423
+ # allow for normal 0/1 vs phased 0|1 genotypes
424
+ GENOTYPE1 = re .split ('[|/]' ,SAMPLE1 [VPOT_conf .sample_coverage_loc [VPOT_conf .GT_val ]]) # split the sample's GENOTYPE fields
425
+ #GENOTYPE1=re.split('/',SAMPLE1[VPOT_conf.sample_coverage_loc[VPOT_conf.GT_val]]) # split the sample's GENOTYPE fields
422
426
# print (src_line1) #
423
427
# print (SAMPLE1) #
424
428
# print (GENOTYPE1) #
Original file line number Diff line number Diff line change @@ -275,7 +275,9 @@ def work_this_src_file(file_line): #
275
275
VPOT_conf .QC_PASS = True # Yes
276
276
# print ("QC_PASS",VPOT_conf.QC_PASS) #
277
277
# print ("add") #
278
- GT_values = re .split ('/' ,SAMPLE1 [VPOT_conf .sample_coverage_loc [VPOT_conf .GT_val ]]) # get the genotype fields
278
+ # print ("add") #
279
+ # Allow for phased genotypes like 0|1
280
+ GT_values = re .split ('[|/]' ,SAMPLE1 [VPOT_conf .sample_coverage_loc [VPOT_conf .GT_val ]]) # get the genotype fields
279
281
# print GT_values #
280
282
for j in range (len (GT_values )) : #
281
283
# print GT_values[j] #
@@ -303,7 +305,8 @@ def check_this_variant(src_line, wrkf1): #
303
305
#
304
306
src_line1 = re .split ('\t |\n |\r ' ,src_line ) # split into file location and sample id
305
307
SAMPLE1 = re .split (':' ,src_line1 [VPOT_conf .sample_loc ]) # split the sample's FORMAT fields
306
- GENOTYPE1 = re .split ('/' ,SAMPLE1 [VPOT_conf .sample_coverage_loc [VPOT_conf .GT_val ]]) # split the sample's GENOTYPE fields
308
+ # Allow for phased genotypes - e.g. 0|1
309
+ GENOTYPE1 = re .split ('[|/]' ,SAMPLE1 [VPOT_conf .sample_coverage_loc [VPOT_conf .GT_val ]]) # split the sample's GENOTYPE fields
307
310
header1 = re .split ('\t |\n |\r ' ,VPOT_conf .header_ln ) # split into file location and sample id
308
311
# print "header : ",VPOT_conf.header_ln #
309
312
# print (src_line1) #
@@ -612,4 +615,4 @@ def prioritise_variants_by_VT_types(INFO_details,header1): #
612
615
###
613
616
return val #
614
617
##
615
- #
618
+ #
You can’t perform that action at this time.
0 commit comments