Skip to content

Instantly share code, notes, and snippets.

@nickloman
Created November 20, 2012 15:16
Show Gist options
  • Select an option

  • Save nickloman/4118522 to your computer and use it in GitHub Desktop.

Select an option

Save nickloman/4118522 to your computer and use it in GitHub Desktop.
Extract the first X bytes from a FASTA file
from Bio import SeqIO
import sys
rec = SeqIO.parse(open(sys.argv[1]), "fasta").next()
SeqIO.write(rec[0:int(sys.argv[2])], sys.stdout, "fasta")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment