bio-polyploid-tools 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e22a969416448c22a39bc4ba2e0b019392a97ed4
4
- data.tar.gz: 16fa6b61e54d6a6da47867826435194605ce0d22
3
+ metadata.gz: 381e678b7d15cffb675e941b461ccd7a8cbc1132
4
+ data.tar.gz: bb2632d78ed15718ea6e295de21539e158896625
5
5
  SHA512:
6
- metadata.gz: 96f1764086a490876516b7f9cf09c70d825733c518ecf4c21ad185ef24dda889e4398a3fe2a2f8e206feb056e2fe6c474fe7b938d03148c50a1a3ae2e6a6e048
7
- data.tar.gz: 4792600da52fc6fdc31f15b2ed4c1e7db294aaf87d3c4538b6242951a24a6f4ba9a359f271a12d66af4c8e51f6eee746f588cb21d65a545216ffeb4bb05f8411
6
+ metadata.gz: 7c3c364a4fc0bdd6e20aa69eacb9e76c90e1a8b34de50775ce5a77177d4438c3f0b768e73e751f282bfa14dc88645e8e19c1c69c0ce4d60d9c01d5371bb0ea08
7
+ data.tar.gz: f16d826561a31ac8d045ca9934068f6f7f2101d306405c5c5d0d0aaa8bc8976039fcc3d0f5f3d0170f08f150257e914a135a706f1f07ae8b6e85b0572d46cb0c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.3
@@ -10,8 +10,23 @@ $: << File.expand_path('.')
10
10
  path= File.expand_path(File.dirname(__FILE__) + '/../lib/bioruby-polyploid-tools.rb')
11
11
  require path
12
12
 
13
+ arm_selection_functions = Hash.new;
13
14
 
14
15
 
16
+ arm_selection_functions[:arm_selection_first_two] = lambda do | contig_name |
17
+ ret = contig_name[0,2]
18
+ return ret
19
+ end
20
+ #Function to parse stuff like: IWGSC_CSS_1AL_scaff_110
21
+ arm_selection_functions[:arm_selection_embl] = lambda do | contig_name|
22
+ ret = contig_name.split('_')[2][0,2]
23
+ return ret
24
+ end
25
+
26
+ arm_selection_functions[:arm_selection_morex] = lambda do | contig_name |
27
+ ret = contig_name.split(':')[0].split("_")[1];
28
+ return ret
29
+ end
15
30
 
16
31
  options = {}
17
32
  options[:path_to_contigs] = "/tgac/references/external/projects/iwgsc/css/IWGSC_CSS_all_scaff_v1.fa"
@@ -19,6 +34,7 @@ options[:chunks] = 1
19
34
  options[:bucket_size] = 0
20
35
  options[:bucket] = 1
21
36
  options[:model] = "est2genome"
37
+ options[:arm_selection] = arm_selection_functions[:arm_selection_embl] ;
22
38
  OptionParser.new do |opts|
23
39
  opts.banner = "Usage: polymarker.rb [options]"
24
40
 
@@ -45,6 +61,10 @@ OptionParser.new do |opts|
45
61
  opts.on("-e", "--exonerate_model MODEL", "Model to be used in exonerate to search for the contigs") do |o|
46
62
  options[:model] = o
47
63
  end
64
+
65
+ opts.on("-a", "--arm_selection arm_selection_embl|arm_selection_morex|arm_selection_first_two", "Function to decide the chromome arm") do |o|
66
+ options[:arm_selection] = arm_selection_functions[o.to_sym];
67
+ end
48
68
 
49
69
 
50
70
  end.parse!
@@ -115,8 +135,14 @@ File.open(test_file) do | f |
115
135
  snp = Bio::PolyploidTools::SNPSequence.parse(line)
116
136
  elsif options[:snp_list] and options[:reference] #List and fasta file
117
137
  snp = Bio::PolyploidTools::SNP.parse(line)
118
- region = fasta_reference_db.index.region_for_entry(snp.gene).get_full_region
119
- snp.template_sequence = fasta_reference_db.fetch_sequence(region)
138
+ entry = fasta_reference_db.index.region_for_entry(snp.gene)
139
+ if entry
140
+ region = fasta_reference_db.index.region_for_entry(snp.gene).get_full_region
141
+ snp.template_sequence = fasta_reference_db.fetch_sequence(region)
142
+ else
143
+ $stderr.puts "Unable to find entry for #{snp.gene}"
144
+ end
145
+
120
146
  else
