bio-polyploid-tools 0.7.2 → 0.7.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: ca90e857f0fdaba3446c19387aea4d2c58a1b450
4
- data.tar.gz: 4d52a29b06d2eb283b1b4233e95172231b09ce02
3
+ metadata.gz: adcaebc142757300631df98a5f672cae5dc76cb7
4
+ data.tar.gz: 05e3acefabb42d5ea3c84236f4b79ebf338c6306
5
5
  SHA512:
6
- metadata.gz: e07d9eeff0771a1d77d9fe1568b48c1cb0fd485fa79f0ae9c8e1932e8400b8e40b43291495da27490fc86bd721077902b8b1d5e90846b69799c4e16b8fb8cdd2
7
- data.tar.gz: f81e1c0cf94ae0b0c77ca29d69f0a6b44919e70965b5c2b9cb0c55c065803e2c01e85954b051d2f6ff1900cc61e5eb385409a23d8e90818e0a39f9fa0db27d36
6
+ metadata.gz: c1fa0e9e177bad1633fc5c4d3fd3f3fe2c2b4fc9915dfeeea943d7559d8850061f9437f703a7fa462163eb7f52431b747216d540ed73e64559ca20cfc7fe471b
7
+ data.tar.gz: 4db9d4d8b404378b39af64978d82671d94b5babc42ea4542c9f76b880793c23a5283945dffc4d76d2ba68761c3d30e1b434f867513e8a71c3f60f61b3885cf58
data/README.md CHANGED
@@ -69,12 +69,16 @@ arm_selection_functions[:arm_selection_embl] = lambda do | contig_name|
69
69
  end
