msf 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. data/.document +5 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +24 -0
  4. data/Gemfile.lock +67 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.md +45 -0
  7. data/Rakefile +43 -0
  8. data/VERSION +1 -0
  9. data/bin/ibspectra +43 -0
  10. data/erd/config.png +0 -0
  11. data/erd/empty.png +0 -0
  12. data/erd/erd.png +0 -0
  13. data/erd/msf.xcdatamodeld/.xccurrentversion +8 -0
  14. data/erd/msf.xcdatamodeld/msf.xcdatamodel/contents +330 -0
  15. data/erd/schema.txt +666 -0
  16. data/lib/msf.rb +2 -0
  17. data/lib/msf/models.rb +4 -0
  18. data/lib/msf/models/amino_acid.rb +50 -0
  19. data/lib/msf/models/amino_acid_modification.rb +55 -0
  20. data/lib/msf/models/amino_acid_modification_neutral_loss.rb +31 -0
  21. data/lib/msf/models/amino_acid_modifications_amino_acid_nls.rb +23 -0
  22. data/lib/msf/models/amino_acid_modifications_amino_acids.rb +27 -0
  23. data/lib/msf/models/annotation_data_version.rb +20 -0
  24. data/lib/msf/models/annotation_dataset.rb +29 -0
  25. data/lib/msf/models/annotation_group.rb +38 -0
  26. data/lib/msf/models/annotation_type.rb +23 -0
  27. data/lib/msf/models/chromatogram.rb +26 -0
  28. data/lib/msf/models/custom_data_field.rb +56 -0
  29. data/lib/msf/models/custom_data_peptide.rb +25 -0
  30. data/lib/msf/models/custom_data_processing_node.rb +25 -0
  31. data/lib/msf/models/custom_data_protein.rb +25 -0
  32. data/lib/msf/models/custom_data_spectrum.rb +25 -0
  33. data/lib/msf/models/enzyme.rb +32 -0
  34. data/lib/msf/models/fasta_file.rb +50 -0
  35. data/lib/msf/models/file_info.rb +41 -0
  36. data/lib/msf/models/mass_peak.rb +36 -0
  37. data/lib/msf/models/peptide.rb +118 -0
  38. data/lib/msf/models/peptide_score.rb +34 -0
  39. data/lib/msf/models/peptide_score_decoy.rb +34 -0
  40. data/lib/msf/models/peptide_terminal_modification.rb +29 -0
  41. data/lib/msf/models/peptides_amino_acid_modifications.rb +32 -0
  42. data/lib/msf/models/peptides_proteins.rb +27 -0
  43. data/lib/msf/models/processing_node.rb +65 -0
  44. data/lib/msf/models/processing_node_score.rb +45 -0
  45. data/lib/msf/models/protein.rb +38 -0
  46. data/lib/msf/models/protein_annotation.rb +35 -0
  47. data/lib/msf/models/protein_identification_group.rb +19 -0
  48. data/lib/msf/models/protein_score.rb +34 -0
  49. data/lib/msf/models/reporter_ion_quan_result.rb +31 -0
  50. data/lib/msf/models/reporter_ion_quan_result_search_spectrum.rb +29 -0
  51. data/lib/msf/models/scan_event.rb +37 -0
  52. data/lib/msf/models/schema_info.rb +29 -0
  53. data/lib/msf/models/spectrum.rb +34 -0
  54. data/lib/msf/models/spectrum_header.rb +63 -0
  55. data/lib/msf/models/spectrum_score.rb +24 -0
  56. data/lib/msf/models/taxonomy_name.rb +26 -0
  57. data/lib/msf/models/workflow_info.rb +46 -0
  58. data/lib/msf/models/workflow_message.rb +31 -0
  59. data/lib/msf/msf.rb +32 -0
  60. data/lib/msf/sql/enzyme_cleavage_specificity.rb +16 -0
  61. data/lib/msf/sql/false_discovery_rate.rb +24 -0
  62. data/lib/msf/sql/fasta_file_protein_annotation.rb +17 -0
  63. data/lib/msf/sql/mass_peak_relation.rb +17 -0
  64. data/lib/msf/sql/peptide_amino_acid_modification_decoy.rb +23 -0
  65. data/lib/msf/sql/peptide_decoy.rb +32 -0
  66. data/lib/msf/sql/peptide_terminal_modification_decoy.rb +20 -0
  67. data/lib/msf/sql/precursor_ion_quan_result.rb +29 -0
  68. data/lib/msf/sql/precursor_ion_quan_result_event_spectrum.rb +17 -0
  69. data/lib/msf/sql/precursor_ion_quan_result_search_spectrum.rb +20 -0
  70. data/lib/msf/sql/processing_node_filter_parameter.rb +29 -0
  71. data/lib/msf/sql/processing_node_interface.rb +19 -0
  72. data/lib/msf/sql/processing_node_parameter.rb +46 -0
  73. data/lib/msf/sql/processing_node_spectrum.rb +16 -0
  74. data/lib/msf/sql/quan_result.rb +40 -0
  75. data/lib/msf/sql/result_filter_set.rb +12 -0
  76. data/lib/msf/sql/taxonomy_node.rb +26 -0
  77. data/msf.gemspec +143 -0
  78. data/spec/msf_spec.rb +7 -0
  79. data/spec/spec_helper.rb +14 -0
  80. metadata +275 -0
