transrate 1.0.0.alpha.8.bowtie → 1.0.0.beta1

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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/README.md +2 -0
  4. data/bin/transrate +3 -5
  5. data/deps/deps.yaml +12 -20
  6. data/lib/transrate.rb +1 -1
  7. data/lib/transrate/assembly.rb +21 -0
  8. data/lib/transrate/contig.rb +33 -3
  9. data/lib/transrate/express.rb +29 -24
  10. data/lib/transrate/read_metrics.rb +40 -28
  11. data/lib/transrate/sam_checker.rb +6 -31
  12. data/lib/transrate/samtools.rb +1 -1
  13. data/lib/transrate/score_optimiser.rb +31 -0
  14. data/lib/transrate/snap.rb +28 -3
  15. data/lib/transrate/transrater.rb +5 -10
  16. data/lib/transrate/version.rb +1 -1
  17. data/test/data/express_results.xprs +5 -0
  18. data/test/test_bin.rb +2 -8
  19. data/test/test_express.rb +22 -0
  20. data/test/test_read_metrics.rb +17 -29
  21. data/test/test_transrater.rb +1 -1
  22. data/test/vagrant/centos_6.5_64/Vagrantfile +122 -0
  23. data/test/vagrant/debian_7.4_64/Vagrantfile +126 -0
  24. data/test/vagrant/debian_7.4_64/provision.sh +28 -0
  25. data/test/vagrant/fedora_20_64/Vagrantfile +122 -0
  26. data/test/vagrant/fedora_20_64/provision.sh +16 -0
  27. data/test/vagrant/fedora_20_64/sample_data/params.xprs +182 -0
  28. data/test/vagrant/fedora_20_64/sample_data/reads_1.fastq +40000 -0
  29. data/test/vagrant/fedora_20_64/sample_data/reads_1.fastq-reads_2.fastq-read_count.txt +1 -0
  30. data/test/vagrant/fedora_20_64/sample_data/reads_2.fastq +40000 -0
  31. data/test/vagrant/fedora_20_64/sample_data/transcripts.fasta +498 -0
  32. data/test/vagrant/fedora_20_64/sample_data/transcripts.fasta_results.xprs +16 -0
  33. data/test/vagrant/fedora_20_64/sample_data/transcripts/Genome +17 -0
  34. data/test/vagrant/fedora_20_64/sample_data/transcripts/GenomeIndex +1 -0
  35. data/test/vagrant/fedora_20_64/sample_data/transcripts/GenomeIndexHash +0 -0
  36. data/test/vagrant/fedora_20_64/sample_data/transcripts/OverflowTable +0 -0
  37. data/test/vagrant/ubuntu_12.04_64/Vagrantfile +126 -0
  38. data/test/vagrant/ubuntu_12.04_64/provision.sh +24 -0
  39. data/test/vagrant/ubuntu_12.04_64/sample_data/params.xprs +182 -0
  40. data/test/vagrant/ubuntu_12.04_64/sample_data/reads_1.fastq +40000 -0
  41. data/test/vagrant/ubuntu_12.04_64/sample_data/reads_1.fastq-reads_2.fastq-read_count.txt +1 -0
  42. data/test/vagrant/ubuntu_12.04_64/sample_data/reads_2.fastq +40000 -0
  43. data/test/vagrant/ubuntu_12.04_64/sample_data/transcripts.fasta +498 -0
  44. data/test/vagrant/ubuntu_12.04_64/sample_data/transcripts.fasta_results.xprs +16 -0
  45. data/test/vagrant/ubuntu_12.04_64/sample_data/transcripts/Genome +17 -0
  46. data/test/vagrant/ubuntu_12.04_64/sample_data/transcripts/GenomeIndex +1 -0
  47. data/test/vagrant/ubuntu_12.04_64/sample_data/transcripts/GenomeIndexHash +0 -0
  48. data/test/vagrant/ubuntu_12.04_64/sample_data/transcripts/OverflowTable +0 -0
  49. data/transrate.gemspec +4 -4
  50. metadata +111 -71
  51. data/lib/transrate/bowtie.rb +0 -103
@@ -31,36 +31,9 @@ module Transrate
31
31
  end
32
32
  end
33
33
  if position > length + 1
34
- # `diff` is how much the cigar makes the read overlap the end
35
- diff = position - (length + 1)
36
- if list[-1][1] == "S" # the last item in the cigar is "S"
37
- # increase the number in the last item in the cigar
38
- list[-1][0] = (list[-1][0].to_i + diff).to_s
39
- if list[-2][0].to_i > diff
40
- # decrease the penultimate item in the cigar
41
- list[-2][0] = (list[-2][0].to_i - diff).to_s
42
- elsif list[-2][0].to_i == diff
43
- # just delete the penultimate item if
44
- list.delete_at(-2) # delete_at changes `list`
45
- else
46
- # this didn't happen in the rice/oases sam file, but it might
47
- end
48
- elsif list[-1][1] == "M"
49
- if list[-1][0].to_i > diff
50
- # decrease the number of the last item in the cigar
51
- list[-1][0] = (list[-1][0].to_i - diff).to_s
52
- # add a new soft mask item to the end of the cigar
53
- list << [diff.to_s, "S"]
54
- elsif list[-1][0].to_i == diff
55
- # just change the last item to soft mask if it's the same length
56
- # as the difference
57
- list[-1][1] = "S"
58
- end
59
- end
60
- cols[5] = list.join("")
61
- return cols.join("\t")
34
+ return false
62
35
  else
63
- return sam
36
+ return true
64
37
  end
65
38
  end
66
39
 
@@ -84,8 +57,10 @@ module Transrate
84
57
  sam1 = sam.dup
85
58
  @first = false
86
59
  else
87
- out.write(check(sam1))
88
- out.write(check(sam))
60
+ if check(sam1) and check(sam)
61
+ out.write(sam1)
62
+ out.write(sam)
63
+ end
89
64
  @first = true
90
65
  end
91
66
  @count+=1
@@ -61,7 +61,7 @@ module Transrate
61
61
  # the sort command behaves inconsistently with the other commands:
62
62
  # it takes an output prefix rather than a filename
63
63
  # and automatically adds the .bam extension
64
- sorted = File.basename(bamfile, '.bam') + '.sorted'
64
+ sorted = File.basename(bamfile, '.bam') + '.readsorted'
65
65
  if !File.exist?("#{sorted}.bam")
66
66
  cmd = "sort"
67
67
  cmd << " -@ #{threads}"
@@ -0,0 +1,31 @@
1
+ module Transrate
2
+
3
+ # This class is currently only used to calculate the basic transrate score.
4
+ # In future it will be used to automatically optimised the score by
5
+ # taking the optimal subset of contigs.
6
+ class ScoreOptimiser
7
+
8
+ def initialize assembly, read_metrics
9
+ @assembly = assembly
10
+ read_stats = read_metrics.read_stats
11
+ @total = read_stats[:fragments]
12
+ @good = read_stats[:good_mappings]
13
+ end
14
+
15
+ def raw_score
16
+ scores = @assembly.assembly.values.map{ |c| c.score }
17
+ @contig_score = geomean scores
18
+ @contig_score * (@good / @total.to_f)
19
+ end
20
+
21
+ # Calculate the geometric mean of an array of numbers
22
+ def geomean x
23
+ sum = 0.0
24
+ x.each{ |v| sum += Math.log(v) }
25
+ sum /= x.size
26
+ Math.exp sum
27
+ end
28
+
29
+ end # ScoreOptimiser
30
+
31
+ end
@@ -6,6 +6,7 @@ module Transrate
6
6
  class Snap
7
7
 
8
8
  require 'fix-trinity-output'
9
+ require 'bio'
9
10
 
10
11
  attr_reader :index_name, :sam, :read_count
11
12
 
@@ -38,7 +39,6 @@ module Transrate
38
39
  cmd << " -t #{threads}"
39
40
  cmd << " -b" # bind threads to cores
40
41
  cmd << " -M" # format cigar string
41
- cmd << " -sa" # keep all alignments, don't discard 0x100
42
42
  cmd << " -D 5" # edit distance to search for mapq calculation
43
43
  cmd << " -om 5" # Output multiple alignments. extra edit distance
44
44
  cmd << " -omax 10" # max alignments per pair/read
@@ -102,8 +102,8 @@ module Transrate
102
102
  def save_readcount stdout
103
103
  stdout.split("\n").each do |line|
104
104
  cols = line.split(/\s+/)
105
- if cols[0]=="2000" and cols[1]=="30"
106
- @read_count = cols[8].to_i / 2
105
+ if cols.size > 5 and cols[0]=~/[0-9\,]+/
106
+ @read_count = cols[0].gsub(",", "").to_i / 2
107
107
  File.open("#{@read_count_file}", "wb") do |out|
108
108
  out.write("#{@read_count}\n")
109
109
  end
@@ -134,6 +134,7 @@ module Transrate
134
134
 
135
135
  def build_index file, threads
136
136
  @index_name = File.basename(file, File.extname(file))
137
+ file = check_ambiguous(file)
137
138
  unless Dir.exists?(@index_name)
138
139
  cmd = "#{@snap} index #{file} #{@index_name}"
139
140
  cmd << " -s 23"
@@ -150,6 +151,30 @@ module Transrate
150
151
  @index_built = true
151
152
  end
152
153
 
154
+ def check_ambiguous file
155
+
156
+ ref = Bio::FastaFormat.open(file)
157
+ ambiguous = false
158
+ fixed = ""
159
+ ref.each do |entry|
160
+ seq = entry.seq
161
+ if seq =~ /[RYSWKMBDHV]/
162
+ seq = seq.gsub(/[RYSWKMBDHV]/, "N")
163
+ ambiguous = true
164
+ end
165
+ fixed << ">#{entry.definition}\n#{seq}\n"
166
+ end
167
+ ref.close
168
+ if ambiguous
169
+ logger.warn "squelching ambiguous nucleotides"
170
+ file = "#{File.basename(file, File.extname(file))}.fixed.fasta"
171
+ File.open(file, "w") do |out|
172
+ out.write fixed
173
+ end
174
+ end
175
+ return file
176
+ end
177
+
153
178
  end # Snap
154
179
 
155
180
  end # Transrate
@@ -62,22 +62,16 @@ module Transrate
62
62
  comparative_metrics
63
63
  end
64
64
 
65
- # Calculate the geometric mean of an array of numbers
66
- def geomean(x)
67
- sum = 0.0
68
- x.each{ |v| sum += Math.log(v) }
69
- sum /= x.size
70
- Math.exp(sum)
71
- end
72
-
73
65
  # Reduce all metrics for the assembly to a single quality score
74
66
  # by taking the geometric mean of the scores for all contigs
75
67
  # and multiplying it by the proportion of fragments whose most likely
76
68
  # mapping is consistent with the assembly
77
69
  # @return [Integer] the assembly score
78
70
  def assembly_score
79
- @score = geomean assembly.assembly.values.map{ |contig| contig.score }
80
- return @score * @read_metrics.p_good_mapping
71
+ if !@score_optimiser
72
+ @score_optimiser = ScoreOptimiser.new(@assembly, @read_metrics)
73
+ end
74
+ return @score_optimiser.raw_score
81
75
  end
82
76
 
83
77
  def assembly_metrics
@@ -89,6 +83,7 @@ module Transrate
89
83
  unless @read_metrics.has_run
90
84
  @read_metrics.run(left, right, threads: @threads)
91
85
  end
86
+ @assembly.classify_contigs
92
87
  @read_metrics
93
88
  end
94
89
 
@@ -11,7 +11,7 @@ module Transrate
11
11
  MAJOR = 1
12
12
  MINOR = 0
13
13
  PATCH = 0
14
- BUILD = 'alpha.8.bowtie'
14
+ BUILD = 'beta1'
15
15
 
16
16
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
17
17
  end
@@ -0,0 +1,5 @@
1
+ bundle_id target_id length eff_length tot_counts uniq_counts est_counts eff_counts ambig_distr_alpha ambig_distr_beta fpkm fpkm_conf_low fpkm_conf_high solvable tpm
2
+ 1 C291600 261 54.369218 10 10 10.000000 48.005105 0.000000e+00 0.000000e+00 5.410108e+00 5.410108e+00 5.410108e+00 T 5.417487e+00
3
+ 2 C196710 138 0.000000 0 0 0.000000 0.000000 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 F 0.000000e+00
4
+ 3 C378763 1364 1096.889202 195 195 195.000000 242.485749 0.000000e+00 0.000000e+00 5.229148e+00 5.183800e+00 5.274496e+00 T 5.236279e+00
5
+ 4 C132376 100 0.000000 0 0 0.000000 0.000000 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 F 0.000000e+00
data/test/test_bin.rb CHANGED
@@ -25,10 +25,8 @@ class TestTransrateBin < Test::Unit::TestCase
25
25
  "transrate_sorghum_transcript.fa_contigs.csv",
