-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
4,201 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Mon May 14 10:26:18 2018 | ||
@author: jtfl2 | ||
""" | ||
import numpy as np | ||
filename = '12lengthpeptides.csv' | ||
f = open(filename,'r') | ||
f.readline() | ||
|
||
def find_base_structure(seq): | ||
structure = np.zeros((3,3)) | ||
consecutive = 0 | ||
placement = 0 | ||
for amino in seq: | ||
if amino in 'IMVAL' and consecutive <= 5: | ||
structure[0, placement] = 1 | ||
consecutive = consecutive + 1 | ||
if consecutive > 5: | ||
placement = placement + 1 | ||
|
||
if amino in 'RHKDESTNQG' and consecutive <= 10: | ||
structure[1, placement] = 1 | ||
consecutive = consecutive + 1 | ||
if consecutive > 10: | ||
placement = placement + 1 | ||
|
||
if amino in 'YWFRHKDESTNQG' and consecutive <= 13: | ||
structure[2, placement] = 1 | ||
consecutive = consecutive + 1 | ||
if consecutive > 13: | ||
placement = placement + 1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,302 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Mon May 7 16:16:42 2018 | ||
@author: jtfl2 | ||
""" | ||
import numpy as np | ||
|
||
masteraminos = { | ||
'A':{ '3letter': 'Ala', | ||
'sc_mass': 15.0234, | ||
'pk1': 2.35, | ||
'pk2': 9.87, | ||
'sc_hphob': 0.5}, | ||
|
||
'R':{ '3letter': 'Arg', | ||
'sc_mass': 100.0873, | ||
'pk1': 1.82, | ||
'pk2': 8.99, | ||
'pk3': 12.48, | ||
'sc_hphob': 1.81}, | ||
|
||
'N':{ '3letter': 'Asn', | ||
'sc_mass': 58.0292, | ||
'pk1': 2.14, | ||
'pk2': 8.72, | ||
'sc_hphob': 0.85}, | ||
|
||
'D':{ '3letter': 'Asp', | ||
'sc_mass': 59.0132, | ||
'pk1': 1.99, | ||
'pk2': 9.9, | ||
'pk3': 3.9, | ||
'sc_hphob': 3.64}, | ||
|
||
'C':{ '3letter': 'Cys', | ||
'sc_mass': 46.9955, | ||
'pk1': 1.92, | ||
'pk2': 10.7, | ||
'pk3': 8.3, | ||
'sc_hphob': -0.02, | ||
'extco': 125}, | ||
|
||
'Q':{ '3letter': 'Gln', | ||
'sc_mass': 72.0448, | ||
'pk1': 2.17, | ||
'pk2': 9.13, | ||
'sc_hphob': 0.77}, | ||
|
||
'E':{ '3letter': 'Glu', | ||
'sc_mass': 73.0288, | ||
'pk1': 2.1, | ||
'pk2': 9.47, | ||
'pk3': 4.07, | ||
'sc_hphob': 3.63}, | ||
|
||
'G':{ '3letter': 'Gly', | ||
'sc_mass': 1.0078, | ||
'pk1': 2.35, | ||
'pk2': 9.78, | ||
'sc_hphob': 1.15}, | ||
|
||
'H':{ '3letter': 'His', | ||
'sc_mass': 81.0452, | ||
'pk1': 1.8, | ||
'pk2': 9.33, | ||
'pk3': 6.04, | ||
'sc_hphob': 2.33}, | ||
|
||
'I':{ '3letter': 'Ile', | ||
'sc_mass': 57.0702, | ||
'pk1': 2.32, | ||
'pk2': 9.76, | ||
'sc_hphob': -1.12}, | ||
|
||
'L':{ '3letter': 'Leu', | ||
'sc_mass': 57.0702, | ||
'pk1': 2.33, | ||
'pk2': 9.74, | ||
'sc_hphob': -1.25}, | ||
|
||
'K':{ '3letter': 'Lys', | ||
'sc_mass': 72.0811, | ||
'pk1': 2.16, | ||
'pk2': 9.06, | ||
'pk3': 10.54, | ||
'sc_hphob': 2.8}, | ||
|
||
'M':{ '3letter': 'Met', | ||
'sc_mass': 75.0267, | ||
'pk1': 2.13, | ||
'pk2': 9.28, | ||
'sc_hphob': -0.67}, | ||
|
||
'F':{ '3letter': 'Phe', | ||
'sc_mass': 91.0546, | ||
'pk1': 2.2, | ||
'pk2': 9.31, | ||
'sc_hphob': -1.71}, | ||
|
||
'P':{ '3letter': 'Pro', | ||
'sc_mass': 41.039, | ||
'pk1': 1.95, | ||
'pk2': 10.64, | ||
'sc_hphob': 0.14}, | ||
|
||
'S':{ '3letter': 'Ser', | ||
'sc_mass': 31.0183, | ||
'pk1': 2.19, | ||
'pk2': 9.21, | ||
'sc_hphob': 0.46}, | ||
|
||
'T':{ '3letter': 'Thr', | ||
'sc_mass': 45.0339, | ||
'pk1': 2.09, | ||
'pk2': 9.1, | ||
'sc_hphob': 0.25}, | ||
|
||
'W':{ '3letter': 'Trp', | ||
'sc_mass': 130.0655, | ||
'pk1': 2.46, | ||
'pk2': 9.41, | ||
'sc_hphob': -2.09, | ||
'extco': 5500}, | ||
|
||
'Y':{ '3letter': 'Tyr', | ||
'sc_mass': 107.0495, | ||
'pk1': 2.2, | ||
'pk2': 9.21, | ||
'pk3': 10.07, | ||
'sc_hphob': -0.71, | ||
'extco': 1490}, | ||
|
||
'V':{ '3letter': 'Val', | ||
'sc_mass': 43.0546, | ||
'pk1': 2.39, | ||
'pk2': 9.74, | ||
'sc_hphob': -0.46}} | ||
|
||
|
||
def CharCount(theString,theChar): | ||
result = 0 | ||
for i in range(0, len(theString)): | ||
if theString[i] == theChar: | ||
result = result + 1 | ||
return result | ||
|
||
|
||
def count_aminos(sequence): | ||
rescounts = {} | ||
rescounts['A'] = CharCount(sequence, "A") | ||
rescounts['R'] = CharCount(sequence, "R") | ||
rescounts['N'] = CharCount(sequence, "N") | ||
rescounts['D'] = CharCount(sequence, "D") | ||
rescounts['C'] = CharCount(sequence, "C") | ||
rescounts['Q'] = CharCount(sequence, "Q") | ||
rescounts['E'] = CharCount(sequence, "E") | ||
rescounts['G'] = CharCount(sequence, "G") | ||
rescounts['H'] = CharCount(sequence, "H") | ||
rescounts['I'] = CharCount(sequence, "I") | ||
rescounts['L'] = CharCount(sequence, "L") | ||
rescounts['K'] = CharCount(sequence, "K") | ||
rescounts['M'] = CharCount(sequence, "M") | ||
rescounts['F'] = CharCount(sequence, "F") | ||
rescounts['P'] = CharCount(sequence, "P") | ||
rescounts['S'] = CharCount(sequence, "S") | ||
rescounts['T'] = CharCount(sequence, "T") | ||
rescounts['W'] = CharCount(sequence, "W") | ||
rescounts['Y'] = CharCount(sequence, "Y") | ||
rescounts['V'] = CharCount(sequence, "V") | ||
return rescounts | ||
|
||
def calcmass(counts,seq): | ||
alphamass = 56.0136 | ||
h2o_mass = 18.0105 | ||
mass = alphamass*len(seq) + h2o_mass | ||
for key in counts: | ||
mass = mass + counts[key]*masteraminos[key]['sc_mass'] | ||
mass = round(mass,4) | ||
|
||
return mass | ||
|
||
|
||
def cystine_count(cysteines): | ||
return (cysteines-(cysteines%2))/2 | ||
|
||
|
||
|
||
def calcec(counts,ranges): | ||
ec2 = counts['W']*masteraminos['W']['extco'] + counts['Y']*masteraminos['Y']['extco'] | ||
ec1 = ec2 + cystine_count(counts['C'])*masteraminos['C']['extco'] | ||
|
||
if not ranges[3]: | ||
ranges[3] = [ec1,ec1] | ||
elif ranges[3][0] > ec1: | ||
ranges[3][0] = ec1 | ||
elif ranges[3][1] < ec1: | ||
ranges[3][1] = ec1 | ||
|
||
if not ranges[4]: | ||
ranges[4] = [ec2,ec2] | ||
elif ranges[4][0] > ec2: | ||
ranges[4][0] = ec2 | ||
elif ranges[4][1] < ec2: | ||
ranges[4][1] = ec2 | ||
|
||
return [ec1, ec2,ranges] | ||
|
||
|
||
def find_charge(a,b,pH): | ||
c = 0 | ||
for key in a: | ||
if a[key]['count'] > 0: | ||
c = c + -a[key]['count']/(1 + pow(10, (a[key]['pk']-pH))) | ||
|
||
for key in b: | ||
if b[key]['count'] > 0: | ||
c += b[key]['count']/(1 + pow(10, (pH - b[key]['pk']))) | ||
c = round(c,3) | ||
return c | ||
|
||
def calcpi(counts,sequence,ranges): | ||
#alert("pI being calculated for " + sequence) | ||
first_res = sequence[0] | ||
#alert("first residue is "+first_res) | ||
last_res = sequence[len(sequence)-1] | ||
#alert("last residue is "+last_res) | ||
acids = { 'C-term': {'count': 1, 'pk':masteraminos[first_res]['pk1']}, | ||
'D': {'count': counts['D'], 'pk':masteraminos['D']['pk3']}, | ||
'E': {'count': counts['E'], 'pk':masteraminos['E']['pk3']}, | ||
'C': {'count': counts['C'], 'pk':masteraminos['C']['pk3']}, | ||
'Y': {'count': counts['Y'], 'pk':masteraminos['Y']['pk3']}} | ||
|
||
bases = { 'N-term': {'count': 1, 'pk':masteraminos[last_res]['pk2']}, | ||
'K': {'count': counts['K'], 'pk':masteraminos['K']['pk3']}, | ||
'R': {'count': counts['R'], 'pk':masteraminos['R']['pk3']}, | ||
'H': {'count': counts['H'], 'pk':masteraminos['H']['pk3']}} | ||
|
||
|
||
for pH in np.arange(0,14,0.01): | ||
if find_charge(acids,bases,pH) <= 0: | ||
break | ||
|
||
pI = round(pH,2) | ||
net_charge = round(find_charge(acids, bases, 7)) | ||
if not ranges[0]: | ||
ranges[0] = [pI,pI] | ||
elif ranges[0][0] > pI: | ||
ranges[0][0] = pI | ||
elif ranges[0][1] < pI: | ||
ranges[0][1] = pI | ||
|
||
if not ranges[1]: | ||
ranges[1] = [net_charge,net_charge] | ||
elif ranges[1][0] > net_charge: | ||
ranges[1][0] = net_charge | ||
elif ranges[1][1] < net_charge: | ||
ranges[1][1] = net_charge | ||
|
||
return [pI,net_charge,ranges] | ||
|
||
|
||
def calchphob(counts,ranges): | ||
hydrophobicity = 7.9 | ||
for key in counts: | ||
hydrophobicity = hydrophobicity + counts[key] * masteraminos[key]['sc_hphob'] | ||
hydrophobicity = round(hydrophobicity,2) | ||
|
||
if not ranges[2]: | ||
ranges[2] = [hydrophobicity,hydrophobicity] | ||
elif ranges[2][0] > hydrophobicity: | ||
ranges[2][0] = hydrophobicity | ||
elif ranges[2][1] < hydrophobicity: | ||
ranges[2][1] = hydrophobicity | ||
|
||
return [round(hydrophobicity,2),ranges] | ||
|
||
|
||
|
||
def calcProp(seq,ranges): | ||
P_count = count_aminos(seq) | ||
P_mass = calcmass(P_count,seq) | ||
[P_pI,P_charge,ranges] = calcpi(P_count,seq,ranges) | ||
[P_hphob,ranges] = calchphob(P_count,ranges) | ||
[P_ec1,P_ec2,ranges] = calcec(P_count,ranges) | ||
return [seq,float(P_mass),float(P_pI),P_charge,float(P_hphob),P_ec1,P_ec2,ranges] | ||
|
||
|
||
def make_barcodes(properties): | ||
from PIL import Image | ||
ranges = properties[7] | ||
binary = list(''.join(format(ord(x), 'b') for x in properties[0])) | ||
binary = [255*int(i) for i in binary] | ||
prop = [((float(properties[2])-ranges[0][0])/(ranges[0][1]-ranges[0][0]))*255,(((float(properties[3])-ranges[1][0])/(ranges[1][1]-ranges[1][0]))*255),(((float(properties[4])-ranges[2][0])/(ranges[2][1]-ranges[2][0]))*255),(((float(properties[5])-ranges[3][0])/(ranges[3][1]-ranges[3][0]))*255),(((float(properties[6])-ranges[4][0])/(ranges[4][1]-ranges[4][0]))*255)] | ||
#prop = [round(i) for i in prop] | ||
return [binary,prop] | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Fri Apr 27 13:38:09 2018 | ||
@author: jtfl2 | ||
""" | ||
import itertools as it | ||
import pc_self as pcs | ||
|
||
|
||
|
||
aromatic = {} | ||
hydrophobic = {} | ||
hydrophilic = {} | ||
per = {} | ||
ranges = [[],[],[],[],[]] | ||
|
||
hydrophobic['3'] = it.product('IMVAL', repeat=3) | ||
hydrophilic['5'] = it.product('TSGNQ', repeat=5) | ||
aromatic['4'] = it.product('YWF','HRKDETSGNQYWF','HRKDETSGNQYWF','HRKDETSGNQYWF') | ||
|
||
per['12'] = it.product(hydrophobic['3'],hydrophilic['5'],aromatic['4'], repeat = 1) | ||
|
||
f = open('12lengthpeptides.csv', 'w') | ||
f.write("Sequence,Mass,Isoelectric Point (pI),Net Charge,Hydrophobicity,Extinction coefficient 1,Extinction coefficient2" + "\n") | ||
p = "" | ||
for p in per['12']: | ||
seq = "".join(p[0] + p[1] + p[2]) | ||
Info = pcs.calcProp(seq,ranges) | ||
ranges = Info[7] | ||
f.write(Info[0] + ',' + str(Info[1])+ ','+ str(Info[2])+ ','+ str(Info[3])+ ','+ str(Info[4])+ ','+ str(Info[5])+ ','+ str(Info[6]) + "\n") | ||
f.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Please keep the INI file and the executable file in the same folder. No | ||
Installation is needed. | ||
|
||
LTFViewer 5.2u supports ANSI and Unicode. It currently does not support | ||
Unicode big endian and UTF-8. | ||
|
||
LTFViewer 5.2u requires Windows NT and up. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.