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

Direction for closest #130

Merged
merged 9 commits into from
Feb 2, 2023
Merged

Direction for closest #130

merged 9 commits into from
Feb 2, 2023

Conversation

agalitsyna
Copy link
Member

@agalitsyna agalitsyna commented Nov 9, 2022

Potential solution for #129

In here, I introduce the new definition of oriented interval (oriented feature).
It is fundamentally different from the strandedness of the feature and can be, in fact, different.

  • Oriented interval is an interval with all the columns of regular interval plus direction that can be '+', '-', or '.'

  • Direction defines the orientation of upstream and downstream directions in the genome.

  • For '+' (forward-oriented) interval, the upstream is to the left from the start; the downstream is to the right from the end. In other words, this orientation coincides with the orientation of chromosome coordinates.

  • For '-' (reverse-oriented) interval, the upstream is to the right from the end; the downstream is to the left from the start.

  • For '.' (non-oriented) interval upstream/downstream is the orientation of chromosomal coordinates.

The proposed PR:

  • introduces the parameter direction_col for closest that defines the column with direction for the oriented intervals
  • modifies both arrops and ops functions to make the call more efficient than applying multiple bioframe operations
  • tests direction param of closest in different contexts

P.S.: This is a header post and can be modified in future

@agalitsyna
Copy link
Member Author

@golobor You mentioned that there should be some change in distance sign. Can you check that it behaves as you expect? This is needed to check my understanding, not the code per se.

Maybe looking into the new closest tests will be enough to tell.

@agalitsyna
Copy link
Member Author

agalitsyna commented Nov 28, 2022

  • Explain that direction is search direction in the docs
  • Add tutorial on upstreams/downstreams from gene, as this one

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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.

None yet

1 participant