Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ from io import StringIO
|
|
| 6 |
from collections import Counter
|
| 7 |
import numpy as np
|
| 8 |
import altair as alt
|
|
|
|
| 9 |
|
| 10 |
# Function to parse GenBank file
|
| 11 |
def parse_genbank(uploaded_file):
|
|
@@ -54,8 +55,9 @@ def calculate_kmers(sequence, k):
|
|
| 54 |
def add_protein_features(cds_info):
|
| 55 |
for cds in cds_info:
|
| 56 |
if cds['Protein'] != 'N/A':
|
| 57 |
-
|
| 58 |
-
cds['
|
|
|
|
| 59 |
else:
|
| 60 |
cds['Molecular Weight'] = 'N/A'
|
| 61 |
cds['Isoelectric Point'] = 'N/A'
|
|
|
|
| 6 |
from collections import Counter
|
| 7 |
import numpy as np
|
| 8 |
import altair as alt
|
| 9 |
+
from Bio.SeqUtils.ProtParam import ProteinAnalysis
|
| 10 |
|
| 11 |
# Function to parse GenBank file
|
| 12 |
def parse_genbank(uploaded_file):
|
|
|
|
| 55 |
def add_protein_features(cds_info):
|
| 56 |
for cds in cds_info:
|
| 57 |
if cds['Protein'] != 'N/A':
|
| 58 |
+
prot_analysis = ProteinAnalysis(cds['Protein'])
|
| 59 |
+
cds['Molecular Weight'] = prot_analysis.molecular_weight()
|
| 60 |
+
cds['Isoelectric Point'] = prot_analysis.isoelectric_point()
|
| 61 |
else:
|
| 62 |
cds['Molecular Weight'] = 'N/A'
|
| 63 |
cds['Isoelectric Point'] = 'N/A'
|