Sha256: d87a2a63cb9c3e1daf05770cd309f593611c99983a755687cc7f63650ec7047d

Contents?: true

Size: 483 Bytes

Versions: 3

Compression:

Stored size: 483 Bytes

Contents

#!/usr/bin/env ruby

if ARGV.size == 0
  puts "usage: #{File.basename(__FILE__)} <file>.fasta ..."
  puts "output: <file>.protid_to_size.yml"
  exit
end

ARGV.each do |file|
  base = file.chomp(File.extname(file))
  outfile = base + ".protid_to_size.yml"
  cnt = 0
  File.open(outfile,'w') do |out|
    Ms::Fasta.foreach(file) do |entry|
      out.puts "#{entry.entry_id}: #{entry.sequence.size}"
      cnt += 1
    end
  end
  puts "wrote #{cnt} protein lengths to: #{outfile}"
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ms-error_rate-0.0.11 bin/fasta_to_protein_length.rb
ms-error_rate-0.0.10 bin/fasta_to_protein_length.rb
ms-error_rate-0.0.9 bin/fasta_to_protein_length.rb