Skip to content

Commit e04c59f

Browse files
committed
Added init files and updated summarize script with new score columns
1 parent eb7037d commit e04c59f

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

__init__.py

Whitespace-only changes.

src/__init__.py

Whitespace-only changes.

src/generators/__init__.py

Whitespace-only changes.

src/utils/__init__.py

Whitespace-only changes.

src/variant_summary_across_folds.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from matplotlib import pyplot as plt
1717
from matplotlib.pyplot import figure
1818
import numpy as np
19-
import os
19+
import os
2020
from utils.argmanager import *
2121

2222
def geo_mean_overflow(iterable,axis=0):
@@ -30,22 +30,22 @@ def main():
3030
output_prefix = args.out_prefix
3131
genes = args.genes
3232
variant_table_list = args.score_list
33-
33+
3434
score_dict = {}
3535
for i in range(len(variant_table_list)):
3636
var_score = variant_table_list[i]
3737
assert os.path.isfile(variant_score_path + var_score)
3838
var_score = pd.read_table(variant_score_path + var_score)
39-
score_dict[i] = var_score
40-
41-
snp_scores = score_dict[0][["chr", "pos", "allele1", "allele2","rsid"]].copy()
39+
score_dict[i] = var_score
40+
41+
snp_scores = score_dict[0][["chr", "pos", "allele1", "allele2", "rsid"]].copy()
4242

4343

4444
for score in ["logfc"]:
4545
if score in score_dict[0]:
4646
snp_scores.loc[:, (score + '.mean')] = np.mean(np.array([score_dict[fold][score].tolist()
4747
for fold in score_dict]), axis=0)
48-
for score in ["abs_logfc", "jsd", "abs_logfc_x_jsd", "abs_logfc_x_jsd_x_max_percentile"]:
48+
for score in ["abs_logfc", "jsd", "abs_logfc_x_jsd", "abs_logfc_x_max_percentile", "jsd_x_max_percentile", "abs_logfc_x_jsd_x_max_percentile"]:
4949
if score in score_dict[0]:
5050
snp_scores.loc[:, (score + '.mean')] = np.mean(np.array([score_dict[fold][score].tolist()
5151
for fold in score_dict]), axis=0)
@@ -113,8 +113,8 @@ def main():
113113
snp_scores = snp_scores.merge(closest_gene_df,on='rsid', how='inner')
114114
out_file = output_prefix + ".average_across_folds.variant_scores.tsv"
115115
snp_scores.to_csv(out_file,\
116-
sep="\t",\
117-
index=False)
116+
sep="\t",\
117+
index=False)
118118

119119
print("DONE")
120120

0 commit comments

Comments
 (0)