Skip to content

Get table of promoter region - #34

Draft
emdann wants to merge 4 commits into
mainfrom
promoters
Draft

Get table of promoter region#34
emdann wants to merge 4 commits into
mainfrom
promoters

Conversation

@emdann

@emdannemdann commented Apr 28, 2023

Copy link
Copy Markdown
Member

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

codecov-commenter commented Apr 28, 2023

Copy link
Copy Markdown

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 linesCoverage Δ
src/genomic_features/ensembl/ensembldb.py93.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
Copy Markdown
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
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Sign up for freeto 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

@emdann@codecov-commenter@ivirshup