Icon representing a recipe

Recipe: AA_subscores_distances

created by brgreening

Profile


Name
AA_subscores_distances
ID
48490
Shared with
Public
Parent
None
Children
Created on
March 11, 2014 at 03:43 AM UTC
Updated on
March 11, 2014 at 03:43 AM UTC
Description

prints the names of the amino acids and their sub-scores for the amino acids in a protein. It prints the diatances between neighbor amino acids.

Best for


Code


-- This program goes through a puzzle and prints the abreviation for each amino acid -- It prints out the score for each amino acid. It does nothing to improve your score. -- It prints out the distances between neighbor amino acids. -- There is a problem that saving a puzzle solution other members of a group -- can loose points. Hopefully the information printed out here will help solve -- this problem. -- find the script output in scriptlog.default.xml in the C:\Foldit directory psn_table = {} function basic_info() print( "Puzzle name: ", puzzle.GetName() ) print( "Score: ", current.GetEnergyScore() ) -- print( "Score: ", scoreboard.GetScore() ) print( "User: ", user.GetPlayerName() ) print( "Group: ", user.GetGroupName() ) print( "Date Time: ", os.date("%c") ) end function init_sub_names() psn_table = puzzle.GetPuzzleSubscoreNames() for ix = 1, table.getn( psn_table ) do -- print( psn_table[ix] ) end end function print_sub_energy() aa_ltr_tab = { 'a', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'y' } aa_abrv_tab = { 'Ala', 'Cys', 'Asp', 'Glu', 'Phe', 'Gly', 'His', 'Ile', 'Lys', 'Leu', 'Met', 'Asn', 'Pro', 'Gln', 'Arg', 'Ser', 'Thr', 'Val', 'Trp', 'Tyr' } aa_name_tab = { "Alanine", "Cysteine", "Aspartic acid", "Glutamic acid", "Phenylalanine", "Glycine", "Histidine", "Isoleucine", "Lysine", "Leucine", "Metheonine", "Asparagine", "Proline", "Glutamine", "Argnine", "Serine", "Threonine", "Valine", "Tryptophan", "Tyrosine" } aa_count = structure.GetCount() -- number of amino acids in the protein for p_ix = 1, aa_count do aa_ltr = structure.GetAminoAcid( p_ix ) sec_struct = structure.GetSecondaryStructure( p_ix ) for aa_ix = 1, 20 do if aa_ltr == aa_ltr_tab[ aa_ix ] then aa_abrv = aa_abrv_tab[ aa_ix ] aa_name = aa_name_tab[ aa_ix ] end end dist_str = " " if p_ix > 1 then dist_str = structure.GetDistance( p_ix - 1, p_ix) end print( p_ix, aa_abrv, current.GetSegmentEnergyScore( p_ix ), sec_struct, dist_str ) for iy = 1,table.getn( psn_table ) do ls = string.lower( psn_table[ iy ] ) ses = current.GetSegmentEnergySubscore( p_ix, ls ) -- if ses ~= 0 then -- print( " ", string.format( "%-12s", ls ), string.format( " %18.8f", ses ) ) -- end end -- print( " " ) end end basic_info() init_sub_names() print_sub_energy()

Comments