Icon representing a recipe

Recipe: Unix V1 to V2 toolset

created by Timo van der Laan

Profile


Name
Unix V1 to V2 toolset
ID
43867
Shared with
Public
Parent
None
Children
None
Created on
August 12, 2012 at 09:40 AM UTC
Updated on
August 12, 2012 at 09:40 AM UTC
Description

NOT a script. For scriptwriters on a unix like environment (or using cygwin in Windows)

Best for


Code


---This is NOT a recipe -- My way of converting scripts from V1 to V2 -- You need a unix like environment (on Windows I use cygwin) First a Makefile -------------------------- TARGETS=prog.V2 all: ${TARGETS} new: rm ${TARGETS} make all ${TARGETS}: %.V2: %.V1 cat libV2.def $< > tmp.c gcc -E tmp.c |sed -e "/^#.*/d" | cat -s >$@ rm tmp.c ---------------end of Makefile Please note the tabs are necessary. And the conversion file. Allmost everything can be autoconverted only some band calls need handwork. After conversion clearly marked with TODO. -----file libV2.def #define are_conditions_met current.AreConditionsMet #define band_add_segment_segment(sgi1, sgi2) band.AddBetweenSegments(sgi1, sgi2) #define band_delete TODO if a~= nil then band.Delete(a) else band.DeleteAll() endBAND_DELETE #define band_disable TODO if a~=nil then band.Disable(a) else band.DisableAll() endBAND_DISABLE #define band_enable TODO if a~=nil then band.Enable(a) else band.EnableAll() endBAND_ENABLE #define band_set_length(a,b) band.SetGoalLength(a,b) #define band_set_strength(a,b) band.SetStrength(a,b) #define get_band_count band.GetCount #define deselect_all selection.DeselectAll #define deselect_index(sgn) selection.Deselect(sgn) #define select_all selection.SelectAll #define select_index(sgn) selection.Select(sgn) #define select_index_range(sg1,sg2) selection.SelectRange(sg1,sg2) #define do_freeze(bbone,schain) freeze.FreezeSelected(bbone,schain) #define do_unfreeze_all freeze.UnfreezeAll #define do_global_wiggle_all(iters) structure.WiggleAll(iters,true,true) #define do_global_wiggle_backbone(iters) structure.WiggleAll(iters, true,false) #define do_global_wiggle_sidechains(iters) structure.WiggleAll(iters,false,true) #define do_local_rebuild(iters) structure.RebuildSelected(iters) #define do_local_wiggle(iters) structure.LocalWiggleSelected(iters,true,true) #define do_mutate(iters) structure.MutateSidechainsSelected(iters) #define do_shake(iters) structure.ShakeSidechainsSelected(iters) #define do_sidechain_snap(sgn, snap) rotamer.SetRotamer(sgn, snap) #define get_sidechain_snap_count(sgn) rotamer.GetCount(sgn) #define load_structure save.LoadSecondaryStructure #define save_structure save.SaveSecondaryStructure #define quickload(slot) save.Quickload(slot) #define quicksave(slot) save.Quicksave(slot) #define get_exploration_score current.GetExplorationMultiplier #define get_ranked_score current.GetScore #define get_score current.GetEnergyScore #define get_segment_distance(sg1,sg2) structure.GetDistance(sg1,sg2) #define get_aa(sn) structure.GetAminoAcid(sn) #define get_segment_count structure.GetCount #define get_ss(sn) structure.GetSecondaryStructure(sn) #define is_hydrophobic(sn) structure.IsHydrophobic(sn) #define replace_aa(aa) for i=1,structure.GetCount() do \n if selection.IsSelected(i) then \n structure.SetAminoAcid(i, aa) \n end \n end #define replace_ss(ss) for i=1,structure.GetCount() do \n if selection.IsSelected(i) then \n structure.SetSecondaryStructure(i,ss) \n end \n end #define get_segment_score(sg) current.GetSegmentEnergyScore(sg) #define get_segment_score_part(score_part,sg) current.GetSegmentEnergySubscore(sg,score_part) #define reset_puzzle puzzle.StartOver #define restore_abs_best absolutebest.Restore #define restore_credit_best creditbest.Restore #define reset_recent_best recentbest.Save #define restore_recent_best recentbest.Restore #define set_behavior_clash_importance(ci) behavior.SetClashImportance(ci) ---end of file libV2.def

Comments


Timo van der Laan Lv 1

NOT A SCRIPT
Contains a template for a Makefile and a definitions file.
Thanks rav3, I used that as a basis for this.

You need the gcc compiler or any other C-preprosessor to do most of the conversion work.