spec/ms/sequest/bioworks_spec.rb in ms-sequest-0.0.17 vs spec/ms/sequest/bioworks_spec.rb in ms-sequest-0.0.18
- old
+ new
@@ -11,14 +11,14 @@
describe Bioworks, 'set from an xml file' do
# NEED TO DEBUG THIS PROB!
it 'can set one with labeled proteins' do
file = Tfiles + "/bioworks_with_INV_small.xml"
obj = Bioworks.new(file)
- obj.prots.size.should == 19
+ obj.proteins.size.should == 19
file = Tfiles + '/bioworks_small.xml'
obj = Bioworks.new(file)
- obj.prots.size.should == 106
+ obj.proteins.size.should == 106
end
it 'can parse an xml file NOT derived from multi-concensus' do
tf_bioworks_single_xml_small = Tfiles + '/bioworks_single_run_small.xml'
obj = Bioworks.new(tf_bioworks_single_xml_small)
@@ -26,14 +26,14 @@
origfilename = '5prot_mix_michrom_20fmol_200pmol.RAW'
origfilepath = 'C:\Xcalibur\sequest'
obj.global_filename.should == gfn
obj.origfilename.should == origfilename
obj.origfilepath.should == origfilepath
- obj.prots.size.should == 7
- obj.prots.first.peps.first.base_name.should == gfn
- obj.prots.first.peps.first.file.should == "152"
- obj.prots.first.peps.first.charge.should == 2
+ obj.proteins.size.should == 7
+ obj.proteins.first.peptides.first.base_name.should == gfn
+ obj.proteins.first.peptides.first.file.should == "152"
+ obj.proteins.first.peptides.first.charge.should == 2
# @TODO: add more tests here
end
it 'can output in excel format (**semi-verified right now)' do
tf_bioworks_to_excel = Tfiles + '/tf_bioworks2excel.bioXML'
@@ -55,11 +55,11 @@
# prot is boolean if this is a protein line!
def _assert_equal_pieces(exp, act, prot)
# equal as floats (by delta)
exp.each_index do |i|
- if i == 5 # both prots and peps
+ if i == 5 # both proteins and peptides
act[i].to_f.should be_close(exp[i].to_f, 0.1)
elsif i == 3 && !prot
act[i].to_f.should be_close(exp[i].to_f, 0.01)
elsif i == 6 && !prot
act[i].to_f.should be_close(exp[i].to_f, 0.01)
@@ -97,20 +97,20 @@
prot
end
end
exp_peps = exp_peps.zip(exp_prots)
exp_peps.collect! do |both|
- both[0].prots = [both[1]]
+ both[0].proteins = [both[1]]
both[0]
end
peptides = [%w(2 PEPTIDE), %w(3 PEPTIDE), %w(2 PEPTIDE), %w(3 PEPY), %w(3 PEPTIDE), %w(3 PEPTIDE), %w(2 PEPY)].collect do |arr|
pep = Bioworks::Pep.new
pep.charge = arr[0]
pep.sequence = arr[1]
- pep.prots = [Bioworks::Prot.new]
- pep.prots.first.reference = "#{cnt}"
+ pep.proteins = [Bioworks::Prot.new]
+ pep.proteins.first.reference = "#{cnt}"
cnt += 1
pep
end
peptides, proteins = Bioworks.new._uniq_peps_by_sequence_charge(peptides)
proteins.size.should == peptides.size
@@ -128,10 +128,10 @@
end
describe Bioworks::Pep do
it 'can be initialized from a hash' do
- hash = {:sequence => 0, :mass => 1, :deltamass => 2, :charge => 3, :xcorr => 4, :deltacn => 5, :sp => 6, :rsp => 7, :ions => 8, :count => 9, :tic => 10, :prots => 11, :base_name => 12, :first_scan => 13, :last_scan => 14, :peptide_probability => 15, :file => 16, :_num_prots => 17, :_first_prot => 18}
+ hash = {:sequence => 0, :mass => 1, :deltamass => 2, :charge => 3, :xcorr => 4, :deltacn => 5, :sp => 6, :rsp => 7, :ions => 8, :count => 9, :tic => 10, :proteins => 11, :base_name => 12, :first_scan => 13, :last_scan => 14, :peptide_probability => 15, :file => 16, :_num_proteins => 17, :_first_prot => 18}
pep = Bioworks::Pep.new(hash)
hash.each do |k,v|
pep.send(k).should == v
end
end