Skip to content

Instantly share code, notes, and snippets.

@mdshw5
Created August 17, 2015 22:54
Show Gist options
  • Save mdshw5/de9db76467ad88c4ae49 to your computer and use it in GitHub Desktop.
Save mdshw5/de9db76467ad88c4ae49 to your computer and use it in GitHub Desktop.
Biostars 154785
import random
import sys
from pyfaidx import Fasta
n = 10
faa = Fasta("file.faa")
for sample in random.sample(faa, n):
print(sample.name)
for line in sample:
print(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment