Permalink
Browse files

Trim sequences to codon boundary

  • Loading branch information...
1 parent 16e376e commit f050b410555f4b7d37b2f04a71d5b7403ccdb5e3 @pjotrp committed Apr 26, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 bin/fasta_filter.rb
View
@@ -30,6 +30,11 @@ def self.parse(args)
options.codonize = b
end
+ opts.on("--min [size]",
+ "Set minimum sequence size") do |min|
+ options.min = min.to_i
+ end
+
opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options.verbose = v
end
@@ -57,6 +62,8 @@ def self.parse(args)
size = rec.seq.size
rec.seq = rec.seq[0..size - (size % 3) - 1]
end
+ next if options.min and req.seq.size < options.min
+
print rec.to_fasta
}

0 comments on commit f050b41

Please sign in to comment.