This skill performs pairwise sequence alignment to compare two DNA, RNA, or protein sequences. It uses Biopython's PairwiseAligner class which implements dynamic programming algorithms for finding optimal alignments.
pip install biopythonTell your AI agent what you want to do:
- "Align these two DNA sequences and show me the best alignment"
- "Compare this protein sequence against a reference using BLOSUM62"
- "Find the best matching region between these two sequences"
"Perform a global alignment between ACCGGTAACGTAG and ACCGTTAACGAAG"
"Align the first two sequences in my FASTA file"
"Find the best local alignment between these sequences to identify conserved regions"
"Use Smith-Waterman to find matching regions in these proteins"
"Align these two protein sequences using BLOSUM62 scoring"
"Compare my query protein against the reference with appropriate gap penalties"
"Calculate the alignment score between these sequences"
"Show me all optimal alignments and their scores"
- Create a
PairwiseAlignerwith appropriate settings - Configure scoring (match/mismatch for DNA, substitution matrix for proteins)
- Set gap penalties based on sequence type
- Generate optimal alignment(s)
- Display aligned sequences with match indicators
- Report alignment score and statistics
| Mode | Best For |
|---|---|
| Global | Full-length sequence comparison |
| Local | Finding conserved regions |
| Semiglobal | Overlapping sequences, primer alignment |
- For DNA/RNA: Use simple match/mismatch scoring (match=2, mismatch=-1)
- For proteins: Always use a substitution matrix like BLOSUM62
- For finding regions: Use local mode instead of global
- For many alignments: Set
max_alignmentsto limit memory usage - Alignment score depends heavily on gap penalties - adjust if results seem wrong