| name | gcell-dna |
| description | DNA sequence and motif analysis using gcell. Use this skill when users ask about:
- Loading and manipulating DNA sequences
- Genome assembly access (hg38, hg19, mm10)
- Motif scanning with HOCOMOCO motifs
- Working with genomic regions (BED, narrowPeak files)
- Transcription factor binding site prediction
Triggers: DNA sequence, motif scanning, HOCOMOCO, genomic regions, BED file, narrowPeak, genome, transcription factor binding
|
DNA Sequence and Motif Analysis
Genome Access
from gcell.dna.genome import Genome
genome = Genome('hg38')
genome = Genome('hg19')
genome = Genome('mm10')
seq = genome.get_sequence('chr1', 1000000, 1001000)
seq = genome.get_sequence('chr17', 41196312, 41277500)
DNA Sequences
from gcell.dna.sequence import DNASequence
seq = DNASequence('ATCGATCGATCG')
rc = seq.reverse_complement()
gc_content = seq.gc_content()
Genomic Regions
from gcell.dna.region import GenomicRegionCollection
regions = GenomicRegionCollection.read_bed('peaks.bed')
regions = GenomicRegionCollection.read_narrowpeak('peaks.narrowPeak')
sequences = regions.get_sequences(genome)
filtered = regions.filter(lambda r: r.length > 200)
merged = regions.merge()
Motif Scanning with HOCOMOCO
from gcell.dna.motif import MotifCollection, Motif
motifs = MotifCollection.from_hocomoco(version='v11')
stat3 = motifs['STAT3']
p53 = motifs['TP53']
hits = motifs.scan(seq, pvalue=1e-4)
for region_seq in sequences:
hits = motifs.scan(region_seq, pvalue=1e-4)
for hit in hits:
print(hit.motif_name, hit.start, hit.end, hit.strand, hit.score)
Single Motif Operations
pwm = motif.pwm
score = motif.score(seq)
consensus = motif.consensus
hits = motif.scan(seq, pvalue=1e-4)
Key Classes
| Class | Purpose |
|---|
Genome | Reference genome access |
DNASequence | DNA sequence operations |
GenomicRegionCollection | BED/peak file handling |
MotifCollection | Collection of TF motifs |
Motif | Single motif PWM and scanning |
Data Location
- Genomes:
~/.gcell_data/genomes/
- Override:
GCELL_GENOME_DIR environment variable