polars-bio
यह क्या करती है
यह टूल genomic sequences (जैसे DNA के जीन) की तुलना करने और उन्हें मैनिपुलेट करने में मदद करता है। इससे आप पता लगा सकते हैं कि कौन-से sequences आपस में overlap करते हैं, कौन-से सबसे नज़दीक हैं, लगातार sequences को merge कर सकते हैं, coverage निकाल सकते हैं और दूसरे ऑपरेशन कर सकते हैं।
कब इस्तेमाल करें
- ✓दो जीन सूचियों की तुलना करके देखना कि कौन-से जीन दोनों में हैं।
- ✓DNA के वे हिस्से ढूंढना जो sequencing में कवर नहीं हुए।
- ✓Genomic sequences के overlap वाले टुकड़ों को merge करना।
Skill का लिंक
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/polars-bio/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“सूची A के कौन-से जीन सूची B के जीनों से overlap करते हैं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह टूल BED, VCF, BAM जैसे आम फॉर्मेट में genomic डेटा पढ़ता है और उसे टेबल में व्यवस्थित करता है। फिर इन sequences की पोज़िशन की तुलना के लिए गणितीय ऑपरेशन लगाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
polars-bio
Use this skill for genomic interval arithmetic and bioinformatics file I/O through Polars and DataFusion. It targets polars-bio 0.36.0, tested with Polars 1.44.2 on Python 3.13. The upstream package requires Polars >=1.37.1, PyArrow >=23.0.1,<25, DataFusion >=53,<54 and polars-config-meta >=0.3.2,<1. Keep this environment separate from packages needing incompatible Arrow or DataFusion releases.
uv pip install "polars-bio==0.36.0" "polars==1.44.2"
# Optional pandas interoperability (requires pandas >=3):
uv pip install "polars-bio[pandas]==0.36.0" "polars==1.44.2"
Verify new releases against the official release notes and package requirements. The examples below with named files are templates: substitute actual files and check their schemas. The synthetic interval example and small local format round trips were executed during this review.
Workflow
- Record the assembly, contig naming, coordinate convention, strand policy and unit of analysis. Identical contig names do not prove identical assemblies.
- Choose readers by format; BCF has its own reader. Inspect schemas and source metadata before selecting attributes or genotypes.
- Normalize all inputs to one coordinate system and validate their bounds.
- Choose pair output, hit counts, covered bases or read depth deliberately.
- Filter and project lazily, then inspect a small result before scaling up.
- Validate output counts and boundaries against a hand-computable fixture; preserve IDs, coordinate metadata and provenance when saving results.
Coordinate contract
The default is 1-based closed, including converted BED reads. Use
use_zero_based=True on genomic readers for 0-based half-open output.
This argument converts positions; it is not only a metadata label. For example,
BED [0,10) becomes [1,10] by default and remains [0,10) with the override.
SAM text POS is 1-based, whereas BAM stores its alignment position internally
as 0-based. Both readers expose the requested output convention.
For manually constructed DataFrames, metadata labels existing numbers and
does not convert them. Converting closed [s,e] to half-open means s-1,e.
Set metadata only after conversion. Never convert twice.
import polars as pl
import polars_bio as pb
pb.set_option("datafusion.bio.coordinate_system_zero_based", True)
pb.set_option("datafusion.bio.coordinate_system_check", True)
query = pl.DataFrame({
"query_id": ["q1", "q2", "q3"],
"chrom": ["chr1", "chr1", "chr2"],
"start": [0, 10, 0], "end": [10, 20, 10],
})
target = pl.DataFrame({
"chrom": ["chr1", "chr1"], "start": [5, 8], "end": [12, 15],
})
for frame in (query, target):
frame.config_meta.set(coordinate_system_zero_based=True)
pairs = pb.overlap(query, target).collect()
counts = pb.count_overlaps(query, target).collect().sort("query_id")
covered = pb.coverage(query, target).collect().sort("query_id")
assert pairs.height == 4
assert counts["count"].to_list() == [2, 2, 0]
assert covered["coverage"].to_list() == [5, 5, 0]
Require non-null contigs, integer positions and valid positive-length intervals
(0 <= start < end in half-open form), within the chosen assembly. Do not silently
turn points/insertions into nonempty intervals: choose the biological convention.
Mismatched input metadata raises CoordinateSystemMismatchError; missing metadata
warns and uses the global setting by default, or raises MissingCoordinateSystemError
in strict mode. Inspect pb.get_metadata(frame) after transformations and SQL.
See configuration.
Choose the operation
| Question | Operation | Interpretation |
|---|---|---|
| Which interval pairs intersect? | overlap(a, b) |
Inner pair join; a query can appear repeatedly |
| Which query rows have any hit? | overlap(a, b, overlap_output="left", distinct_output=True) |
One hit per original query row; duplicate input rows retain identity |
| How many target intervals intersect each query? | count_overlaps(a, b) |
Target-record count, including zero for no hit |
| How many query bases are covered? | coverage(a, b) |
Length of the union of target intersections; not read depth |
| Which targets are closest? | nearest(a, b, k=1) |
Up to k neighbors, with nullable target/distance for no candidate |
…
अक्सर पूछे जाने वाले सवाल
'Genomic intervals' क्या होते हैं?
ये DNA के वे हिस्से हैं जो किसी क्रोमोसोम या बड़े sequence पर एक शुरुआती और आखिरी बिंदु से तय होते हैं।
यह कौन-से फाइल फॉर्मेट सपोर्ट करता है?
यह आणविक जीवविज्ञान (molecular biology) में इस्तेमाल होने वाले कई फॉर्मेट सपोर्ट करता है, जैसे BED, VCF, BAM, GFF, GTF, FASTA और FASTQ।
यह पोज़िशन गिनती (0 या 1 से शुरू) को कैसे संभालता है?
डिफ़ॉल्ट रूप से यह 1-based (closed) गिनती सिस्टम इस्तेमाल करता है, लेकिन ज़रूरत पड़ने पर इसे 0-based (half-open) सिस्टम पर सेट किया जा सकता है, जो कुछ टूल्स में आम है।
जानकारी
लेखक का मूल विवरण
Performs genomic interval overlap, nearest, merge, coverage, complement and subtraction on Polars DataFrames, and reads or writes BED, VCF, BCF, BAM, CRAM, GFF, GTF, FASTA and FASTQ data. Use for coordinate-aware genomic joins, read-depth analysis, lazy bioinformatics I/O, SQL queries or migration from bioframe.
लोकप्रियता
- GitHub स्टार
- 51k
- रैंकिंग में स्थान
- #3529
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
13c-metabolic-flux
51kकार्बन-13 आइसोटोप ट्रेसिंग डेटा से मेटाबोलिक फ़्लक्स का अनुमान लगाता है। कोशिका के मेटाबॉलिज़्म और बायोकेमिकल मार्गों का विश्लेषण करने के लिए यह उपयोगी है।
adaptyv
51kAdaptyv API का उपयोग करके प्रोटीन कैरेक्टराइज़ेशन प्रयोग डिज़ाइन करता है। लागत का अनुमान लगाने, सीक्वेंस सबमिट करने और लैब के नतीजों पर नज़र रखने में मदद करता है।
aeon
51kटाइम सीरीज़ डेटा पर मशीन लर्निंग के काम करता है। क्रमबद्ध डेटा में वर्गीकरण, पूर्वानुमान, एनोमली डिटेक्शन और पैटर्न खोजने के लिए यह उपयोगी है।
alphagenome
51kजेनेटिक वेरिएंट्स के पहले से गणना किए गए जीनोमिक प्रभाव देखता है। वेरिएंट का जीनोम पर असर समझने के लिए स्कोर और स्पष्टीकरण देता है।
मिलती-जुलती skills
pytorch-patterns
280kआपके एजेंट को machine learning models के लिए PyTorch इस्तेमाल करने में मदद करता है। कुशल model training के best practices लागू करता है और नतीजों को दोहराने लायक रखता है।
evm-token-decimals
280kयह आपके एजेंट को अलग-अलग blockchain networks पर decimal numbers की गलतियों से बचने में मदद करता है। यह transactions और calculations में token values सही रखने का ध्यान रखता है।
ito-inference
280kआपके एजेंट को AI models की उपलब्धता जाँचने देता है। यह compute request को तैयार model service से जोड़ता है।