26
26
  "150uncovered.l.fq-150uncovered.r.fq-read_count.txt",
27
27
  "150uncovered.l.fq.150uncovered.r.fq.sorghum_transcript.merged.sorted.bam",
28
- "150uncovered.l.fq.150uncovered.r.fq.sorghum_transcript.merged.valid.bam",
29
- "150uncovered.l.fq.150uncovered.r.fq.sorghum_transcript.valid.bam",
30
- "150uncovered.l.fq.150uncovered.r.fq.sorghum_transcript.valid.sorted.bam",
31
- "150uncovered.l.fq.150uncovered.r.fq.sorghum_transcript.sam-read_count.txt"]
28
+ "bad.sorghum_transcript.fa", "chimeric.sorghum_transcript.fa",
29
+ "fragmented.sorghum_transcript.fa", "good.sorghum_transcript.fa"]
32
30
  files.each do |file|
33
31
  File.delete(file) if File.exist?(file)
34
32
  end
@@ -70,10 +68,6 @@ class TestTransrateBin < Test::Unit::TestCase
70
68
  assert File.exist?("transrate_sorghum_transcript.fa_contigs.csv"),
71
69
  "contig csv file doesn't exist"
72
70
  hash = {}
73
- if !c.status.success?
74
- puts c.stderr
75
- puts c.stdout
76
- end
77
71
  CSV.foreach("transrate_assemblies.csv", :headers => true,
78
72
  :header_converters => :symbol,
79
73
  :converters => :all) do |row|
@@ -0,0 +1,22 @@
1
+ require 'helper'
2
+ require 'tmpdir'
3
+
4
+ class TestExpress < Test::Unit::TestCase
5
+
6
+ context "Express" do
7
+
8
+ should "load an expression file" do
9
+ file = File.join(File.dirname(__FILE__), 'data',
10
+ 'express_results.xprs')
11
+ e = Transrate::Express.new
12
+ results = e.load_expression file
13
+ assert_equal 4, results.size, "should be four results loaded"
14
+ assert_equal 54, results['C291600'][:eff_len], "eff length is wrong"
15
+ assert_equal 48.005105, results['C291600'][:eff_count],
16
+ "eff count is wrong"
17
+ assert_equal 5.417487e+00, results['C291600'][:tpm], "tpm is wrong"
18
+ end
19
+
20
+ end
21
+
22
+ end
@@ -27,32 +27,19 @@ class TestReadMetrics < Test::Unit::TestCase
27
27
  left = File.join(File.dirname(__FILE__), 'data', '150uncovered.l.fq')
28
28
  right = File.join(File.dirname(__FILE__), 'data', '150uncovered.r.fq')
29
29
  Dir.mktmpdir do |tmpdir|
30
- # tmpdir = Dir.mktmpdir
31
- # puts tmpdir
32
30
  Dir.chdir tmpdir do
33
31
  @read_metrics.run(left, right)
34
32
  stats = @read_metrics.read_stats
35
33
  assert @read_metrics.has_run, "has run"
36
34
  assert_equal 223, stats[:fragments], 'number of read pairs'
37
- assert_equal 219, stats[:fragments_mapped], 'number mapping'
38
- assert_equal 0.9821, stats[:p_fragments_mapped].round(4),
35
+ assert_equal 215, stats[:fragments_mapped], 'number mapping'
36
+ assert_equal 0.9641, stats[:p_fragments_mapped].round(4),
39
37
  'proportion mapping'
40
- assert_equal 184, stats[:good_mappings], 'good mapping'
41
- assert_equal 0.8251, stats[:p_good_mapping].round(4),
38
+ assert_equal 182, stats[:good_mappings], 'good mapping'
39
+ assert_equal 0.8161, stats[:p_good_mapping].round(4),
42
40
  'percent good mapping'
43
- assert_equal 35, stats[:bad_mappings], 'bad mapping'
44
- end
45
- end
46
- end
47
-
48
- should "calculate more read mapping statistics" do
49
- left = File.join(File.dirname(__FILE__), 'data', '150uncovered.l.fq')
50
- right = File.join(File.dirname(__FILE__), 'data', '150uncovered.r.fq')
51
- Dir.mktmpdir do |tmpdir|
52
- Dir.chdir tmpdir do
53
- @read_metrics.run(left, right)
54
- stats = @read_metrics.read_stats
55
- assert_equal 0, stats[:potential_bridges], 'bridges'
41
+ assert_equal 33, stats[:bad_mappings], 'bad mapping'
42
+ assert_equal 1, stats[:potential_bridges], 'bridges'
56
43
  assert_equal 2, stats[:contigs_uncovbase], 'uncovered base contig'
