Skip to content

Allow separate upstream and downstream gene window flanks - #46

Open
leoxnard wants to merge 1 commit into
BergmannLab:mainfrom
leoxnard:window_flanks
Open

leoxnard wants to merge 1 commit into
BergmannLab:mainfrom
leoxnard:window_flanks

Conversation

@leoxnard

Copy link
Copy Markdown

Fixes #45

Changes

  • Add genome.gene_window(G, window). It returns the gene interval including its flanks. window is an int (symmetric, as before) or a tuple (upstream, downstream), applied according to the gene's strand (-/-1 = minus, anything else = plus).
  • Replace the 19 G[1]-self._window, G[2]+self._window expressions in genescorer.py and xscorer.py with this helper.
  • Update the window docstrings.

Example: chi2sum(window=(35000, 10000)) uses 35 kb upstream and 10 kb downstream.

Tested

I Scored 10,000 GWAS SNPs on chr1 (EUR reference panel) with chi2sum:

  • window=10000 gives identical results before and after this change, and the same as window=(10000, 10000).
  • window=(20000, 0) and (0, 20000) give identical results to the old code with window=0 and the flanks added to the annotation by hand, per strand. This covers both + and - genes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow separate upstream and downstream gene window flanks

1 participant