-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Bioinformatic formats support and code cleanup (#59)
* feat: Bioinformatic formats support * fix: Issue-47 * Version bump * chore: Doc upgrades * BAM test * file format docs * Basic format tests * Formats refactor
- Loading branch information
Showing
35 changed files
with
2,524 additions
and
266 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
:construction: | ||
|
||
[//]: # (## Genomic ranges operations) | ||
|
||
[//]: # (## How to read bioinformatics formats) | ||
|
||
|
||
[//]: # () | ||
[//]: # (## How to work directly with Datafusion DataFrame) | ||
|
||
[//]: # (To bypasss issue XXX) | ||
|
||
[//]: # (## How to set logging level) | ||
|
||
[//]: # (## How to read from object storage) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,29 @@ | ||
import logging | ||
|
||
from .range_op import FilterOp, ctx, nearest, overlap | ||
from polars_bio.polars_bio import InputFormat | ||
|
||
from .context import ctx | ||
from .io import read_bam, read_bed, read_fasta, read_fastq, read_vcf | ||
from .range_op import FilterOp, nearest, overlap | ||
from .range_viz import visualize_intervals | ||
|
||
logging.basicConfig() | ||
logging.getLogger().setLevel(logging.WARN) | ||
logger = logging.getLogger("polars_bio") | ||
logger.setLevel(logging.INFO) | ||
|
||
__version__ = "0.4.0" | ||
__all__ = ["overlap", "nearest", "ctx", "FilterOp", "vizualize_intervals"] | ||
|
||
__version__ = "0.5.0" | ||
__all__ = [ | ||
"overlap", | ||
"nearest", | ||
"ctx", | ||
"FilterOp", | ||
"visualize_intervals", | ||
"read_bam", | ||
"read_vcf", | ||
"read_bed", | ||
"read_fasta", | ||
"read_fastq", | ||
"InputFormat", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from polars_bio.polars_bio import BioSessionContext | ||
|
||
|
||
def singleton(cls): | ||
"""Decorator to make a class a singleton.""" | ||
instances = {} | ||
|
||
def get_instance(*args, **kwargs): | ||
if cls not in instances: | ||
instances[cls] = cls(*args, **kwargs) | ||
return instances[cls] | ||
|
||
return get_instance | ||
|
||
|
||
@singleton | ||
class Context: | ||
def __init__(self): | ||
self.ctx = BioSessionContext() | ||
self.ctx.set_option("datafusion.execution.target_partitions", "1") | ||
self.ctx.set_option("sequila.interval_join_algorithm", "coitrees") | ||
|
||
def set_option(self, key, value): | ||
self.ctx.set_option(key, value) | ||
|
||
|
||
ctx = Context().ctx |
Oops, something went wrong.