<commit_before>#
# Cookbook Name:: chef-bioinf-worker
# Recipe:: msgf
#
# Copyright (c) 2015 <NAME>, All Rights Reserved.

msgf_link = "http://proteomics.ucsd.edu/Software/MSGFPlus/MSGFPlus.zip"
msgf_zip  = "#{node.dir.archive}/#{File.basename( msgf_link )}"
msgf_dir  = "#{node.dir.software}/msgf"
msgf_jar  = "#{msgf_dir}/MSGFPlus.jar"


include_recipe "chef-bioinf-worker::java"

directory node.dir.software
directory node.dir.archive

package "unzip"

remote_file msgf_zip do
  action :create_if_missing
  source msgf_link
  retries 1
end

bash "extract_msgf" do
  code "unzip -o #{msgf_zip} -d #{msgf_dir}"
  not_if "#{Dir.exists?( msgf_dir )}"
end

file "#{node.dir.bin}/msgf" do
  content <<-SCRIPT
#!/usr/bin/env bash
java -jar #{msgf_jar} $@
  SCRIPT
  mode "0755"
end<commit_msg>buildsa command for MSGF added.<commit_after>#
# Cookbook Name:: chef-bioinf-worker
# Recipe:: msgf
#
# Copyright (c) 2015 <NAME>, All Rights Reserved.

msgf_link = "http://proteomics.ucsd.edu/Software/MSGFPlus/MSGFPlus.zip"
msgf_zip  = "#{node.dir.archive}/#{File.basename( msgf_link )}"
msgf_dir  = "#{node.dir.software}/msgf"
msgf_jar  = "#{msgf_dir}/MSGFPlus.jar"


include_recipe "chef-bioinf-worker::java"

directory node.dir.software
directory node.dir.archive

package "unzip"

remote_file msgf_zip do
  action :create_if_missing
  source msgf_link
  retries 1
end

bash "extract_msgf" do
  code "unzip -o #{msgf_zip} -d #{msgf_dir}"
  not_if "#{Dir.exists?( msgf_dir )}"
end

file "#{node.dir.bin}/msgf" do
  content <<-SCRIPT
#!/usr/bin/env bash
java -jar #{msgf_jar} $@
  SCRIPT
  mode "0755"
end

file "#{node.dir.bin}/buildsa" do
  content <<-SCRIPT
#!/usr/bin/env bash
java -Xmx3500M -cp #{msgf_jar} edu.ucsd.msjava.msdbsearch.BuildSA $@
  SCRIPT
  mode "0755"
end
{'fraction_non_alphanumeric': 0.15506508205998867, 'fraction_numerical': 0.014714204867006225, 'mean_word_length': 4.44, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7081178', 'n_tokens_mistral': 765, 'n_tokens_neox': 720, 'n_words': 153}