From dc0109d07824f779e85e0ededa794a1d868c8af0 Mon Sep 17 00:00:00 2001 From: carlosp420 Date: Tue, 20 Jan 2015 11:40:33 +0200 Subject: [PATCH] genbank fasta: result page --- .../templates/genbank_fasta/results.html | 129 ++++++++---------- voseq/genbank_fasta/utils.py | 8 +- voseq/genbank_fasta/views.py | 11 +- 3 files changed, 73 insertions(+), 75 deletions(-) diff --git a/voseq/genbank_fasta/templates/genbank_fasta/results.html b/voseq/genbank_fasta/templates/genbank_fasta/results.html index 93f189ec..4c43098d 100644 --- a/voseq/genbank_fasta/templates/genbank_fasta/results.html +++ b/voseq/genbank_fasta/templates/genbank_fasta/results.html @@ -4,7 +4,7 @@ {% block content %}
-

Create GenBank FASTA file:

+

Results:

@@ -12,89 +12,76 @@

Create GenBank FASTA file:

-
-

Enter the required info to make yourself a FASTA file to be submitted to GenBank

+

Sequences that already have GenBank accession numbers: + {{ items_with_accession|length }} +
+ These will be ignored

- {% csrf_token %} +
    + {% for i in items_with_accession %} +
  • {{ i.voucher_code }} for {{ i.gene_code }} = {{ i.accession }}
  • + {% endfor %} +
+
- - - - - +

+ This is your nucleotide FASTA file to import into Sequin + (http://www.ncbi.nlm.nih.gov/Sequin/) +

+ + +
+
+
+
+

Your nucleotide file:

+
+ +
- - - - - - - - - -
- - - {% for i in form.taxonset.errors %} -
{{ i }}
- {% endfor %} - {{ form.taxonset }} -
- - - {% for i in form.gene_code_list.errors %} -
{{ i }}
- {% endfor %} - {{ form.gene_code_list }} -
-
- - - - - - - - - -
- - - {% for i in form.geneset.errors %} -
{{ i }}
- {% endfor %} - {{ form.geneset }} -
- Check to select your alignment/gene:
-
- (if geneset chosen, adds extra genes) -
- - - {% for i in form.gene_codes %} - - {% endfor %} - -
- {{ i }} -
-
-
+ + -
+ +
+
- - +

+ This is your protein file to use in case you have introns. + Load it in Sequin after your nucleotide file to link nucleotides to + protein and identify the introns. +

+ +
+
+
+
+

Your protein file:

+
+ + + + + +
+ +
+ +
diff --git a/voseq/genbank_fasta/utils.py b/voseq/genbank_fasta/utils.py index 2a32f135..d0823018 100644 --- a/voseq/genbank_fasta/utils.py +++ b/voseq/genbank_fasta/utils.py @@ -75,7 +75,13 @@ def get_datasets(self): continue if s.accession.strip() != '': - self.items_with_accession.append((code, gene_code, s.accession)) + self.items_with_accession.append( + { + 'voucher_code': code, + 'gene_code': gene_code, + 'accession': s.accession, + }, + ) else: seq_id = v.genus + '_' + v.species + '_' + code seq_description = '[org=' + v.genus + ' ' + v.species + ']' diff --git a/voseq/genbank_fasta/views.py b/voseq/genbank_fasta/views.py index 52008c01..9a464791 100644 --- a/voseq/genbank_fasta/views.py +++ b/voseq/genbank_fasta/views.py @@ -36,12 +36,17 @@ def results(request): gene_codes = utils.get_gene_codes(cleaned_data) print(voucher_codes, gene_codes) - items_with_accession, fasta, proteins = utils.get_results(voucher_codes, gene_codes) - result = '' + res = utils.Results(voucher_codes, gene_codes) + res.get_datasets() + items_with_accession = res.items_with_accession + fasta = res.fasta + protein = res.protein return render(request, 'genbank_fasta/results.html', { - 'result': result, + 'items_with_accession': items_with_accession, + 'fasta': fasta, + 'protein': protein, 'version': version, 'stats': stats, },