Class: MS::Sequest::Srf::Out

Inherits:
Object
  • Object
show all
Defined in:
lib/ms/sequest/srf.rb

Overview

0=first_scan, 1=last_scan, 2=charge, 3=num_hits, 4=computer, 5=date_time, 6=hits, 7=total_inten, 8=lowest_sp, 9=num_matched_peptides, 10=db_locus_count

Defined Under Namespace

Classes: Peptide, Protein

Constant Summary collapse

Unpack_32 =
'@36vx2Z*@60Z*'
Unpack_35 =
'@36vx4Z*@62Z*'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_io(fh, unpack_35, dup_refs_gt_0) ⇒ Object

returns an MS::Sequest::Srf::Out object



548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
# File 'lib/ms/sequest/srf.rb', line 548

def self.from_io(fh, unpack_35, dup_refs_gt_0)
  ## EMPTY out file is 96 bytes
  ## each hit is 320 bytes
  ## num_hits and charge:
  st = fh.read(96)

  # num_hits computer date_time
  initial_vals = st.unpack( (unpack_35 ? Unpack_35 : Unpack_32) )
  # total_inten lowest_sp num_matched_peptides db_locus_count
  initial_vals.push( *st.unpack('@8eex4Ix4I') )
  out_obj = self.new( *initial_vals )

  _num_hits = out_obj.num_hits

  ar = Array.new(_num_hits)
  if ar.size > 0
    num_extra_references = 0
    _num_hits.times do |i|
      ar[i] = MS::Sequest::Srf::Out::Peptide.from_io(fh, unpack_35)
      num_extra_references += ar[i].num_other_loci
    end
    if dup_refs_gt_0
      MS::Sequest::Srf::Out::Peptide.read_extra_references(fh, num_extra_references, ar)
    end
    ## The xcorrs are already ordered by best to worst hit
    ## ADJUST the deltacn's to be meaningful for the top hit:
    ## (the same as bioworks and prophet)
    MS::Sequest::Srf::Out::Peptide.set_deltacn_from_deltacn_orig(ar)
  end
  out_obj.hits = ar
  out_obj[1].chomp! # computer
  out_obj
end

Instance Method Details

#inspectObject



537
538
539
540
541
542
543
544
545
# File 'lib/ms/sequest/srf.rb', line 537

def inspect
  hits_s = 
    if self.hits
      ", @hits(#)=#{hits.size}"
    else
      ''
    end
  "<MS::Sequest::Srf::Out  first_scan=#{first_scan}, last_scan=#{last_scan}, charge=#{charge}, num_hits=#{num_hits}, computer=#{computer}, date_time=#{date_time}#{hits_s}>"
end