[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EEJDNW32J2BF6SD1NEDM3H":3,"skill-same:01M7EEJDNW32J2BF6SD1NEDM3H":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EEJDNW32J2BF6SD1NEDM3H","bio-motif-search",null,"Find sequence motifs, degenerate IUPAC patterns, and transcription-factor binding sites in DNA\u002FRNA using Biopython and regex, including position weight matrix (PWM\u002FPSSM) scoring. Use when locating regulatory elements, counting overlapping motif occurrences, scanning for binding-site matches above a significance threshold, or reading motif matrices from JASPAR\u002FMEME\u002FTRANSFAC files. For restriction enzyme sites, use restriction-analysis\u002Frestriction-sites.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-motif-search\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-motif-search\ndescription: Find sequence motifs, degenerate IUPAC patterns, and transcription-factor binding sites in DNA\u002FRNA using Biopython and regex, including position weight matrix (PWM\u002FPSSM) scoring. Use when locating regulatory elements, counting overlapping motif occurrences, scanning for binding-site matches above a significance threshold, or reading motif matrices from JASPAR\u002FMEME\u002FTRANSFAC files. For restriction enzyme sites, use restriction-analysis\u002Frestriction-sites.\ntool_type: python\nprimary_tool: Bio.motifs\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"sequence-manipulation\u002Fmotif-search\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: BioPython 1.83+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Motif Search\n\n**\"Search for a sequence motif or binding-site pattern\"** -> Scan sequences for a fixed motif, a degenerate IUPAC consensus, or a probabilistic PWM, on one or both strands, and locate transcription-factor binding sites, regulatory elements, or custom patterns.\n- Python: `Bio.SeqUtils.nt_search` (IUPAC + overlaps), `re` (regex\u002Flookahead), `Bio.motifs` (PWM\u002FPSSM scoring + matrix file parsing)\n\n## The Governing Principle\n\nTwo silent failures dominate motif searching; both return a plausible-but-wrong answer with no error:\n\n1. **Overlapping matches are dropped.** `str.count`, `str.find`, and `re.findall` consume the string left to right, so a motif that overlaps its own next occurrence is undercounted. Target `AAGCGCGCGAA`, motif `GCGC`: `str.count` returns 1, the true answer is 2 (starts at positions 2 and 4). Use a zero-width lookahead `re.finditer(r'(?=(GCGC))', target)` or `Bio.SeqUtils.nt_search`, both of which report overlaps.\n2. **A PSSM score is a likelihood in bits, not a probability.** `pssm.calculate` returns log2-odds versus background. A \"high-looking\" threshold chosen by eye is arbitrary and non-reproducible; derive the threshold from the score distribution at a chosen false-positive rate. And a PSSM scans only the strand it is given, so scoring just the forward strand silently misses roughly half of real sites on double-stranded DNA.\n\n## Which Approach for Which Question\n\n| Question | Tool |\n|----------|------|\n| Position of first exact hit | `str.find` \u002F `Seq.find` (returns -1 if absent) |\n| All exact hits, possibly overlapping | `re.finditer(r'(?=(motif))', seq)` |\n| Degenerate IUPAC consensus (e.g. `GATNNTC`), with overlaps | `Bio.SeqUtils.nt_search(seq, motif)` |\n| Flexible \u002F repeat \u002F variable-spacer pattern | `re` with explicit character classes and quantifiers |\n| Graded match to many aligned sites (binding sites) | `Bio.motifs` PWM -> PSSM, score and threshold |\n| Match significance \u002F false-positive control | `pssm.distribution(...).threshold_fpr(fpr)` |\n| Restriction enzyme recognition sites | restriction-analysis\u002Frestriction-sites |\n\n## IUPAC Degenerate Motifs\n\nA degenerate motif expands each ambiguity code to a regex character class:\n\n| Code | Class | Code | Class | Code | Class |\n|------|-------|------|-------|------|-------|\n| N | `[ACGT]` | R | `[AG]` | Y | `[CT]` |\n| W | `[AT]` | S | `[GC]` | K | `[GT]` |\n| M | `[AC]` | B | `[CGT]` | D | `[AGT]` |\n| H | `[ACT]` | V | `[ACG]` | | |\n\nB, D, H, V each exclude A, C, G, T respectively (the code preceding the one they drop is a mnemonic).\n\n```python\nIUPAC_DNA = {'N': '[ACGT]', 'R': '[AG]', 'Y': '[CT]', 'W': '[AT]', 'S': '[GC]',\n             'K': '[GT]', 'M': '[AC]', 'B': '[CGT]', 'D': '[AGT]', 'H': '[ACT]', 'V': '[ACG]'}\n\ndef iupac_to_regex(pattern):\n    return ''.join(IUPAC_DNA.get(base, base) for base in pattern)\n\n# 'GATNNTC' -> 'GAT[ACGT][ACGT]TC'\n```\n\n`Bio.SeqUtils.nt_search` expands IUPAC ambiguity in the query motif automatically and reports overlapping hits, so it is the shortest correct path for a degenerate consensus.\n\n## Overlapping Matches (the count trap)\n\n**Goal:** Report every start position of a motif, including self-overlapping occurrences.\n\n**Approach:** Use a zero-width lookahead so the regex engine never consumes the matched text; recover the match string from the inner capture group. For IUPAC motifs, prefer `nt_search`, which both expands ambiguity and reports overlaps.\n\n**Reference (BioPython 1.83+):**\n```python\nimport re\nfrom Bio.SeqUtils import nt_search\n\ntarget = 'AAGCGCGCGAA'\n\nstarts = [match.start(1) for match in re.finditer(r'(?=(GCGC))', target)]  # [2, 4]\nhits = [(match.start(1), match.group(1)) for match in re.finditer(r'(?=([AG]CG[CT]))', target)]\n\nresult = nt_search(target, 'GCGC')  # ['GCGC', 2, 4]\npattern, positions = result[0], result[1:]\n```\n\n`nt_search` returns a heterogeneous list: `result[0]` is the (expanded) pattern string and `result[1:]` are the 0-based start positions. When there are no hits it returns just `[pattern]` (length 1), so test `len(result) > 1` before indexing rather than truthiness.\n\n## Bio.motifs PWM \u002F PSSM Pipeline\n\n**Goal:** Build a probabilistic model from a set of aligned binding sites and score a target sequence for graded matches.\n\n**Approach:** Create a motif from instances or a matrix file, set pseudocounts and background, read the recomputed PSSM, then scan. The count matrix `m.counts['A', 0]` is indexed `[base, position]`.\n\n**Reference (BioPython 1.83+):**\n```python\nfrom Bio import motifs\nfrom Bio.Seq import Seq\n\nm = motifs.create([Seq('TACAA'), Seq('TACGA'), Seq('TACTA'), Seq('TGCAA')])  # alphabet defaults to ACGT\n\nm.pseudocounts = 0.5        # set BEFORE reading m.pssm (see trap below)\nm.background = None         # None gives uniform 0.25; or pass a dict of base frequencies\n\npwm = m.pwm                 # normalized frequencies (property)\npssm = m.pssm               # log2-odds vs background (property; RECOMPUTED on each access)\n\nm.consensus                 # most frequent base per column\nm.degenerate_consensus      # IUPAC-degenerate consensus\n```\n\n`m.counts.normalize(pseudocounts=0.5)` returns a position weight matrix and `pwm.log_odds()` returns a PSSM; these are equivalent to reading `m.pwm` \u002F `m.pssm` after setting `m.pseudocounts`.\n\n### The Pseudocount \u002F -inf Trap (silent)\n\nA column where some base has count 0 gives that base frequency 0 and a log-odds of negative infinity; any target carrying that base at that position then scores `-inf` and is unmatchable. This is common with short motifs or few instances. Setting `m.pseudocounts` (a flat 0.5, or sqrt(N) with N the number of instances; scalar or per-base dict) makes every cell finite by shrinking toward background.\n\nCritically, `m.pssm` is recomputed from `m.pseudocounts` and `m.background` on every access. Set both BEFORE reading `m.pssm` (or `pwm.log_odds()`), or the matrix is silently wrong.\n\n### Score, Threshold, and P-value\n\n`pssm.calculate(seq)` returns the log2-odds score in bits for each window (a relative likelihood, not a probability). `pssm.search(seq, threshold=...)` yields `(position, score)` pairs at or above the threshold.\n\nTo convert a bit score into a false-positive rate, build the null distribution and ask it for a threshold:\n\n```python\ndist = pssm.distribution(background=m.background, precision=10**4)\nthreshold = dist.threshold_fpr(0.01)        # 1% false-positive rate\nthreshold = dist.threshold_fnr(0.1)         # 10% false-negative rate\nthreshold = dist.threshold_balanced(1000)   # rate_proportion = FNR:FPR ratio (FNR = FPR x rate_proportion), NOT a sequence length; default 1.0 gives FPR=FNR\n```\n\nChoosing a threshold \"because it looks high\" is the classic non-reproducible error. Higher `precision` gives finer threshold resolution at the cost of memory.\n\n### Both Strands\n\n`pssm.calculate` scans only the strand it is handed. `pssm.search` defaults to `both=True`, scanning both strands in one call; with `both=True` a hit at negative position `p` lies on the reverse strand and its forward-coordinate start is `len(seq) + p`. To handle strands separately, set `both=False` and scan the reverse-complemented PSSM explicitly:\n\n```python\ncombined = list(pssm.search(seq, threshold=3.0))  # both strands; reverse hits have NEGATIVE positions\n\nrc_pssm = pssm.reverse_complement()\nforward = list(pssm.search(seq, threshold=3.0, both=False))\nreverse = list(rc_pssm.search(seq, threshold=3.0, both=False))\n```\n\n## Reading Motif Matrix Files\n\n`motifs.read(handle, fmt)` reads exactly one motif; `motifs.parse(handle, fmt)` returns an iterator over many. The format string must match the file layout exactly.\n\n| `fmt` string | File type \u002F source |\n|--------------|--------------------|\n| `jaspar` | multi-motif JASPAR PFM collection (use `parse`) |\n| `pfm` | single JASPAR-style PFM (use `read`) |\n| `pfm-four-columns` | CIS-BP, HOMER, HOCOMOCO (A C G T as columns) |\n| `pfm-four-rows` | ScerTF, YeTFaSCo (A C G T as rows) |\n| `sites` | JASPAR sites file (use `read`) |\n| `meme` | MEME program output (use `parse`) |\n| `minimal` | MEME minimal text format |\n| `transfac` | TRANSFAC matrices |\n| `mast`, `alignace`, `clusterbuster`, `xms` | respective tool outputs |\n\n`'cisbp'`, `'homer'`, and `'hocomoco'` are NOT valid strings; those databases use `pfm-four-columns`. The four-columns versus four-rows distinction is the most common mix-up: a 4-column matrix read as `pfm-four-rows` parses without error but produces a meaningless transposed motif.\n\n```python\nfrom Bio import motifs\n\nwith open('collection.jaspar') as handle:\n    for m in motifs.parse(handle, 'jaspar'):\n        print(m.matrix_id, m.name, m.consensus)\n\nm.format('jaspar')      # serialize back out\nm.format('transfac')\n```\n\n## Common Motif Patterns\n\n| Motif | Pattern | Description |\n|-------|---------|-------------|\n| Start codon | `ATG` | Translation initiation |\n| Kozak | `[AG]CCATGG` | Eukaryotic translation initiation |\n| TATA box | `TATA[AT]A[AT]` | Core promoter element |\n| GC box (Sp1) | `GGGCGG` | Promoter element |\n| CAAT box | `CCAAT` | Promoter element |\n| Poly-A signal | `AATAAA` | mRNA polyadenylation |\n| E-box (bHLH) | `CA[ACGT]{2}TG` | bHLH TF binding |\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| Count is too low | `str.count`\u002F`re.findall` skip overlaps | `re.finditer(r'(?=(motif))', seq)` or `nt_search` |\n| `IndexError` on `nt_search` result | No hits returns `[pattern]` (length 1) | Test `len(result) > 1` before reading `result[1:]` |\n| Every target scores `-inf` | Count-0 cell gives -inf log-odds | Set `m.pseudocounts` (0.5 or sqrt(N)) before reading `m.pssm` |\n| PSSM scores look wrong | Pseudocounts\u002Fbackground set after reading `m.pssm` | Set them first; `m.pssm` is recomputed on each access |\n| Roughly half of sites missed | Only forward strand scanned | Score `pssm.reverse_complement()` or pass `both=True` |\n| Threshold not reproducible | Cutoff chosen by eye | `pssm.distribution(...).threshold_fpr(fpr)` |\n| `ValueError` parsing matrix | Wrong `fmt` (4-column vs 4-row, `jaspar` vs `pfm`) | Match `fmt` to the actual layout |\n| No matches | Case or strand mismatch | `.upper()` both; check reverse complement |\n\n## Related Skills\n\n- seq-objects - Create Seq objects for searching\n- reverse-complement - Reverse-complement the target to search the opposite strand\n- transcription-translation - ORF and codon-context motifs in coding sequences\n- sequence-properties - GC content and per-sequence properties around hits\n- restriction-analysis\u002Frestriction-sites - Restriction enzyme recognition sites\n- chip-seq\u002Fmotif-analysis - De novo motif discovery and enrichment in peak sets\n- database-access\u002Fentrez-fetch - Download motif matrices from JASPAR\u002FNCBI\n","## Version Compatibility\n\nReference examples tested with: BioPython 1.83+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Motif Search\n\n**\"Search for a sequence motif or binding-site pattern\"** -> Scan sequences for a fixed motif, a degenerate IUPAC consensus, or a probabilistic PWM, on one or both strands, and locate transcription-factor binding sites, regulatory elements, or custom patterns.\n- Python: `Bio.SeqUtils.nt_search` (IUPAC + overlaps), `re` (regex\u002Flookahead), `Bio.motifs` (PWM\u002FPSSM scoring + matrix file parsing)\n\n## The Governing Principle\n\nTwo silent failures dominate motif searching; both return a plausible-but-wrong answer with no error:\n\n1. **Overlapping matches are dropped.** `str.count`, `str.find`, and `re.findall` consume the string left to right, so a motif that overlaps its own next occurrence is undercounted. Target `AAGCGCGCGAA`, motif `GCGC`: `str.count` returns 1, the true answer is 2 (starts at positions 2 and 4). Use a zero-width lookahead `re.finditer(r'(?=(GCGC))', target)` or `Bio.SeqUtils.nt_search`, both of which report overlaps.\n2. **A PSSM score is a likelihood in bits, not a probability.** `pssm.calculate` returns log2-odds versus background. A \"high-looking\" threshold chosen by eye is arbitrary and non-reproducible; derive the threshold from the score distribution at a chosen false-positive rate. And a PSSM scans only the strand it is given, so scoring just the forward strand silently misses roughly half of real sites on double-stranded DNA.\n\n## Which Approach for Which Question\n\n| Question | Tool |\n|----------|------|\n| Position of first exact hit | `str.find` \u002F `Seq.find` (returns -1 if absent) |\n| All exact hits, possibly overlapping | `re.finditer(r'(?=(motif))', seq)` |\n| Degenerate IUPAC consensus (e.g. `GATNNTC`), with overlaps | `Bio.SeqUtils.nt_search(seq, motif)` |\n| Flexible \u002F repeat \u002F variable-spacer pattern | `re` with explicit character classes and quantifiers |\n| Graded match to many aligned sites (binding sites) | `Bio.motifs` PWM -> PSSM, score and threshold |\n| Match significance \u002F false-positive control | `pssm.distribution(...).threshold_fpr(fpr)` |\n| Restriction enzyme recognition sites | restriction-analysis\u002Frestriction-sites |\n\n## IUPAC Degenerate Motifs\n\nA degenerate motif expands each ambiguity code to a regex character class:\n\n| Code | Class | Code | Class | Code | Class |\n|------|-------|------|-------|------|-------|\n| N | `[ACGT]` | R | `[AG]` | Y | `[CT]` |\n| W | `[AT]` | S | `[GC]` | K | `[GT]` |\n| M | `[AC]` | B | `[CGT]` | D | `[AGT]` |\n| H | `[ACT]` | V | `[ACG]` | | |\n\nB, D, H, V each exclude A, C, G, T respectively (the code preceding the one they drop is a mnemonic).\n\n```python\nIUPAC_DNA = {'N': '[ACGT]', 'R': '[AG]', 'Y': '[CT]', 'W': '[AT]', 'S': '[GC]',\n             'K': '[GT]', 'M': '[AC]', 'B': '[CGT]', 'D': '[AGT]', 'H': '[ACT]', 'V': '[ACG]'}\n\ndef iupac_to_regex(pattern):\n    return ''.join(IUPAC_DNA.get(base, base) for base in pattern)\n\n# 'GATNNTC' -> 'GAT[ACGT][ACGT]TC'\n```\n\n`Bio.SeqUtils.nt_search` expands IUPAC ambiguity in the query motif automatically and reports overlapping hits, so it is the shortest correct path for a degenerate consensus.\n\n## Overlapping Matches (the count trap)\n\n**Goal:** Report every start position of a motif, including self-overlapping occurrences.\n\n**Approach:** Use a zero-width lookahead so the regex engine never consumes the matched text; recover the match string from the inner capture group. For IUPAC motifs, prefer `nt_search`, which both expands ambiguity and reports overlaps.\n\n**Reference (BioPython 1.83+):**\n```python\nimport re\nfrom Bio.SeqUtils import nt_search\n\ntarget = 'AAGCGCGCGAA'\n\nstarts = [match.start(1) for match in re.finditer(r'(?=(GCGC))', target)]  # [2, 4]\nhits = [(match.start(1), match.group(1)) for match in re.finditer(r'(?=([AG]CG[CT]))', target)]\n\nresult = nt_search(target, 'GCGC')  # ['GCGC', 2, 4]\npattern, positions = result[0], result[1:]\n```\n\n`nt_search` returns a heterogeneous list: `result[0]` is the (expanded) pattern string and `result[1:]` are the 0-based start positions. When there are no hits it returns just `[pattern]` (length 1), so test `len(result) > 1` before indexing rather than truthiness.\n\n## Bio.motifs PWM \u002F PSSM Pipeline\n\n**Goal:** Build a probabilistic model from a set of aligned binding sites and score a target sequence for graded matches.\n\n**Approach:** Create a motif from instances or a matrix file, set pseudocounts and background, read the recomputed PSSM, then scan. The count matrix `m.counts['A', 0]` is indexed `[base, position]`.\n\n**Reference (BioPython 1.83+):**\n```python\nfrom Bio import motifs\nfrom Bio.Seq import Seq\n\nm = motifs.create([Seq('TACAA'), Seq('TACGA'), Seq('TACTA'), Seq('TGCAA')])  # alphabet defaults to ACGT\n\nm.pseudocounts = 0.5        # set BEFORE reading m.pssm (see trap below)\nm.background = None         # None gives uniform 0.25; or pass a dict of base frequencies\n\npwm = m.pwm                 # normalized frequencies (property)\npssm = m.pssm               # log2-odds vs background (property; RECOMPUTED on each access)\n\nm.consensus                 # most frequent base per column\nm.degenerate_consensus      # IUPAC-degenerate consensus\n```\n\n`m.counts.normalize(pseudocounts=0.5)` returns a position weight matrix and `pwm.log_odds()` returns a PSSM; these are equivalent to reading `m.pwm` \u002F `m.pssm` after setting `m.pseudocounts`.\n\n### The Pseudocount \u002F -inf Trap (silent)\n\nA column where some base has count 0 gives that base frequency 0 and a log-odds of negative infinity; any target carrying that base at that position then scores `-inf` and is unmatchable. This is common with short motifs or few instances. Setting `m.pseudocounts` (a flat 0.5, or sqrt(N) with N the number of instances; scalar or per-base dict) makes every cell finite by shrinking toward background.\n\nCritically, `m.pssm` is recomputed from `m.pseudocounts` and `m.background` on every access. Set both BEFORE reading `m.pssm` (or `pwm.log_odds()`), or the matrix is silently wrong.\n\n### Score, Threshold, and P-value\n\n`pssm.calculate(seq)` returns the log2-odds score in bits for each window (a relative likelihood, not a probability). `pssm.search(seq, threshold=...)` yields `(position, score)` pairs at or above the threshold.\n\nTo convert a bit score into a false-positive rate, build the null distribution and ask it for a threshold:\n\n```python\ndist = pssm.distribution(background=m.background, precision=10**4)\nthreshold = dist.threshold_fpr(0.01)        # 1% false-positive rate\nthreshold = dist.threshold_fnr(0.1)         # 10% false-negative rate\nthreshold = dist.threshold_balanced(1000)   # rate_proportion = FNR:FPR ratio (FNR = FPR x rate_proportion), NOT a sequence length; default 1.0 gives FPR=FNR\n```\n\nChoosing a threshold \"because it looks high\" is the classic non-reproducible error. Higher `precision` gives finer threshold resolution at the cost of memory.\n\n### Both Strands\n\n`pssm.calculate` scans only the strand it is handed. `pssm.search` defaults to `both=True`, scanning both strands in one call; with `both=True` a hit at negative position `p` lies on the reverse strand and its forward-coordinate start is `len(seq) + p`. To handle strands separately, set `both=False` and scan the reverse-complemented PSSM explicitly:\n\n```python\ncombined = list(pssm.search(seq, threshold=3.0))  # both strands; reverse hits have NEGATIVE positions\n\nrc_pssm = pssm.reverse_complement()\nforward = list(pssm.search(seq, threshold=3.0, both=False))\nreverse = list(rc_pssm.search(seq, threshold=3.0, both=False))\n```\n\n## Reading Motif Matrix Files\n\n`motifs.read(handle, fmt)` reads exactly one motif; `motifs.parse(handle, fmt)` returns an iterator over many. The format string must match the file layout exactly.\n\n| `fmt` string | File type \u002F source |\n|--------------|--------------------|\n| `jaspar` | multi-motif JASPAR PFM collection (use `parse`) |\n| `pfm` | single JASPAR-style PFM (use `read`) |\n| `pfm-four-columns` | CIS-BP, HOMER, HOCOMOCO (A C G T as columns) |\n| `pfm-four-rows` | ScerTF, YeTFaSCo (A C G T as rows) |\n| `sites` | JASPAR sites file (use `read`) |\n| `meme` | MEME program output (use `parse`) |\n| `minimal` | MEME minimal text format |\n| `transfac` | TRANSFAC matrices |\n| `mast`, `alignace`, `clusterbuster`, `xms` | respective tool outputs |\n\n`'cisbp'`, `'homer'`, and `'hocomoco'` are NOT valid strings; those databases use `pfm-four-columns`. The four-columns versus four-rows distinction is the most common mix-up: a 4-column matrix read as `pfm-four-rows` parses without error but produces a meaningless transposed motif.\n\n```python\nfrom Bio import motifs\n\nwith open('collection.jaspar') as handle:\n    for m in motifs.parse(handle, 'jaspar'):\n        print(m.matrix_id, m.name, m.consensus)\n\nm.format('jaspar')      # serialize back out\nm.format('transfac')\n```\n\n## Common Motif Patterns\n\n| Motif | Pattern | Description |\n|-------|---------|-------------|\n| Start codon | `ATG` | Translation initiation |\n| Kozak | `[AG]CCATGG` | Eukaryotic translation initiation |\n| TATA box | `TATA[AT]A[AT]` | Core promoter element |\n| GC box (Sp1) | `GGGCGG` | Promoter element |\n| CAAT box | `CCAAT` | Promoter element |\n| Poly-A signal | `AATAAA` | mRNA polyadenylation |\n| E-box (bHLH) | `CA[ACGT]{2}TG` | bHLH TF binding |\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| Count is too low | `str.count`\u002F`re.findall` skip overlaps | `re.finditer(r'(?=(motif))', seq)` or `nt_search` |\n| `IndexError` on `nt_search` result | No hits returns `[pattern]` (length 1) | Test `len(result) > 1` before reading `result[1:]` |\n| Every target scores `-inf` | Count-0 cell gives -inf log-odds | Set `m.pseudocounts` (0.5 or sqrt(N)) before reading `m.pssm` |\n| PSSM scores look wrong | Pseudocounts\u002Fbackground set after reading `m.pssm` | Set them first; `m.pssm` is recomputed on each access |\n| Roughly half of sites missed | Only forward strand scanned | Score `pssm.reverse_complement()` or pass `both=True` |\n| Threshold not reproducible | Cutoff chosen by eye | `pssm.distribution(...).threshold_fpr(fpr)` |\n| `ValueError` parsing matrix | Wrong `fmt` (4-column vs 4-row, `jaspar` vs `pfm`) | Match `fmt` to the actual layout |\n| No matches | Case or strand mismatch | `.upper()` both; check reverse complement |\n\n## Related Skills\n\n- seq-objects - Create Seq objects for searching\n- reverse-complement - Reverse-complement the target to search the opposite strand\n- transcription-translation - ORF and codon-context motifs in coding sequences\n- sequence-properties - GC content and per-sequence properties around hits\n- restriction-analysis\u002Frestriction-sites - Restriction enzyme recognition sites\n- chip-seq\u002Fmotif-analysis - De novo motif discovery and enrichment in peak sets\n- database-access\u002Fentrez-fetch - Download motif matrices from JASPAR\u002FNCBI\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","python","2026-09-20","sequence-manipulation\u002Fmotif-search\u002FSKILL.md","Bio.motifs","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-motif-search","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-motif-search",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-motif-search",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-motif-search","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-motif-search\u002FSKILL.md",true,[50,56,60,64,68],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fbasic_search.py","SCRIPT","脚本",1388,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-motif-search\u002Fexamples\u002Fbasic_search.py",{"path":57,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":58,"sourceHtmlUrl":59},"examples\u002Fmotif_files.py",1937,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-motif-search\u002Fexamples\u002Fmotif_files.py",{"path":61,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":62,"sourceHtmlUrl":63},"examples\u002Fpwm_search.py",2204,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-motif-search\u002Fexamples\u002Fpwm_search.py",{"path":65,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":66,"sourceHtmlUrl":67},"examples\u002Fregex_search.py",1575,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-motif-search\u002Fexamples\u002Fregex_search.py",{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"usage-guide.md","REFERENCE","参考文档",3561,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-motif-search\u002Fusage-guide.md",[75,83,90,97,104,111],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":82},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":82},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":82},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":82},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":82},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":82},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]