Skip to content

Commit

Permalink
Merge pull request #281 from mgalardini/summary_betas
Browse files Browse the repository at this point in the history
Allow the users to decide if they want the absolute betas
  • Loading branch information
mgalardini authored Oct 23, 2024
2 parents 4b8d22f + 1a9cf19 commit 9c96852
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/summarise_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def get_options():
parser.add_argument('--unadj-p',
action='store_true',
help='Use the unadjusted p-value (set if adjusted p-value not available)')
parser.add_argument('--no-absolute-beta',
action='store_true',
help='Do not use the absolute value for the betas')

return parser.parse_args()

Expand Down Expand Up @@ -55,7 +58,9 @@ def update_summary(summary, gene, pval, af, beta):
sys.stderr.write("No adjusted p-value found; try with --unadj-p\n")
else:
pvalue = float(anot_fields[3])
beta = abs(float(anot_fields[4]))
beta = float(anot_fields[4])
if not options.no_absolute_beta:
beta = abs(beta)
# double check that there are actual hits here
if anot_fields[-1].count(';') == 0:
sys.stderr.write('K-mer %s seemingly has no '
Expand Down

0 comments on commit 9c96852

Please sign in to comment.