/bio-crispr-screens-library-design
CRISPR library design for genetic screens. Covers sgRNA selection, library composition, control design, and oligo ordering. Use when designing custom sgRNA libraries for knockout, activation, or interference screens.
Claude Code
$ npx -y skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-crispr-screens-library-design --agent claude-code
Codex
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-crispr-screens-library-design -a codex -y
Cursor
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-crispr-screens-library-design -a cursor -y
Gemini CLI
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-crispr-screens-library-design -a gemini-cli -y
GitHub Copilot
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-crispr-screens-library-design -a github-copilot -y
OpenCode
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-crispr-screens-library-design -a opencode -y
Windsurf
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-crispr-screens-library-design -a windsurf -y
SKILL.md
bio-crispr-screens-library-design.SKILL.mdname: bio-crispr-screens-library-design
description: CRISPR library design for genetic screens. Covers sgRNA selection, library composition, control design, and oligo ordering. Use when designing custom sgRNA libraries for knockout, activation, or interference screens.
tool_type: python
primary_tool: crispor
Version Compatibility
Reference examples tested with: BioPython 1.83+, MAGeCK 0.5+, numpy 1.26+, pandas 2.2+
Before using code patterns, verify installed versions match. If versions differ:
- Python: `pip show <package>` then `help(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.
Library Design
**"Design a custom CRISPR library for my screen"** → Select optimal sgRNAs for knockout, CRISPRi/a, or base editing libraries with on-target scoring, off-target filtering, and control guide design.
- Python: CRISPOR-based scoring with `BioPython` for sequence handling
sgRNA Selection Criteria
**Goal:** Score and rank candidate sgRNAs for a target gene based on design quality metrics.
**Approach:** Scan the gene sequence for PAM sites, extract 20-nt protospacer sequences, score each on GC content, poly-T avoidance, 5' G preference, and length, then return the top-ranked candidates.
import pandas as pd
import numpy as np
from Bio import SeqIO
from Bio.Seq import Seq
def score_sgrna(sequence, pam='NGG'):
'''Score sgRNA based on multiple criteria.'''
scores = {}
gc_content = (sequence.count('G') + sequence.count('C')) / len(sequence)
scores['gc_content'] = 1 - abs(gc_content - 0.5) * 2
if len(sequence) >= 4:
has_poly_t = 'TTTT' in sequence
scores['poly_t'] = 0 if has_poly_t else 1
starts_with_g = sequence.startswith('G')
scores['start_g'] = 1 if starts_with_g else 0.5
scores['length'] = 1 if len(sequence) == 20 else 0.8
overall = np.mean(list(scores.values()))
return overall, scores
def design_sgrnas_for_gene(gene_sequence, n_guides=4, pam='NGG'):
'''Design sgRNAs targeting a gene.'''
candidates = []
pam_pattern = pam.replace('N', '[ACGT]')
import re
for strand in ['+', '-']:
seq = gene_sequence if strand == '+' else str(Seq(gene_sequence).reverse_complement())
for match in re.finditer(f'([ACGT]{{20}})({pam_pattern})', seq):
sgrna = match.group(1)
position = match.start()
if strand == '-':
position = len(seq) - position - 23
score, details = score_sgrna(sgrna)
candidates.append({
'sequence': sgrna,
'pam': match.group(2),
'strand': strand,
'position': position,
'score': score,
'gc_content': (sgrna.count('G') + sgrna.count('C')) / 20,
**details
})
candidates_df = pd.DataFrame(candidates)
candidates_df = candidates_df.sort_values('score', ascending=False)
return candidates_df.head(n_guides)
gene_seq = 'ATGCGATCGATCGATCGATCGAATCGATCGATCGAGGCGATCGATCGATCGATCGAATCGATCGATCGAGGCGATCGATCGATCGATCGAATCGATCGATCGAGG'
guides = design_sgrnas_for_gene(gene_seq, n_guides=5)
print(guides[['sequence', 'position', 'strand', 'score', 'gc_content']])Library Composition
**Goal:** Assemble a complete sgRNA library targeting a list of genes with appropriate controls.
**Approach:** Design top-scoring guides for each gene, append non-targeting, essential-control, and safe-harbor-control guides, and compile into an ordered library table.
def design_library(gene_list, guides_per_gene=4, include_controls=True):
'''Design complete library for gene list.'''
library = []
for gene in gene_list:
gene_data = get_gene_sequence(gene)
guides = design_sgrnas_for_gene(gene_data['sequence'], n_guides=guides_per_gene)
for idx, guide in guides.iterrows():
library.append({
'gene': gene,
'gene_id': gene_data.get('ensembl_id', ''),
'guide_number': idx + 1,
'sequence': guide['sequence'],
'pam': guide['pam'],
'position': guide['position'],
'strand': guide['strand'],
'score': guide['score'],
'type': 'targeting'
})
if include_controls:
controls = design_control_guides()
library.extend(controls)
return pd.DataFrame(library)
def get_gene_sequence(gene_name):
'''Fetch gene sequence (placeholder - use Ensembl API or local files).'''
return {
'sequence': 'ATGC' * 250,
'ensembl_id': f'ENSG_{hash(gene_name) % 100000:05d}'
}
genes = ['TP53', 'BRCA1', 'KRAS', 'MYC', 'CDK4']
library = design_library(genes, guides_per_gene=4)
print(f'Library size: {len(library)} guides')
print(f'Genes: {library["gene"].nunique()}')Control Guide Design
**Goal:** Design control guide sets for normalization and quality assessment in CRISPR screens.
**Approach:** Generate random non-targeting sequences with acceptable GC content, add validated guides against known essential genes (positive controls) and safe-harbor loci (negative controls).
def design_control_guides(n_nontargeting=100, n_essential=20, n_nonessential=20):
'''Design control guides for library.'''
controls = []
for i in range(n_nontargeting):
sequence = generate_nontargeting_sequence()
controls.append({
'gene': f'NonTargeting_{i+1}',
'gene_id': '',
'guide_number': 1,
'sequence': sequence,
'pam': 'NGG',
'position': -1,
'strand': '',
'score': 0,
'type': 'non-targeting'
})
essential_genes = ['RPS3', 'RPL11', 'EIF3A', 'POLR2A', 'CDK1']
for gene in essential_genes[:n_essentRead more
name: bio-crispr-screens-library-design description: CRISPR library design for genetic screens. Covers sgRNA selection, library composition, control design, and oligo ordering. Use when designing custom sgRNA libraries for knockout, activation, or interference screens. tool_type: python primary_tool: crispor
Version Compatibility
Reference examples tested with: BioPython 1.83+, MAGeCK 0.5+, numpy 1.26+, pandas 2.2+
Before using code patterns, verify installed versions match. If versions differ:
- Python: `pip show <package>` then `help(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.
Library Design
**"Design a custom CRISPR library for my screen"** → Select optimal sgRNAs for knockout, CRISPRi/a, or base editing libraries with on-target scoring, off-target filtering, and control guide design.
- Python: CRISPOR-based scoring with `BioPython` for sequence handling
sgRNA Selection Criteria
**Goal:** Score and rank candidate sgRNAs for a target gene based on design quality metrics.
**Approach:** Scan the gene sequence for PAM sites, extract 20-nt protospacer sequences, score each on GC content, poly-T avoidance, 5' G preference, and length, then return the top-ranked candidates.
import pandas as pd
import numpy as np
from Bio import SeqIO
from Bio.Seq import Seq
def score_sgrna(sequence, pam='NGG'):
'''Score sgRNA based on multiple criteria.'''
scores = {}
gc_content = (sequence.count('G') + sequence.count('C')) / len(sequence)
scores['gc_content'] = 1 - abs(gc_content - 0.5) * 2
if len(sequence) >= 4:
has_poly_t = 'TTTT' in sequence
scores['poly_t'] = 0 if has_poly_t else 1
starts_with_g = sequence.startswith('G')
scores['start_g'] = 1 if starts_with_g else 0.5
scores['length'] = 1 if len(sequence) == 20 else 0.8
overall = np.mean(list(scores.values()))
return overall, scores
def design_sgrnas_for_gene(gene_sequence, n_guides=4, pam='NGG'):
'''Design sgRNAs targeting a gene.'''
candidates = []
pam_pattern = pam.replace('N', '[ACGT]')
import re
for strand in ['+', '-']:
seq = gene_sequence if strand == '+' else str(Seq(gene_sequence).reverse_complement())
for match in re.finditer(f'([ACGT]{{20}})({pam_pattern})', seq):
sgrna = match.group(1)
position = match.start()
if strand == '-':
position = len(seq) - position - 23
score, details = score_sgrna(sgrna)
candidates.append({
'sequence': sgrna,
'pam': match.group(2),
'strand': strand,
'position': position,
'score': score,
'gc_content': (sgrna.count('G') + sgrna.count('C')) / 20,
**details
})
candidates_df = pd.DataFrame(candidates)
candidates_df = candidates_df.sort_values('score', ascending=False)
return candidates_df.head(n_guides)
gene_seq = 'ATGCGATCGATCGATCGATCGAATCGATCGATCGAGGCGATCGATCGATCGATCGAATCGATCGATCGAGGCGATCGATCGATCGATCGAATCGATCGATCGAGG'
guides = design_sgrnas_for_gene(gene_seq, n_guides=5)
print(guides[['sequence', 'position', 'strand', 'score', 'gc_content']])Library Composition
**Goal:** Assemble a complete sgRNA library targeting a list of genes with appropriate controls.
**Approach:** Design top-scoring guides for each gene, append non-targeting, essential-control, and safe-harbor-control guides, and compile into an ordered library table.
def design_library(gene_list, guides_per_gene=4, include_controls=True):
'''Design complete library for gene list.'''
library = []
for gene in gene_list:
gene_data = get_gene_sequence(gene)
guides = design_sgrnas_for_gene(gene_data['sequence'], n_guides=guides_per_gene)
for idx, guide in guides.iterrows():
library.append({
'gene': gene,
'gene_id': gene_data.get('ensembl_id', ''),
'guide_number': idx + 1,
'sequence': guide['sequence'],
'pam': guide['pam'],
'position': guide['position'],
'strand': guide['strand'],
'score': guide['score'],
'type': 'targeting'
})
if include_controls:
controls = design_control_guides()
library.extend(controls)
return pd.DataFrame(library)
def get_gene_sequence(gene_name):
'''Fetch gene sequence (placeholder - use Ensembl API or local files).'''
return {
'sequence': 'ATGC' * 250,
'ensembl_id': f'ENSG_{hash(gene_name) % 100000:05d}'
}
genes = ['TP53', 'BRCA1', 'KRAS', 'MYC', 'CDK4']
library = design_library(genes, guides_per_gene=4)
print(f'Library size: {len(library)} guides')
print(f'Genes: {library["gene"].nunique()}')Control Guide Design
**Goal:** Design control guide sets for normalization and quality assessment in CRISPR screens.
**Approach:** Generate random non-targeting sequences with acceptable GC content, add validated guides against known essential genes (positive controls) and safe-harbor loci (negative controls).
def design_control_guides(n_nontargeting=100, n_essential=20, n_nonessential=20):
'''Design control guides for library.'''
controls = []
for i in range(n_nontargeting):
sequence = generate_nontargeting_sequence()
controls.append({
'gene': f'NonTargeting_{i+1}',
'gene_id': '',
'guide_number': 1,
'sequence': sequence,
'pam': 'NGG',
'position': -1,
'strand': '',
'score': 0,
'type': 'non-targeting'
})
essential_genes = ['RPS3', 'RPL11', 'EIF3A', 'POLR2A', 'CDK1']
for gene in essential_genes[:n_essentOther skills on openclaw-medical-skills.
adaptyv
Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental…
adhd-daily-planner
Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time…
aeon
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting,…
agent-browser
Browse the web for any task — research topics, read articles, interact with web apps, fill forms, take screenshots, extract data,…
More skills from other plugins.
paddleocr-doc-parsing
Use this skill to extract structured Markdown/JSON from PDFs and document images—tables with cell-level precision, formulas as…
13c-metabolic-flux
Estimates intracellular metabolic fluxes from steady-state carbon-13 isotope-tracing measurements using validated atom maps,…
Questions about bio-crispr-screens-library-design.
- Which coding agents can use bio-crispr-screens-library-design?
- bio-crispr-screens-library-design installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

