Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Cell-free DNA analysis pipeline from plasma sequencing to tumor monitoring. Preprocesses cfDNA reads, analyzes fragment patterns, estimates tumor fraction from sWGS, and optionally detects mutations from targeted panels. Use when analyzing liquid biopsy samples for cancer detection or monitoring.
.claude/skills/bio-liquid-biopsy-pipeline/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 26% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 234% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 119% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 207% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 56% | 0% |
<!--
#
#
-->
Complete workflow for cfDNA analysis from sequencing to clinical interpretation.
Pre-analytical QC → cfDNA Preprocessing → Fragment QC
↓
┌─────────────────┴─────────────────┐
↓ ↓
sWGS Branch Panel Branch
↓ ↓
ichorCNA VarDict/smCounter2
(Tumor Fraction) (Mutation Detection)
↓ ↓
└─────────────────┬─────────────────┘
↓
Longitudinal Trackingpythondef check_preanalytical_quality(sample_metadata): ''' Pre-analytical factors critical for cfDNA quality. Requirements: - Streck tube: up to 7 days at room temperature - EDTA tube: process within 6 hours - Avoid hemolysis - Store extracted DNA at -80C ''' issues = [] if sample_metadata['tube_type'] == 'EDTA': if sample_metadata['processing_delay_hours'] > 6: issues.append('EDTA tube processed > 6 hours - risk of gDNA contamination') if sample_metadata['hemolysis_score'] > 1: issues.append('Hemolysis detected - expect cellular DNA contamination') return issues
bash# For UMI-tagged libraries (targeted panels) # fgbio pipeline # Extract UMIs fgbio ExtractUmisFromBam \ --input raw.bam \ --output with_umis.bam \ --read-structure 3M2S+T 3M2S+T \ --single-tag RX # Align bwa mem -t 8 -Y reference.fa with_umis.bam | \ samtools view -bS - > aligned.bam # Group by UMI fgbio GroupReadsByUmi \ --input aligned.bam \ --output grouped.bam \ --strategy adjacency \ --edits 1 # Consensus calling fgbio CallMolecularConsensusReads \ --input grouped.bam \ --output consensus.bam \ --min-reads 2 # Filter fgbio FilterConsensusReads \ --input consensus.bam \ --output final.bam \ --ref reference.fa \ --min-reads 2
pythonimport pysam import numpy as np def verify_cfdna_quality(bam_path): ''' QC Checkpoint: Verify cfDNA fragment profile. Expected: peak at ~167bp (mononucleosome) ''' 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) modal_size = np.bincount(sizes[:400]).argmax() mono_frac = np.sum((sizes >= 150) & (sizes <= 180)) / len(sizes) qc_pass = 150 <= modal_size <= 180 and mono_frac > 0.3 return { 'modal_size': modal_size, 'mononucleosome_fraction': mono_frac, 'qc_pass': qc_pass, 'message': 'Good cfDNA profile' if qc_pass else 'Atypical fragment distribution' }
r# For shallow WGS data (0.1-1x coverage) library(ichorCNA) runIchorCNA( WIG = 'sample.wig', gcWig = 'gc_hg38_1mb.wig', mapWig = 'map_hg38_1mb.wig', normalPanel = 'pon_median.rds', centromere = 'centromeres.txt', outDir = 'ichor_results/', id = 'sample_id', normal = c(0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99), ploidy = c(2, 3), maxCN = 5 )
bash# For deep targeted sequencing # Use UMI-consensus BAM from Step 1 vardict-java \ -G reference.fa \ -f 0.005 \ -N sample_id \ -b consensus.bam \ -c 1 -S 2 -E 3 -g 4 \ panel.bed | \ teststrandbias.R | \ var2vcf_valid.pl \ -N sample_id \ -E \ -f 0.005 \ > sample.vcf
pythonCHIP_GENES = ['DNMT3A', 'TET2', 'ASXL1', 'PPM1D', 'JAK2', 'SF3B1', 'SRSF2', 'TP53'] def filter_chip(variants_df, chip_genes=CHIP_GENES): ''' Filter out clonal hematopoiesis variants. Critical for elderly patients (>5% have CHIP). ''' chip = variants_df[variants_df['gene'].isin(chip_genes)] somatic = variants_df[~variants_df['gene'].isin(chip_genes)] print(f'Potential CHIP variants: {len(chip)}') print(f'Likely somatic: {len(somatic)}') return somatic, chip
pythonimport finaletoolkit as ft def run_fragmentomics(bam_path, output_prefix): ''' DELFI-style fragmentation analysis. Use FinaleToolkit (MIT license, not DELFI software). ''' fragments = ft.read_fragments(bam_path) 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') return profile
pythonimport pandas as pd import numpy as np def track_longitudinal(samples_df): ''' Track ctDNA over treatment. samples_df columns: [sample_id, timepoint, tumor_fraction, mutations...] ''' samples_df = samples_df.sort_values('timepoint') baseline = samples_df.iloc[0]['tumor_fraction'] samples_df['log2_fc'] = np.log2(samples_df['tumor_fraction'] / baseline) nadir = samples_df['tumor_fraction'].min() response = 'unknown' if nadir < 0.001: response = 'Complete molecular response' elif nadir < baseline * 0.01: response = 'Major molecular response (>2 log)' elif nadir < baseline * 0.5: response = 'Partial molecular response' return samples_df, response
pythondef run_liquid_biopsy_pipeline(sample_config): ''' Complete liquid biopsy analysis pipeline. sample_config: dict with keys: - bam_file: Input BAM - data_type: 'swgs' or 'panel' - reference: Reference FASTA - bed_file: Panel BED (for panel data) - output_dir: Output directory ''' results = {} # Step 1: Preprocess (if UMI data) if sample_config.get('has_umis'): preprocessed_bam = preprocess_with_fgbio(sample_config['bam_file']) else: preprocessed_bam = sample_config['bam_file'] # Step 2: Fragment QC frag_qc = verify_cfdna_quality(preprocessed_bam) if not frag_qc['qc_pass']: print(f"WARNING: {frag_qc['message']}") results['fragment_qc'] = frag_qc # Step 3: Analysis based on data type if sample_config['data_type'] == 'swgs': # Tumor fraction estimation results['tumor_fraction'] = run_ichorcna(preprocessed_bam) elif sample_config['data_type'] == 'panel': # Mutation detection variants = call_variants(preprocessed_bam, sample_config['bed_file']) somatic, chip = filter_chip(variants) results['variants'] = somatic results['chip_variants'] = chip # Step 4: Optional fragmentomics if sample_config.get('run_fragmentomics'): results['fragmentomics'] = run_fragmentomics(preprocessed_bam) return results
<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 15,389 | 9,838 | -36% | 1 | 1 | 0% | 3,579 | 4,512 | +26% | 0 | 0 | — |
case-02 | fail→fail | 40,112 | 19,082 | -52% | 1 | 1 | 0% | 2,550 | 6,602 | +159% | 0 | 0 | — |
case-03 | fail→fail | 21,579 | 17,861 | -17% | 1 | 1 | 0% | 4,417 | 5,426 | +23% | 0 | 0 | — |
case-08 | fail→pass | 17,599 | 5,353 | -70% | 1 | 1 | 0% | 1,029 | 3,442 | +234% | 0 | 0 | — |
case-09 | pass→pass | 8,411 | 2,028 | -76% | 1 | 1 | 0% | 1,377 | 2,787 | +102% | 0 | 0 | — |
case-10 | fail→pass | 7,627 | 2,198 | -71% | 1 | 1 | 0% | 1,269 | 2,783 | +119% | 0 | 0 | — |
case-15 | fail→pass | 15,866 | 3,651 | -77% | 1 | 1 | 0% | 1,029 | 3,155 | +207% | 0 | 0 | — |
case-16 | fail→pass | 18,503 | 13,145 | -29% | 1 | 1 | 0% | 3,232 | 5,053 | +56% | 0 | 0 | — |
case-21 | pass→pass | 15,082 | 17,838 | +18% | 1 | 1 | 0% | 2,676 | 5,627 | +110% | 0 | 0 | — |
case-04 | fail→pass | 11,818 | 7,090 | -40% | 1 | 1 | 0% | 2,220 | 3,771 | +70% | 0 | 0 | — |
case-05 | fail→fail | 39,214 | 12,325 | -69% | 1 | 1 | 0% | 3,558 | 4,815 | +35% | 0 | 0 | — |
case-06 | pass→pass | 21,240 | 8,199 | -61% | 1 | 1 | 0% | 2,335 | 4,010 | +72% | 0 | 0 | — |
case-07 | fail→pass | 11,818 | 5,955 | -50% | 1 | 1 | 0% | 2,169 | 3,631 | +67% | 0 | 0 | — |
case-11 | pass→pass | 12,832 | 13,171 | +3% | 1 | 1 | 0% | 2,515 | 4,795 | +91% | 0 | 0 | — |
case-12 | pass→pass | 8,512 | 7,487 | -12% | 1 | 1 | 0% | 1,424 | 3,704 | +160% | 0 | 0 | — |
case-13 | fail→fail | 16,105 | 14,047 | -13% | 1 | 1 | 0% | 2,948 | 5,024 | +70% | 0 | 0 | — |
case-14 | pass→pass | 8,056 | 3,957 | -51% | 1 | 1 | 0% | 1,419 | 3,087 | +118% | 0 | 0 | — |
case-17 | fail→pass | 11,719 | 2,115 | -82% | 1 | 1 | 0% | 1,819 | 2,808 | +54% | 0 | 0 | — |
case-18 | fail→pass | 10,046 | 2,534 | -75% | 1 | 1 | 0% | 1,915 | 2,944 | +54% | 0 | 0 | — |
case-19 | pass→pass | 8,538 | 4,217 | -51% | 1 | 1 | 0% | 1,433 | 3,232 | +126% | 0 | 0 | — |
case-20 | pass→pass | 14,438 | 11,998 | -17% | 1 | 1 | 0% | 2,504 | 4,624 | +85% | 0 | 0 | — |
case-22 | pass→pass | 15,999 | 13,528 | -15% | 1 | 1 | 0% | 2,543 | 4,791 | +88% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 20 counted toward the lift figure. The other 2 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +41 percentage points is the difference between those two pass rates over the 20 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 7/24/2026 | +36% |
Other measured skills in the registry, with their headline benchmark lift.