bio-polyploid-tools 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/VERSION +1 -1
- data/bin/polymarker.rb +41 -58
- data/bio-polyploid-tools.gemspec +2 -2
- data/lib/bio/PolyploidTools/ChromosomeArm.rb +14 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33b494dbc4bf2eca85c52524144ee8577b8a157952dc1de6d588c2a9afa1fbff
|
4
|
+
data.tar.gz: 9884092fea3663022caf6d56cd66bb1e024aba12e0d896fe8ee8691ce0354d03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e852c5da462b2978612b87ce6b71ba70ff030d42b547bb5283818ea525058c389935471d8003dae7cd817c426acfdea5ec3ce8ec58f58682e5c3e9636168d6ef
|
7
|
+
data.tar.gz: c8e7b741c92989c070b0aa0c8d452de5bc8611c53266305942ab5e383ffd70233445b1cb6e3853e842e17490d455ccab12e785b818e442a1e6021a28dd7bbc57
|
data/README.md
CHANGED
@@ -128,6 +128,11 @@ To use blast instead of exonerate, use the following command:
|
|
128
128
|
|
129
129
|
## Release Notes
|
130
130
|
|
131
|
+
### 0.9.7
|
132
|
+
There was some strange issue with the numbering, so bumped to 0.9.7
|
133
|
+
|
134
|
+
* Moved the arm selection function for fields in the chromosome name to the ```ChromosomeArm``` class.
|
135
|
+
|
131
136
|
### 0.8.7
|
132
137
|
* FEATURE: ```polymarker.rb``` now also prints the total number of hits found.
|
133
138
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.8
|
data/bin/polymarker.rb
CHANGED
@@ -39,8 +39,7 @@ options[:min_identity] = 90
|
|
39
39
|
options[:scoring] = :genome_specific
|
40
40
|
options[:database] = false
|
41
41
|
options[:filter_best] = false
|
42
|
-
options[:
|
43
|
-
options[:aligner] = :exonerate
|
42
|
+
options[:aligner] = :blast
|
44
43
|
|
45
44
|
|
46
45
|
options[:primer_3_preferences] = {
|
@@ -58,70 +57,56 @@ options[:primer_3_preferences] = {
|
|
58
57
|
OptionParser.new do |opts|
|
59
58
|
opts.banner = "Usage: polymarker.rb [options]"
|
60
59
|
|
61
|
-
opts.on("-a", "--arm_selection #{Bio::PolyploidTools::ChromosomeArm.getValidFunctions.join('|')}", "Function to decide the chromome arm") do |o|
|
62
|
-
tmp_str = o
|
63
|
-
arr = o.split(",")
|
64
|
-
if arr.size == 2
|
65
|
-
options[:arm_selection] = lambda do |contig_name|
|
66
|
-
separator, field = arr
|
67
|
-
field = field.to_i
|
68
|
-
ret = contig_name.split(separator)[field]
|
69
|
-
return ret
|
70
|
-
end
|
71
|
-
else
|
72
|
-
options[:arm_selection] = Bio::PolyploidTools::ChromosomeArm.getArmSelection(o)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
opts.on("-b", "--filter_best", "If set, only keep the best alignment for each chromosome") do
|
77
|
-
options[:filter_best] = true
|
78
|
-
end
|
79
|
-
|
80
60
|
opts.on("-c", "--contigs FILE", "File with contigs to use as database") do |o|
|
81
61
|
options[:path_to_contigs] = o
|
82
62
|
end
|
83
63
|
|
84
|
-
opts.on("-
|
85
|
-
options[:
|
86
|
-
end
|
87
|
-
|
88
|
-
opts.on("-e", "--exonerate_model MODEL", "Model to be used in exonerate to search for the contigs") do |o|
|
89
|
-
options[:model] = o
|
64
|
+
opts.on("-m", "--marker_list FILE", "File with the list of markers to search from") do |o|
|
65
|
+
options[:marker_list] = o
|
90
66
|
end
|
91
67
|
|
92
68
|
opts.on("-g", "--genomes_count INT", "Number of genomes (default 3, for hexaploid)") do |o|
|
93
69
|
options[:genomes_count] = o.to_i
|
94
70
|
end
|
95
|
-
|
96
|
-
opts.on("-
|
97
|
-
options[:
|
71
|
+
|
72
|
+
opts.on("-b", "--filter_best", "If set, only keep the best alignment for each chromosome") do
|
73
|
+
options[:filter_best] = true
|
98
74
|
end
|
99
75
|
|
100
|
-
opts.on("-m", "--marker_list FILE", "File with the list of markers to search from") do |o|
|
101
|
-
options[:marker_list] = o
|
102
|
-
end
|
103
76
|
|
104
|
-
opts.on("-
|
105
|
-
options[:
|
77
|
+
opts.on("-s", "--snp_list FILE", "File with the list of snps to search from, requires --reference to get the sequence using a position") do |o|
|
78
|
+
options[:snp_list] = o
|
106
79
|
end
|
107
80
|
|
108
|
-
opts.on("-
|
109
|
-
|
81
|
+
opts.on("-t", "--mutant_list FILE", "File with the list of positions with mutation and the mutation line.\n\
|
82
|
+
requires --reference to get the sequence using a position") do |o|
|
83
|
+
options[:mutant_list] = o
|
110
84
|
end
|
111
|
-
|
85
|
+
|
112
86
|
opts.on("-r", "--reference FILE", "Fasta file with the sequence for the markers (to complement --snp_list)") do |o|
|
113
87
|
options[:reference] = o
|
114
88
|
end
|
89
|
+
|
90
|
+
opts.on("-i", "--min_identity INT", "Minimum identity to consider a hit (default 90)") do |o|
|
91
|
+
options[:min_identity] = o.to_i
|
92
|
+
end
|
115
93
|
|
116
|
-
opts.on("-
|
117
|
-
options[:
|
94
|
+
opts.on("-o", "--output FOLDER", "Output folder") do |o|
|
95
|
+
options[:output_folder] = o
|
118
96
|
end
|
119
|
-
|
120
|
-
opts.on("-
|
121
|
-
|
122
|
-
options[:mutant_list] = o
|
97
|
+
|
98
|
+
opts.on("-e", "--exonerate_model MODEL", "Model to be used in exonerate to search for the contigs") do |o|
|
99
|
+
options[:model] = o
|
123
100
|
end
|
101
|
+
|
102
|
+
opts.on("-a", "--arm_selection #{Bio::PolyploidTools::ChromosomeArm.getValidFunctions.join('|')}", "Function to decide the chromome arm") do |o|
|
103
|
+
options[:arm_selection] = Bio::PolyploidTools::ChromosomeArm.getArmSelection(o)
|
104
|
+
end
|
124
105
|
|
106
|
+
opts.on("-p", "--primer_3_preferences FILE", "file with preferences to be sent to primer3") do |o|
|
107
|
+
options[:primer_3_preferences] = Bio::DB::Primer3.read_primer_preferences(o, options[:primer_3_preferences] )
|
108
|
+
end
|
109
|
+
|
125
110
|
opts.on("-v", "--variation_free_region INT", "If present, avoid generating the common primer if there are homoeologous SNPs within the specified distance") do |o|
|
126
111
|
options[:variation_free_region] = o.to_i
|
127
112
|
end
|
@@ -130,24 +115,23 @@ OptionParser.new do |opts|
|
|
130
115
|
options[:extract_found_contigs] = true
|
131
116
|
end
|
132
117
|
|
133
|
-
opts.on("-
|
134
|
-
|
135
|
-
options[:
|
118
|
+
opts.on("-P", "--primers_to_order", "If present, save a separate file with the primers with the KASP tails")do
|
119
|
+
#TODO: have a string with the tails, optional.
|
120
|
+
options[:primers_to_order] = true
|
136
121
|
end
|
137
122
|
|
138
123
|
opts.on("-H", "--het_dels", "If present, change the scoring to give priority to: semi-specific, specific, non-specific") do
|
139
124
|
options[:scoring] = :het_dels
|
140
125
|
end
|
141
126
|
|
142
|
-
opts.on("-
|
143
|
-
|
127
|
+
opts.on("-A", "--aligner exonerate|blast", "Select the aligner to use. Default: exonerate") do |o|
|
128
|
+
raise "Invalid aligner" unless o == "exonerate" or o == "blast"
|
129
|
+
options[:aligner] = o.to_sym
|
144
130
|
end
|
145
131
|
|
146
|
-
opts.on("-
|
147
|
-
|
148
|
-
options[:primers_to_order] = true
|
132
|
+
opts.on("-d", "--database PREFIX", "Path to the blast database. Only used if the aligner is blast. The default is the name of the contigs file without extension.") do |o|
|
133
|
+
options[:database] = o
|
149
134
|
end
|
150
|
-
|
151
135
|
end.parse!
|
152
136
|
|
153
137
|
|
@@ -312,7 +296,7 @@ def do_align(aln, exo_f, found_contigs, min_identity,fasta_file,options)
|
|
312
296
|
|
313
297
|
end
|
314
298
|
|
315
|
-
Bio::DB::Blast.align({:
|
299
|
+
Bio::DB::Blast.align({:query=>temp_fasta_query, :target=>options[:database], :model=>model}) do |aln|
|
316
300
|
do_align(aln, exo_f, found_contigs,min_identity, fasta_file,options)
|
317
301
|
end if options[:aligner] == :blast
|
318
302
|
|
@@ -333,9 +317,8 @@ contigs_f.close() if options[:extract_found_contigs]
|
|
333
317
|
write_status "Reading best alignment on each chromosome"
|
334
318
|
|
335
319
|
|
336
|
-
container
|
337
|
-
container.flanking_size
|
338
|
-
container.max_hits = options[:max_hits]
|
320
|
+
container= Bio::PolyploidTools::ExonContainer.new
|
321
|
+
container.flanking_size=options[:flanking_size]
|
339
322
|
container.gene_models(temp_fasta_query)
|
340
323
|
container.chromosomes(target)
|
341
324
|
container.add_parental({:name=>snp_in})
|
@@ -392,7 +375,7 @@ snps.each do |snp|
|
|
392
375
|
end
|
393
376
|
|
394
377
|
kasp_container.add_primers_file(primer_3_output) if added_exons > 0
|
395
|
-
header = "Marker,SNP,RegionSize,chromosome,total_contigs,contig_regions,SNP_type,#{original_name},#{snp_in},common,primer_type,orientation,#{original_name}_TM,#{snp_in}_TM,common_TM,selected_from,product_size,errors
|
378
|
+
header = "Marker,SNP,RegionSize,chromosome,total_contigs,contig_regions,SNP_type,#{original_name},#{snp_in},common,primer_type,orientation,#{original_name}_TM,#{snp_in}_TM,common_TM,selected_from,product_size,errors"
|
396
379
|
File.open(output_primers, 'w') { |f| f.write("#{header}\n#{kasp_container.print_primers}") }
|
397
380
|
|
398
381
|
File.open(output_to_order, "w") { |io| io.write(kasp_container.print_primers_with_tails()) }
|
data/bio-polyploid-tools.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: bio-polyploid-tools 0.9.
|
5
|
+
# stub: bio-polyploid-tools 0.9.8 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "bio-polyploid-tools".freeze
|
9
|
-
s.version = "0.9.
|
9
|
+
s.version = "0.9.8"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
@@ -1,8 +1,6 @@
|
|
1
1
|
module Bio::PolyploidTools
|
2
2
|
class ChromosomeArm
|
3
3
|
|
4
|
-
|
5
|
-
|
6
4
|
@@arm_selection_functions = Hash.new;
|
7
5
|
|
8
6
|
#example format: chr2A
|
@@ -42,11 +40,24 @@ class ChromosomeArm
|
|
42
40
|
end
|
43
41
|
|
44
42
|
def self.getArmSelection(name)
|
43
|
+
arr = name.split(",")
|
44
|
+
if arr.size == 2
|
45
|
+
@@arm_selection_functions[name.to_sym] = lambda do |contig_name|
|
46
|
+
separator, field = arr
|
47
|
+
field = field.to_i
|
48
|
+
ret = contig_name.split(separator)[field]
|
49
|
+
return ret
|
50
|
+
end
|
51
|
+
end
|
45
52
|
@@arm_selection_functions[name.to_sym]
|
46
53
|
end
|
47
54
|
|
48
55
|
def self.getValidFunctions
|
49
|
-
@@arm_selection_functions.keys.map { |e| e.to_s }
|
56
|
+
tmp = @@arm_selection_functions.keys.map { |e| e.to_s }
|
57
|
+
tmp.unshift "<sep>,<index>"
|
58
|
+
tmp
|
50
59
|
end
|
60
|
+
|
61
|
+
|
51
62
|
end
|
52
63
|
end
|