57
44
  assert_equal 0, stats[:contigs_uncovered], 'uncovered contig'
58
45
  assert_equal 0, stats[:contigs_lowcovered], 'lowcovered contig'
@@ -76,22 +63,23 @@ class TestReadMetrics < Test::Unit::TestCase
76
63
 
77
64
  edit_a = a[:p_seq_true].round(5)
78
65
  edit_b = b[:p_seq_true].round(5)
79
- assert_equal 0.98618, edit_a, "edit distance 1"
80
- assert_equal 0.9749, edit_b, "edit distance 2"
66
+ assert_equal 0.98414, edit_a, "edit distance 1"
67
+ assert_equal 0.974, edit_b, "edit distance 2"
81
68
 
82
- assert_equal 0.83146, a[:p_good].round(5), "proportion of good mappings"
83
- assert_equal 0.84615, b[:p_good].round(5), "proportion of good mappings"
69
+ assert_equal 0.8046, a[:p_good].round(5),
70
+ "proportion of good mappings"
71
+ assert_equal 0.875, b[:p_good].round(5), "proportion of good mappings"
84
72
 
85
73
  # uncovered bases
86
74
  unc_a = contigs[0].uncovered_bases
87
75
  unc_b = contigs[1].uncovered_bases
88
- assert_equal 12, unc_a, "uncovered bases"
89
- assert_equal 4, unc_b, "uncovered bases"
76
+ assert_equal 11, unc_a, "uncovered bases"
77
+ assert_equal 3, unc_b, "uncovered bases"
90
78
 
91
79
  prop_unc_a = a[:p_bases_covered]
92
80
  prop_unc_b = b[:p_bases_covered]
93
- assert_equal 0.98361, prop_unc_a.round(5), "proportion covered bases"
94
- assert_equal 0.99514, prop_unc_b.round(5), "proportion covered bases"
81
+ assert_equal 0.98497, prop_unc_a.round(5), "proportion covered bases"
82
+ assert_equal 0.99635, prop_unc_b.round(5), "proportion covered bases"
95
83
 
96
84
  end
97
85
  end
@@ -112,8 +100,8 @@ class TestReadMetrics < Test::Unit::TestCase
112
100
 
113
101
  edit_a = a[:p_not_segmented].round(5)
114
102
  edit_b = b[:p_not_segmented].round(5)
115
- assert_equal 0.47635, edit_a, "probability not segmented 1"
116
- assert_equal 0.77451, edit_b, "probability not segmented 2"
103
+ assert_equal 0.23527, edit_a, "probability not segmented 1"
104
+ assert_equal 0.9341, edit_b, "probability not segmented 2"
117
105
 
118
106
  end
119
107
  end
@@ -59,7 +59,7 @@ class TestTransrater < Test::Unit::TestCase
59
59
  Dir.chdir tmpdir do
60
60
  all = @rater.all_metrics(@left, @right)
61
61
  score = @rater.assembly_score
62
- assert_equal 0.4078, score.round(5) # regression test
62
+ assert_equal 0.31136, score.round(5) # regression test
63
63
  end
64
64
  end
65
65
  end
