This file contains hidden or 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
| # Bacterial Foraging Optimization Algorithm | |
| # (c) Copyright 2013 Max Nanis [[email protected]]. | |
| import os, random, math, csv | |
| class BFOA(): | |
| def __init__(self, pop_size = 100, problem_size = 2, dimension = [-1, 1], elim_disp_steps = 1, repro_steps = 4, chem_steps = 30): | |
| self.step_index = 0 | |
| self.run_id = os.urandom(6).encode('hex') |
This file contains hidden or 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
| var user = [0,1,0,0,1,0,0,1,1,0,0,0,1,0], | |
| truth = [0,1,1,1,0,0,0,0,1,1,0,0,1,1]; | |
| function compare(user, truth) { | |
| var a = 0, b = 0, c = 0, d = 0, fpr, fnr; | |
| if( truth.length !== user.length ) return; | |
| for (var i = 0; i < truth.length; i++) { | |
| switch(user[i] + truth[i]) { | |
| case 0: ++d; break; | |
| case 2: ++a; break; |
This file contains hidden or 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
| #!/usr/bin/env python3.1 | |
| import math as m, random as r, rhinoscriptsyntax as rs | |
| # 1UBQ, 1F9J, 1R4N, 1FXT, 1LDK, 1FQK, 1FNT | |
| ubiquitin = "MQIFVKTLTGKTITLEVEPSDTIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLVLRLRGG" | |
| tetraubiquitin = "MQIFVKTLTGKTITLEVEPSDTIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLVLRLRGGMQIFVKTLTGKTITLEVEPSDTIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLVLRLRGG" | |
| eone = "MAQLGKLLKEQKYDRQLRLWGDHGQEALESAHVCLINATATGTEILKNLVLPGIGSFTIIDGNQVSGEDAGNNFFLQRSSIGKNRAEAAMEFLQELNSDVSGSFVEESPENLLDNDPSFFCRFTVVVATQLPESTSLRLADVLWNSQIPLLICRTYGLVGYMRIIIKEHPVIESHPDNALEDLRLDKPFPELREHFQSYDLDHMEKKDHSHTPWIVIIAKYLAQWYSETNGRIPKTYKEKEDFRDLIRQGILKPEDEENFEEAIKNVNTALNTTQIPSSIEDIFNDDRCINITKQTPSFWILARALKEFVAKEGQGNLPVRGTIPDMIADSGKYIKLQNVYREKAKKDAAAVGNHVAKLLQSIGQAPESISEKELKLLCSNSAFLRVVRCRSLAEEYGLDTINKDEIISSMDNPDNEIVLYLMLRAVDRFHKQQGRYPGVSNYQVEEDIGKLKSCLTGFLQEYGLSVMVKDDYVHEFCRYGAAEPHTIAAFLGGAAAQEVIKIITKQFVIFNNTYIYSGMSQTSATFQLDWEGRWNHVKKFLERSGPFTHPDFEPSTESLQFLLDTCKVLVIGAGGLGCELLKNLALSGFRQIHVIDMDTIDVSNLNRQFLFRPKDIGRPKAEVAAEFL |
This file contains hidden or 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
| #!/usr/bin/env python3.1 | |
| # cc attribution-sharealike // max [@] maxnanis.com | |
| #transmembrane | |
| import re | |
| def tmpred(aa): | |
| aa = aa.upper() | |
| engine = re.compile("[^A-Z]") | |
| aa = engine.sub("", aa) | |
| ruler = '' | |
| count = 1 |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| # cc attribution-sharealike // max [@] maxnanis.com | |
| import re | |
| from bio import fastad, fastac, rc | |
| # set up a standard code table (as a Python dictionary) | |
| # takes in a nucleotide string and returns the amino acid string | |
| stdcode = {} | |
| stdcode["TTT"] = stdcode["TTC"] = "F" |