1 # Copyright (C) The Lightning Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
18 columns = numpy.load(os.path.join(input_path, 'onehot-columns.npy'))
20 # pvalue maps tag# => [pvalue1, pvalue2, ...] (one het p-value and one hom p-value for each tile variant)
22 for i in range(columns.shape[1]):
24 x = pvalue.get(tag, [])
25 x.append(pow(10, -columns[4,i] / 1000000))
28 # tilepos maps tag# => (chromosome, position)
30 for dirent in os.scandir(input_path):
31 if dirent.name.endswith('.annotations.csv'):
32 with open(dirent, 'rt', newline='') as annotations:
33 for annotation in csv.reader(annotations):
34 # 500000,0,2,=,chr1,160793649,,,
35 if annotation[3] == "=":
36 tilepos[int(annotation[0])] = (annotation[4], int(annotation[5]))
38 series = {"#CHROM": [], "POS": [], "P": []}
39 for tag, chrpos in sorted(tilepos.items(), key=lambda item: (item[1][0].lstrip('chr').zfill(2), item[1][1])):
40 for p in pvalue.get(tag, []):
41 series["#CHROM"].append(chrpos[0])
42 series["POS"].append(chrpos[1])
45 qmplot.manhattanplot(data=pandas.DataFrame(series))
46 matplotlib.pyplot.savefig(output_path)