Passing Query Sequence through POST?

87 views
Skip to first unread message

Ioannis Kirmitzoglou

unread,
Jul 18, 2014, 9:38:12 PM7/18/14
to sequenc...@googlegroups.com
Hi there,

just a simple question. Can I call the sequenceserver main page in a way that I can populate the Query Sequence field automatically (e.g. through POST)?
If not is it easy to add? I don't mind adding a few lines to the search.erb view.

Thank you very much,

Ioannis

Anurag Priyam

unread,
Jul 19, 2014, 5:50:55 AM7/19/14
to sequenceserver
Do you want to open SS with a different query sequence each time or
with the same query sequence always?

Where is this query sequence sitting? your computer? on the computer
SS is installed on? some third computer?

-- Priyam
> --
> You received this message because you are subscribed to the Google Groups
> "sequenceserver" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sequenceserve...@googlegroups.com.
> To post to this group, send email to sequenc...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sequenceserver.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sequenceserver/97b85b01-b741-44ef-8aa3-5ead547d4184%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Ioannis Kirmitzoglou

unread,
Jul 19, 2014, 4:50:55 PM7/19/14
to sequenc...@googlegroups.com
The query is different every time. It resides within a MySQL database and the user selects it from a Gbrowse instance. I have a gbrowse plugin that can start ncbi web blast searches using the current sequence in gbrowse and blast settings different than the defaults. I would like to do the same using SS to run a blast against a local database. Ideally I would also like to pass to SS custom blast settings as well.

Anurag Priyam

unread,
Jul 20, 2014, 11:50:05 AM7/20/14
to sequenceserver
Interesting usage.

The simplest solution probably is,

1. Use SS from the git repository (or source download - tar.gz or
zip). No gem install.

$ git clone https://github.com/yannickwurm/sequenceserver.git
$ cd sequenceserver
$ gem install bundler
$ bundle install

Rest should follow from website.

2. Redirect users from GBrowse to foobar.com/blast?qid=sequence_id
(assuming foobar.com/blast hosts your SS installation)

3. In SS,
a. modify this [1] line so,

get '/' do
qid = params[:qid]
seq = `mysql -e "select seq from seqs where seq_id=#{qid}"` # 3
erb :search, :locals => {:sequence => seq, :databases =>
databases.values.group_by(&:type)}
end

b. and modify this [2] line so,

<textarea name="sequence" id="sequence" spellcheck="false"
autofocus="true" placeholder="Paste your sequence(s) here..." >
<%= sequence %>
</textarea>

I hope this makes sense. Drop us a line is there's any confusion. And
we would like to know once you get this working :)

If you already have a URL that can be hit to obtain the desired
sequence, given it's id, from MySQL - say going to
foobar.com/sequences?qid=sequence_id shows sequence with id
sequence_id - there's another approach that might be simpler.

[1]: https://github.com/yannickwurm/sequenceserver/blob/master/lib/sequenceserver.rb#L321
[2]: https://github.com/yannickwurm/sequenceserver/blob/master/views/search.erb#L52
[3]: See Ruby's backtick operator and string interpolation syntax
"#{}", if needed.

-- Priyam

On Sun, Jul 20, 2014 at 2:20 AM, Ioannis Kirmitzoglou
<ioanniski...@gmail.com> wrote:
> The query is different every time. It resides within a MySQL database and the user selects it from a Gbrowse instance. I have a gbrowse plugin that can start ncbi web blast searches using the current sequence in gbrowse and blast settings different than the defaults. I would like to do the same using SS to run a blast against a local database. Ideally I would also like to pass to SS custom blast settings as well.
>
> --
> You received this message because you are subscribed to the Google Groups "sequenceserver" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sequenceserve...@googlegroups.com.
> To post to this group, send email to sequenc...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sequenceserver.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sequenceserver/936690be-51b0-4541-80cc-7bd585412b4f%40googlegroups.com.

Thomas van Gurp

unread,
May 14, 2016, 8:29:09 AM5/14/16
to sequenceserver
I'm interested in this approach. If a script on the server returns a fasta object, like foobar.com/sequences?qid=sequence_id would it be possible to get sequenceserver to accept something like



Op zondag 20 juli 2014 17:50:05 UTC+2 schreef Anurag Priyam:

Anurag Priyam

unread,
May 16, 2016, 5:19:24 AM5/16/16
to sequenceserver
… and populate query textarea with FASTA returned from sequences.cgi?

Not automatically. You will have to make modifications.

You could curl sequences.cgi with the given qid instead of running a mysql query to get the sequence in the previous example. Or you could use Ruby’s Net::HTTP library.

Alternatively, you could do this client side:

$.get(‘/sequence.cgi’ + window.location.search, function (data) {
  $(‘.sequences’).val(data)
})

The code is just to give you an idea - it’s not tested.

Priyam

Thomas van Gurp

unread,
May 16, 2016, 5:44:25 AM5/16/16
to sequenc...@googlegroups.com

Hi Priyam,

 

Thanks fort he prompt reply!

Yes, exactly. In which Ruby script should the example you gave below be implemented?

 

 

With kind regards,

 

Thomas van Gurp

Owner | Bioinformatician

Deena Bioinformatics

+31(6) 472 421 09

--
You received this message because you are subscribed to a topic in the Google Groups "sequenceserver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sequenceserver/Nyw7ADODGMo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sequenceserve...@googlegroups.com.


To post to this group, send email to sequenc...@googlegroups.com.
Visit this group at https://groups.google.com/group/sequenceserver.

Anurag Priyam

unread,
May 16, 2016, 6:05:53 AM5/16/16
to sequenceserver
The example in the email/post to which you responded. Here - https://groups.google.com/d/msg/sequenceserver/Nyw7ADODGMo/0LtsnXOEnjAJ

There, instead of running a mysql query try to curl sequences.cgi to get the sequence instead.

Ah. The URLs in that post have grown stale … L120 lib/sequenceserver/routes.rb and L148 views/search.erb are the parts you are interested in.

If this works for you, we can try to refine and put a hook in sequenceserver to pre-load sequences given a url and sequence id.

Priyam

Thomas van Gurp

unread,
May 16, 2016, 6:32:37 AM5/16/16
to sequenc...@googlegroups.com

Ok, I will give it a try. Thanks for the pointers. I’ll get back to you as soon as I have it working J

 

Thomas

Reply all
Reply to author
Forward
0 new messages