INNER CODE UNIT · Python
percent_aligned
cbg-ethz/V-pipe · workflow/scripts/alignmentBias.py:113
percent_aligned = read.query_alignment_length / read.infer_read_length()
assert percent_aligned <= 1, f"{cigar_arr}"
if hapID in hap_coverage:
hap_coverage[hapID] += percent_aligned
else:
hap_coverage[hapID] = percent_aligned
for k, v in hap_cnt.items():
aux = hap_coverage[k] / v
assert aux <= 1, f"{aux}"
hap_coverage[k] = aux
# Parse FASTQ file to compute the expected number of reads per haplotype
hap_expected = {}
total = 0
for read in SeqIO.parse(args.fastq_file, "fastq"):
total += 1
hapID = read.id.split("-")[0]