msf 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +24 -0
- data/Gemfile.lock +67 -0
- data/LICENSE.txt +20 -0
- data/README.md +45 -0
- data/Rakefile +43 -0
- data/VERSION +1 -0
- data/bin/ibspectra +43 -0
- data/erd/config.png +0 -0
- data/erd/empty.png +0 -0
- data/erd/erd.png +0 -0
- data/erd/msf.xcdatamodeld/.xccurrentversion +8 -0
- data/erd/msf.xcdatamodeld/msf.xcdatamodel/contents +330 -0
- data/erd/schema.txt +666 -0
- data/lib/msf.rb +2 -0
- data/lib/msf/models.rb +4 -0
- data/lib/msf/models/amino_acid.rb +50 -0
- data/lib/msf/models/amino_acid_modification.rb +55 -0
- data/lib/msf/models/amino_acid_modification_neutral_loss.rb +31 -0
- data/lib/msf/models/amino_acid_modifications_amino_acid_nls.rb +23 -0
- data/lib/msf/models/amino_acid_modifications_amino_acids.rb +27 -0
- data/lib/msf/models/annotation_data_version.rb +20 -0
- data/lib/msf/models/annotation_dataset.rb +29 -0
- data/lib/msf/models/annotation_group.rb +38 -0
- data/lib/msf/models/annotation_type.rb +23 -0
- data/lib/msf/models/chromatogram.rb +26 -0
- data/lib/msf/models/custom_data_field.rb +56 -0
- data/lib/msf/models/custom_data_peptide.rb +25 -0
- data/lib/msf/models/custom_data_processing_node.rb +25 -0
- data/lib/msf/models/custom_data_protein.rb +25 -0
- data/lib/msf/models/custom_data_spectrum.rb +25 -0
- data/lib/msf/models/enzyme.rb +32 -0
- data/lib/msf/models/fasta_file.rb +50 -0
- data/lib/msf/models/file_info.rb +41 -0
- data/lib/msf/models/mass_peak.rb +36 -0
- data/lib/msf/models/peptide.rb +118 -0
- data/lib/msf/models/peptide_score.rb +34 -0
- data/lib/msf/models/peptide_score_decoy.rb +34 -0
- data/lib/msf/models/peptide_terminal_modification.rb +29 -0
- data/lib/msf/models/peptides_amino_acid_modifications.rb +32 -0
- data/lib/msf/models/peptides_proteins.rb +27 -0
- data/lib/msf/models/processing_node.rb +65 -0
- data/lib/msf/models/processing_node_score.rb +45 -0
- data/lib/msf/models/protein.rb +38 -0
- data/lib/msf/models/protein_annotation.rb +35 -0
- data/lib/msf/models/protein_identification_group.rb +19 -0
- data/lib/msf/models/protein_score.rb +34 -0
- data/lib/msf/models/reporter_ion_quan_result.rb +31 -0
- data/lib/msf/models/reporter_ion_quan_result_search_spectrum.rb +29 -0
- data/lib/msf/models/scan_event.rb +37 -0
- data/lib/msf/models/schema_info.rb +29 -0
- data/lib/msf/models/spectrum.rb +34 -0
- data/lib/msf/models/spectrum_header.rb +63 -0
- data/lib/msf/models/spectrum_score.rb +24 -0
- data/lib/msf/models/taxonomy_name.rb +26 -0
- data/lib/msf/models/workflow_info.rb +46 -0
- data/lib/msf/models/workflow_message.rb +31 -0
- data/lib/msf/msf.rb +32 -0
- data/lib/msf/sql/enzyme_cleavage_specificity.rb +16 -0
- data/lib/msf/sql/false_discovery_rate.rb +24 -0
- data/lib/msf/sql/fasta_file_protein_annotation.rb +17 -0
- data/lib/msf/sql/mass_peak_relation.rb +17 -0
- data/lib/msf/sql/peptide_amino_acid_modification_decoy.rb +23 -0
- data/lib/msf/sql/peptide_decoy.rb +32 -0
- data/lib/msf/sql/peptide_terminal_modification_decoy.rb +20 -0
- data/lib/msf/sql/precursor_ion_quan_result.rb +29 -0
- data/lib/msf/sql/precursor_ion_quan_result_event_spectrum.rb +17 -0
- data/lib/msf/sql/precursor_ion_quan_result_search_spectrum.rb +20 -0
- data/lib/msf/sql/processing_node_filter_parameter.rb +29 -0
- data/lib/msf/sql/processing_node_interface.rb +19 -0
- data/lib/msf/sql/processing_node_parameter.rb +46 -0
- data/lib/msf/sql/processing_node_spectrum.rb +16 -0
- data/lib/msf/sql/quan_result.rb +40 -0
- data/lib/msf/sql/result_filter_set.rb +12 -0
- data/lib/msf/sql/taxonomy_node.rb +26 -0
- data/msf.gemspec +143 -0
- data/spec/msf_spec.rb +7 -0
- data/spec/spec_helper.rb +14 -0
- metadata +275 -0
data/lib/msf.rb
ADDED
data/lib/msf/models.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# ActiveRecord model of MSF AminoAcid
|
2
|
+
#
|
3
|
+
# Example:
|
4
|
+
#
|
5
|
+
# AminoAcid.find(1)
|
6
|
+
# AminoAcid.first.monoisotopic_mass
|
7
|
+
# AminoAcid.first.amino_acid_modifications.first.modification_name
|
8
|
+
class AminoAcid < ActiveRecord::Base
|
9
|
+
def self.masses
|
10
|
+
if @masses.nil?
|
11
|
+
@masses = {}
|
12
|
+
AminoAcid.select("OneLetterCode,MonoisotopicMass").where("OneLetterCode != ' '").map {|aa| @masses[aa.one_letter_code] = aa.monoisotopic_mass}
|
13
|
+
end
|
14
|
+
@masses
|
15
|
+
end
|
16
|
+
def self.mass_for_one_letter_code(aa)
|
17
|
+
self.masses[aa]
|
18
|
+
end
|
19
|
+
def self.table_name
|
20
|
+
:AminoAcids
|
21
|
+
end
|
22
|
+
def self.primary_key
|
23
|
+
:AminoAcidID
|
24
|
+
end
|
25
|
+
def amino_acid_id
|
26
|
+
self.AminoAcidID
|
27
|
+
end
|
28
|
+
def amino_acid_name
|
29
|
+
self.AminoAcidName
|
30
|
+
end
|
31
|
+
def one_letter_code
|
32
|
+
self.OneLetterCode
|
33
|
+
end
|
34
|
+
def three_letter_code
|
35
|
+
self.ThreeLetterCode
|
36
|
+
end
|
37
|
+
def monoisotopic_mass
|
38
|
+
self.MonoisotopicMass
|
39
|
+
end
|
40
|
+
def average_mass
|
41
|
+
self.AverageMass
|
42
|
+
end
|
43
|
+
def sum_formula
|
44
|
+
self.SumFormula
|
45
|
+
end
|
46
|
+
# associations
|
47
|
+
has_many :amino_acid_modifications,
|
48
|
+
:class_name => 'AminoAcidModificationsAminoAcids',
|
49
|
+
:foreign_key => "AminoAcidID"
|
50
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# ActiveRecord model of MSF AminoAcidModification
|
2
|
+
#
|
3
|
+
# Example:
|
4
|
+
#
|
5
|
+
# AminoAcidModification.find(1)
|
6
|
+
# AminoAcidModification.first.modification_name
|
7
|
+
# AminoAcidModification.first.amino_acids.first.amino_acid_name
|
8
|
+
class AminoAcidModification < ActiveRecord::Base
|
9
|
+
def self.table_name
|
10
|
+
:AminoAcidModifications
|
11
|
+
end
|
12
|
+
def self.primary_key
|
13
|
+
:AminoAcidModificationID
|
14
|
+
end
|
15
|
+
def amino_acid_modification_id
|
16
|
+
self.AminoAcidModificationID
|
17
|
+
end
|
18
|
+
def modification_name
|
19
|
+
self.ModificationName
|
20
|
+
end
|
21
|
+
def delta_mass
|
22
|
+
self.DeltaMass
|
23
|
+
end
|
24
|
+
def substitution
|
25
|
+
self.Substitution
|
26
|
+
end
|
27
|
+
def leaving_group
|
28
|
+
self.LeavingGroup
|
29
|
+
end
|
30
|
+
def abbreviation
|
31
|
+
self.Abbreviation
|
32
|
+
end
|
33
|
+
def position_type
|
34
|
+
self.PositionType
|
35
|
+
end
|
36
|
+
def is_active
|
37
|
+
self.IsActive
|
38
|
+
end
|
39
|
+
def delta_average_mass
|
40
|
+
self.DeltaAverageMass
|
41
|
+
end
|
42
|
+
def unimod_accession
|
43
|
+
self.UnimodAccession
|
44
|
+
end
|
45
|
+
def is_substitution
|
46
|
+
self.IsSubstitution
|
47
|
+
end
|
48
|
+
# associations
|
49
|
+
# join table for amino_acid
|
50
|
+
has_one :amino_acid_modification_amino_acid,
|
51
|
+
:class_name => 'AminoAcidModificationsAminoAcids',
|
52
|
+
:foreign_key => "AminoAcidModificationID"
|
53
|
+
has_one :amino_acid, :through => :amino_acid_modification_amino_acid
|
54
|
+
|
55
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# ActiveRecord model of MSF AminoAcidModificationsNeutralLoss
|
2
|
+
#
|
3
|
+
# Example:
|
4
|
+
#
|
5
|
+
# AminoAcidModificationNeutralLoss.find(1)
|
6
|
+
# AminoAcidModificationNeutralLoss.first
|
7
|
+
# AminoAcidModificationNeutralLoss.first.amino_acids.first.monoisotopic_mass
|
8
|
+
class AminoAcidModificationNeutralLoss < ActiveRecord::Base
|
9
|
+
def self.table_name
|
10
|
+
:AminoAcidModificationsNeutralLosses
|
11
|
+
end
|
12
|
+
def self.primary_key
|
13
|
+
:NeutralLossID
|
14
|
+
end
|
15
|
+
def neutral_loss_id
|
16
|
+
self.NeutralLossID
|
17
|
+
end
|
18
|
+
def name
|
19
|
+
self.Name
|
20
|
+
end
|
21
|
+
def monoisotopic_mass
|
22
|
+
self.MonoisotopicMass
|
23
|
+
end
|
24
|
+
def average_mass
|
25
|
+
self.AverageMass
|
26
|
+
end
|
27
|
+
has_and_belongs_to_many :amino_acids,
|
28
|
+
:join_table => "AminoAcidModificationsAminoAcidsNL",
|
29
|
+
:foreign_key => "NeutralLossID",
|
30
|
+
:association_foreign_key => "AminoAcidID"
|
31
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# ActiveRecord model of MSF AminoAcidModificationsAminoAcidNLs
|
2
|
+
# Join table for AminoAcid and AminoAcidModificationsNeutralLosses HABTM
|
3
|
+
#
|
4
|
+
# Example:
|
5
|
+
#
|
6
|
+
# AminoAcidModificationsAminoAcidNLs.first
|
7
|
+
class AminoAcidModificationsAminoAcidNLs < ActiveRecord::Base
|
8
|
+
def self.table_name
|
9
|
+
:AminoAcidModificationsAminoAcidsNL
|
10
|
+
end
|
11
|
+
def self.primary_key
|
12
|
+
[:AminoAcidModificationID, :AminoAcidID, :NeutralLossID]
|
13
|
+
end
|
14
|
+
def amino_acid_modification_id
|
15
|
+
self.AminoAcidModificationID
|
16
|
+
end
|
17
|
+
def amino_acid_id
|
18
|
+
self.AminoAcidID
|
19
|
+
end
|
20
|
+
def neutral_loss_id
|
21
|
+
self.NeutralLossID
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# ActiveRecord model of MSF AminoAcidModificationsAminoAcids
|
2
|
+
# Join table for AminoAcid and AminoAcidModification HABTM
|
3
|
+
#
|
4
|
+
# Example:
|
5
|
+
#
|
6
|
+
# AminoAcidModificationsAminoAcids.first.classification
|
7
|
+
class AminoAcidModificationsAminoAcids < ActiveRecord::Base
|
8
|
+
def self.table_name
|
9
|
+
:AminoAcidModificationsAminoAcids
|
10
|
+
end
|
11
|
+
def self.primary_key
|
12
|
+
[:AminoAcidModificationID, :AminoAcidID]
|
13
|
+
end
|
14
|
+
def amino_acid_modification_id
|
15
|
+
self.AminoAcidModificationID
|
16
|
+
end
|
17
|
+
def amino_acid_id
|
18
|
+
self.AminoAcidID
|
19
|
+
end
|
20
|
+
def classification
|
21
|
+
self.Classification
|
22
|
+
end
|
23
|
+
belongs_to :amino_acid,
|
24
|
+
:foreign_key => "AminoAcidID"
|
25
|
+
belongs_to :amino_acid_modification,
|
26
|
+
:foreign_key => "AminoAcidModificationID"
|
27
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# ActiveRecord model of MSF AnnotationDataVersion
|
2
|
+
#
|
3
|
+
# Example:
|
4
|
+
#
|
5
|
+
# AnnotationDataVersion.find(1)
|
6
|
+
# AnnotationDataVersion.first.name
|
7
|
+
class AnnotationDataVersion < ActiveRecord::Base
|
8
|
+
def self.table_name
|
9
|
+
:AnnotationDataVersion
|
10
|
+
end
|
11
|
+
def self.primary_key
|
12
|
+
:PcDataVersion
|
13
|
+
end
|
14
|
+
def pc_data_version
|
15
|
+
self.PcDataVersion
|
16
|
+
end
|
17
|
+
def pc_data_release
|
18
|
+
self.PcDataRelease
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# ActiveRecord model of MSF AnnotationDataset
|
2
|
+
#
|
3
|
+
# Example:
|
4
|
+
#
|
5
|
+
# AnnotationDataset.find(1)
|
6
|
+
# AnnotationDataset.first.name
|
7
|
+
class AnnotationDataset < ActiveRecord::Base
|
8
|
+
def self.table_name
|
9
|
+
:AnnotationDataset
|
10
|
+
end
|
11
|
+
def self.primary_key
|
12
|
+
:DatasetId
|
13
|
+
end
|
14
|
+
def dataset_id
|
15
|
+
self.DatasetId
|
16
|
+
end
|
17
|
+
def name
|
18
|
+
self.Name
|
19
|
+
end
|
20
|
+
def display_name
|
21
|
+
self.DisplayName
|
22
|
+
end
|
23
|
+
def guid
|
24
|
+
self.Guid
|
25
|
+
end
|
26
|
+
def description
|
27
|
+
self.Description
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# ActiveRecord model of MSF AnnotationGroup
|
2
|
+
#
|
3
|
+
# Example:
|
4
|
+
#
|
5
|
+
# AnnotationGroup.find(1)
|
6
|
+
# AnnotationGroup.first.name
|
7
|
+
class AnnotationGroup < ActiveRecord::Base
|
8
|
+
def self.table_name
|
9
|
+
:AnnotationGroups
|
10
|
+
end
|
11
|
+
def self.primary_key
|
12
|
+
[:AnnotationGroupId, :DatasetId]
|
13
|
+
end
|
14
|
+
def annotation_group_id
|
15
|
+
self.AnnotationGroupId
|
16
|
+
end
|
17
|
+
def dataset_id
|
18
|
+
self.DatasetId
|
19
|
+
end
|
20
|
+
def description
|
21
|
+
self.Description
|
22
|
+
end
|
23
|
+
def position
|
24
|
+
self.Position
|
25
|
+
end
|
26
|
+
def color_r
|
27
|
+
self.ColorR
|
28
|
+
end
|
29
|
+
def color_g
|
30
|
+
self.ColorG
|
31
|
+
end
|
32
|
+
def color_b
|
33
|
+
self.ColorB
|
34
|
+
end
|
35
|
+
def group_definition
|
36
|
+
self.GroupDefinition
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# ActiveRecord model of MSF AnnotationType
|
2
|
+
#
|
3
|
+
# Example:
|
4
|
+
#
|
5
|
+
# AnnotationType.find(1)
|
6
|
+
# AnnotationType.first.name
|
7
|
+
class AnnotationType < ActiveRecord::Base
|
8
|
+
def self.table_name
|
9
|
+
:AnnotationTypes
|
10
|
+
end
|
11
|
+
def self.primary_key
|
12
|
+
:AnnotationTypeId
|
13
|
+
end
|
14
|
+
def annotation_type_id
|
15
|
+
self.AnnotationTypeId
|
16
|
+
end
|
17
|
+
def name
|
18
|
+
self.Name
|
19
|
+
end
|
20
|
+
def description
|
21
|
+
self.Description
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# ActiveRecord model of MSF Chromatogram
|
2
|
+
#
|
3
|
+
# Example:
|
4
|
+
#
|
5
|
+
# Chromatogram.find(1)
|
6
|
+
# Chromatogram.all.first.trace_type
|
7
|
+
# Chromatogram.first.file_infos.file_name
|
8
|
+
class Chromatogram < ActiveRecord::Base
|
9
|
+
def self.table_name
|
10
|
+
:Chromatograms
|
11
|
+
end
|
12
|
+
def self.primary_key
|
13
|
+
[:FileID, :TraceType]
|
14
|
+
end
|
15
|
+
def file_id
|
16
|
+
self.FileID
|
17
|
+
end
|
18
|
+
def trace_type
|
19
|
+
self.TraceType
|
20
|
+
end
|
21
|
+
def chromatogram
|
22
|
+
self.Chromatogram
|
23
|
+
end
|
24
|
+
belongs_to :file_info,
|
25
|
+
:foreign_key => "FileID"
|
26
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# ActiveRecord model of MSF CustomDataField
|
2
|
+
#
|
3
|
+
# Example:
|
4
|
+
#
|
5
|
+
# CustomDataField.find(1)
|
6
|
+
# CustomDataField.first.display_name
|
7
|
+
class CustomDataField < ActiveRecord::Base
|
8
|
+
def self.table_name
|
9
|
+
:CustomDataFields
|
10
|
+
end
|
11
|
+
def self.primary_key
|
12
|
+
:FieldID
|
13
|
+
end
|
14
|
+
def field_id
|
15
|
+
self.FieldID
|
16
|
+
end
|
17
|
+
def guid
|
18
|
+
self.Guid
|
19
|
+
end
|
20
|
+
def display_name
|
21
|
+
self.DisplayName
|
22
|
+
end
|
23
|
+
def source_node_number
|
24
|
+
self.SourceNodeNumber
|
25
|
+
end
|
26
|
+
def target_node_number
|
27
|
+
self.TargetNodeNumber
|
28
|
+
end
|
29
|
+
def data_type
|
30
|
+
self.DataType
|
31
|
+
end
|
32
|
+
def data_target
|
33
|
+
self.DataTarget
|
34
|
+
end
|
35
|
+
def version
|
36
|
+
self.Version
|
37
|
+
end
|
38
|
+
def access_mode
|
39
|
+
self.AccessMode
|
40
|
+
end
|
41
|
+
def visibility
|
42
|
+
self.Visibility
|
43
|
+
end
|
44
|
+
def group_visibility
|
45
|
+
self.GroupVisibility
|
46
|
+
end
|
47
|
+
def format
|
48
|
+
self.Format
|
49
|
+
end
|
50
|
+
def plot_type
|
51
|
+
self.PlotType
|
52
|
+
end
|
53
|
+
def data_purpose
|
54
|
+
self.DataPurpose
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# ActiveRecord model of MSF CustomDataPeptide
|
2
|
+
#
|
3
|
+
# Example:
|
4
|
+
#
|
5
|
+
# CustomDataPeptide.find(1)
|
6
|
+
# CustomDataPeptide.first.field_value
|
7
|
+
class CustomDataPeptide < ActiveRecord::Base
|
8
|
+
def self.table_name
|
9
|
+
:CustomDataPeptides
|
10
|
+
end
|
11
|
+
def self.primary_key
|
12
|
+
[:FieldID, :PeptideID]
|
13
|
+
end
|
14
|
+
def field_id
|
15
|
+
self.FieldID
|
16
|
+
end
|
17
|
+
def peptide_id
|
18
|
+
self.PeptideID
|
19
|
+
end
|
20
|
+
def field_value
|
21
|
+
self.FieldValue
|
22
|
+
end
|
23
|
+
belongs_to :custom_data_field,
|
24
|
+
:foreign_key => "FieldID"
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# ActiveRecord model of MSF CustomDataProcessingNode
|
2
|
+
#
|
3
|
+
# Example:
|
4
|
+
#
|
5
|
+
# CustomDataProcessingNode.find(1)
|
6
|
+
# CustomDataProcessingNode.first.field_value
|
7
|
+
class CustomDataProcessingNode < ActiveRecord::Base
|
8
|
+
def self.table_name
|
9
|
+
:CustomDataProcessingNodes
|
10
|
+
end
|
11
|
+
def self.primary_key
|
12
|
+
[:FieldID, :ProcessingNodeNumber]
|
13
|
+
end
|
14
|
+
def field_id
|
15
|
+
self.FieldID
|
16
|
+
end
|
17
|
+
def processing_node_number
|
18
|
+
self.ProcessingNodeNumber
|
19
|
+
end
|
20
|
+
def field_value
|
21
|
+
self.FieldValue
|
22
|
+
end
|
23
|
+
belongs_to :custom_data_field,
|
24
|
+
:foreign_key => "FieldID"
|
25
|
+
end
|