Skip to content
Back to skills

Biostrings

ASecurity

R Biostrings package for biological sequences. Use for DNA, RNA, and protein sequence manipulation.

  • 5 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 4, 2026
datagoapi

Works with

  • api

Security analysis

A100/100

Scanned June 4, 2026

npx -y skills add LeoLin990405/r-analytics-skill --skill Biostrings --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Biostrings?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Biostrings
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leolin990405-biostrings/badge)](https://www.skillsdirectory.com/skills/leolin990405-biostrings)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Biostrings
description: R Biostrings package for biological sequences. Use for DNA, RNA, and protein sequence manipulation.
---

# Biostrings Package

Efficient manipulation of biological sequences.

## Create Sequences

```r
library(Biostrings)

# DNA
dna <- DNAString("ATGCGATCGATCG")
dna_set <- DNAStringSet(c("ATGC", "GCTA", "TTAA"))

# RNA
rna <- RNAString("AUGCGAUCGAUCG")

# Amino acids
aa <- AAString("MKTAYIAKQRQISFVKSHFSRQLEERLGLIEVQAPILSRVGDGTQDNLSGAEKAVQVKVKALPDAQFEVVHSLAKWKRQQIAAALEHHHHHH")
```

## Read FASTA

```r
# Read
seqs <- readDNAStringSet("sequences.fasta")
seqs <- readAAStringSet("proteins.fasta")

# Write
writeXStringSet(seqs, "output.fasta")
```

## Basic Operations

```r
# Length
length(dna)
width(dna_set)

# Subset
subseq(dna, start = 1, end = 10)
dna[1:10]

# Reverse complement
reverseComplement(dna)

# Translate
translate(dna)
```

## Pattern Matching

```r
# Find pattern
matchPattern("ATG", dna)

# Count
countPattern("ATG", dna)

# Multiple patterns
vmatchPattern("ATG", dna_set)

# With mismatches
matchPattern("ATG", dna, max.mismatch = 1)
```

## Alignment

```r
# Pairwise alignment
pairwiseAlignment(pattern, subject,
  type = "global",
  substitutionMatrix = "BLOSUM62"
)

# Score
score(alignment)

# Aligned sequences
aligned(alignment)
```

## Sequence Statistics

```r
# Letter frequency
letterFrequency(dna, letters = c("A", "T", "G", "C"))

# Dinucleotide frequency
dinucleotideFrequency(dna)

# GC content
letterFrequency(dna, "GC", as.prob = TRUE)

# Oligonucleotide frequency
oligonucleotideFrequency(dna, width = 3)
```

## Consensus

```r
# Consensus matrix
consensusMatrix(dna_set)

# Consensus string
consensusString(dna_set)
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.