Source: https://github.com/aipoch/medical-research-skills
Sequence Alignment
A skill for performing sequence alignment using NCBI BLAST API. Supports nucleotide and protein sequence comparison against major biological databases.
When to Use
- Use this skill when the task needs performing sequence alignment using NCBI BLAST API. Supports nucleotide and protein sequence comparison against major biological databases.
- Use this skill for data analysis tasks that require explicit assumptions, bounded scope, and a reproducible output format.
- Use this skill when the response must stay inside the documented task boundary instead of expanding into adjacent work.
Key Features
See ## Features above for related details.
- Scope-focused workflow aligned to: A skill for performing sequence alignment using NCBI BLAST API. Supports nucleotide and protein sequence comparison against major biological databases.
- Packaged executable path(s):
scripts/main.py.
- Reference material available in
references/ for task-specific guidance.
- Structured execution path designed to keep outputs consistent and reviewable.
Dependencies
See ## Prerequisites above for related details.
Python: 3.10+. Repository baseline for current packaged skills.
Third-party packages: not explicitly version-pinned in this skill package. Add pinned versions if this skill needs stricter environment control.
Example Usage
See ## Usage above for related details.
cd "20260318/scientific-skills/Data Analytics/sequence-alignment"
python -m py_compile scripts/main.py
python scripts/main.py --help
Example run plan:
- Confirm the user input, output path, and any required config values.
- Edit the in-file
CONFIG block or documented parameters if the script uses fixed settings.
- Run
python scripts/main.py with the validated inputs.
- Review the generated output and return the final artifact with any assumptions called out.
Implementation Details
See ## Workflow above for related details.
- Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.
- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.
- Primary implementation surface:
scripts/main.py.
- Reference guidance:
references/ contains supporting rules, prompts, or checklists.
- Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.
- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.
Quick Check
Use this command to verify that the packaged script entry point can be parsed before deeper execution.
python -m py_compile scripts/main.py
Audit-Ready Commands
Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
python -m py_compile scripts/main.py
python scripts/main.py --help
Workflow
- Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
- Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
- Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
- Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
- If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
Features
- BLAST API Integration: Query NCBI BLAST service for sequence similarity search
- Multiple BLAST Programs: blastn, blastp, blastx, tblastn, tblastx
- Alignment Visualization: Display results in human-readable format
- Database Support: nr, nt, swissprot, refseq, pdb, and more
Usage
python scripts/main.py --sequence "ATGCGTACGTAGCTAGCTAG" --program blastn --database nt --output results.txt
Parameters
| Parameter |
Description |
Required |
--sequence |
Query sequence (DNA/Protein) |
Yes |
--program |
BLAST program: blastn, blastp, blastx, tblastn, tblastx |
Yes |
--database |
Target database: nr, nt, swissprot, pdb, refseq_protein |
Yes |
--output |
Output file path |
No |
--format |
Output format: text, json, csv |
No (default: text) |
--max_hits |
Maximum number of hits to return |
No (default: 10) |
--evalue |
E-value threshold |
No (default: 10) |
Technical Difficulty
Medium - Requires understanding of BLAST algorithm, API handling with retry logic, and biological sequence formats.
BLAST Programs Reference
| Program |
Query Type |
Database Type |
Use Case |
| blastn |
Nucleotide |
Nucleotide |
DNA vs DNA |
| blastp |
Protein |
Protein |
Protein vs Protein |
| blastx |
Nucleotide (translated) |
Protein |
DNA vs Protein |
| tblastn |
Protein |
Nucleotide (translated) |
Protein vs DNA |
| tblastx |
Nucleotide (translated) |
Nucleotide (translated) |
Translated DNA vs DNA |
Example Workflows
DNA Sequence Similarity Search
python scripts/main.py --sequence "ATGGCCCTGTGGATGCGCTTCTTAGTCG" --program blastn --database nt --max_hits 5
Protein Sequence Alignment
python scripts/main.py --sequence "MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQAPILSRVGDGT" --program blastp --database swissprot --evalue 0.001
Output Format
Results include:
- Query sequence info
- Hit definitions and accession numbers
- Alignment scores (bit score, e-value)
- Percent identity and similarity
- Alignment visualization with match/mismatch highlighting
References
- BLAST Documentation
- NCBI BLAST API Guide
Risk Assessment
| Risk Indicator |
Assessment |
Level |
| Code Execution |
Python scripts with tools |
High |
| Network Access |
External API calls |
High |
| File System Access |
Read/write data |
Medium |
| Instruction Tampering |
Standard prompt guidelines |
Low |
| Data Exposure |
Data handled securely |
Medium |
Security Checklist
Prerequisites
No additional Python packages required.
Evaluation Criteria
Success Metrics
Test Cases
- Basic Functionality: Standard input → Expected output
- Edge Case: Invalid input → Graceful error handling
- Performance: Large dataset → Acceptable processing time
Lifecycle Status
- Current Stage: Draft
- Next Review Date: 2026-03-06
- Known Issues: None
- Planned Improvements:
- Performance optimization
- Additional feature support
Output Requirements
Every final response should make these items explicit when they are relevant:
- Objective or requested deliverable
- Inputs used and assumptions introduced
- Workflow or decision path
- Core result, recommendation, or artifact
- Constraints, risks, caveats, or validation needs
- Unresolved items and next-step checks
Error Handling
- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
- If
scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.
- Do not fabricate files, citations, data, search results, or execution outcomes.
Input Validation
This skill accepts requests that match the documented purpose of sequence-alignment and include enough context to complete the workflow safely.
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
sequence-alignment only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
Response Template
Use the following fixed structure for non-trivial requests:
- Objective
- Inputs Received
- Assumptions
- Workflow
- Deliverable
- Risks and Limits
- Next Checks
If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.
1---2name: sequence-alignment3description: A skill for performing sequence alignment using NCBI BLAST API. Supports nucleotide and protein sequence comparison against major biological databases.4license: MIT5---6> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)
7
8# Sequence Alignment
9
10A skill for performing sequence alignment using NCBI BLAST API. Supports nucleotide and protein sequence comparison against major biological databases.
11
12## When to Use
13
14- Use this skill when the task needs performing sequence alignment using NCBI BLAST API. Supports nucleotide and protein sequence comparison against major biological databases.
15- Use this skill for data analysis tasks that require explicit assumptions, bounded scope, and a reproducible output format.
16- Use this skill when the response must stay inside the documented task boundary instead of expanding into adjacent work.
17
18## Key Features
19
20See `## Features` above for related details.
21
22- Scope-focused workflow aligned to: A skill for performing sequence alignment using NCBI BLAST API. Supports nucleotide and protein sequence comparison against major biological databases.
23- Packaged executable path(s): `scripts/main.py`.
24- Reference material available in `references/` for task-specific guidance.
25- Structured execution path designed to keep outputs consistent and reviewable.
26
27## Dependencies
28
29See `## Prerequisites` above for related details.
30
31- `Python`: `3.10+`. Repository baseline for current packaged skills.
32- `Third-party packages`: `not explicitly version-pinned in this skill package`. Add pinned versions if this skill needs stricter environment control.
33
34## Example Usage
35
36See `## Usage` above for related details.
37
38```bash
39cd "20260318/scientific-skills/Data Analytics/sequence-alignment"
40python -m py_compile scripts/main.py
41python scripts/main.py --help
42```
43
44Example run plan:
451. Confirm the user input, output path, and any required config values.
462. Edit the in-file `CONFIG` block or documented parameters if the script uses fixed settings.
473. Run `python scripts/main.py` with the validated inputs.
484. Review the generated output and return the final artifact with any assumptions called out.
49
50## Implementation Details
51
52See `## Workflow` above for related details.
53
54- Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.
55- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.
56- Primary implementation surface: `scripts/main.py`.
57- Reference guidance: `references/` contains supporting rules, prompts, or checklists.
58- Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.
59- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.
60
61## Quick Check
62
63Use this command to verify that the packaged script entry point can be parsed before deeper execution.
64
65```bash
66python -m py_compile scripts/main.py
67```
68
69## Audit-Ready Commands
70
71Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
72
73```bash
74python -m py_compile scripts/main.py
75python scripts/main.py --help
76```
77
78## Workflow
79
801. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
812. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
823. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
834. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
845. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
85
86## Features
87
88- **BLAST API Integration**: Query NCBI BLAST service for sequence similarity search
89- **Multiple BLAST Programs**: blastn, blastp, blastx, tblastn, tblastx
90- **Alignment Visualization**: Display results in human-readable format
91- **Database Support**: nr, nt, swissprot, refseq, pdb, and more
92
93## Usage
94
95```text
96python scripts/main.py --sequence "ATGCGTACGTAGCTAGCTAG" --program blastn --database nt --output results.txt
97```
98
99### Parameters
100
101| Parameter | Description | Required |
102|-----------|-------------|----------|
103| `--sequence` | Query sequence (DNA/Protein) | Yes |
104| `--program` | BLAST program: blastn, blastp, blastx, tblastn, tblastx | Yes |
105| `--database` | Target database: nr, nt, swissprot, pdb, refseq_protein | Yes |
106| `--output` | Output file path | No |
107| `--format` | Output format: text, json, csv | No (default: text) |
108| `--max_hits` | Maximum number of hits to return | No (default: 10) |
109| `--evalue` | E-value threshold | No (default: 10) |
110
111## Technical Difficulty
112
113**Medium** - Requires understanding of BLAST algorithm, API handling with retry logic, and biological sequence formats.
114
115## BLAST Programs Reference
116
117| Program | Query Type | Database Type | Use Case |
118|---------|-----------|---------------|----------|
119| blastn | Nucleotide | Nucleotide | DNA vs DNA |
120| blastp | Protein | Protein | Protein vs Protein |
121| blastx | Nucleotide (translated) | Protein | DNA vs Protein |
122| tblastn | Protein | Nucleotide (translated) | Protein vs DNA |
123| tblastx | Nucleotide (translated) | Nucleotide (translated) | Translated DNA vs DNA |
124
125## Example Workflows
126
127### DNA Sequence Similarity Search
128```text
129python scripts/main.py --sequence "ATGGCCCTGTGGATGCGCTTCTTAGTCG" --program blastn --database nt --max_hits 5
130```
131
132### Protein Sequence Alignment
133```text
134python scripts/main.py --sequence "MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQAPILSRVGDGT" --program blastp --database swissprot --evalue 0.001
135```
136
137## Output Format
138
139Results include:
140- Query sequence info
141- Hit definitions and accession numbers
142- Alignment scores (bit score, e-value)
143- Percent identity and similarity
144- Alignment visualization with match/mismatch highlighting
145
146## References
147
148- [BLAST Documentation](references/blast_docs.md)
149- [NCBI BLAST API Guide](references/ncbi_api_guide.md)
150
151## Risk Assessment
152
153| Risk Indicator | Assessment | Level |
154|----------------|------------|-------|
155| Code Execution | Python scripts with tools | High |
156| Network Access | External API calls | High |
157| File System Access | Read/write data | Medium |
158| Instruction Tampering | Standard prompt guidelines | Low |
159| Data Exposure | Data handled securely | Medium |
160
161## Security Checklist
162
163- [ ] No hardcoded credentials or API keys
164- [ ] No unauthorized file system access (../)
165- [ ] Output does not expose sensitive information
166- [ ] Prompt injection protections in place
167- [ ] API requests use HTTPS only
168- [ ] Input validated against allowed patterns
169- [ ] API timeout and retry mechanisms implemented
170- [ ] Output directory restricted to workspace
171- [ ] Script execution in sandboxed environment
172- [ ] Error messages sanitized (no internal paths exposed)
173- [ ] Dependencies audited
174- [ ] No exposure of internal service architecture
175
176## Prerequisites
177
178No additional Python packages required.
179
180## Evaluation Criteria
181
182### Success Metrics
183- [ ] Successfully executes main functionality
184- [ ] Output meets quality standards
185- [ ] Handles edge cases gracefully
186- [ ] Performance is acceptable
187
188### Test Cases
1891. **Basic Functionality**: Standard input → Expected output
1902. **Edge Case**: Invalid input → Graceful error handling
1913. **Performance**: Large dataset → Acceptable processing time
192
193## Lifecycle Status
194
195- **Current Stage**: Draft
196- **Next Review Date**: 2026-03-06
197- **Known Issues**: None
198- **Planned Improvements**:
199 - Performance optimization
200 - Additional feature support
201
202## Output Requirements
203
204Every final response should make these items explicit when they are relevant:
205
206- Objective or requested deliverable
207- Inputs used and assumptions introduced
208- Workflow or decision path
209- Core result, recommendation, or artifact
210- Constraints, risks, caveats, or validation needs
211- Unresolved items and next-step checks
212
213## Error Handling
214
215- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
216- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
217- If `scripts/main.py` fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.
218- Do not fabricate files, citations, data, search results, or execution outcomes.
219
220## Input Validation
221
222This skill accepts requests that match the documented purpose of `sequence-alignment` and include enough context to complete the workflow safely.
223
224Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
225
226> `sequence-alignment` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
227
228## Response Template
229
230Use the following fixed structure for non-trivial requests:
231
2321. Objective
2332. Inputs Received
2343. Assumptions
2354. Workflow
2365. Deliverable
2376. Risks and Limits
2387. Next Checks
239
240If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.