@@ -0,0 +1,122 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5
+ VAGRANTFILE_API_VERSION = "2"
6
+
7
+ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8
+ # All Vagrant configuration is done here. The most common configuration
9
+ # options are documented and commented below. For a complete reference,
10
+ # please see the online documentation at vagrantup.com.
11
+
12
+ # Every Vagrant virtual environment requires a box to build off of.
13
+ config.vm.box = "chef/centos-6.5"
14
+
15
+ # Disable automatic box update checking. If you disable this, then
16
+ # boxes will only be checked for updates when the user runs
17
+ # `vagrant box outdated`. This is not recommended.
18
+ # config.vm.box_check_update = false
19
+
20
+ # Create a forwarded port mapping which allows access to a specific port
21
+ # within the machine from a port on the host machine. In the example below,
22
+ # accessing "localhost:8080" will access port 80 on the guest machine.
23
+ # config.vm.network "forwarded_port", guest: 80, host: 8080
24
+
25
+ # Create a private network, which allows host-only access to the machine
26
+ # using a specific IP.
27
+ # config.vm.network "private_network", ip: "192.168.33.10"
28
+
29
+ # Create a public network, which generally matched to bridged network.
30
+ # Bridged networks make the machine appear as another physical device on
31
+ # your network.
32
+ # config.vm.network "public_network"
33
+
34
+ # If true, then any SSH connections made will enable agent forwarding.
35
+ # Default value: false
36
+ # config.ssh.forward_agent = true
37
+
38
+ # Share an additional folder to the guest VM. The first argument is
39
+ # the path on the host to the actual folder. The second argument is
40
+ # the path on the guest to mount the folder. And the optional third
41
+ # argument is a set of non-required options.
42
+ # config.vm.synced_folder "../data", "/vagrant_data"
43
+
44
+ # Provider-specific configuration so you can fine-tune various
45
+ # backing providers for Vagrant. These expose provider-specific options.
46
+ # Example for VirtualBox:
47
+ #
48
+ # config.vm.provider "virtualbox" do |vb|
49
+ # # Don't boot with headless mode
50
+ # vb.gui = true
51
+ #
52
+ # # Use VBoxManage to customize the VM. For example to change memory:
53
+ # vb.customize ["modifyvm", :id, "--memory", "1024"]
54
+ # end
55
+ #
56
+ # View the documentation for the provider you're using for more
57
+ # information on available options.
58
+
59
+ # Enable provisioning with CFEngine. CFEngine Community packages are
60
+ # automatically installed. For example, configure the host as a
61
+ # policy server and optionally a policy file to run:
62
+ #
63
+ # config.vm.provision "cfengine" do |cf|
64
+ # cf.am_policy_hub = true
65
+ # # cf.run_file = "motd.cf"
66
+ # end
67
+ #
68
+ # You can also configure and bootstrap a client to an existing
69
+ # policy server:
70
+ #
71
+ # config.vm.provision "cfengine" do |cf|
72
+ # cf.policy_server_address = "10.0.2.15"
73
+ # end
74
+
75
+ # Enable provisioning with Puppet stand alone. Puppet manifests
76
+ # are contained in a directory path relative to this Vagrantfile.
77
+ # You will need to create the manifests directory and a manifest in
78
+ # the file default.pp in the manifests_path directory.
79
+ #
80
+ # config.vm.provision "puppet" do |puppet|
81
+ # puppet.manifests_path = "manifests"
82
+ # puppet.manifest_file = "site.pp"
83
+ # end
84
+
85
+ # Enable provisioning with chef solo, specifying a cookbooks path, roles
86
+ # path, and data_bags path (all relative to this Vagrantfile), and adding
87
+ # some recipes and/or roles.
88
+ #
89
+ # config.vm.provision "chef_solo" do |chef|
90
+ # chef.cookbooks_path = "../my-recipes/cookbooks"
91
+ # chef.roles_path = "../my-recipes/roles"
92
+ # chef.data_bags_path = "../my-recipes/data_bags"
93
+ # chef.add_recipe "mysql"
94
+ # chef.add_role "web"
95
+ #
96
+ # # You may also specify custom JSON attributes:
97
+ # chef.json = { mysql_password: "foo" }
98
+ # end
99
+
100
+ # Enable provisioning with chef server, specifying the chef server URL,
101
+ # and the path to the validation key (relative to this Vagrantfile).
102
+ #
103
+ # The Opscode Platform uses HTTPS. Substitute your organization for
104
+ # ORGNAME in the URL and validation key.
105
+ #
106
+ # If you have your own Chef Server, use the appropriate URL, which may be
107
+ # HTTP instead of HTTPS depending on your configuration. Also change the
108
+ # validation key to validation.pem.
109
+ #
110
+ # config.vm.provision "chef_client" do |chef|
111
+ # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
112
+ # chef.validation_key_path = "ORGNAME-validator.pem"
113
+ # end
114
+ #
115
+ # If you're using the Opscode platform, your validator client is
116
+ # ORGNAME-validator, replacing ORGNAME with your organization name.
117
+ #
118
+ # If you have your own Chef Server, the default validation client name is
119
+ # chef-validator, unless you changed the configuration.
120
+ #
121
+ # chef.validation_client_name = "ORGNAME-validator"
122
+ end