๐ง Motif Discovery Fundamentals
๐ฏ What is Motif Discovery?
Motif discovery is the computational identification of short, recurring, conserved sequence patterns (motifs) in DNA, RNA, or protein sequences. It's used to find transcription factor binding sites, regulatory elements, splice sites, and functional signatures that are over-represented in a set of sequences. It's a cornerstone of regulatory genomics and epigenomics.
Why It Matters
TF Binding: Regulatory sites. Enhancers: Discovery. Splicing: Splice sites. Function: Protein motifs. Disease: Regulatory variants. Networks: Gene regulation.
# Motif Discovery โ the big picture
# Finding recurring patterns in sequences.
# CONCEPTUAL OVERVIEW
print("""
=== Motif Discovery ===
What it is:
- Find recurring patterns
- Short sequences (6-20 bp)
- Over-represented
- Functional sites
Why it matters:
- TF binding sites
- Enhancers
- Promoters
- Splice sites
- Protein motifs
- Regulatory networks
Types of motifs:
- DNA motifs (TF binding)
- RNA motifs (splicing, structure)
- Protein motifs (domains, active sites)
- Structural motifs
Representations:
- Consensus sequence
- PWM / PSSM
- IUPAC codes
- Regular expressions
- HMM
Discovery methods:
- Enumerative (DREME, STREME)
- Probabilistic (MEME)
- Bayesian (Gibbs)
- Combinatorial (HOMER)
Workflow:
1. Collect sequences
2. Identify motifs (MEME, HOMER)
3. Compare to databases (JASPAR)
4. Scan genome (FIMO)
5. Annotate
6. Validate
Applications:
- ChIP-Seq analysis
- ATAC-Seq analysis
- Enhancer discovery
- Regulatory variants
- Gene networks
- Disease mechanisms
""")
# WHY IT MATTERS
print("=== Why It Matters ===")
print("""
Biological questions:
- What TFs bind these regions?
- What are the regulatory elements?
- How is gene expression controlled?
- What motifs are enriched in peaks?
- How do variants affect binding?
Motif discovery answers:
- Binding motifs
- Regulatory logic
- Networks
- Functional sites
- Disease mechanisms
""")
# HISTORICAL CONTEXT
print("=== Historical Context ===")
print("""
1980s: Consensus sequences
1990s: MEME, Gibbs sampling
2000s: HOMER, DREME, JASPAR
2010s: ChIP-Seq era, MEME-ChIP
2020s: Deep learning, single-cell
""")
# CHALLENGES
print("=== Challenges ===")
print("""
1. MOTIF LENGTH
- Short motifs
- Many false positives
- Degenerate
2. BACKGROUND
- Composition bias
- Dinucleotide bias
- Need good background
3. MULTIPLE MOTIFS
- Co-occurring
- Composite
- Cooperative
4. REPEATS
- Low complexity
- Masking needed
5. VALIDATION
- Functional testing
- Conservation
- ChIP-Seq
""")๐ฏ Why Motif Discovery Matters
๐ฏ The Value of Motif Discovery
Motif discovery is the key to understanding gene regulation, interpreting ChIP-Seq peaks, and decoding regulatory variants.
Key Applications
ChIP-Seq: TF motifs. ATAC-Seq: Regulatory. Enhancers: Discovery. Variants: Impact. Networks: Regulation. Disease: Mechanisms.
# Why Motif Discovery Matters
print("=== 1. ChIP-Seq Analysis ===")
print("""
ChIP-Seq:
- TF binding sites
- Peaks
- Motif discovery
Workflow:
1. ChIP-Seq
2. Peak calling
3. Extract sequences
4. Motif discovery (MEME, HOMER)
5. Compare to JASPAR
6. Validate
Examples:
- p53 motifs
- CTCF motifs
- OCT4 motifs
- NF-ฮบB motifs
Tools:
- MEME-ChIP
- HOMER
- ChIPseeker
""")
print("\n=== 2. Enhancer Discovery ===")
print("""
Enhancers:
- Distal regulatory
- H3K27ac peaks
- TF motifs
Workflow:
1. H3K27ac ChIP-Seq
2. Peak calling
3. Motif discovery
4. TF assignment
5. Networks
Examples:
- Cell-type specific
- Cancer enhancers
- Super-enhancers
Tools:
- HOMER
- MEME
- ROSE
""")
print("\n=== 3. Regulatory Variants ===")
print("""
Variants:
- GWAS hits
- eQTLs
- Motif disruption
Workflow:
1. Variant
2. Reference motif
3. Alternate motif
4. Score change
5. Impact
Tools:
- FIMO
- JASPAR
- motifbreakR
- atSNP
""")
print("\n=== 4. Gene Regulatory Networks ===")
print("""
Networks:
- TF โ target genes
- Motif in promoters
- Network inference
Workflow:
1. ChIP-Seq / ATAC
2. Motif discovery
3. Target genes
4. Network
5. Analysis
Tools:
- HOMER
- MEME
- RcisTarget
- SCENIC
""")
print("\n=== 5. Splicing Regulation ===")
print("""
Splicing:
- Splice sites
- ESE/ESS
- ISE/ISS
Motifs:
- Donor: GT
- Acceptor: AG
- Branch point
- Polypyrimidine tract
Tools:
- MEME
- SpliceAid
- ESEfinder
- MaxEntScan
""")
print("\n=== 6. Protein Motifs ===")
print("""
Protein motifs:
- Domains
- Active sites
- Binding sites
Examples:
- Walker A: GXXXXGK[ST]
- Zinc finger: CXXC
- N-glycosylation: NX[ST]
- Nuclear localization: K[KR]X[KR]
Tools:
- PROSITE
- Pfam
- ELM
- MEME
""")
print("\n=== 7. RNA Motifs ===")
print("""
RNA motifs:
- Binding sites
- Structural
- Regulatory
Examples:
- RBP motifs
- Riboswitches
- miRNA seeds
Tools:
- MEME
- HOMER
- RNAcontext
- GraphProt
""")
print("\n=== 8. Disease Mechanisms ===")
print("""
Disease:
- Regulatory variants
- Enhancer hijacking
- Motif disruption
Workflow:
1. Variant
2. Motif
3. Impact
4. Mechanism
5. Treatment
Examples:
- Cancer
- Autoimmune
- Neurodegenerative
""")๐งฌ Types of Motifs
๐ฏ Many Kinds of Patterns
Motifs come in many forms: DNA, RNA, protein, and structural. Each has its own discovery methods.
Types
DNA: TF binding. RNA: Splicing, RBP. Protein: Domains. Structural: 3D. Regulatory: Enhancers. Consensus: Sequence.
# Types of Motifs
print("=== 1. DNA Motifs ===")
print("""
DNA motifs:
- TF binding sites
- Regulatory elements
- Promoters, enhancers
- 6-20 bp
Examples:
- TATA box: TATAAA
- GC box: GGGCGG
- CCAAT box: CCAAT
- p53: RRRCWWGYYY
- CTCF: CCCTC
Databases:
- JASPAR
- HOCOMOCO
- CIS-BP
- UniPROBE
""")
print("\n=== 2. RNA Motifs ===")
print("""
RNA motifs:
- Splicing signals
- RBP binding sites
- Structural elements
- miRNA targets
Examples:
- 5' splice site: GURAGU
- 3' splice site: YAG
- Branch point: YNYURAY
- miRNA seed: 2-8 nt
Tools:
- MEME
- HOMER
- RNAcontext
- GraphProt
""")
print("\n=== 3. Protein Motifs ===")
print("""
Protein motifs:
- Domains
- Active sites
- Binding sites
- Modification sites
Examples:
- Walker A: GXXXXGK[ST]
- Walker B: [RK]XXXXGXXXX[LIVMF]
- Zinc finger: CXXC
- N-glycosylation: NX[ST]
- NLS: K[KR]X[KR]
Databases:
- PROSITE
- Pfam
- ELM
- InterPro
""")
print("\n=== 4. Structural Motifs ===")
print("""
Structural motifs:
- 3D patterns
- Folds
- Supersecondary
Examples:
- Helix-turn-helix
- Zinc finger
- Leucine zipper
- ฮฒ-hairpin
- Greek key
Databases:
- CATH
- SCOP
- PROSITE
""")
print("\n=== 5. Regulatory Motifs ===")
print("""
Regulatory motifs:
- Enhancers
- Promoters
- Insulators
- Silencers
Examples:
- Enhancer: cell-type specific
- Promoter: TATA, CpG
- Insulator: CTCF
- Silencer: REST
Tools:
- HOMER
- MEME
- ChIPseeker
""")
print("\n=== 6. Composite Motifs ===")
print("""
Composite motifs:
- Multiple TFs
- Cooperative binding
- Clusters
Examples:
- NF-ฮบB + IRF
- STAT + GATA
- OCT4 + SOX2
- AP-1 + NFAT
Tools:
- MCAST
- Cluster-Buster
- Cister
""")
print("\n=== 7. Repeat Motifs ===")
print("""
Repeat motifs:
- Tandem repeats
- STRs
- Microsatellites
Examples:
- (CAG)n: Huntington's
- (CGG)n: Fragile X
- (GAA)n: Friedreich's
Tools:
- Tandem Repeats Finder
- TRF
- RepeatMasker
""")
print("\n=== 8. Consensus Sequences ===")
print("""
Consensus:
- Most common base
- IUPAC codes
- Simple
IUPAC:
A: A
C: C
G: G
T: T
R: A/G
Y: C/T
S: G/C
W: A/T
K: G/T
M: A/C
N: Any
Example:
p53: RRRCWWGYYY
Meaning:
R = A/G
W = A/T
Y = C/T
""")๐ PWM & PSSM
๐ฏ Representing Motifs Numerically
A Position Weight Matrix (PWM) is the standard numerical representation of a motif, giving a score for each base at each position.
PWM
PWM: Position weight. PSSM: Scoring matrix. Frequencies: Counts. Log-odds: Scores. Background: Correction. Logo: Visualization.
# PWM & PSSM
print("=== Position Weight Matrix ===")
print(""
PWM:
- Position Weight Matrix
- 4 x L (DNA)
- 20 x L (protein)
- Frequencies or log-odds
Example (DNA):
Position: 1 2 3 4 5 6
A: 0.1 0.6 0.1 0.1 0.1 0.1
C: 0.1 0.1 0.1 0.6 0.1 0.1
G: 0.7 0.2 0.1 0.2 0.1 0.1
T: 0.1 0.1 0.7 0.1 0.7 0.7
Consensus: G A T C T T
""")
print("\n=== PSSM (Log-Odds) ===")
print(""
PSSM:
- Position-Specific Scoring Matrix
- Log-odds
- Background correction
Formula:
score(i,j) = log2( f(i,j) / b(j) )
Where:
f(i,j) = frequency of base j at position i
b(j) = background frequency
Example:
f = 0.7, b = 0.25
score = log2(0.7/0.25) = 1.49
f = 0.1, b = 0.25
score = log2(0.1/0.25) = -1.32
""")
print("\n=== Information Content ===")
print(""
Information content:
IC = log2(4) - H
H = Shannon entropy
Formula:
H = -ฮฃ p(i) log2 p(i)
Example:
All A: H = 0, IC = 2 bits
Random: H = 2, IC = 0 bits
Logo:
- Height = IC
- Letter size = frequency
- Conserved = tall
- Variable = short
""")
print("\n=== PWM Formats ===")
print(""
MEME:
- Text format
- Frequencies
- With background
JASPAR:
- PFM: Position Frequency Matrix
- PWM: Log-odds
- PFM โ PWM
TRANSFAC:
- Matrix format
- Frequencies
HOMER:
- Motif file
- Frequencies
- Log-odds
""")
print("\n=== Example MEME ===")
print(""
MEME version 5.0
ALPHABET= ACGT
strands: + -
Background letter frequencies
A 0.25 C 0.25 G 0.25 T 0.25
MOTIF p53
letter-probability matrix: alength= 4 w= 10 nsites= 100 E= 1e-50
0.100 0.100 0.700 0.100
0.600 0.100 0.200 0.100
0.700 0.100 0.100 0.100
0.100 0.600 0.100 0.200
...
""")
print("\n=== Example JASPAR ===")
print(""
>MA0001.1 AGL3
A [ 0 3 79 40 66 48 65 11 65 0 ]
C [94 75 4 3 1 2 5 2 3 3 ]
G [ 1 0 3 4 1 0 5 3 28 88 ]
T [ 2 19 11 50 29 47 22 81 1 6 ]
""")
print("\n=== Tools ===")
print(""
1. MEME
- PWM generation
- Discovery
2. JASPAR
- Database
- PFM/PWM
3. Biopython
- Motif parsing
- PSSM
4. TFBSTools (R)
- PWM manipulation
- Scanning
5. Logomaker (Python)
- Logo visualization
""")
print("\n=== Best Practices ===")
print(""
1. Use log-odds
2. Correct background
3. Use pseudocounts
4. Check IC
5. Visualize logos
6. Validate
7. Report parameters
""")โ๏ธ Discovery Algorithms
๐ฏ How Motifs Are Found
Motif discovery algorithms fall into several categories: enumerative, probabilistic, Bayesian, and combinatorial.
Algorithms
Enumerative: DREME. Probabilistic: MEME. Bayesian: Gibbs. Combinatorial: HOMER. Consensus: Simple. HMM: Profile.
# Discovery Algorithms
print("=== 1. Enumerative ===")
print(""
Enumerative:
- Enumerate all k-mers
- Count occurrences
- Statistical significance
Steps:
1. Extract k-mers (k=6-10)
2. Count in input
3. Compare to background
4. Score
5. Report
Pros:
- Fast
- Complete
- No local optima
Cons:
- k limited
- Degenerate motifs
Tools:
- DREME
- STREME
- Weeder
- YMF
""")
print("\n=== 2. Probabilistic ===")
print(""
Probabilistic:
- PWM
- Expectation-Maximization
- Local optima
Steps:
1. Initialize PWM
2. E-step: assign sites
3. M-step: update PWM
4. Repeat until convergence
Pros:
- Handles degeneracy
- PWM output
- Standard
Cons:
- Local optima
- Needs initialization
- Multiple runs
Tools:
- MEME
- AlignACE
- Consensus
""")
print("\n=== 3. Bayesian ===")
print(""
Bayesian:
- Gibbs sampling
- Posterior
- Flexible
Steps:
1. Initialize
2. Sample motif positions
3. Update PWM
4. Repeat
5. Posterior
Pros:
- No local optima
- Uncertainty
- Flexible
Cons:
- Slow
- Convergence
- Complex
Tools:
- Gibbs Motif Sampler
- BioProspector
- MODELLER
""")
print("\n=== 4. Combinatorial ===")
print(""
Combinatorial:
- Known motifs
- De novo
- HOMER
Steps:
1. Enumerate
2. Score
3. Compare to database
4. Report
Pros:
- Fast
- Known + de novo
- Annotation
Cons:
- k limited
- Simple motifs
Tools:
- HOMER
- Pscan
- Clover
""")
print("\n=== 5. Consensus ===")
print(""
Consensus:
- Simple
- Most common base
- IUPAC
Methods:
- Frequency
- Threshold
- IUPAC
Pros:
- Simple
- Fast
- Interpretable
Cons:
- Loses info
- No scoring
- Not quantitative
Tools:
- Simple scripts
- Consensus
""")
print("\n=== 6. HMM ===")
print(""
HMM (Hidden Markov Model):
- Profile HMM
- Probabilistic
- Flexible
Steps:
1. Build HMM
2. Train
3. Score
4. Align
Pros:
- Flexible
- Indels
- Probabilistic
Cons:
- Complex
- Slow
Tools:
- HMMER
- SAM
- Profile HMM
""")
print("\n=== Algorithm Comparison ===")
print(f"{'Algorithm':<20} {'Speed':<15} {'Accuracy':<15} {'Tools':<20}")
print("-" * 70)
print(f"{'Enumerative':<20} {'Fast':<15} {'Good':<15} {'DREME':<20}")
print(f"{'Probabilistic':<20} {'Medium':<15} {'Good':<15} {'MEME':<20}")
print(f"{'Bayesian':<20} {'Slow':<15} {'Good':<15} {'Gibbs':<20}")
print(f"{'Combinatorial':<20} {'Fast':<15} {'Good':<15} {'HOMER':<20}")
print(f"{'Consensus':<20} {'Very fast':<15} {'Basic':<15} {'Scripts':<20}")
print(f"{'HMM':<20} {'Medium':<15} {'Excellent':<15} {'HMMER':<20}")
print("\n=== Choosing ===")
print(""
Choose algorithm:
- Fast: DREME, STREME
- Comprehensive: MEME
- Known + de novo: HOMER
- Long motifs: MEME
- Short motifs: DREME
- Protein: MEME, HMMER
- Flexible: Gibbs
""")๐ฏ MEME Suite
๐ฏ The Comprehensive Toolkit
The MEME Suite is the most comprehensive collection of motif discovery and analysis tools.
MEME
MEME: Discovery. DREME: Short motifs. STREME: Fast. FIMO: Scanning. MAST: Search. TOMTOM: Compare. MEME-ChIP: ChIP.
# MEME Suite
print("=== MEME ===")
print(""
MEME:
- De novo discovery
- Probabilistic
- PWM
- Comprehensive
Command:
meme input.fa \
-dna \
-oc meme_output \
-nmotifs 10 \
-minw 6 \
-maxw 20 \
-mod zoops
Options:
-dna: DNA sequences
-nmotifs: Number (10)
-minw: Min width (6)
-maxw: Max width (20)
-mod: Distribution (zoops, anr, oops)
Output:
meme.txt
meme.html
meme.xml
""")
print("\n=== DREME ===")
print(""
DREME:
- Short motifs
- Enumerative
- Fast
Command:
dreme -p input.fa -o dreme_output
Options:
-p: Primary sequences
-n: Background
-e: E-value
-m: Max motifs
Output:
dreme.txt
dreme.html
""")
print("\n=== STREME ===")
print(""
STREME:
- Fast
- Sensitive
- Enumerative
Command:
streme --p input.fa --o streme_output
Options:
--p: Primary sequences
--n: Background
--thresh: Threshold
Output:
streme.txt
streme.html
""")
print("\n=== FIMO ===")
print(""
FIMO:
- Scan sequences
- PWM matching
- P-values
Command:
fimo motif.meme genome.fa > fimo.txt
Options:
--thresh: P-value threshold
--bgfile: Background
--parse-genomic-coord
Output:
fimo.txt
fimo.html
""")
print("\n=== MAST ===")
print(""
MAST:
- Motif search
- Multiple motifs
- E-values
Command:
mast motif.meme genome.fa > mast.txt
Options:
-mt: Motif threshold
-ev: E-value
Output:
mast.txt
mast.html
""")
print("\n=== TOMTOM ===")
print(""
TOMTOM:
- Compare motifs
- Database matching
- E-values
Command:
tomtom query.meme database.meme -oc tomtom_output
Options:
-thresh: Threshold
-dist: Distance
Output:
tomtom.tsv
tomtom.html
""")
print("\n=== MEME-ChIP ===")
print(""
MEME-ChIP:
- ChIP-Seq analysis
- Peak sequences
- Comprehensive
Command:
meme-chip peaks.fa -oc meme_chip_output
Options:
-db: Database (JASPAR)
-meme-nmotifs: Number
-dreme-e: E-value
Output:
meme-chip.html
combined.meme
""")
print("\n=== Other MEME Tools ===")
print(""
1. CentriMo
- Central motif enrichment
- ChIP-Seq
2. SpaMo
- Spacing analysis
- Composite motifs
3. GOMo
- Gene ontology
- Motif function
4. MCAST
- Cluster analysis
- Composite motifs
5. AME
- Motif enrichment
- Known motifs
""")
print("\n=== Workflow ===")
print(""
1. Extract sequences:
bedtools getfasta -fi genome.fa -bed peaks.bed -fo peaks.fa
2. Discover motifs:
meme peaks.fa -dna -oc meme_output
3. Compare to JASPAR:
tomtom meme_output/meme.txt JASPAR2020.meme -oc tomtom
4. Scan genome:
fimo meme_output/meme.txt genome.fa > fimo.txt
5. Enrichment:
ame peaks.fa JASPAR2020.meme -o ame_output
""")๐ HOMER
๐ฏ Known + De Novo Discovery
HOMER (Hypergeometric Optimization of Motif EnRichment) is a popular tool for combined known and de novo motif discovery.
HOMER
Known: Database. De novo: Discovery. Fast: Efficient. Annotation: Genes. ChIP: Peaks. Standard: Popular.
# HOMER
print("=== Basic Usage ===")
print(""
HOMER:
- Known + de novo
- Fast
- Popular
Command:
findMotifsGenome.pl peaks.bed hg38 homer_output \
-size 200 \
-mask
Options:
-size: Peak size
-mask: Repeat masking
-bg: Background
-len: Motif lengths
-S: Number of motifs
Output:
homer_results.html
knownResults.txt
homerMotifs.all.meme
""")
print("\n=== Input Types ===")
print(""
BED:
findMotifsGenome.pl peaks.bed hg38 output
FASTA:
findMotifs.pl input.fa output
Positions:
findMotifsGenome.pl positions.txt hg38 output
Peak file:
findMotifsGenome.pl peaks.txt hg38 output -size 200
""")
print("\n=== Known Motifs ===")
print(""
Known motifs:
- HOMER database
- JASPAR
- Custom
Command:
findMotifsGenome.pl peaks.bed hg38 output -known
Output:
knownResults.txt
Columns:
- Motif name
- Consensus
- P-value
- Log P
- Target %
- Background %
""")
print("\n=== De Novo ===")
print(""
De novo:
- Discover from scratch
- Rich motifs
- Standard
Command:
findMotifsGenome.pl peaks.bed hg38 output -size 200
Output:
homerMotifs.all.meme
homerResults.html
""")
print("\n=== Annotation ===")
print(""
Annotation:
- Associate peaks with genes
- Nearest gene
- GO
Command:
annotatePeaks.pl peaks.bed hg38 > annotation.txt
Options:
-go: GO analysis
-genome: Genome
-gtf: Custom annotation
Output:
annotation.txt
Columns:
- Peak
- Nearest gene
- Distance
- Feature
""")
print("\n=== HOMER Databases ===")
print(""
Supported:
- Human (hg19, hg38)
- Mouse (mm9, mm10)
- Rat (rn5, rn6)
- Zebrafish (danRer10)
- Drosophila (dm3, dm6)
- C. elegans (ce10)
- Yeast (sacCer3)
- Arabidopsis (tair10)
- Many more
""")
print("\n=== Custom Databases ===")
print(""
Custom:
- Custom genome
- Custom motifs
Prepare:
loadGenome.pl -org custom -fasta genome.fa -gtf genes.gtf
Use:
findMotifsGenome.pl peaks.bed custom output
""")
print("\n=== Best Practices ===")
print(""
1. Use -mask
2. Use appropriate size
3. Use background
4. Check known motifs
5. Check de novo
6. Annotate
7. Validate
8. Report
""")โก DREME & STREME
๐ฏ Fast Short Motif Discovery
DREME and STREME are fast, enumerative tools for discovering short motifs, especially in ChIP-Seq peaks.
DREME & STREME
DREME: Short motifs. STREME: Fast, sensitive. Enumerative: Complete. Discriminative: Primary vs control. Fast: Efficient. ChIP: Peaks.
# DREME & STREME
print("=== DREME ===")
print(""
DREME:
- Short motifs
- Enumerative
- Fast
Command:
dreme -p peaks.fa -o dreme_output
Options:
-p: Primary sequences
-n: Control sequences
-e: E-value threshold
-m: Max motifs
-k: k-mer size
Output:
dreme.txt
dreme.html
""")
print("\n=== STREME ===")
print(""
STREME:
- Fast
- Sensitive
- Enumerative
Command:
streme --p peaks.fa --o streme_output
Options:
--p: Primary sequences
--n: Control sequences
--thresh: Threshold
--verbosity: Verbosity
Output:
streme.txt
streme.html
""")
print("\n=== Comparison ===")
print(f"{'Feature':<20} {'DREME':<20} {'STREME':<20}")
print("-" * 60)
print(f"{'Speed':<20} {'Fast':<20} {'Very fast':<20}")
print(f"{'Motif length':<20} {'Short (4-8)':<20} {'Short (4-15)':<20}")
print(f"{'Sensitivity':<20} {'Good':<20} {'Excellent':<20}")
print(f"{'Discriminative':<20} {'Yes':<20} {'Yes':<20}")
print(f"{'Output':<20} {'MEME':<20} {'MEME':<20}")
print("\n=== Discriminative ===")
print(""
Discriminative:
- Primary vs control
- Enriched motifs
- Reduces false positives
Example:
Primary: ChIP-Seq peaks
Control: Shuffled / background
Output:
- Motifs enriched in primary
- Statistically significant
- Ranked by E-value
""")
print("\n=== Workflow ===")
print(""
1. Extract sequences:
bedtools getfasta -fi genome.fa -bed peaks.bed -fo peaks.fa
2. Generate control:
fasta-shuffle-letters peaks.fa control.fa
3. Run DREME:
dreme -p peaks.fa -n control.fa -o dreme_output
4. Compare:
tomtom dreme_output/dreme.txt JASPAR2020.meme -oc tomtom
""")
print("\n=== Best Practices ===")
print(""
1. Use control
2. Use appropriate k
3. Check E-value
4. Compare to databases
5. Combine with MEME
6. Validate
7. Report
""")๐ Motif Scanning (FIMO, MAST)
๐ฏ Finding Known Motifs in Sequences
Motif scanning searches sequences for matches to known motifs using PWMs, producing p-values and positions.
Scanning
FIMO: Individual motifs. MAST: Multiple motifs. P-value: Significance. PWM: Scoring. Genome: Scan. Annotation: Sites.
# Motif Scanning
print("=== FIMO ===")
print(""
FIMO:
- Find Individual Motif Occurrences
- PWM matching
- P-values
Command:
fimo motif.meme genome.fa > fimo.txt
Options:
--thresh: P-value threshold (1e-4)
--bgfile: Background
--parse-genomic-coord
--max-stored-scores
Output:
fimo.txt
fimo.html
Columns:
- Motif ID
- Sequence name
- Start
- Stop
- Strand
- Score
- P-value
- Q-value
- Matched sequence
""")
print("\n=== MAST ===")
print(""
MAST:
- Motif Alignment and Search Tool
- Multiple motifs
- E-values
Command:
mast motif.meme genome.fa > mast.txt
Options:
-mt: Motif threshold
-ev: E-value
-di: Diagram
Output:
mast.txt
mast.html
""")
print("\n=== Example FIMO ===")
print(""
#motif_id motif_alt_id sequence_name start stop strand score p-value q-value matched_sequence
p53 MA0001.1 chr1 1000 1010 + 12.5 1e-5 1e-4 GGACATGTCC
p53 MA0001.1 chr1 2000 2010 - 11.8 2e-5 1e-4 GGACATGTCC
CTCF MA0139.1 chr1 3000 3014 + 15.2 1e-6 1e-5 CCCTCCTGG
""")
print("\n=== Scanning Workflow ===")
print(""
1. Get motif:
- JASPAR
- HOMER
- MEME output
2. Get sequences:
- Genome
- Peaks
- Promoters
3. Scan:
fimo motif.meme sequences.fa > fimo.txt
4. Filter:
awk '$7 < 1e-4' fimo.txt > significant.txt
5. Annotate:
bedtools intersect -a fimo.bed -b genes.bed
""")
print("\n=== Scanning Genomes ===")
print(""
Genome-wide:
fimo --parse-genomic-coord motif.meme genome.fa > genome_fimo.txt
Large genomes:
- Split by chromosome
- Parallel processing
- Use background
Memory:
- Use --max-stored-scores
- Use --thresh
- Use --bgfile
""")
print("\n=== Scanning Peaks ===")
print(""
Peaks:
bedtools getfasta -fi genome.fa -bed peaks.bed -fo peaks.fa
fimo motif.meme peaks.fa > peaks_fimo.txt
Enrichment:
- Compare to background
- AME
- CentriMo
""")
print("\n=== Best Practices ===")
print(""
1. Use appropriate threshold
2. Use background
3. Use genomic coordinates
4. Filter by p-value
5. Annotate
6. Compare to ChIP
7. Validate
8. Report
""")๐๏ธ Databases (JASPAR, HOCOMOCO)
๐ฏ Known Motif Collections
Motif databases provide curated collections of known PWMs for TFs, RBPs, and other regulatory factors.
Databases
JASPAR: Open. HOCOMOCO: Human/mouse. CIS-BP: Large. UniPROBE: PBM. TRANSFAC: Commercial. Jolma: HT-SELEX.
# Motif Databases
print("=== JASPAR ===")
print(""
JASPAR:
- Open access
- Curated
- Multiple species
- Standard
Collections:
- CORE: Verified
- UNVALIDATED
- PLANTA
- INSECTA
- VERTEBRATA
Formats:
- PFM (frequencies)
- PWM (log-odds)
- MEME
- TRANSFAC
Download:
https://jaspar.genereg.net/downloads/
URL:
https://jaspar.genereg.net/
""")
print("\n=== HOCOMOCO ===")
print(""
HOCOMOCO:
- Human + mouse
- High quality
- Comprehensive
Versions:
- v11 (current)
- v12 (2024)
Collections:
- A: High confidence
- B: Medium
- C: Low
Download:
https://hocomoco11.autosome.org/
URL:
https://hocomoco11.autosome.org/
""")
print("\n=== CIS-BP ===")
print(""
CIS-BP:
- Large
- Many species
- TF motifs
Features:
- 1000s of TFs
- Many species
- Direct + indirect
URL:
http://cisbp.ccbr.utoronto.ca/
""")
print("\n=== UniPROBE ===")
print(""
UniPROBE:
- Protein binding microarray
- PBM data
- High throughput
Features:
- 8-mer scores
- Many TFs
- Mouse + human
URL:
http://thebrain.bwh.harvard.edu/uniprobe/
""")
print("\n=== TRANSFAC ===")
print(""
TRANSFAC:
- Commercial
- Comprehensive
- Curated
Features:
- TF motifs
- Regulation
- Pathways
URL:
https://gene-regulation.com/
""")
print("\n=== Other Databases ===")
print(""
1. JASPAR
2. HOCOMOCO
3. CIS-BP
4. UniPROBE
5. TRANSFAC
6. Jolma 2013
7. HT-SELEX
8. FactorBook
9. ReMap
10. GTRD
""")
print("\n=== Downloading ===")
print(""
JASPAR:
wget https://jaspar.genereg.net/download/data/2022/CORE/JASPAR2022_CORE_vertebrates_non-redundant_pfms_meme.txt
HOCOMOCO:
wget https://hocomoco11.autosome.org/final_bundle/hocomoco11/full/HUMAN/mono/HOCOMOCOv11_full_HUMAN_mono_meme_format.meme
CIS-BP:
wget http://cisbp.ccbr.utoronto.ca/data/2.00/DataFiles/Mus_musculus_2022_08_23_12-41_pm.zip
""")
print("\n=== Best Practices ===")
print(""
1. Use appropriate database
2. Use non-redundant
3. Filter by quality
4. Compare multiple
5. Check species
6. Use latest version
7. Cite
8. Report
""")๐ Python Integration
๐ฏ Motif Discovery from Python
You can run MEME, HOMER, and FIMO from Python and analyze motifs with Biopython, pandas, and logomaker.
Python
subprocess: Run CLI. Biopython: Motifs. pandas: Results. logomaker: Logos. pybedtools: BED. Pipeline: Automate.
# Python Integration
print("=== Run MEME ===")
print(""
import subprocess
def run_meme(fasta_file, output_dir="meme_output",
nmotifs=10, minw=6, maxw=20):
\"\"\"Run MEME.\"\"\"
cmd = [
'meme', fasta_file,
'-dna',
'-oc', output_dir,
'-nmotifs', str(nmotifs),
'-minw', str(minw),
'-maxw', str(maxw),
'-mod', 'zoops'
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
raise RuntimeError(f"MEME failed: {result.stderr}")
return f"{output_dir}/meme.txt"
# Use
# motifs = run_meme("peaks.fa")
""")
print("\n=== Run HOMER ===")
print(""
def run_homer(bed_file, genome="hg38", output_dir="homer_output",
size=200, mask=True):
\"\"\"Run HOMER.\"\"\"
cmd = [
'findMotifsGenome.pl',
bed_file,
genome,
output_dir,
'-size', str(size)
]
if mask:
cmd.append('-mask')
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
raise RuntimeError(f"HOMER failed: {result.stderr}")
return output_dir
# Use
# output = run_homer("peaks.bed")
""")
print("\n=== Run FIMO ===")
print(""
def run_fimo(motif_file, sequence_file, output_file="fimo.txt",
thresh=1e-4):
\"\"\"Run FIMO.\"\"\"
cmd = [
'fimo',
'--thresh', str(thresh),
'--parse-genomic-coord',
motif_file,
sequence_file
]
with open(output_file, 'w') as f:
result = subprocess.run(cmd, stdout=f, stderr=subprocess.PIPE,
text=True)
if result.returncode != 0:
raise RuntimeError(f"FIMO failed: {result.stderr}")
return output_file
# Use
# hits = run_fimo("motif.meme", "genome.fa")
""")
print("\n=== Parse MEME Output ===")
print(""
import pandas as pd
import re
def parse_meme(meme_file):
\"\"\"Parse MEME output.\"\"\"
motifs = []
with open(meme_file) as f:
content = f.read()
# Find motifs
for match in re.finditer(
r'MOTIF (\S+) .*?letter-probability matrix.*?\n(.*?)\n\n',
content, re.DOTALL
):
name = match.group(1)
matrix = match.group(2).strip()
motifs.append({
'name': name,
'matrix': matrix
})
print(f"Motifs: {len(motifs)}")
return motifs
# Use
# motifs = parse_meme("meme.txt")
""")
print("\n=== Parse FIMO ===")
print(""
def parse_fimo(fimo_file):
\"\"\"Parse FIMO output.\"\"\"
df = pd.read_csv(fimo_file, sep='\\t', comment='#')
print(f"Hits: {len(df)}")
print(f"Motifs: {df['motif_id'].nunique()}")
print(f"Sequences: {df['sequence_name'].nunique()}")
# Significant
sig = df[df['p-value'] < 1e-4]
print(f"Significant: {len(sig)}")
return df
# Use
# hits = parse_fimo("fimo.txt")
""")
print("\n=== Motif Logo ===")
print(""
import logomaker
import pandas as pd
import matplotlib.pyplot as plt
def plot_logo(pwm_data, output="logo.png"):
\"\"\"Plot motif logo.\"\"\"
# Create DataFrame
df = pd.DataFrame(pwm_data, columns=['A', 'C', 'G', 'T'])
# Create logo
logo = logomaker.Logo(df)
logo.style_spines(visible=False)
logo.style_spines(spines=['left', 'bottom'], visible=True)
plt.tight_layout()
plt.savefig(output)
plt.show()
# Use
# plot_logo(pwm_data)
""")
print("\n=== Complete Pipeline ===")
print(""
import subprocess
import pandas as pd
from Bio import SeqIO
def motif_pipeline(peaks_bed, genome_fa, genome="hg38",
output_dir="motif_output"):
\"\"\"Complete motif pipeline.\"\"\"
import os
os.makedirs(output_dir, exist_ok=True)
# 1. Extract sequences
print("Extracting sequences...")
peaks_fa = f"{output_dir}/peaks.fa"
subprocess.run([
'bedtools', 'getfasta',
'-fi', genome_fa,
'-bed', peaks_bed,
'-fo', peaks_fa
], check=True)
# 2. Run MEME
print("Running MEME...")
meme_txt = run_meme(peaks_fa, f"{output_dir}/meme")
# 3. Run HOMER
print("Running HOMER...")
run_homer(peaks_bed, genome, f"{output_dir}/homer")
# 4. Compare to JASPAR
print("Comparing to JASPAR...")
subprocess.run([
'tomtom', meme_txt,
'JASPAR2020.meme',
'-oc', f"{output_dir}/tomtom"
], check=True)
print("Pipeline complete!")
return output_dir
# Use
# output = motif_pipeline("peaks.bed", "genome.fa")
""")๐จ Visualization
๐ฏ Seeing Motifs
Motif visualization is essential for interpretation and publication. Logos, heatmaps, and genome browser tracks are standard.
Visualization
Logo: Sequence. Heatmap: Motifs. IGV: Genome. Tomtom: Comparison. CentriMo: Distribution. Network: Regulation.
# Visualization
print("=== Sequence Logo ===")
print(""
Logo:
- Height = information content
- Letter size = frequency
- Conserved = tall
- Variable = short
Tools:
- WebLogo
- Skylign
- ggseqlogo (R)
- logomaker (Python)
WebLogo:
https://weblogo.berkeley.edu/
Skylign:
https://skylign.org/
Python:
import logomaker
logo = logomaker.Logo(df)
""")
print("\n=== Heatmap ===")
print(""
Heatmap:
- Motifs x sequences
- Scores
- Clustering
Tools:
- pheatmap (R)
- ComplexHeatmap (R)
- seaborn (Python)
- matplotlib (Python)
Example:
import seaborn as sns
sns.clustermap(scores)
""")
print("\n=== IGV ===")
print(""
IGV (Integrative Genomics Viewer):
- Genome browser
- Interactive
- Standard
Load:
- BED (peaks)
- FIMO hits
- Motif tracks
- ChIP-Seq
Commands:
igv.sh -g hg38 peaks.bed fimo.bed
URL:
https://igv.org/
""")
print("\n=== Tomtom ===")
print(""
Tomtom:
- Compare motifs
- Heatmap
- E-values
Output:
tomtom.html
tomtom.tsv
Visualization:
- Query vs target
- Alignment
- E-value
""")
print("\n=== CentriMo ===")
print(""
CentriMo:
- Central enrichment
- ChIP-Seq
- Distribution
Command:
centrimo peaks.fa motif.meme -oc centrimo_output
Output:
centrimo.html
Distribution plot
""")
print("\n=== Network ===")
print(""
Network:
- TF โ target
- Motif โ gene
- Regulation
Tools:
- Cytoscape
- igraph
- networkx
- RcisTarget
""")
print("\n=== Genome Browser Tracks ===")
print(""
Tracks:
- Peaks (BED)
- Motifs (BED)
- Conservation
- ChIP-Seq
- RNA-Seq
Tools:
- IGV
- UCSC
- JBrowse
""")
print("\n=== Best Practices ===")
print(""
1. Use logos
2. Colorblind-friendly
3. High resolution
4. Vector format
5. Annotate
6. Compare
7. Document
8. Publish
""")โ๏ธ Tool Comparison
๐ฏ Which Tool?
Choosing the right motif tool depends on your goal: discovery, scanning, or comparison.
Comparison
MEME: Discovery. DREME: Short. HOMER: Known + de novo. FIMO: Scanning. TOMTOM: Compare. JASPAR: Database.
| Tool | Type | Speed | Best For |
|---|---|---|---|
| MEME | Discovery | Medium | Comprehensive de novo |
| DREME | Discovery | Fast | Short motifs |
| STREME | Discovery | Fast | Short + sensitive |
| HOMER | Discovery | Fast | Known + de novo, annotation |
| Gibbs | Discovery | Slow | Bayesian sampling |
| FIMO | Scanning | Fast | Known motifs in sequences |
| MAST | Scanning | Fast | Multiple motifs |
| TOMTOM | Comparison | Fast | Compare to databases |
| AME | Enrichment | Fast | Motif enrichment |
| MEME-ChIP | Pipeline | Medium | ChIP-Seq peaks |
# Decision Guide
print("=== Choose Tool by Task ===")
print(""
De novo discovery:
โ MEME (comprehensive)
โ DREME (short)
โ HOMER (known + de novo)
Known motif scanning:
โ FIMO (individual)
โ MAST (multiple)
Compare to databases:
โ TOMTOM
Motif enrichment:
โ AME
โ CentriMo
ChIP-Seq pipeline:
โ MEME-ChIP
โ HOMER
Protein motifs:
โ MEME
โ HMMER
RNA motifs:
โ MEME
โ HOMER
""")
print("\n=== Speed Comparison ===")
print(f"{'Tool':<20} {'10 seqs':<15} {'100 seqs':<15} {'1000 seqs':<15}")
print("-" * 65)
print(f"{'DREME':<20} {'1s':<15} {'10s':<15} {'1 min':<15}")
print(f"{'STREME':<20} {'1s':<15} {'5s':<15} {'30s':<15}")
print(f"{'MEME':<20} {'10s':<15} {'5 min':<15} {'1 hour':<15}")
print(f"{'HOMER':<20} {'5s':<15} {'1 min':<15} {'10 min':<15}")
print(f"{'FIMO':<20} {'1s':<15} {'10s':<15} {'2 min':<15}")
print("\n=== When to Use Which ===")
print(""
USE MEME:
โ Comprehensive
โ Long motifs
โ Publication
USE DREME:
โ Short motifs
โ Fast
โ ChIP-Seq
USE HOMER:
โ Known + de novo
โ Annotation
โ ChIP-Seq
USE FIMO:
โ Known motifs
โ Genome scan
โ Variants
USE TOMTOM:
โ Compare motifs
โ Database match
USE MEME-ChIP:
โ ChIP-Seq pipeline
โ Comprehensive
""")๐ผ Use Cases
๐ฏ Where Motif Discovery Is Used
Motif discovery is used in virtually every area of regulatory genomics: ChIP-Seq, ATAC-Seq, variants, and networks.
Use Cases
ChIP-Seq: TF motifs. ATAC-Seq: Regulatory. Enhancers: Discovery. Variants: Impact. Networks: Regulation. Disease: Mechanisms.
# Use Cases
print("=== 1. ChIP-Seq Analysis ===")
print(""
Use case:
- TF binding sites
- Peaks
- Motif discovery
Workflow:
1. ChIP-Seq
2. Peak calling
3. Extract sequences
4. Motif discovery (MEME, HOMER)
5. Compare to JASPAR
6. Validate
Examples:
- p53 motifs
- CTCF motifs
- OCT4 motifs
- NF-ฮบB motifs
Tools:
- MEME-ChIP
- HOMER
- ChIPseeker
""")
print("\n=== 2. ATAC-Seq Analysis ===")
print("""
Use case:
- Open chromatin
- Regulatory elements
- TF motifs
Workflow:
1. ATAC-Seq
2. Peak calling
3. Motif discovery
4. TF assignment
5. Networks
Examples:
- Cell types
- Development
- Cancer
Tools:
- HOMER
- MEME
- chromVAR
""")
print("\n=== 3. Enhancer Discovery ===")
print(""
Use case:
- Distal regulatory
- H3K27ac peaks
- TF motifs
Workflow:
1. H3K27ac ChIP-Seq
2. Peak calling
3. Motif discovery
4. TF assignment
5. Networks
Examples:
- Cell-type specific
- Cancer enhancers
- Super-enhancers
Tools:
- HOMER
- MEME
- ROSE
""")
print("\n=== 4. Regulatory Variants ===")
print(""
Use case:
- GWAS hits
- eQTLs
- Motif disruption
Workflow:
1. Variant
2. Reference motif
3. Alternate motif
4. Score change
5. Impact
Examples:
- Cancer
- Autoimmune
- Neurodegenerative
Tools:
- FIMO
- motifbreakR
- atSNP
- JASPAR
""")
print("\n=== 5. Gene Regulatory Networks ===")
print(""
Use case:
- TF โ target genes
- Motif in promoters
- Network inference
Workflow:
1. ChIP-Seq / ATAC
2. Motif discovery
3. Target genes
4. Network
5. Analysis
Tools:
- HOMER
- MEME
- RcisTarget
- SCENIC
""")
print("\n=== 6. Splicing Regulation ===")
print(""
Use case:
- Splice sites
- ESE/ESS
- ISE/ISS
Workflow:
1. RNA-Seq
2. Splicing analysis
3. Motif discovery
4. Validation
Tools:
- MEME
- SpliceAid
- ESEfinder
- MaxEntScan
""")
print("\n=== 7. Protein Motifs ===")
print(""
Use case:
- Domains
- Active sites
- Binding sites
Workflow:
1. Sequences
2. Motif discovery
3. Compare to PROSITE
4. Validate
Examples:
- Walker A
- Zinc finger
- N-glycosylation
Tools:
- MEME
- PROSITE
- Pfam
""")
print("\n=== 8. Disease Mechanisms ===")
print(""
Use case:
- Regulatory variants
- Enhancer hijacking
- Motif disruption
Workflow:
1. Variant
2. Motif
3. Impact
4. Mechanism
5. Treatment
Examples:
- Cancer
- Autoimmune
- Neurodegenerative
""")
print("\n=== Comparison ===")
print(f"{'Use Case':<25} {'Tool':<20} {'Output':<20}")
print("-" * 65)
print(f"{'ChIP-Seq':<25} {'MEME-ChIP':<20} {'Motifs':<20}")
print(f"{'ATAC-Seq':<25} {'HOMER':<20} {'TF motifs':<20}")
print(f"{'Enhancers':<25} {'HOMER':<20} {'TF assignment':<20}")
print(f"{'Variants':<25} {'FIMO':<20} {'Impact':<20}")
print(f"{'Networks':<25} {'SCENIC':<20} {'Network':<20}")
print(f"{'Splicing':<25} {'MaxEntScan':<20} {'Splice sites':<20}")
print(f"{'Protein':<25} {'MEME':<20} {'Domains':<20}")
print(f"{'Disease':<25} {'motifbreakR':<20} {'Mechanism':<20}")โ FAQ
๐ฏ Frequently Asked Questions
Answers to common questions about motif discovery.
What is motif discovery?
Motif discovery is the computational identification of short, recurring, conserved sequence patterns (motifs) in DNA, RNA, or protein sequences. It's used to find transcription factor binding sites, regulatory elements, splice sites, and functional signatures that are over-represented in a set of sequences.
What is a Position Weight Matrix (PWM)?
A Position Weight Matrix (PWM), also called a Position-Specific Scoring Matrix (PSSM), is a representation of a motif. It gives a score for each nucleotide (or amino acid) at each position of the motif, based on observed frequencies in a set of aligned binding sites, often with a background model correction.
Which motif discovery tool should I use?
Use MEME for comprehensive de novo discovery, DREME or STREME for fast short motifs, HOMER for combined known + de novo discovery and annotation, and MEME-ChIP for ChIP-Seq peak analysis. For scanning known motifs, use FIMO (MEME suite) or the JASPAR database with tools like TFBSTools.
What is the difference between de novo and known motif discovery?
De novo motif discovery finds motifs from scratch using only the input sequences (e.g., MEME, DREME, HOMER). Known motif discovery scans input sequences for matches to a database of known motifs (e.g., JASPAR, HOCOMOCO, CIS-BP), using tools like FIMO or MAST. They are complementary.
What is a motif logo?
A motif logo (sequence logo) is a graphical representation of a motif where the height of each letter is proportional to its information content (conservation) at that position and the size of each letter reflects its frequency. It's the standard way to visualize PWMs and is produced by WebLogo, Skylign, or ggseqlogo.
How do I choose the right motif length?
Most TF motifs are 6-20 bp. Use MEME's -minw and -maxw options, or HOMER's default range. Shorter motifs (6-8 bp) have higher false positive rates; longer motifs (15-20 bp) are more specific but may be too restrictive. Try multiple lengths and compare.
What is the difference between MEME and DREME?
MEME uses probabilistic (EM) methods to find longer, more complex motifs with PWM output. DREME uses enumerative methods to find short (4-8 bp) motifs quickly with a discriminative approach (primary vs control). DREME is faster; MEME is more comprehensive. Both are part of the MEME Suite.
What is FIMO and when should I use it?
FIMO (Find Individual Motif Occurrences) scans sequences for matches to known PWMs, reporting positions, scores, and p-values. Use it to find where a known motif occurs in a genome or set of peaks, to test variant impact on binding, or to annotate regulatory regions. It's part of the MEME Suite.
How do I find motifs in ChIP-Seq peaks?
Extract peak sequences with bedtools getfasta, then run MEME-ChIP or HOMER. MEME-ChIP runs MEME, DREME, CentriMo, and TOMTOM automatically. HOMER performs known + de novo discovery and annotation. Both handle background and produce comprehensive HTML reports.
How do I interpret motif E-values?
E-value is the expected number of motifs with a given score or better occurring by chance in a database of a given size. Lower is better: E-value < 1e-10 = very significant, 1e-10 to 1e-4 = significant, > 1e-4 = marginal. Always consider E-value, p-value, and biological context together.
# Quick Reference
print("=== Quick Answers ===")
print(""
Q: What is motif discovery?
A: Finding recurring patterns in sequences.
Q: What is PWM?
A: Position Weight Matrix; motif representation.
Q: Best discovery tool?
A: MEME (comprehensive), DREME (fast).
Q: Known + de novo?
A: HOMER.
Q: ChIP-Seq pipeline?
A: MEME-ChIP, HOMER.
Q: Scan known motifs?
A: FIMO, MAST.
Q: Compare motifs?
A: TOMTOM.
Q: Motif databases?
A: JASPAR, HOCOMOCO, CIS-BP.
Q: Motif logo?
A: WebLogo, Skylign, logomaker.
Q: Free tools?
A: Yes โ MEME Suite, HOMER, JASPAR.
""")๐ Future
๐ฏ Where Motif Discovery Is Going
The future is deep learning, single-cell, multi-omics, 3D genomics, and clinical.
Future Directions
Deep learning: CNNs, transformers. Single-cell: scATAC. Multi-omics: Integration. 3D: Hi-C, loops. Clinical: Variants. Spatial: Location.
# Future of Motif Discovery
print("=== 1. Deep Learning ===")
print(""
Trend: Deep learning
Ideas:
- CNN for motif discovery
- Transformer models
- Attention
- Learned representations
Examples:
- DeepBind
- BPNet
- ChromBPNet
- Enformer
Future:
- End-to-end
- Multi-modal
- Variant effect
- Clinical
""")
print("\n=== 2. Single-Cell ===")
print(""
Trend: Single-cell
Current:
- Bulk
- Average
Single-cell:
- scATAC-Seq
- scChIP-Seq
- Per-cell motifs
- Cell-type specific
Tools:
- ArchR
- Signac
- chromVAR
- SCENIC
Future:
- Cell-type specific
- Rare populations
- Developmental
""")
print("\n=== 3. Multi-Omics ===")
print(""
Trend: Integrate everything
Current:
- Single modality
- Separate analysis
Multi-omics:
- ChIP + RNA
- ATAC + RNA
- Hi-C + ATAC
- Single-cell multi-omics
Tools:
- Seurat
- MOFA
- ArchR
- Signac
Future:
- Unified models
- Regulatory networks
- Systems biology
""")
print("\n=== 4. 3D Genomics ===")
print(""
Trend: 3D genome
Current:
- 1D sequence
- Linear motifs
3D:
- Hi-C
- TADs
- Loops
- Enhancer-promoter
Tools:
- HiCExplorer
- Juicer
- Cooler
- LoopNet
Future:
- 3D motif context
- Loop motifs
- Clinical
""")
print("\n=== 5. Clinical ===")
print(""
Trend: Clinical
Current:
- Research
- Specialized
Future:
- Clinical routine
- Variant interpretation
- Drug response
- Diagnostics
Examples:
- Cancer variants
- Rare disease
- Pharmacogenomics
""")
print("\n=== 6. Spatial ===")
print(""
Trend: Spatial
Current:
- Dissociated
- Lose location
Spatial:
- Tissue context
- Spatial ATAC
- Spatial motifs
- Tumor microenvironment
Platforms:
- Spatial-ATAC
- Spatial-CUT&Tag
- Slide-tags
Future:
- 3D
- Tissue atlases
- Clinical
""")
# TIMELINE
print("\n=== Timeline ===")
print(""
Past:
1980s: Consensus
1990s: MEME, Gibbs
2000s: HOMER, DREME
2010s: ChIP-Seq era
2020s: Deep learning
Present:
2025: Single-cell
2026: Multi-omics
Future:
2030: 3D genomics?
2035: Clinical?
2040: Predictive?
""")
print("\n=== Final Thoughts ===")
print(""
Motif discovery is:
- Fundamental to regulatory genomics
- Needed for ChIP-Seq
- Needed for ATAC-Seq
- Needed for variants
- Rapidly improving
The future is:
- Deep learning
- Single-cell
- Multi-omics
- 3D genomics
- Clinical
- Spatial
"Motifs are the words
of the regulatory genome."
Keep exploring. Keep building.
""")