Back to Recipes Homepage
recipe picture
Recipe: IsPhobic V1.0
0
Your rating: None
Used 69 times with an average impact of 8097 points.

Profile

Name: IsPhobic V1.0
ID: 5568
Created on: Thu, 07/15/2010 - 06:07
Updated on: Thu, 07/15/2010 - 13:07
Description:

Just for some info. See script for details.



Best For


Comments

Joined: 09/18/2009
Groups: SETI.Germany
That's how the code does look like

-- IsPhobic and IsPhilic function by Crashguard303, inspired by Tlaloc
-- Now, as the get_aa() function does work again, I wrote this for informational purposes.
-- IsPhobic(x) / not(IsPhilic(x)) checks if segment x is hydrophobic, and returns true, if it is
-- IsPhilic(x) / not(IsPhobic(x)) checks if segment x is hydrophilic, and returns true, if it is

-- The functions get the sidechain-one-letter-name, and compare it with a table content
-- As IsPhilic has to check for only 9 letters
-- in contrast to IsPhobic, which has to check for 11 letters,
-- it is done a little bit earlier.

function IsPhobic(segNr)
PhobicLetter={"a";"c";"g";"i";"l";"m";"f";"p";"W";"y";"v"}
SegLetter=get_aa(segNr)

PhobicBool=false
exit_condition=false
k=1
repeat
if SegLetter==PhobicLetter[k] then
PhobicBool=true
exit_condition=true
end -- if
k=k+1
if k==11 then exit_condition=true end
until exit_condition==true
return PhobicBool
end -- function

function IsPhilic(segNr)
PhilicLetter={"r";"n";"d";"e";"q";"h";"k";"s";"t"}
SegLetter=get_aa(segNr)

PhilicBool=false
exit_condition=false
k=1
repeat
if SegLetter==PhilicLetter[k] then
PhilicBool=true
exit_condition=true
end -- if
k=k+1
if k==9 then exit_condition=true end
until exit_condition==true
return PhilicBool
end -- function

function CC2(OS,SPC,AS,E,ME)
OS2=OS
E2=E+1
if E2>1 then
OS2=OS2..SPC
end -- if E2
OS2=OS2..AS
if E2>=ME then
E2=0
OS2=OS2.."\n"
end -- if E2
return OS2,E2
end -- function

NumSegs=get_segment_count()

print("Hydrophobic segments:")
OS=""
Elements=0
for k=1,NumSegs do
if IsPhilic(k)==false then
-- if IsPhobic(k)==true then
OS,Elements=CC2(OS," ",k,Elements,15)
end -- if
end -- k
print(OS)

print()
print("Hydrophilic segments:")
OS=""
Elements=0
for k=1,NumSegs do
if IsPhilic(k)==true then
OS,Elements=CC2(OS," ",k,Elements,15)
end -- if
end -- k
print(OS)

Joined: 09/18/2009
Groups: SETI.Germany
Update...

This version is obsolete now.

Want to try?
Add to Cookbook!
To download recipes to your cookbook, you need to have the game client running.
Parent
Children

none

Authors
Sitemap

Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, RosettaCommons