@@ -0,0 +1,24 @@
1
+ # ActiveRecord model of MSF SpectrumScore
2
+ #
3
+ # Example:
4
+ #
5
+ # SpectrumScore.first.protein_score
6
+ class SpectrumScore < ActiveRecord::Base
7
+ def self.table_name
8
+ :SpectrumScores
9
+ end
10
+ def self.primary_key
11
+ [:ProcessingNodeNumber, :SpectrumID]
12
+ end
13
+ def processing_node_number
14
+ self.ProcessingNodeNumber
15
+ end
16
+ def spectrum_id
17
+ self.SpectrumID
18
+ end
19
+ def score
20
+ self.Score
21
+ end
22
+ belongs_to :spectrum,
23
+ :foreign_key => "SpectrumID"
24
+ end
@@ -0,0 +1,26 @@
1
+ # ActiveRecord model of MSF TaxonomyName
2
+ #
3
+ # Example:
4
+ #
5
+ # TaxonomyName.find(1)
6
+ # TaxonomyName.first.name
7
+ class TaxonomyName < ActiveRecord::Base
8
+ def self.table_name
9
+ :TaxonomyNames
10
+ end
11
+ def self.primary_key
12
+ :TaxonomyID
13
+ end
14
+ def taxonomy_id
15
+ self.TaxonomyID
16
+ end
17
+ def name
18
+ self.Name
19
+ end
20
+ def name_category
21
+ self.NameCategory
22
+ end
23
+ # associations
24
+ belongs_to :taxonomy_names,
25
+ :foreign_key => "TaxonomyID"
26
+ end
@@ -0,0 +1,46 @@
1
+ # ActiveRecord model of MSF WorkflowInfo
2
+ #
3
+ # Example:
4
+ #
5
+ # WorkflowInfo.first.workflow_description
6
+ class WorkflowInfo < ActiveRecord::Base
7
+ def self.table_name
8
+ :WorkflowInfo
9
+ end
10
+ def workflow_name
11
+ self.WorkflowName
12
+ end
13
+ def workflow_description
14
+ self.WorkflowDescription
15
+ end
16
+ def workflow_state
17
+ self.WorkflowState
18
+ end
19
+ def workflow_start_date
20
+ self.WorkflowStartDate
21
+ end
22
+ def workflow_template
23
+ self.WorkflowTemplate
24
+ end
25
+ def user
26
+ self.User
27
+ end
28
+ def workflow_guid
29
+ self.WorkflowGUID
30
+ end
31
+ def machine_guid
32
+ self.MachineGUID
33
+ end
34
+ def machine_name
35
+ self.MachineName
36
+ end
37
+ def merge_similar_identification_results
38
+ self.MergeSimilarIdentificationResults
39
+ end
40
+ def is_valid
41
+ self.IsValid
42
+ end
43
+ def version
44
+ self.Version
45
+ end
46
+ end
@@ -0,0 +1,31 @@
1
+ # ActiveRecord model of MSF WorkflowMessage
2
+ #
3
+ # Example:
4
+ #
5
+ # WorkflowMessage.first.message
6
+ class WorkflowMessage < ActiveRecord::Base
7
+ def self.table_name
8
+ :WorkflowMessages
9
+ end
10
+ def self.primary_key
11
+ :MessageID
12
+ end
13
+ def message_id
14
+ self.MessageID
15
+ end
16
+ def processing_node_id
17
+ self.ProcessingNodeID
18
+ end
19
+ def processing_node_number
20
+ self.ProcessingNodeNumber
21
+ end
22
+ def time
23
+ self.Time
24
+ end
25
+ def message_kind
26
+ self.MessageKind
27
+ end
28
+ def message
29
+ self.Message
30
+ end
31
+ end
@@ -0,0 +1,32 @@
1
+ require 'active_record'
2
+
3
+ # This class establishes an ActiveRecord connection to an MSF file (sqlite3 database) at the specified path.
4
+ class MSF
5
+
6
+ # filesystem PATH to an MSF file
7
+ attr_accessor :path
8
+ # the resulting ActiveRecord::Base.connection
9
+ attr_reader :connection
10
+
11
+ # * assign any passed attributes
12
+ # * define connection
13
+ #
14
+ # Example:
15
+ #
16
+ # msf = MSF.new({
17
+ # :path => './my.msf'
18
+ # })
19
+ # msf.connection.tables
20
+ # msf.connection.disconnect!
21
+ # msf.reconnect
22
+ def initialize(attributes={})
23
+ attributes.each do |name, value|
24
+ send("#{name}=", value)
25
+ end
26
+ @connection = ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => @path).connection
27
+ end
28
+ # reconnect to the MSF file (sqlite3 database)
29
+ def reconnect
30
+ @connection = ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => @path).connection
31
+ end
32
+ end
@@ -0,0 +1,16 @@
1
+ module ThermoMSF
2
+ module Model
3
+ class EnzymeCleavageSpecificity < Sequel::Model(:EnzymesCleavageSpecificities)
4
+ set_primary_key [:EnzymeID, :Specificity]
5
+ # ruby style accessors
6
+ def enzyme_id
7
+ self.EnzymeID
8
+ end
9
+ def specificity
10
+ self.Specificity
11
+ end
12
+ # associations
13
+ many_to_one enzyme, :key => :EnzymeID
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,24 @@
1
+ module ThermoMSF
2
+ module Model
3
+ class FalseDiscoveryRate < Sequel::Model(:FalseDiscoveryRates)
4
+ set_primary_key [:ProcessingNodeNumber, :ConfidenceLevel]
5
+ # ruby style accessors
6
+ def processing_node_number
7
+ self.ProcessingNodeNumber
8
+ end
9
+ def confidence_level
10
+ self.ConfidenceLevel
11
+ end
12
+ def true_count
13
+ self.TrueCount
14
+ end
15
+ def false_count
16
+ self.FalseCount
17
+ end
18
+ def target
19
+ self.Target
20
+ end
21
+ # associations
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,17 @@
1
+ module ThermoMSF
2
+ module Model
3
+ class FastaFileProteinAnnotation < Sequel::Model(:FastaFilesProteinAnnotations)
4
+ set_primary_key [:FastaFileID, :ProteinAnnotationID]
5
+ # ruby style accessors
6
+ def fasta_file_id
7
+ self.FastaFileID
8
+ end
9
+ def protein_annotation_id
10
+ self.ProteinAnnotationID
11
+ end
12
+ # associations
13
+ many_to_one fasta_file, :key => :FastaFileID
14
+ many_to_one protein_annotation, :key => :ProteinAnnotationID
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ module ThermoMSF
2
+ module Model
3
+ class MassPeakRelation < Sequel::Model(:MassPeakRelations)
4
+ set_primary_key [:MassPeakID, :RelatedMassPeakID]
5
+ # ruby style accessors
6
+ def mass_peak_id
7
+ self.MassPeakID
8
+ end
9
+ def related_mass_peak_id
10
+ self.RelatedMassPeakID
11
+ end
12
+ # associations
13
+ many_to_one mass_peak, :key => :MassPeakID
14
+ many_to_one related_mass_peak, :key => :RelatedMassPeakID
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,23 @@
1
+ module ThermoMSF
2
+ module Model
3
+ class PeptideAminoAcidModificationDecoy < Sequel::Model(:PeptidesAminoAcidModifications_decoy)
4
+ set_primary_key :
5
+ # ruby style accessors
6
+ def processing_node_number
7
+ self.ProcessingNodeNumber
8
+ end
9
+ def peptide_id
10
+ self.PeptideID
11
+ end
12
+ def amino_acid_modification_id
13
+ self.AminoAcidModificationID
14
+ end
15
+ def position
16
+ self.Position
17
+ end
18
+ # associations
19
+ many_to_one peptide, :key => :PeptideID
20
+ many_to_one amino_acid_modification, :key => :AminoAcidModificationID
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,32 @@
1
+ module ThermoMSF
2
+ module Model
3
+ class PeptideDecoy < Sequel::Model(:Peptides_decoy)
4
+ set_primary_key :
5
+ # ruby style accessors
6
+ def processing_node_number
7
+ self.ProcessingNodeNumber
8
+ end
9
+ def peptide_id
10
+ self.PeptideID
11
+ end
12
+ def spectrum_id
13
+ self.SpectrumID
14
+ end
15
+ def total_ions_count
16
+ self.TotalIonsCount
17
+ end
18
+ def matched_ions_count
19
+ self.MatchedIonsCount
20
+ end
21
+ def confidence_level
22
+ self.ConfidenceLevel
23
+ end
24
+ def sequence
25
+ self.Sequence
26
+ end
27
+ # associations
28
+ many_to_one peptide, :key => :PeptideID
29
+ many_to_one spectrum, :key => :SpectrumID
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,20 @@
1
+ module ThermoMSF
2
+ module Model
3
+ class PeptideTerminalModificationDecoy < Sequel::Model(:PeptidesTerminalModifications_decoy)
4
+ set_primary_key :
5
+ # ruby style accessors
6
+ def processing_node_number
7
+ self.ProcessingNodeNumber
8
+ end
9
+ def peptide_id
10
+ self.PeptideID
11
+ end
12
+ def terminal_modification_id
13
+ self.TerminalModificationID
14
+ end
15
+ # associations
16
+ many_to_one peptide, :key => :PeptideID
17
+ many_to_one terminal_modification, :key => :TerminalModificationID
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,29 @@
1
+ module ThermoMSF
2
+ module Model
3
+ class PrecursorIonQuanResult < Sequel::Model(:PrecursorIonQuanResults)
4
+ set_primary_key :
5
+ # ruby style accessors
6
+ def quan_channel_id
7
+ self.QuanChannelID
8
+ end
9
+ def quan_result_id
10
+ self.QuanResultID
11
+ end
12
+ def mass
13
+ self.Mass
14
+ end
15
+ def charge
16
+ self.Charge
17
+ end
18
+ def area
19
+ self.Area
20
+ end
21
+ def retention_time
22
+ self.RetentionTime
23
+ end
24
+ # associations
25
+ many_to_one quan_channel, :key => :QuanChannelID
26
+ many_to_one quan_result, :key => :QuanResultID
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,17 @@
1
+ module ThermoMSF
2
+ module Model
3
+ class PrecursorIonQuanResultEventSpectrum < Sequel::Model(:PrecursorIonQuanResultsEventSpectra)
4
+ set_primary_key :
5
+ # ruby style accessors
6
+ def quan_result_id
7
+ self.QuanResultID
8
+ end
9
+ def quan_spectrum_id
10
+ self.QuanSpectrumID
11
+ end
12
+ # associations
13
+ many_to_one quan_result, :key => :QuanResultID
14
+ many_to_one quan_spectrum, :key => :QuanSpectrumID
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,20 @@
1
+ module ThermoMSF
2
+ module Model
3
+ class PrecursorIonQuanResultSearchSpectrum < Sequel::Model(:PrecursorIonQuanResultsSearchSpectra)
4
+ set_primary_key :
5
+ # ruby style accessors
6
+ def processing_node_number
7
+ self.ProcessingNodeNumber
8
+ end
9
+ def quan_result_id
10
+ self.QuanResultID
11
+ end
12
+ def search_spectrum_id
13
+ self.SearchSpectrumID
14
+ end
15
+ # associations
16
+ many_to_one quan_result, :key => :QuanResultID
17
+ many_to_one search_spectrum, :key => :SearchSpectrumID
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,29 @@
1
+ module ThermoMSF
2
+ module Model
3
+ class ProcessingNodeFilterParameter < Sequel::Model(:ProcessingNodeFilterParameters)
4
+ set_primary_key [:ProcessingNodeNumber, :FilterParameterName]
5
+ # ruby style accessors
6
+ def processing_node_number
7
+ self.ProcessingNodeNumber
8
+ end
9
+ def filter_parameter_name
10
+ self.FilterParameterName
11
+ end
12
+ def filter_module_type_id
13
+ self.FilterModuleTypeID
14
+ end
15
+ def filter_module_number
16
+ self.FilterModuleNumber
17
+ end
18
+ def processing_node_id
19
+ self.ProcessingNodeID
20
+ end
21
+ def filter_parameter_value
22
+ self.FilterParameterValue
23
+ end
24
+ # associations
25
+ many_to_one filter_module_type, :key => :FilterModuleTypeID
26
+ many_to_one processing_node, :key => :ProcessingNodeID
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,19 @@
1
+ module ThermoMSF
2
+ module Model
3
+ class ProcessingNodeInterface < Sequel::Model(:ProcessingNodeInterfaces)
4
+ set_primary_key :
5
+ # ruby style accessors
6
+ def processing_node_id
7
+ self.ProcessingNodeID
8
+ end
9
+ def interface_kind
10
+ self.InterfaceKind
11
+ end
12
+ def interface_name
13
+ self.InterfaceName
14
+ end
15
+ # associations
16
+ many_to_one processing_node, :key => :ProcessingNodeID
17
+ end
18
+ end
19
+ end