Skip to content

Instantly share code, notes, and snippets.

@dwinter
Last active August 29, 2015 14:16
Show Gist options
  • Save dwinter/47895c5cb952a2b63db9 to your computer and use it in GitHub Desktop.
Save dwinter/47895c5cb952a2b63db9 to your computer and use it in GitHub Desktop.
biostars example
 library(ape)
 data(woodmouse)
 #Just the third codon (assuming alignment is in-frame)
 woodmouse[, seq(1, ncol(woodmouse), by=3) ]
## 15 DNA sequences in binary format stored in a matrix.
## 
## All sequences of same length: 322 
## 
## Labels: No305 No304 No306 No0906S No0908S No0909S ...
## 
## Base composition:
##     a     c     g     t 
## 0.285 0.238 0.219 0.258
 #skipping the thrid codon
 woodmouse[, -seq(1, ncol(woodmouse), by=3) ]
## 15 DNA sequences in binary format stored in a matrix.
## 
## All sequences of same length: 643 
## 
## Labels: No305 No304 No306 No0906S No0908S No0909S ...
## 
## Base composition:
##     a     c     g     t 
## 0.318 0.273 0.079 0.330
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment