-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProteinLenght.py
More file actions
executable file
·60 lines (48 loc) · 1.41 KB
/
Copy pathProteinLenght.py
File metadata and controls
executable file
·60 lines (48 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Change the sequences as you wish
defen_seq = ['KTCENLADTFRGPCFTDGSCDDHCKNKEHLIKGRCRDDFRCWCTRNC','ATCDLASGFGVGSSLCAAHCLVKGYRGGYCKNKICHCRDKF','ATCDLASGFGVGSSLCAAHCIARRYRGGYCNSKAVCVCRN','ATCDLASIFNVNHALCAAHCIARRYRGGYCNSKAVCVCRN',
'ATCDLASKWNWNHTLCAAHCIARRYRGGYCNSKAVCVCRN','ATCDLASFSSQWVTPNDSLCAAHCIARRYRGGYCNGKRVCVCR', 'ATCDLASFSSQWVTPNDSLCAAHCLVKGYRGGYCKNKICHCRDKF', 'ATCDLASFSSQWVTPNDSLCAAHCLVKGYRGGYCKNKICHCRDKF']
# Finding the shortest peptide/protein sequence
comp = []
for i in defen_seq:
comp.append(len(i))
count = 0
for n in comp:
if n == min(comp):
count += 1
index = comp.index(n)
defen_short = defen_seq[index:index + count]
print(defen_short)
for m in range(count):
print(len(defen_short[m]))
# Finding the Longest peptide/protein sequence
comp = []
for i in defen_seq:
comp.append(len(i))
count = 0
for n in comp:
if n == max(comp):
count += 1
index = comp.index(n)
defen_short = defen_seq[index:index + count]
print(defen_short)
for m in range(count):
print(len(defen_short[m]))
# Finding the mean lenght of peptide/protein sequences
comp = []
for i in defen_seq:
comp.append(len(i))
print(comp)
count = 0
sum = 0
for n in comp:
count += 1
sum += n
media = sum / count
print(media)
# Finding the median of peptide/protein sequences
from statistics import median
comp = []
for i in defen_seq:
comp.append(len(i))
x = median(comp)
print(x)