<commit_before>#!/usr/bin/env ruby

require 'transmembrane'
include Transmembrane
require 'tempfile'
require 'rubygems'
gem 'rio'
require 'rio'

class PhobiusWrapper
  
  # Given an amino acid sequence, return a TransmembraneProtein
  # made up of the predicted transmembrane domains
  def calculate(sequence)
    rio(:tempdir) do |d|
      FileUtils.cd(d.to_s) do
        Tempfile.open('phobiusin') { |tempfilein|
          # Write a fasta to the tempfile
          tempfilein.puts '>wrapperSeq'
          tempfilein.puts "#{sequence}"
          tempfilein.close #required. Maybe because it doesn't flush otherwise?<commit_msg>updated phobius_wrapper<commit_after>#!/usr/bin/env ruby

require 'rubygems'
require 'bio-tm_hmm'
include Bio::Transmembrane
require 'tempfile'
require 'rubygems'
require 'rio'

class PhobiusWrapper
  
  # Given an amino acid sequence, return a TransmembraneProtein
  # made up of the predicted transmembrane domains
  def calculate(sequence)
    rio(:tempdir) do |d|
      FileUtils.cd(d.to_s) do
        Tempfile.open('phobiusin') { |tempfilein|
          # Write a fasta to the tempfile
          tempfilein.puts '>wrapperSeq'
          tempfilein.puts "#{sequence}"
          tempfilein.close #required. Maybe because it doesn't flush otherwise?
{'fraction_non_alphanumeric': 0.09005481597494126, 'fraction_numerical': 0.0, 'mean_word_length': 3.5159010600706715, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7183599', 'n_tokens_mistral': 416, 'n_tokens_neox': 386, 'n_words': 116}