Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The blast_sequence table is big and only getting bigger #288

Open
childers opened this issue May 30, 2019 · 10 comments
Open

The blast_sequence table is big and only getting bigger #288

childers opened this issue May 30, 2019 · 10 comments
Assignees

Comments

@childers
Copy link
Contributor

I've been getting warnings about the blast.sequence table growing large, and on looking at the table definitions, it seems like this is because records are never deleted when the blast database the record refers to is also deleted.

Right now this one table id around 935 MB. I did some basic tests and it looks like queries on this table may take a significant amount of time to return results.

I think the only reason we have this is for displaying the subject sequence in the results page. This functionality should be reproducible either using the included BLAST+ tools.

@deming7h777 deming7h777 self-assigned this Jun 21, 2019
@deming7h777
Copy link
Contributor

I try to use postgres schema to access blast_sequence table but encounter the permission issue

@deming7h777
Copy link
Contributor

deming7h777 commented Jun 24, 2019

I try to use postgres schema to access blast_sequence table but encounter the permission issue

ERROR: permission denied for relation blast_sequence
and then I try : GRANT ALL PRIVILEGES ON TABLE blast_sequence TO django;
GRANT ALL PRIVILEGES ON TABLES IN SCHEMA public TO django;
but still get the same error

@deming7h777
Copy link
Contributor

I went through three script yesterday to figure out the procedure for replacing current fasta-view by blast+ application.

  1. setup.py ( check if it need more installation for blast+)
  2. blast.result.js ( there are further more package need to figure out eg. codemirror)
  3. result.html

@deming7h777
Copy link
Contributor

1.Encounter the issue No alias or index file found for nucleotide database
2.After figuring out, I try to use blastdbcmd -list /home/vagrant/genomics-workspace/media/blast/db -recursive but fail
3.Then I try to replace full path by ./ then somehow it works
4. There are several argument for blastdbcmd such like blastdbcmd [-h] [-help] [-db dbname] [-dbtype molecule_type]
[-entry sequence_identifier] [-entry_batch input_file] [-pig PIG] [-info]
[-range numbers] [-strand strand] [-mask_sequence_with mask_algo_id]
[-out output_file] [-outfmt format] [-target_only] [-get_dups]
[-line_length number] [-ctrl_a] [-show_blastdb_search_path]
[-list directory] [-remove_redundant_dbs] [-recursive]
[-list_outfmt format] [-exact_length] [-long_seqids] [-logfile File_Name]
[-version]
I pick " - entry " as the argument to extract sequence from BLAST database but it seems like I still choose the wrong value to search

@deming7h777
Copy link
Contributor

There are three python package that can use for CLI:

  1. Click ( include: django-click)
  2. Docopt
  3. Fire (develop by google)

The way than can used by javascript:

  1. fixed package.json bin
  2. commander.js

@deming7h777
Copy link
Contributor

Get Javascript and Python get communicate using Json

  1. Ajax include JQuery and Js

@deming7h777
Copy link
Contributor

Alright, so for sending data from the client (JavaScript) to the backend (your Django app) you need to employ something called Ajax, it stands for Asynchronous JavaScript and XML. Basically what it does is allowing you to communicate with your backend services without the need of having to reload the page, which, you would have to do using a normal POST or PUT form submission.

The easiest implementation is using jQuery. jQuery is first and foremost a DOM manipulation library but since its inception has grown to encompass much more than that.

example code :
'''
$(document).ready(function() {
$.ajax({
method: 'POST',
url: '/path/to/your/view/',
data: {'yourJavaScriptArrayKey': yourJavaScriptArray},
success: function (data) {
//this gets called when server returns an OK response
alert("it worked!");
},
error: function (data) {
alert("it didnt work");
}
});
});
'''

@deming7h777
Copy link
Contributor

deming7h777 commented Jul 16, 2019

so far we need three steps to achieve the goal

  1. build the folder /blast/templatetags
  2. put the function script under /blast/templatetags e.g. blastdbcmd.py
  3. add some more AJAX line in result.html or blast-result.js

@childers
Copy link
Contributor Author

childers commented Aug 2, 2019

For future reference. This is in branch "blastdbcmd"

@deming7h777
Copy link
Contributor

different path between blast/views.py and media/blast/db (where the BLAST DATABASE is)
the only problem right now is that we need to change the default path set by " blastdbcmd"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants