bio-polyploid-tools 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/homokaryot_primers.rb +32 -4
- data/bio-polyploid-tools.gemspec +3 -3
- data/lib/bio/PolyploidTools/ExonContainer.rb +1 -0
- data/lib/bio/PolyploidTools/SNP.rb +6 -2
- data/lib/bio/db/primer3.rb +10 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8560331ced4feb75e55252375e8ba98465afc5cf
|
4
|
+
data.tar.gz: 80ae4e52cf6612f7715316176763c17489afa8b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 736c33a7fca6ea11d1456efe2967e237f39b3ecaa850ea04e2720254ba0fe74ee57f611872dcd31a37b58dfae69f6a0d76466080bf1e0296928e8b7d9b0d25b6
|
7
|
+
data.tar.gz: 3b5b6743f098b918d0b2336db079cf7b23be51690bdbf4e7531f4f27f716af1c143dabf11622692f7388e7742dbd92fb704646f8a143af46005225a5bceb263f
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.6
|
data/bin/homokaryot_primers.rb
CHANGED
@@ -21,14 +21,22 @@ class HomokaryotContainer < Bio::PolyploidTools::ExonContainer
|
|
21
21
|
flanking_size = 100
|
22
22
|
File.open(filename) do | f |
|
23
23
|
f.each_line do | line |
|
24
|
+
if ARGV.size == 1 #List with Sequence
|
25
|
+
snp = Bio::PolyploidTools::SNPSequence.parse(line)
|
26
|
+
snp.use_reference = false
|
27
|
+
elsif ARGV.size == 2 #List and fasta file
|
24
28
|
snp = Bio::PolyploidTools::SNP.parse(line)
|
29
|
+
snp.use_reference = true
|
30
|
+
end
|
31
|
+
#snp = Bio::PolyploidTools::SNP.parse(line)
|
32
|
+
# puts snp.gene
|
25
33
|
snp.flanking_size = flanking_size
|
26
34
|
if snp.position > 0
|
27
35
|
snp.container = self
|
28
36
|
snp.chromosome = chromosome
|
29
37
|
snp.snp_in = snp_in
|
30
38
|
snp.original_name = original_name
|
31
|
-
|
39
|
+
|
32
40
|
snp.container = self
|
33
41
|
@snp_map[snp.gene] = Array.new unless @snp_map[snp.gene]
|
34
42
|
@snp_map[snp.gene] << snp
|
@@ -95,6 +103,7 @@ File.open(snp_file) do | f |
|
|
95
103
|
snp = nil
|
96
104
|
if ARGV.size == 1 #List with Sequence
|
97
105
|
snp = Bio::PolyploidTools::SNPSequence.parse(line)
|
106
|
+
|
98
107
|
elsif ARGV.size == 2 #List and fasta file
|
99
108
|
snp = Bio::PolyploidTools::SNP.parse(line)
|
100
109
|
region = fasta_reference_db.index.region_for_entry(snp.gene).get_full_region
|
@@ -112,13 +121,32 @@ File.open(snp_file) do | f |
|
|
112
121
|
end
|
113
122
|
|
114
123
|
|
124
|
+
output_folder="#{snp_file}_primer_design_#{Time.now.strftime('%Y%m%d-%H%M%S')}/"
|
125
|
+
Dir.mkdir(output_folder)
|
126
|
+
seqs_file= output_folder + "sequences.fa"
|
127
|
+
written_seqs = Set.new
|
128
|
+
reference_file = seqs_file unless reference_file
|
129
|
+
|
130
|
+
|
131
|
+
file = File.open(seqs_file, "w")
|
132
|
+
snps.each do |snp|
|
133
|
+
unless written_seqs.include?(snp.gene)
|
134
|
+
written_seqs << snp.gene
|
135
|
+
file.puts snp.to_fasta
|
136
|
+
end
|
137
|
+
end
|
138
|
+
file.close
|
139
|
+
|
140
|
+
|
115
141
|
container = HomokaryotContainer.new
|
116
142
|
container.add_parental({:name=>snp_in})
|
117
143
|
container.add_parental({:name=>original_name})
|
118
|
-
container.gene_models(reference_file)
|
144
|
+
container.gene_models(reference_file) if reference_file
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
119
149
|
|
120
|
-
output_folder="#{snp_file}_primer_design_#{Time.now.strftime('%Y%m%d-%H%M%S')}/"
|
121
|
-
Dir.mkdir(output_folder)
|
122
150
|
primer_3_input="#{output_folder}primer_3_input_temp"
|
123
151
|
primer_3_output="#{output_folder}primer_3_output_temp"
|
124
152
|
container.add_snp_file(snp_file, "PST130", snp_in, original_name)
|
data/bio-polyploid-tools.gemspec
CHANGED
@@ -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.4.
|
5
|
+
# stub: bio-polyploid-tools 0.4.6 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "bio-polyploid-tools"
|
9
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.6"
|
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-10-
|
14
|
+
s.date = "2014-10-08"
|
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", "snp_position_to_polymarker.rb", "snps_between_bams.rb"]
|
@@ -99,8 +99,12 @@ module Bio::PolyploidTools
|
|
99
99
|
max = @position
|
100
100
|
# puts "Calculating covered region for #{self.inspect}"
|
101
101
|
# puts "#{@exon_list.inspect}"
|
102
|
-
raise SNPException.new "Exons haven't been loaded for #{self.to_s}" if @exon_list.size == 0
|
103
|
-
|
102
|
+
#raise SNPException.new "Exons haven't been loaded for #{self.to_s}" if @exon_list.size == 0
|
103
|
+
if @exon_list.size == 0
|
104
|
+
min = self.position - self.flanking_size
|
105
|
+
min = 1 if min < 1
|
106
|
+
max = self.position + self.flanking_size
|
107
|
+
end
|
104
108
|
@exon_list.each do | chromosome, exon |
|
105
109
|
# puts exon.inspect
|
106
110
|
reg = exon.query_region
|
data/lib/bio/db/primer3.rb
CHANGED
@@ -287,11 +287,11 @@ module Bio::DB::Primer3
|
|
287
287
|
|
288
288
|
if primer3record.primer_left_num_returned.to_i > 0
|
289
289
|
case
|
290
|
-
when primer3record.line == @
|
290
|
+
when primer3record.line == @line_1
|
291
291
|
primers_line_1 << primer3record
|
292
292
|
#puts primer3record.inspect
|
293
293
|
@primer3_line_1 = primer3record if not @primer3_line_1 or @primer3_line_1 > primer3record
|
294
|
-
when primer3record.line == @
|
294
|
+
when primer3record.line == @line_2
|
295
295
|
primers_line_2 << primer3record
|
296
296
|
@primer3_line_2 = primer3record if not @primer3_line_2 or @primer3_line_2 > primer3record
|
297
297
|
else
|
@@ -309,12 +309,12 @@ module Bio::DB::Primer3
|
|
309
309
|
|
310
310
|
def best_pair
|
311
311
|
return @best_pair if @best_pair
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
312
|
+
@best_pair = nil
|
313
|
+
@primerPairs.each do | primer |
|
314
|
+
@best_pair = primer if @best_pair == nil
|
315
|
+
@best_pair = primer if primer.size < @best_pair.size
|
316
|
+
end
|
317
|
+
#@best_pair = @primerPairs.min
|
318
318
|
@best_pair
|
319
319
|
end
|
320
320
|
|
@@ -680,6 +680,8 @@ module Bio::DB::Primer3
|
|
680
680
|
|
681
681
|
def add_primers_file(filename)
|
682
682
|
Primer3Record.parse_file(filename) do | primer3record |
|
683
|
+
# puts "#{primer3record.snp.to_s}:#{primer3record.chromosome}"
|
684
|
+
# puts @snp_hash.keys.to_s
|
683
685
|
current_snp = @snp_hash["#{primer3record.snp.to_s}:#{primer3record.chromosome}"]
|
684
686
|
current_snp.add_record(primer3record)
|
685
687
|
|
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.4.
|
4
|
+
version: 0.4.6
|
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-10-
|
11
|
+
date: 2014-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bio
|