Sha256: 0c4578001b1e6f1cb0491d7a6e116f8167db8e4e81f7e01b5a8dbeeb2dd0f199

Contents?: true

Size: 752 Bytes

Versions: 14

Compression:

Stored size: 752 Bytes

Contents

#!/usr/bin/ruby -w

require 'fasta'
require 'sample_enzyme'

if ARGV.size < 2
  puts "usage: #{File.basename(__FILE__)} missed_cleavages <file>.fasta ..."
  puts "       returns <file>.missed_cleavages_<missed_cleavages>.peptides"
  abort
end

missed_cleavages = ARGV.shift.to_i

ARGV.each do |file|
  
  if file !~ /\.fasta/
    abort "must be a fasta file with extension fasta"
  end
  new_filename = file.sub(/\.fasta$/, '')
  new_filename << ".missed_cleavages_#{missed_cleavages}.peptides"
  File.open(new_filename, "w") do |fh|
    peptides = []
    Fasta.new.read_file(file).prots.each do |prot|
      fh.puts( prot.header.split(/\s+/).first.sub(/^>/,'') + "\t" + SampleEnzyme.tryptic(prot.aaseq, missed_cleavages).join(" ") )
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mspire-0.4.9 script/simple_protein_digestion.rb
mspire-0.2.1 script/simple_protein_digestion.rb
mspire-0.1.7 script/simple_protein_digestion.rb
mspire-0.2.0 script/simple_protein_digestion.rb
mspire-0.2.2 script/simple_protein_digestion.rb
mspire-0.2.4 script/simple_protein_digestion.rb
mspire-0.1.5 script/simple_protein_digestion.rb
mspire-0.3.0 script/simple_protein_digestion.rb
mspire-0.3.1 script/simple_protein_digestion.rb
mspire-0.3.9 script/simple_protein_digestion.rb
mspire-0.4.2 script/simple_protein_digestion.rb
mspire-0.4.4 script/simple_protein_digestion.rb
mspire-0.4.7 script/simple_protein_digestion.rb
mspire-0.4.5 script/simple_protein_digestion.rb