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

Double-tokenizing a RegionSet will result in no tokens #42

Open
nleroy917 opened this issue Oct 26, 2024 · 1 comment
Open

Double-tokenizing a RegionSet will result in no tokens #42

nleroy917 opened this issue Oct 26, 2024 · 1 comment

Comments

@nleroy917
Copy link
Member

Here is an interesting one:

>>> from gtars.tokenizers import TreeTokenizer
>>> from gtars.models import RegionSet, Region
>>> 
>>> tokenizer = TreeTokenizer("/Users/nathanleroy/Desktop/universe.bed")
>>> rs = RegionSet("/Users/nathanleroy/Desktop/test.bed")
>>> 
>>> tokens = tokenizer(rs)
>>> len(tokens)
12
>>> 
>>> tokens = tokenizer(rs)
>>> len(tokens)
0

If you try to tokenize a RegionSet twice, you get tokens the first time, then no tokens the second time. I really dont know why this is the case. I confirmed that this happens in the latest version of gtars on PyPi.

@nleroy917
Copy link
Member Author

This is specific to the RegionSet object/struct. This doesn't occur with these two calls:

rs = "/Users/nathanleroy/Desktop/test.bed"
tokens = tokenizer(rs)

rs = [Region("chr1", 1, 10), Region("chr1", 5, 15)]
tokens = tokenizer(rs)

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

No branches or pull requests

1 participant