diff --git a/.travis.yml b/.travis.yml index 55b623907..6b94f5eb1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ matrix: # command to install dependencies install: + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install enchant; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install rabbitmq; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install memcached; fi @@ -52,8 +53,9 @@ before_script: - sudo chmod 666 /var/log/django/django.log - sudo touch /var/log/django/i5k.log - sudo chmod 666 /var/log/django/i5k.log - - sudo python2 manage.py migrate - sudo python2 setup.py + - sudo python2 manage.py migrate + - sudo python2 manage.py collectstatic --noinput # command to run tests script: diff --git a/blast/admin.py b/blast/admin.py index e5a828856..a4a7a69f2 100644 --- a/blast/admin.py +++ b/blast/admin.py @@ -136,3 +136,12 @@ def get_model_perms(self, request): admin.site.register(JbrowseSetting, JbrowseSettingAdmin) + +class BlastSearchAdmin(admin.ModelAdmin): + list_display = ('task_id', 'sequence',) + search_fields = ('task_id', 'sequence',) + actions_on_top = True + actions_on_bottom = True +admin.site.register(BlastSearch, BlastSearchAdmin) + + diff --git a/blast/migrations/0007_auto_20180104_1513.py b/blast/migrations/0007_auto_20180104_1513.py new file mode 100644 index 000000000..4e02d3cac --- /dev/null +++ b/blast/migrations/0007_auto_20180104_1513.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings +import filebrowser.fields + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('blast', '0006_auto_20150410_1038'), + ] + + operations = [ + migrations.CreateModel( + name='BlastSearch', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('task_id', models.CharField(max_length=50, null=True)), + ('search_tag', models.CharField(max_length=64)), + ('enqueue_date', models.DateTimeField()), + ('sequence', models.TextField(null=True)), + ('program', models.CharField(max_length=32)), + ('soft_masking', models.BooleanField()), + ('low_complexity', models.BooleanField()), + ('penalty', models.IntegerField()), + ('evalue', models.DecimalField(max_digits=10, decimal_places=5)), + ('gapopen', models.IntegerField()), + ('strand', models.CharField(max_length=10)), + ('gapextend', models.IntegerField()), + ('word_size', models.IntegerField()), + ('reward', models.IntegerField()), + ('max_target_seqs', models.IntegerField()), + ('organisms', models.TextField(null=True)), + ('matrix', models.CharField(max_length=10, null=True)), + ('threshold', models.IntegerField(null=True)), + ('user', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True)), + ], + ), + migrations.AlterField( + model_name='blastdb', + name='fasta_file', + field=filebrowser.fields.FileBrowseField(max_length=200, verbose_name=b'FASTA file path'), + ), + migrations.AlterField( + model_name='blastdb', + name='organism', + field=models.ForeignKey(to='app.Organism'), + ), + ] diff --git a/blast/migrations/0008_merge_20180511_1254.py b/blast/migrations/0008_merge_20180511_1254.py new file mode 100644 index 000000000..a8e5cd013 --- /dev/null +++ b/blast/migrations/0008_merge_20180511_1254.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.11 on 2018-05-11 16:54 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('blast', '0007_auto_20180104_1513'), + ('blast', '0007_auto_20180104_1450'), + ] + + operations = [ + ] diff --git a/blast/models.py b/blast/models.py index 0e25764b5..86ae06916 100755 --- a/blast/models.py +++ b/blast/models.py @@ -218,3 +218,31 @@ class JbrowseSetting(models.Model): def __unicode__(self): return self.url + +class BlastSearch(models.Model): + task_id = models.CharField(null=True, max_length=50) + search_tag = models.CharField(max_length=64) + enqueue_date = models.DateTimeField() + sequence = models.TextField(null=True) + program = models.CharField(max_length=32) + user = models.ForeignKey(User, null=True, blank=True) + soft_masking = models.BooleanField() + low_complexity = models.BooleanField() + penalty = models.IntegerField() + #tr_box = models.BooleanField(default=False) + #ga_box = models.BooleanField(default=False) + #pep_box = models.BooleanField(default=False) + evalue = models.DecimalField(max_digits=10, decimal_places=5) + gapopen = models.IntegerField() + strand = models.CharField(max_length=10) + gapextend = models.IntegerField() + word_size = models.IntegerField() + reward = models.IntegerField() + max_target_seqs = models.IntegerField() + organisms = models.TextField(null=True) + matrix = models.CharField(max_length=10, null=True) + threshold = models.IntegerField(null=True) + + def __unicode__(self): + return self.search_tag + diff --git a/blast/static/blast/scripts/blast-multi.js b/blast/static/blast/scripts/blast-multi.js index 8e43a7423..627476f30 100644 --- a/blast/static/blast/scripts/blast-multi.js +++ b/blast/static/blast/scripts/blast-multi.js @@ -49,185 +49,193 @@ if (!Array.prototype.indexOf) { }; } $(function() { // document ready - /////////////////////////////// - // HTML STRUCTURE GENERATION // - /////////////////////////////// - - var organism_list_count = organism_list.length; - var alphabet_list_count = alphabet_list.length; - for (var i = 0; i < organism_list_count; i++) { - var organism_id = organism_list[i].toLowerCase().replace(' ', '-'); - // organism-checkbox - var $organism_checkbox = $('', { - 'organism': organism_id, - 'id': organism_id, + /////////////////////////////// + // HTML STRUCTURE GENERATION // + /////////////////////////////// + + var organism_list_count = organism_list.length; + var alphabet_list_count = alphabet_list.length; + for (var i = 0; i < organism_list_count; i++) { + var organism_id = organism_list[i].toLowerCase().replace(' ', '-'); + // organism-checkbox + var $organism_checkbox = $('', { + 'organism': organism_id, + 'id': organism_id, + 'type': 'checkbox', + 'class': 'organism-checkbox ' + organism_id, + 'name': 'organism-checkbox[]', + }); + var $organism_div = $('
', { + 'organism': organism_id, + 'class': 'organism-div italic', + }).append($organism_checkbox).append(organism_list[i]); + $('