bio-fragment-analysis
Analyzes cfDNA fragment size distributions and fragmentomics features using FinaleToolkit or Griffin. Extracts nucleosome positioning patterns, fragment ratios, and DELFI-style fragmentation profiles for cancer detection
Install / Use
npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-fragment-analysisInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of bio-fragment-analysis
bio-fragment-analysis scores 89/100 on our quality scale, 1590th of 4,698 Development & Engineering skills we index (top 34%).
Its SKILL.md is 6.4 KB long, well organised into 9 sections with 4 code examples: a thorough specification that gives an agent plenty to work with.
With 3,034 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- Our last check on 2026-10-31 found the source still online.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 86/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit ā read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-29. Automated pattern scan on 2026-09-29. It catches known dangerous patterns, not every risk ā read a skill before letting an agent act on it.
bio-fragment-analysis compared with similar skills
All 4 of these similar skills score higher than bio-fragment-analysis; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| bio-fragment-analysis (this skill)by FreedomIntelligence | 89 | 3.0k | 4mo ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 116.8k | 8d ago | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 112.3k | 8d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.8k | today | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 72.1k | today | CLAUDE.md |
Frequently asked questions
- How do I install bio-fragment-analysis?
- Run
npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-fragment-analysis. The install tabs above show the steps for each supported agent. - Which AI agents does bio-fragment-analysis work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is bio-fragment-analysis safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 86/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is bio-fragment-analysis still maintained?
- The repository was last updated about 4 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubname: bio-fragment-analysis description: Analyzes cfDNA fragment size distributions and fragmentomics features using FinaleToolkit or Griffin. Extracts nucleosome positioning patterns, fragment ratios, and DELFI-style fragmentation profiles for cancer detection. Use when leveraging fragment patterns for tumor detection or tissue-of-origin analysis. tool_type: python primary_tool: FinaleToolkit
Version Compatibility
Reference examples tested with: numpy 1.26+, pandas 2.2+, pysam 0.22+
Before using code patterns, verify installed versions match. If versions differ:
- Python:
pip show <package>thenhelp(module.function)to check signatures
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Fragment Analysis
"Analyze cfDNA fragment patterns for cancer detection" ā Extract fragmentomics features (size distributions, nucleosome positioning, DELFI profiles) from cfDNA for tumor detection and tissue-of-origin analysis.
- Python:
FinaleToolkitorGriffinfor fragment feature extraction - Python:
pysamfor custom fragmentomics analysis
Analyze cfDNA fragmentomics for cancer detection and characterization.
Tool Selection
| Tool | Description | Use Case | |------|-------------|----------| | FinaleToolkit | DELFI-style patterns, MIT license | General fragmentomics | | Griffin | Nucleosome profiling | Tissue deconvolution |
Note: DELFI is a commercial company, NOT software. Use FinaleToolkit (MIT license) which replicates DELFI patterns and is 50x faster.
Fragment Size Metrics
import pysam
import numpy as np
import pandas as pd
def calculate_fragment_metrics(bam_path):
'''
Calculate cfDNA fragment metrics.
Key ratios for cancer detection:
- Short (100-150 bp) vs Long (151-220 bp)
- ctDNA tends to be shorter than normal cfDNA
'''
bam = pysam.AlignmentFile(bam_path, 'rb')
sizes = []
for read in bam.fetch():
if read.is_proper_pair and not read.is_secondary and read.template_length > 0:
sizes.append(read.template_length)
bam.close()
sizes = np.array(sizes)
# DELFI-style ratios
short = np.sum((sizes >= 100) & (sizes <= 150))
long = np.sum((sizes >= 151) & (sizes <= 220))
metrics = {
'total_fragments': len(sizes),
'median_size': np.median(sizes),
'mean_size': np.mean(sizes),
'short_fragments': short,
'long_fragments': long,
'short_long_ratio': short / long if long > 0 else np.nan,
# Mononucleosome peak
'mono_peak_fraction': np.sum((sizes >= 150) & (sizes <= 180)) / len(sizes)
}
return metrics
FinaleToolkit Analysis
import finaletoolkit as ft
import pandas as pd
def run_finaletoolkit(bam_path, output_prefix):
'''
Run FinaleToolkit for DELFI-style fragmentomics.
FinaleToolkit 0.7.1+ required.
'''
# Extract fragment sizes
fragments = ft.read_fragments(bam_path)
# Calculate genome-wide fragmentation profile
# 5Mb bins as in DELFI
profile = ft.calculate_fragmentation_profile(
fragments,
bin_size=5_000_000,
short_range=(100, 150),
long_range=(151, 220)
)
profile.to_csv(f'{output_prefix}_frag_profile.csv')
# Calculate coverage-corrected ratios
ratios = ft.calculate_short_long_ratios(
fragments,
bin_size=5_000_000,
gc_correct=True
)
return profile, ratios
Griffin Nucleosome Profiling
import subprocess
def run_griffin(bam_path, sites_bed, output_dir):
'''
Run Griffin for nucleosome positioning analysis.
Griffin 0.2.0+ required.
'''
# Griffin analyzes nucleosome accessibility around regulatory sites
subprocess.run([
'griffin',
'--bam', bam_path,
'--sites', sites_bed, # TSS, CTCF, etc.
'--output', output_dir,
'--window', '2000', # bp around site
'--fragment_length', '120-180'
], check=True)
Genome-Wide Fragmentation Profile
Goal: Generate a genome-wide map of short-to-long fragment ratios across fixed-size bins, replicating the DELFI approach for cancer detection from cfDNA fragmentomics.
Approach: Iterate over proper-pair fragments in each genomic bin, classify each as short (100-150 bp) or long (151-220 bp), and compute the short/long ratio per bin as the fragmentation feature vector.
import pysam
import numpy as np
def calculate_binned_profile(bam_path, bin_size=5_000_000, chromosomes=None):
'''
Calculate fragment profiles in genomic bins.
Similar to DELFI approach.
'''
if chromosomes is None:
chromosomes = [f'chr{i}' for i in range(1, 23)]
bam = pysam.AlignmentFile(bam_path, 'rb')
profiles = {}
for chrom in chromosomes:
try:
chrom_len = bam.get_reference_length(chrom)
except Exception:
continue
n_bins = (chrom_len // bin_size) + 1
short_counts = np.zeros(n_bins)
long_counts = np.zeros(n_bins)
for read in bam.fetch(chrom):
if not read.is_proper_pair or read.is_secondary:
continue
if read.template_length <= 0:
continue
bin_idx = read.reference_start // bin_size
if bin_idx >= n_bins:
continue
size = read.template_length
if 100 <= size <= 150:
short_counts[bin_idx] += 1
elif 151 <= size <= 220:
long_counts[bin_idx] += 1
# Calculate ratio per bin
with np.errstate(divide='ignore', invalid='ignore'):
ratios = short_counts / long_counts
ratios[~np.isfinite(ratios)] = np.nan
profiles[chrom] = {
'short': short_counts,
'long': long_counts,
'ratio': ratios
}
bam.close()
return profiles
Interpretation
| Pattern | Interpretation | |---------|----------------| | Higher short/long ratio | Possible tumor signal | | Altered nucleosome positioning | Epigenetic changes | | Tissue-specific patterns | Tissue of origin | | Modal peak shift | cfDNA quality issue or biology |
Related Skills
- cfdna-preprocessing - Preprocess before fragment analysis
- tumor-fraction-estimation - Complement with CNV-based estimation
- methylation-based-detection - Alternative detection approach
Related Skills
taste-skill
116.8kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu ā one CLI, zero API fees.
headroom
79.8kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ai-job-search
72.1kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit ā see the Safety scan above for what the skill file itself contains.
