Class: Sequest::PepXML::SearchDatabase

Inherits:
Object
  • Object
show all
Includes:
SpecIDXML
Defined in:
lib/ms/sequest/pepxml.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = nil, args = nil) ⇒ SearchDatabase

Takes a SequestParams object Sets :local_path from the params object attr :database



1184
1185
1186
1187
1188
1189
1190
# File 'lib/ms/sequest/pepxml.rb', line 1184

def initialize(params=nil, args=nil)
  @seq_type = nil
  if params
    @local_path = params.database
  end
  if args ; set_from_hash(args) end
end

Instance Attribute Details

#local_pathObject

Returns the value of attribute local_path.



1180
1181
1182
# File 'lib/ms/sequest/pepxml.rb', line 1180

def local_path
  @local_path
end

#seq_typeObject



1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/ms/sequest/pepxml.rb', line 1192

def seq_type
  if @seq_type ; @seq_type
  else
    if @local_path =~ /\.fasta/
      'AA'
    else
      abort "Don't recognize type from your database local path: #{@local_path}"
    end
  end
end

Instance Method Details

#to_pepxmlObject



1203
1204
1205
# File 'lib/ms/sequest/pepxml.rb', line 1203

def to_pepxml
  short_element_xml_and_att_string(:search_database, "local_path=\"#{local_path}\" type=\"#{seq_type}\"")
end