Skip to content

Commit

Permalink
genbank fasta: make filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosp420 committed Jan 20, 2015
1 parent 329f090 commit 96c2f4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion voseq/core/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from django.shortcuts import render
# from django.shortcuts import render

# Create your views here.
7 changes: 7 additions & 0 deletions voseq/genbank_fasta/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import uuid

from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
Expand Down Expand Up @@ -45,8 +46,11 @@ def __init__(self, voucher_codes, gene_codes):
self.voucher_codes = voucher_codes
self.gene_codes = gene_codes
self.items_with_accession = []
self.guid = self.make_guid()
self.fasta = ''
self.protein = ''
self.fasta_file = 'fasta_' + self.guid + '.fasta'
self.protein_file = 'prot_' + self.guid + '.fasta'

def get_datasets(self):
"""Queries sequences and creates FASTA, protein strings and list of
Expand Down Expand Up @@ -125,3 +129,6 @@ def get_datasets(self):

self.protein += '>' + seq_id + ' ' + seq_description + '\n'
self.protein += str(prot_sequence) + '\n'

def make_guid(self):
return uuid.uuid4().hex

0 comments on commit 96c2f4c

Please sign in to comment.