70
70
  ```
71
71
 
72
- The function should return a 2 character string, when the first is the chromosome number and the second the chromosome group. The symbol in the hash is the name to be used in the argument ```--arm_selection```. If you want your parser to be added to the distribution, feel free to fork and make a pull request.
72
+ The function should return a 2 character string, when the first is the chromosome number and the second the chromosome group. The symbol in the hash is the name to be used in the argument ```--arm_selection```. If you want your parser to be added to the distribution, feel free to fork and make a pull request.
73
73
 
74
74
 
75
75
 
76
76
  ##Release Notes
77
77
 
78
+ ###0.7.3
79
+ * FEATURE: ```polymarker.rb``` Added to the flag ```--arm_selection``` the option ```scaffold```, which now supports a scaffold specific primer.
80
+ * FEATURE: ```snp_position_to_polymarker``` Added the option ```--mutant_list``` to prepare files for PolyMarker from files with the following columns ```ID,Allele_1,position,Allele_1,target_chromosome```.
81
+
78
82
  ###0.7.2
79
83
  * FEATURE: Added a flag ```min_identity``` to set the minimum identity to consider a hit. The default is 90
80
84
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.2
1
+ 0.7.3
@@ -24,7 +24,7 @@ markers = nil
24
24
  options = {}
25
25
  OptionParser.new do |opts|
26
26
 
27
- opts.banner = "Usage: polymarker.rb [options]"
27
+ opts.banner = "Usage: markers_in_region.rb [options]"
28
28
 
29
29
  opts.on("-c", "--chromosome CHR", "chromosome (1A, 3B, etc)") do |o|
30
30
  options[:chromosome] = o.upcase
@@ -37,6 +37,11 @@ arm_selection_functions[:arm_selection_morex] = lambda do | contig_name |
37
37
  return ret
38
38
  end
39
39
 
40
+ arm_selection_functions[:scaffold] = lambda do | contig_name |
41
+ ret = contig_name;
42
+ return ret
43
+ end
44
+
40
45
  def validate_files(o)
41
46
 
42
47
  [
@@ -113,7 +118,7 @@ OptionParser.new do |opts|
113
118
  options[:model] = o
114
119
  end
115
120
 
116
- opts.on("-a", "--arm_selection arm_selection_embl|arm_selection_morex|arm_selection_first_two", "Function to decide the chromome arm") do |o|
121
+ opts.on("-a", "--arm_selection arm_selection_embl|arm_selection_morex|arm_selection_first_two|scaffold", "Function to decide the chromome arm") do |o|
117
122
  options[:arm_selection] = arm_selection_functions[o.to_sym];
118
123
  end
119
124
 
@@ -24,12 +24,14 @@ markers = nil
24
24
 
25
25
  options = {}
26
26
  options[:flanking_size] = 100
27
+ test_file=''
27
28
  OptionParser.new do |opts|
28
29
 
29
30
  opts.banner = "Usage: snp_postion_to_polymarker.rb [options]"
30
31
 
31
32
  opts.on("-s", "--snp_file CSV", "CSV file with the following columnns:\nID,Allele_1,position,Allele_1,target_chromosome") do |o|
32
33
  options[:snp_file] = o
34
+ test_file = o
33
35
  end
34
36
  opts.on("-r", "--reference FASTA", "reference with the genes/contings/marker seuqnece") do |o|
35
37
  options[:reference] = o
@@ -40,6 +42,11 @@ OptionParser.new do |opts|
40
42
  opts.on("-f", "--flanking_size INT", "Flanking size around the SNP") do |o|
41
43
  options[:flanking_size] = o.to_i
42
44
  end
45
+ opts.on("-t", "--mutant_list FILE", "File with the list of positions with mutation and the mutation line.\n\
46
+ requires --reference to get the sequence using a position") do |o|
47
+ options[:mutant_list] = o
48
+ test_file = o
49
+ end
43
50
 
44
51
  end.parse!
45
52
  #reference="/Users/ramirezr/Documents/TGAC/references/Triticum_aestivum.IWGSP1.21.dna_rm.genome.fa"
@@ -49,16 +56,28 @@ fasta_reference_db = Bio::DB::Fasta::FastaFile.new({:fasta=>fasta_reference})
49
56
  fasta_reference_db.load_fai_entries
50
57
 
51
58
  out = $stdout
59
+ lastRegion = nil
60
+ lastTemplate = nil
52
61
  out = File.open(options[:output], "w") if options[:output]
53
- File.open(options[:snp_file]) do | f |
62
+ File.open(test_file) do | f |
54
63
  f.each_line do | line |
55
64
  snp = nil
56
- snp = Bio::PolyploidTools::SNP.parse(line)
57
- entry = fasta_reference_db.index.region_for_entry(snp.gene)
65
+ entry = nil
66
+ if options[:snp_file]
67
+ snp = Bio::PolyploidTools::SNP.parse(line)
68
+ entry = fasta_reference_db.index.region_for_entry(snp.gene)
69
+ elsif options[:mutant_list]
70
+ snp = Bio::PolyploidTools::SNPMutant.parse(line)
71
+ entry = fasta_reference_db.index.region_for_entry(snp.contig)
72
+ end
73
+
58
74
  if entry
59
- region = fasta_reference_db.index.region_for_entry(snp.gene).get_full_region
60
- snp.template_sequence = fasta_reference_db.fetch_sequence(region)
61
-
75
+ region = entry.get_full_region
76
+ if region != lastRegion
77
+ lastTemplate = fasta_reference_db.fetch_sequence(region)
78
+ end
79
+ snp.template_sequence = lastTemplate
80
+ lastRegion = region
62
81
  out.puts "#{snp.gene}_#{snp.snp_id_in_seq},#{snp.chromosome},#{snp.to_polymarker_sequence(options[:flanking_size])}"
63
82
  else
64
83
  $stderr.puts "ERROR: Unable to find entry for #{snp.gene}"
@@ -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.7.2 ruby lib
5
+ # stub: bio-polyploid-tools 0.7.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "bio-polyploid-tools"
9
- s.version = "0.7.2"
9
+ s.version = "0.7.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 = "2015-05-28"
14
+ s.date = "2015-08-10"
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", "filter_exonerate_by_identity.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"]
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.7.2
4
+ version: 0.7.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: 2015-05-28 00:00:00.000000000 Z
11
+ date: 2015-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bio