Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get table of promoter region #34

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Get table of promoter region #34

wants to merge 4 commits into from

Conversation

emdann
Copy link
Member

@emdann emdann commented Apr 28, 2023

Closes #4

Implemented strand-aware selection of region around TSS.

Example usage:

promoters = hsapiens108.promoters(upstream=500, downstream=100)

TO DO

  • Use transcript instead of gene table: we need to call the transcript table, using a join to extract seq_name and seq_strand for each gene (i.e. relies on merging Initial columns functions #22 )

@codecov-commenter
Copy link

Codecov Report

Merging #34 (36fd565) into main (8e336e9) will increase coverage by 0.55%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
+ Coverage   88.40%   88.96%   +0.55%     
==========================================
  Files           6        6              
  Lines         138      145       +7     
==========================================
+ Hits          122      129       +7     
  Misses         16       16              
Impacted Files Coverage Δ
src/genomic_features/ensembl/ensembldb.py 91.37% <100.00%> (+1.18%) ⬆️

Comment on lines +167 to +177
tx_ss = np.where(
tx_table["seq_strand"] == 1,
tx_table["gene_seq_start"],
tx_table["gene_seq_end"],
)
tx_table["promoter_seq_start"] = np.where(
tx_table["seq_strand"] == 1, tx_ss - upstream, tx_ss - downstream
)
tx_table["promoter_seq_end"] = np.where(
tx_table["seq_strand"] == 1, tx_ss + downstream, tx_ss + upstream
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Would you be up for PR-ing this into bioframe as well? open2c/bioframe#144

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drafted in open2c/bioframe#152

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.

TSS/ promoter regions
3 participants