-
Notifications
You must be signed in to change notification settings - Fork 0
/
readsamples.py
29 lines (25 loc) · 918 Bytes
/
readsamples.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from __future__ import division
import numpy as np
from alleles import GenomePolymorphisms
from snps import GenomeSNPs
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import os
import subprocess
from fnmatch import filter
from natsort import natsorted
from Bio import SeqIO
from collections import Counter
import counter_stats as cs
data_dir = 'snps/'
save_dir = 'plots/'
samples = [fname.split('.')[0] for fname in os.listdir(data_dir)]
names_L = natsorted([sample for sample in filter(samples, '*L*')])
names_M = natsorted([sample for sample in filter(samples, '*M*')])
names_S = natsorted([sample for sample in filter(samples, '*S*')])
samples_L = {sample: GenomeSNPs(sample, data_dir)
for sample in names_L}
samples_M = {sample: GenomeSNPs(sample, data_dir)
for sample in names_M}
samples_S = {sample: GenomeSNPs(sample, data_dir)
for sample in names_S}