SRF conversion

15 views
Skip to first unread message

Gabe

unread,
Jun 15, 2009, 9:04:59 PM6/15/09
to Mspire Forum
Hi,

I'm new to mspire (and ruby) but am excited about the possibilities.
I have several collaborators that would *very* much like to convert
SRF files to SQT files for obvious reasons. A little googling led me
to this project which looks very promising. I managed to install ruby
and ms-sequest-0.0.2 but I'm not exactly sure what to do next. I
found the sequest/srf folders but I'm not sure which files to run and
how, exactly. Any help? As I said, I'm new to ruby, but proficient
in perl/linux so I mostly just need to know if this functionality is
mature yet and, if so, what syntax to use.

THANKS for any info and to everyone working on this desperately-needed
project!

g

John Prince

unread,
Jun 17, 2009, 3:44:48 PM6/17/09
to mspire...@googlegroups.com
Hi Gabe,

Thanks for your interest in this.  The SRF conversion is fairly mature.  I've thoroughly tested/crosschecked it on the files we typically generate and other users have done similar checks on their files.  Of course, decoding a binary file (with no open standard) has its inherent risks.  Users anxious about the conversion can output .out and .dta files and compare the output.  What I can say is that converting from srf to sqt with mspire is less buggy than going from srf to .dta/.out or .sqt using Thermo's own Bioworks software (for instance, they fail to implement precursor cutoffs found in the params file as occurs if you output directly to .out in your search).  I'm probably biased, but I do trust mspire over Bioworks.

How to use it:

Ideally, you only need to do this from the command line:

sudo gem install ms-sequest
srf_to_sqt.rb <yourfile>.srf

Unfortunately, in our current shuffle of things this is broken.  In a day or two I'll have things back in order.  In the meantime the basic underlying conversion is still quite operational.  This on one line:

ruby -e 'require "ms/sequest/srf"; Ms::Sequest::Srf.new("020.srf").to_sqt("020.sqt", :round => true)'

You may need ms-fasta installed (gem install ms-fasta).

I'll let you know when it's fixed proper.

--John

Gabe

unread,
Jun 17, 2009, 6:21:40 PM6/17/09
to Mspire Forum
Hi John,
Thanks very much for the response, and I'm very to happy to hear that
this function is pretty-much up and running. I had a hard time with
your instructions, for several different possible reasons.

FYI - I installed Ruby on Windows (not via Cygwin, which is also
installed). It's preferable to me to run via Windows because this is
all for collaborators that don't use linux. That said, if you think
this might be the problem I also dual-boot Ubuntu so I can try
alternatives if you think I should.

First, I cannot find the srf_to_sqt.rb file despite having the ms-
core-0.0.1, ms-fasta-0.2.0, mspire-0.5.0, and ms-sequest-0.0.2 gems
installed (in my c:\ruby\lib\ruby\gems\1.8\gems folder). Should this
be included in one of those packages? Or is it missing because, as
you mentioned, it's broken at the mo?

Second, when I try running the code you suggested from the command-
line I get the following error:

-e:1: syntax error, unexpected $end, expecting ')'

and when I try to put it into "test.rb" and run it I get:

C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require': no such file to load -- ms/sequest/srf/mgf
(LoadError)
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `require'
from C:/Ruby/lib/ruby/gems/1.8/gems/ms-sequest-0.0.2/lib/ms/
sequest/srf.rb:16
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
36:in `gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
36:in `require'
from C:/Ruby/lib/ruby/gems/1.8/gems/ms-sequest-0.0.2/lib/ms/
sequest/test.rb:1

Like you said, this could all be because something is broken at the
moment. So, please let me know if I just need to wait a bit or if
this is something I might be able to address myself. Thanks again for
your help and for initiating this project!!!!!

gabe

PS - I'm in Ben Cravatt's lab at the Scripps research institute and
he's talked several times about how much he admires Dr. Marcotte's
work. I didn't realize you were in that lab until this morning. :)

John Prince

unread,
Jun 18, 2009, 4:02:32 PM6/18/09
to mspire...@googlegroups.com
Gabe,

My packaging wasn't done properly on that release, so it wasn't included.  I've released a new gem that should work.

Install it with rubygems to ensure that you get the latest dependencies:

gem install ms-sequest

Then run it:

srf_to_sqt.rb <yourfile>.srf

To see options:

srf_to_sqt.rb

This should work on windows (its just ruby code), but I haven't had a chance to test it yet on windows.  If you test it before me, please post any error messages and I'll sort it out.  You shouldn't have any problems on linux.

--John

PS  it's true, Ed does exceptional work (and was great to work for).  Likewise, we've always enjoyed Ben's work--his research is in a league of its own.

gabe simon

unread,
Jun 18, 2009, 7:05:25 PM6/18/09
to mspire...@googlegroups.com
John,
Sorry to keep bugging you with this, but I tried updating ms-sequest
but I still have no file called 'srf_to_sqt.rb':

C:\Ruby>gem install rubygems-update
Successfully installed rubygems-update-1.3.4
1 gem installed
Installing ri documentation for rubygems-update-1.3.4...
Installing RDoc documentation for rubygems-update-1.3.4...

C:\Ruby>update_rubygems
Installing RubyGems 1.3.4
Installing RubyGems
Installing gem executable
Removing old source_cache files
Removing old RubyGems RDoc and ri
Installing rubygems-1.3.4 ri into
C:/Ruby/lib/ruby/gems/1.8/doc/rubygems-1.3.4/ri
Installing rubygems-1.3.4 rdoc into
C:/Ruby/lib/ruby/gems/1.8/doc/rubygems-1.3.4/rdoc

------------------------------------------------------------------------------

Oh-no! Unable to find release notes!

------------------------------------------------------------------------------

RubyGems installed the following executables:
C:/Ruby/bin/gem


C:\Ruby>gem install ms-sequest
Successfully installed ms-sequest-0.0.2
1 gem installed
Installing ri documentation for ms-sequest-0.0.2...
Installing RDoc documentation for ms-sequest-0.0.2...
--------------------------------------------------------------------------------------------

but still no 'srf_to_sqt.rb' anywhere.... wth? am I using rubygems
incorrectly? Do I need to manually delete the ms-sequest-0.0.2 folder
before updating? Like I said I'm new to ruby, so please pardon my
ignorance. BTW - I have files called sqt.rb and srf.rb, just no
srf_to_sqt.rb.

gabe

John Prince

unread,
Jun 18, 2009, 7:20:38 PM6/18/09
to mspire...@googlegroups.com
Gabe,

Two things:

1) it looks like you aren't getting the latest version downloaded.  I had just uploaded the file to the server when I emailed you (and checked that it was there).  Sometimes there is a lag on the different mirrors though.  Try installing ms-sequest one more time (gem install ms-sequest) and check that its version 0.0.4.

2) Once you have version 0.0.4, then you should be able to just type 'srf_to_search.rb'.  It's possible that you don't have ruby gems configured in your environment, so you may need to run it like this:

ruby -rubygems -S srf_to_search.rb

(which requires rubygems and then runs the script)

Let me know how it goes.

--John

Gabe

unread,
Jun 19, 2009, 7:57:25 PM6/19/09
to Mspire Forum
John,
I got it to work. THANK YOU for your patience. Here's what I did:
no matter how many times/ways I tried running gem install ms-sequest
or updating my rubygems, it always downloaded ms-sequest-0.0.2. So, I
finally went to the RubyForge: mspire page and downloaded the ms-
sequest-0.0.4.gem file and gem-installed it manually and it works like
a charm. So far it looks perfect and DTASelect runs without a hitch.
I will also attempt to install Ruby on a fresh system to see if my
problems have anything to do with all my cygwin nonsense or anything
peculiar, or if it should be straightforward to install in the
future. Regardless, I can instruct other users to simply install Ruby
then download the ms-sequest-0.0.4.gem file manually. What are the
dependencies of this file, does it require mspire or ms-fasta or
anything?

THANKS again.

Best,

Gabe
> > On Thu, Jun 18, 2009 at 1:02 PM, John Prince<jtpri...@gmail.com> wrote:
> > > Gabe,
>
> > > My packaging wasn't done properly on that release, so it wasn't included.
> > > I've released a new gem that should work.
>
> > > Install it with rubygems to ensure that you get the latest dependencies:
>
> > > gem install ms-sequest
>
> > > Then run it:
>
> > > srf_to_sqt.rb <yourfile>.srf
>
> > > To see options:
>
> > > srf_to_sqt.rb
>
> > > This should work on windows (its just ruby code), but I haven't had a
> > chance
> > > to test it yet on windows.  If you test it before me, please post any
> > error
> > > messages and I'll sort it out.  You shouldn't have any problems on linux.
>
> > > --John
>
> > > PS  it's true, Ed does exceptional work (and was great to work for).
> > > Likewise, we've always enjoyed Ben's work--his research is in a league of
> > > its own.
>

John Prince

unread,
Jun 22, 2009, 11:06:12 AM6/22/09
to mspire...@googlegroups.com
Gabe,

I'm glad you got it working.  Thanks for your persistence as I know these kinds of things can be frustrating.

The dependencies right now are:
arrayclass
ms-core
tap

    # depends on:
    lazydoc
    configurable
ms-fasta


All of these exist as gems on rubyforge and so the dependencies should be installable with:
gem install arrayclass ms-core tap lazydoc configurable ms-fasta

Were I advising other windows users, I would advise along these lines:
  1. Make sure to check the 'enable RUBYGEMS' option when installing with the one-click installer. (This is not checked by default so needs to be checked manually during installation).
  2. (as you mention) try installing first with 'gem install ms-sequest'.  This should work and if other users report problems with this I need to figure out what's going on.
  3. If needed, can try to install 'gem install -y ms-sequest' (which says "yes" to the installation of all dependencies)
  4. Can try a manual install of necessary gems.
In several years of working with the rubygems system, I've never had it fail to pick up the latest version (as you have) and install the required dependecies (at least those specified by the gemspec).  My point in saying this is only that something very weird is going on that probably shouldn't be.  Maybe the RUBYGEMS option listed in step #1 is really important; I haven't done enough installs lately on windows to say for sure.

BTW, what do you get when you type in:
gem list --remote ms-sequest

(you should see 0.0.4 gem listed)


Please let me know how it goes with a fresh install. 

Thanks for your help with this,
John

Gabe

unread,
Jun 22, 2009, 11:56:15 AM6/22/09
to Mspire Forum
Hi John,
FYI - I did a fresh install on a clean Windows computer (with 'enable
rubygems' checked) and everything went without a hitch. 'gem install
ms-sequest' installed v0.0.4 with all the dependencies and
srf_to_sqt.rb worked immediately. Thanks again for all the help.

If you're still curious, on my machine (the one that was not
recognizing 0.0.4) when I do the list --remote thing I get:

*** REMOTE GEMS ***

ms-sequest (0.0.4)

C:\Ruby>gem install ms-sequest
Successfully installed ms-sequest-0.0.4
1 gem installed
Installing ri documentation for ms-sequest-0.0.4...
Installing RDoc documentation for ms-sequest-0.0.4...

-------------------------------------------

so, now it looks fine. I don't know if it's because I manually
installed 0.0.4 or because the server updated or something but it's
moot now because everything seems to be working fine. Sorry for the
hassle... Windows, y'know?

BTW where are you working now?

Thanks again!

Gabe




On Jun 22, 8:06 am, John Prince <jtpri...@gmail.com> wrote:
> Gabe,
>
> I'm glad you got it working.  Thanks for your persistence as I know these
> kinds of things can be frustrating.
>
> The dependencies right now are:
> *arrayclass
> ms-core
> tap*
>     # depends on:
>     *lazydoc
>     configurable
> ms-fasta*
>
> All of these exist as gems on rubyforge and so the dependencies should be
> installable with:
> *gem install arrayclass ms-core tap lazydoc configurable ms-fasta
> *
>
> Were I advising other windows users, I would advise along these lines:
>
>    1. Make sure to check the 'enable RUBYGEMS' option when installing with
>    the one-click installer. (This is not checked by default so needs to be
>    checked manually during installation).
>    2. (as you mention) try installing first with 'gem install ms-sequest'.
>    This should work and if other users report problems with this I need to
>    figure out what's going on.
>    3. If needed, can try to install 'gem install -y ms-sequest' (which says
>    "yes" to the installation of all dependencies)
>    4. Can try a manual install of necessary gems.
>
> In several years of working with the rubygems system, I've never had it fail
> to pick up the latest version (as you have) and install the required
> dependecies (at least those specified by the gemspec).  My point in saying
> this is only that something very weird is going on that probably shouldn't
> be.  Maybe the RUBYGEMS option listed in step #1 is really important; I
> haven't done enough installs lately on windows to say for sure.
>
> BTW, what do you get when you type in:
> *gem list --remote ms-sequest*
> ...
>
> read more »

John Prince

unread,
Jun 22, 2009, 12:10:44 PM6/22/09
to mspire...@googlegroups.com
Gabe,
I'm glad you got it working :)  Looks like things should work on windows then...
I'm Postdoc'ing at CU-Boulder in the Ahn lab.

regards,
John
Reply all
Reply to author
Forward
0 new messages