This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env snakemake | |
# Requires Python3.6 or greater | |
rule align_A: | |
output: | |
outfile = "align__A/{sample}.bam" | |
shell: | |
''' | |
mkdir -p $(dirname {output.outfile}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 63 | |
49 66 | |
211 27 | |
56 64 | |
140 18 | |
65 65 | |
68 61 | |
39 30 | |
75 58 | |
10 18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_pl_allele(allele, n_alleles, ploidy): | |
gts = [0] * ploidy | |
idx = ploidy - 1 | |
pl_pos = 0 | |
while (sum(gts) <= ploidy * (n_alleles - 1)): | |
if allele in gts: | |
yield pl_pos | |
if sum(gts) == ploidy * (n_alleles - 1): | |
break |