INNER CODE UNIT · Python
affine_pen
cbg-ethz/V-pipe · workflow/scripts/alignmentBias.py:149
affine_pen = pairwise2.affine_penalty(-1, -0.1, True)
with open(args.haplotype_seqs, "r") as infile:
for record in SeqIO.parse(infile, "fasta"):
alignment = pairwise2.align.globalmc(
reference.seq,
record.seq,
1,
0,
affine_pen,
affine_pen,
one_alignment_only=True,
)
divergence[record.id] = (
hamming_dist(alignment[0][0], alignment[0][1]) / alignment[0][4]
)
with open(args.output_file, "w") as outfile:
outfile.write(