121
147
  rise Bio::DB::Exonerate::ExonerateException.new "Wrong number of arguments. "
122
148
  end
@@ -178,15 +204,7 @@ contigs_f.close()
178
204
  #Custom arm selection function that only uses the first two characters. Maybe
179
205
  #we want to make it a bit more cleaver
180
206
  write_status "Reading best alignment on each chromosome"
181
- arm_selection_first_two = lambda do | contig_name |
182
- ret = contig_name[0,2]
183
- return ret
184
- end
185
- #Function to parse stuff like: IWGSC_CSS_1AL_scaff_110
186
- arm_selection_embl = lambda do | contig_name|
187
- ret = contig_name.split('_')[2][0,2]
188
- return ret
189
- end
207
+
190
208
 
191
209
  container= Bio::PolyploidTools::ExonContainer.new
192
210
  container.flanking_size=100
@@ -199,7 +217,7 @@ snps.each do |snp|
199
217
  snp.flanking_size = container.flanking_size
200
218
  container.add_snp(snp)
201
219
  end
202
- container.add_alignments({:exonerate_file=>exonerate_file, :arm_selection=>arm_selection_embl, :min_identity=>min_identity})
220
+ container.add_alignments({:exonerate_file=>exonerate_file, :arm_selection=>options[:arm_selection] , :min_identity=>min_identity})
203
221
 
204
222
 
205
223
  #4.1 generating primer3 file
@@ -15,7 +15,7 @@ require path
15
15
 
16
16
 
17
17
 
18
- fasta_db = Bio::DB::Fasta::FastaFile.new(:fasta=>ARGV[0])
18
+ fasta_db = Bio::DB::Fasta::FastaFile.new( ARGV[0])
19
19
  fasta_db.load_fai_entries
20
20
  bam1 = Bio::DB::Sam.new({:fasta=>ARGV[0], :bam=>ARGV[1]})
21
21
  bam2 = Bio::DB::Sam.new({:fasta=>ARGV[0], :bam=>ARGV[2]})
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: bio-polyploid-tools 0.3.1 ruby lib
5
+ # stub: bio-polyploid-tools 0.3.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "bio-polyploid-tools"
9
- s.version = "0.3.1"
9
+ s.version = "0.3.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Ricardo H. Ramirez-Gonzalez"]
14
- s.date = "2014-05-08"
14
+ s.date = "2014-05-30"
15
15
  s.description = "Repository of tools developed in TGAC and Crop Genetics in JIC to work with polyploid wheat"
16
16
  s.email = "ricardo.ramirez-gonzalez@tgac.ac.uk"
17
17
  s.executables = ["bfr.rb", "count_variations.rb", "filter_blat_by_target_coverage.rb", "find_best_blat_hit.rb", "find_best_exonerate.rb", "hexaploid_primers.rb", "homokaryot_primers.rb", "map_markers_to_contigs.rb", "markers_in_region.rb", "polymarker.rb", "snps_between_bams.rb"]
@@ -13,7 +13,7 @@ module Bio::PolyploidTools
13
13
  attr_accessor :use_reference
14
14
  attr_accessor :genomes_count
15
15
 
16
- attr_reader :chromosome
16
+ attr_accessor :chromosome
17
17
 
18
18
  #Format:
19
19
  #Gene_name,Original,SNP_Pos,pos,chromosome
@@ -40,9 +40,10 @@ module Bio::PolyploidTools
40
40
 
41
41
 
42
42
  #We Only want the chromosome, we drop the arm.
43
- def chromosome= (chr)
44
- @chromosome = chr[0,2]
45
- end
43
+ #We don't use this any more.
44
+ #def chromosome= (chr)
45
+ # @chromosome = chr
46
+ #end
46
47
 
47
48
  def chromosome_group
48
49
  chromosome[0]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-polyploid-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo H. Ramirez-Gonzalez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-08 00:00:00.000000000 Z
11
+ date: 2014-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bio