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-commenter commented Apr 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.23%. Comparing base (a18e2fb) to head (04ed56d).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
+ Coverage   93.09%   93.23%   +0.14%     
==========================================
  Files           6        6              
  Lines         333      340       +7     
==========================================
+ Hits          310      317       +7     
  Misses         23       23              
Files with missing lines Coverage Δ
src/genomic_features/ensembl/ensembldb.py 93.40% <100.00%> (+0.24%) ⬆️

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