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

pybigtools: more flexibility with open #66

Open
jackh726 opened this issue Nov 28, 2024 · 3 comments
Open

pybigtools: more flexibility with open #66

jackh726 opened this issue Nov 28, 2024 · 3 comments

Comments

@jackh726
Copy link
Owner

Currently, for files, we hard code the extensions (.bigWig/.bw/.bigBed/.bb). Seems that this is worked around (https://github.com/Bio2Byte/tools-iuc/blob/df9c285dddde7d901823c608c8d7dab971224b5b/tools/bigwig_outlier_bed/bigwig_outlier_bed.py#L115)

Would be good to offer a bit more flexibility. A couple options:

  1. Add a type parameter (bigwig, bigbed)
  2. Test open a file regardless of extension
@ghuls
Copy link
Contributor

ghuls commented Dec 12, 2024

Preferably it would just rely on the first 4 magic bytes to determine if it is a bigwig or bigbed file and not look at the extension at all:
https://github.com/jackh726/bigtools/blame/master/bigtools/src/bbi/bbiread.rs#L657-L664

Probably having that code in a separate function that would return if a file is a bigWig or bigBed file, would be useful.

@jackh726
Copy link
Owner Author

Yes, that's covered under (2). Pretty trivial to do.

@jackh726
Copy link
Owner Author

I did add IIRC a GenericBBIFile somewhere that does this.

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

2 participants