Skip to content

Instantly share code, notes, and snippets.

@sirusb
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sirusb/cf584bbc8e44786bbf95 to your computer and use it in GitHub Desktop.
Save sirusb/cf584bbc8e44786bbf95 to your computer and use it in GitHub Desktop.
Biostrings basic access
ds <- DNAString("GCAAAGT-TT-C")
length(ds)
# [1] 12
ds[1:3]
# 3-letter "DNAString" instance
#seq: GCA
ds[3:1]
# 3-letter "DNAString" instance
#seq: ACG
alphabetFrequency(ds)
#A C G T M R W S Y K V H D B N - + .
#3 2 2 3 0 0 0 0 0 0 0 0 0 0 0 2 0 0
head(trinucleotideFrequency(ds))
#AAA AAC AAG AAT ACA ACC
# 1 0 1 0 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment