protk 1.2.6.pre2 → 1.2.6.pre3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2cb8ece1038575e27d4d2bb8d5eff3ff2367a33
4
- data.tar.gz: db9cd97c0b87186e7a84c53ed43e132b25d1cd15
3
+ metadata.gz: d2c799502e7cdd09fc7067d8b2bdfbeba270805e
4
+ data.tar.gz: 39ba2f20593785f7a9720be1d48fa1e37f694b22
5
5
  SHA512:
6
- metadata.gz: df19012cdb42d14136a4f4682a3a45b2423b4b216bcdd8f959e0eaab5b7bcaa0546b5550d3a69accc1da4e158966150bb9f0e21d52c0ed2bf2c0397ca333195c
7
- data.tar.gz: a08a7bd13e3027b21bdd24cf13491e6041b05a19f3f066468a96357b543332e40b4827356de2d4b81e1d7a67daa44a73b283b1948f7824f33c6cf738df46383d
6
+ metadata.gz: 897eebcb8fd0e49b7373aa466bfbd7fe20a7b5fd7f0fbc08a6e015bdc808158416ac225d5f2703acbeb4f4421c79b1393460b1d69ebe55f010fd24a4854a9b0d
7
+ data.tar.gz: f61d8418f78b958d2b586c2a2f975fc6caf6b0ef4bb9838a5a9c7f5f7b90f22e96b6210cef3b27c91f038aa0764089481318cfe7f71793726c77e80f379b3705
data/README.md CHANGED
@@ -1,3 +1,6 @@
1
+
2
+ [![Build Status](https://travis-ci.org/iracooke/protk.png?branch=master)](https://travis-ci.org/iracooke/protk)
3
+
1
4
  # protk ( Proteomics toolkit )
2
5
 
3
6
 
@@ -6,15 +9,6 @@
6
9
 
7
10
  Protk is a wrapper for various proteomics tools. It aims to present a consistent interface to a wide variety of tools and provides support for managing protein databases.
8
11
 
9
- ***
10
-
11
- ## Table of Contents
12
-
13
- * [Protk](#what-is-it?)
14
- * [Installation](#installation)
15
- * [Configuration](#configuration)
16
-
17
-
18
12
 
19
13
  ## Installation
20
14
 
@@ -10,6 +10,8 @@
10
10
  require 'protk/constants'
11
11
  require 'protk/command_runner'
12
12
  require 'protk/prophet_tool'
13
+ require 'protk/galaxy_util'
14
+
13
15
 
14
16
  # Setup specific command-line options for this tool. Other options are inherited from ProphetTool
15
17
  #
@@ -70,7 +72,11 @@ if ( !Pathname.new(output_file).exist? || prophet_tool.over_write )
70
72
  cmd << " MINPROB=#{prophet_tool.min_prob}" if ( prophet_tool.min_prob !="" )
71
73
 
72
74
  inputs = ARGV.collect {|file_name|
73
- file_name.chomp
75
+ input_name=file_name.chomp
76
+ unless input_name !~/pep\.xml$/
77
+ input_name = GalaxyStager.new(input_name, :extension => ".pep.xml").staged_path
78
+ end
79
+ input_name
74
80
  }
75
81
 
76
82
  cmd << " #{inputs.join(" ")} #{output_file}"
@@ -238,7 +238,7 @@ ARGV.each do |filename|
238
238
  #if search_tool.explicit_output
239
239
  cmd << ";ruby -pi.bak -e \"gsub('post=\\\"?','post=\\\"X')\" #{mzid_output_path}"
240
240
  cmd << ";ruby -pi.bak -e \"gsub('pre=\\\"?','pre=\\\"X')\" #{mzid_output_path}"
241
- cmd << "; #{genv.idconvert} #{mzid_output_path} --pepXML -o #{Pathname.new(mzid_output_path).dirname}"
241
+ cmd << ";idconvert #{mzid_output_path} --pepXML -o #{Pathname.new(mzid_output_path).dirname}"
242
242
  #Then copy the pepxml to the final output path
243
243
  cmd << "; mv #{mzid_output_path.chomp('.mzid')}.pepXML #{output_path}"
244
244
  end
@@ -10,6 +10,9 @@
10
10
  require 'protk/constants'
11
11
  require 'protk/command_runner'
12
12
  require 'protk/prophet_tool'
13
+ require 'protk/galaxy_util'
14
+
15
+ galaxy_util = GalaxyUtil.new
13
16
 
14
17
  # Setup specific command-line options for this tool. Other options are inherited from ProphetTool
15
18
  #
@@ -116,6 +119,11 @@ throw "When --output and -F options are set only one file at a time can be run"
116
119
  genv=Constants.new
117
120
 
118
121
 
122
+ inputs=ARGV.collect { |file_name| file_name.chomp}
123
+ if galaxy_util.for_galaxy?
124
+ inputs = inputs.collect {|ip| galaxy_util.stage_pepxml(ip) }
125
+ end
126
+
119
127
  # Interrogate all the input files to obtain the database and search engine from them
120
128
  #
121
129
  genv.log("Determining search engine and database used to create input files ...",:info)
@@ -31,6 +31,16 @@ end
31
31
  tool=Tool.new([:explicit_output])
32
32
  tool.option_parser.banner = "Create a sixframe translation of a genome.\n\nUsage: sixframe.rb [options] genome.fasta"
33
33
 
34
+ tool.options.print_coords=false
35
+ tool.option_parser.on( '--coords', 'Write genomic coordinates in the fasta header' ) do
36
+ tool.options.print_coords=true
37
+ end
38
+
39
+ tool.options.keep_header=true
40
+ tool.option_parser.on( '--strip-header', 'Dont write sequence definition' ) do
41
+ tool.options.keep_header=false
42
+ end
43
+
34
44
  exit unless tool.check_options
35
45
 
36
46
  if ( ARGV[0].nil? )
@@ -86,12 +96,20 @@ file.each do |entry|
86
96
  ncbi_scaffold_id = entry.entry_id.gsub('|','_').gsub(' ','_')
87
97
  ncbi_accession = "lcl|#{ncbi_scaffold_id}_frame_#{frame}_orf_#{oi}"
88
98
 
89
- # check_coords(entry.naseq,orf,frame,position_start,position_end)
99
+ defline=">#{ncbi_accession}"
100
+
101
+ if tool.print_coords
102
+ defline << " #{position_start}|#{position_end}"
103
+ end
104
+
105
+ if tool.keep_header
106
+ defline << " #{entry.definition}"
107
+ end
90
108
 
91
109
  # Output in fasta format
92
110
  # start and end positions are always relative to the forward strand
93
111
 
94
- outfile.write(">#{ncbi_accession} #{position_start}|#{position_end}\n#{orf}\n")
112
+ outfile.write("#{defline}\n#{orf}\n")
95
113
 
96
114
  end
97
115
  position += orf.length*3+3
@@ -145,10 +145,6 @@ class Constants
145
145
  end
146
146
  end
147
147
 
148
- def idconvert
149
- return "#{self.pwiz_root}/idconvert"
150
- end
151
-
152
148
  def msconvert
153
149
  return "#{self.pwiz_root}/msconvert"
154
150
  end
@@ -206,7 +202,7 @@ class Constants
206
202
  end
207
203
 
208
204
  def makeblastdb
209
- return "#{self.blast_root}/bin/makeblastdb"
205
+ return "makeblastdb"
210
206
  end
211
207
 
212
208
  def searchblastdb
@@ -6,12 +6,20 @@ require 'fileutils'
6
6
 
7
7
  class GalaxyUtil
8
8
 
9
- def self.for_galaxy?
10
- for_galaxy = ARGV[0] == "--galaxy"
11
- ARGV.shift if for_galaxy
12
- return for_galaxy
9
+ attr_accessor :for_galaxy
10
+ attr_accessor :stagers
11
+
12
+ def initialize()
13
+ @for_galaxy= ARGV[0]=="--galaxy"
14
+ ARGV.shift if @for_galaxy
15
+ @stagers=[]
13
16
  end
14
17
 
18
+ def stage_pepxml(input_pepxml_path)
19
+ stager = GalaxyStager.new(input_pepxml_path, :extension => ".pep.xml")
20
+ @stagers << stager
21
+ stager.staged_path
22
+ end
15
23
 
16
24
  def self.stage_protxml(input_protxml_path)
17
25
  # This method takes in the path to a protxml created in Galaxy,
@@ -43,4 +51,7 @@ class GalaxyUtil
43
51
  protxml_path
44
52
  end
45
53
 
54
+
55
+
56
+
46
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6.pre2
4
+ version: 1.2.6.pre3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ira Cooke