Created
June 10, 2016 17:02
-
-
Save walterst/edde79da8912759285567f6f4cb50c8c to your computer and use it in GitHub Desktop.
Specify an input fasta file and minimum length, e.g. python remove_short_reads.py seqs.fna 1300 > trimmed_reads.fna
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from sys import argv | |
from cogent.parse.fasta import MinimalFastaParser | |
min_len = int(argv[2]) | |
for label,seq in MinimalFastaParser(open(argv[1], "U")): | |
if len(seq) >= min_len: | |
print ">%s\n%s" % (label, seq) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment