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

automatically anchor bins/sequences around target gene, feature, ... #204

Open
thackl opened this issue Oct 22, 2024 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@thackl
Copy link
Owner

thackl commented Oct 22, 2024

It's already possible to shift bins in order to align sequences, but if one wants to align everything, for example, at a certain gene, those coordinates have to be manually precomputed and given to shift

@thackl thackl self-assigned this Oct 22, 2024
@thackl thackl added the enhancement New feature or request label Oct 22, 2024
@thackl
Copy link
Owner Author

thackl commented Oct 22, 2024

Here's a draft implementation for an anchor function. Might need some more testing - especially in multi-contig context. Ideas for additional functionality are also welcome.

pp <- 
	# left-align on MCP gene
	p2 |> anchor(name == "MCP") +
	# left-align on MCP gene after flipping bins
	p2 |> sync() |> anchor(name =="MCP") +
	# right-align on MCP gene
	p2 |> anchor(name == "MCP", .align = "right") +
	# center-align on MCP + pri-hel gene
	p2 |> sync() |> anchor(name %in% c("MCP", "pri-hel"), .align = "center") +
	# center-align by fraction on MCP and pri-hel gene (hjust-like behaviour)
	p2 |> anchor(name %in% c("MCP", "pri-hel"), .align = .5) +
	# right-align by fraction after flipping
	p2 |> sync() |> anchor(name %in% c("MCP", "pri-hel"), .align = 1)
	
pp	

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant