wurmlab / sequenceserver

Intuitive graphical web interface for running BLAST bioinformatics tool (i.e. have your own custom NCBI BLAST site!)
https://sequenceserver.com
GNU Affero General Public License v3.0
271 stars 113 forks source link

Make it possible to download xxx bp up+downstream of matched region. #324

Open yeban opened 7 years ago

yeban commented 7 years ago

Carry over from #92.

yeban commented 4 years ago

A simple first implementation can simply be a 'Matching ± 1kb' button next to 'FASTA' button that downloads all matching regions (HSPs) for the database sequence (hit) ± 1kb on both sides.

Screenshot 2020-10-13 at 15 09 07

A slightly more refined version would allow the user to choose how many base pairs each side to include in the download.

Screenshot 2020-10-13 at 15 17 06

homonecloco commented 1 year ago

Hi, I started implementing this feature (as it is required for a project I'm collaborating). So far, I have managed to add a link to a new route that corresponds to the hit.

I extended the Retriver class to have the range as an optional parameter. The unit tests still work, but I'm still to add unit tests for single and multiple regions.

Right now the flanking size is hardcoded as 1000, it may be a configuraiton file, or added as a field.

I am using the whichdb method to find out which database I need to query. This is very slow, but I think the queries using blastcmd can be cached, but this probably a different issue.

I added the route get_sequence_range, but I think this could be overloaded with the get_sequence call, but I realised that it is using the POST method, which is not how the links.rb works.

I'm still to figure out a way to change the UI to include a field similar to this.

Finally, on my use case I would like o be able to disable the default Fasta download, as my use case requires NOT to be able to download the full chromosome (as this can be huge).

You can see my changes here: https://github.com/homonecloco/sequenceserver/tree/download_flanking_sequence