#!/bin/sh # hexagonal 1.5 1.29904 0.75 # scalers 1 0.866025 0.5 # tetragonal 1.5 1.22496 0.865718 # scalers 1 0.816642 0.577145 echo ASMKGCAARR | fold -1 | tr '\n' ' ' | awk ' { b=1.50; # set this to the bond length, which gets scaled ResName = "UNK"; ResLet= $1 ; ResNum= 1 ; AtomNum=1; j=0 ; l=1; d=0; hdy = b*0.5; hdx = b*0.866025; tdy = b*0.577145; tdx = b*0.816642; while ( ResNum <= NF) { if (ResLet == "A") {ResName = "ALA"; alanine()} if (ResLet == "R") {ResName = "ARG"; arginine()} if (ResLet == "N") {ResName = "ASN"; asparagine()} if (ResLet == "D") {ResName = "ASP"; aspartic()} if (ResLet == "C") {ResName = "CYS"; cysteine()} if (ResLet == "E") {ResName = "GLU"; glutamic()} if (ResLet == "Q") {ResName = "GLN"; glutamine()} if (ResLet == "G") {ResName = "GLY"; glycine()} if (ResLet == "H") {ResName = "HIS"; histidine()} if (ResLet == "I") {ResName = "ILE"; isoleucine()} if (ResLet == "L") {ResName = "LEU"; leucine()} if (ResLet == "K") {ResName = "LYS"; lysine()} if (ResLet == "M") {ResName = "MET"; methionine()} if (ResLet == "F") {ResName = "PHE"; phenylalanine()} if (ResLet == "P") {ResName = "PRO"; proline()} if (ResLet == "S") {ResName = "SER"; serine()} if (ResLet == "T") {ResName = "THR"; threonine()} if (ResLet == "W") {ResName = "TRY"; tryptophan()} if (ResLet == "Y") {ResName = "TYR"; tyrosine()} if (ResLet == "V") {ResName = "VAL"; valine()} ResNum++; ResLet = $ResNum; d = d + tdx + 2*hdx; if (j == 0) j = tdy ; else j = 0 ; if (l == 1) l = -1 ; else l = 1 ; } AtomNum = AtomNum++; ResNum--; printf("ATOM%7d O%6s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum, ResName, ResNum, d, j, 0); } function alanine(){ printf("ATOM%7d N %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum, ResName, ResNum, d, j, 0); printf("ATOM%7d CA%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+1, ResName, ResNum, d+(tdx), -j+tdy, 0); printf("ATOM%7d CB%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+2, ResName, ResNum, d+(tdx), (-j+tdy)+(l*tdy), 1*l*tdx); printf("ATOM%7d C %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+3, ResName, ResNum, d+(tdx+hdx), j, 0); printf("ATOM%7d O %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+4, ResName, ResNum, d+(tdx+hdx), j+(-l*b), 0); AtomNum = AtomNum + 5; } function arginine(){ printf("ATOM%7d N %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum, ResName, ResNum, d, j, 0); printf("ATOM%7d CA%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+1, ResName, ResNum, d+(tdx), -j+tdy, 0); printf("ATOM%7d CB%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+2, ResName, ResNum, d+(tdx), (-j+tdy)+(l*tdy), 1*l*tdx); printf("ATOM%7d CC%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+3, ResName, ResNum, d+(tdx), (-j+tdy), 2*l*tdx); printf("ATOM%7d CD%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+4, ResName, ResNum, d+(tdx), (-j+tdy)+(l*tdy), 3*l*tdx); printf("ATOM%7d NE%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+5, ResName, ResNum, d+(tdx), (-j+tdy), 4*l*tdx); printf("ATOM%7d CF%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+6, ResName, ResNum, d+(tdx), (-j+tdy)+(l*tdy), 5*l*tdx); printf("ATOM%7d NG%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+7, ResName, ResNum, d+(tdx), (-j+tdy), 6*l*tdx); printf("ATOM%7d NF%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+8, ResName, ResNum, d+(tdx), (-j+tdy)+(l*tdy)+(l*b), 5*l*tdx); printf("ATOM%7d C %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+9, ResName, ResNum, d+(tdx+hdx), j, 0); printf("ATOM%7d O %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+10, ResName, ResNum, d+(tdx+hdx), j+(-l*b), 0); AtomNum = AtomNum + 11; } function asparagine(){ } function aspartic(){ } function cysteine(){ printf("ATOM%7d N %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum, ResName, ResNum, d, j, 0); printf("ATOM%7d CA%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+1, ResName, ResNum, d+(tdx), -j+tdy, 0); printf("ATOM%7d CB%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+2, ResName, ResNum, d+(tdx), (-j+tdy)+(l*tdy), 1*l*tdx); printf("ATOM%7d S %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+3, ResName, ResNum, d+(tdx), (-j+tdy), 2*l*tdx); printf("ATOM%7d C %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+4, ResName, ResNum, d+(tdx+hdx), j, 0); printf("ATOM%7d O %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+5, ResName, ResNum, d+(tdx+hdx), j+(-l*b), 0); AtomNum = AtomNum + 6; } function glutamic(){ } function glutamine(){ } function glycine(){ printf("ATOM%7d N %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum, ResName, ResNum, d, j, 0); printf("ATOM%7d CA%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+1, ResName, ResNum, d+(tdx), -j+tdy, 0); printf("ATOM%7d C %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+2, ResName, ResNum, d+(tdx+hdx), j, 0); printf("ATOM%7d O %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+3, ResName, ResNum, d+(tdx+hdx), j+(-l*b), 0); AtomNum = AtomNum + 4; } function histidine(){ } function isoleucine(){ } function leucine(){ } function lysine(){ printf("ATOM%7d N %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum, ResName, ResNum, d, j, 0); printf("ATOM%7d CA%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+1, ResName, ResNum, d+(tdx), -j+tdy, 0); printf("ATOM%7d CB%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+2, ResName, ResNum, d+(tdx), (-j+tdy)+(l*tdy), 1*l*tdx); printf("ATOM%7d CC%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+3, ResName, ResNum, d+(tdx), (-j+tdy), 2*l*tdx); printf("ATOM%7d CD%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+4, ResName, ResNum, d+(tdx), (-j+tdy)+(l*tdy), 3*l*tdx); printf("ATOM%7d CE%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+5, ResName, ResNum, d+(tdx), (-j+tdy), 4*l*tdx); printf("ATOM%7d NF%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+6, ResName, ResNum, d+(tdx), (-j+tdy)+(l*tdy), 5*l*tdx); printf("ATOM%7d C %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+7, ResName, ResNum, d+(tdx+hdx), j, 0); printf("ATOM%7d O %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+8, ResName, ResNum, d+(tdx+hdx), j+(-l*b), 0); AtomNum = AtomNum + 9; } function methionine(){ printf("ATOM%7d N %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum, ResName, ResNum, d, j, 0); printf("ATOM%7d CA%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+1, ResName, ResNum, d+(tdx), -j+tdy, 0); printf("ATOM%7d CB%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+2, ResName, ResNum, d+(tdx), (-j+tdy)+(l*tdy), 1*l*tdx); printf("ATOM%7d CC%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+3, ResName, ResNum, d+(tdx), (-j+tdy), 2*l*tdx); printf("ATOM%7d S %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+4, ResName, ResNum, d+(tdx), (-j+tdy)+(l*tdy), 3*l*tdx); printf("ATOM%7d CE%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+5, ResName, ResNum, d+(tdx), (-j+tdy), 4*l*tdx); printf("ATOM%7d C %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+6, ResName, ResNum, d+(tdx+hdx), j, 0); printf("ATOM%7d O %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+7, ResName, ResNum, d+(tdx+hdx), j+(-l*b), 0); AtomNum = AtomNum + 8; } function phenylalanine(){ } function proline(){ } function serine(){ printf("ATOM%7d N %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum, ResName, ResNum, d, j, 0); printf("ATOM%7d CA%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+1, ResName, ResNum, d+(tdx), -j+tdy, 0); printf("ATOM%7d CB%5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+2, ResName, ResNum, d+(tdx), (-j+tdy)+(l*tdy), 1*l*tdx); printf("ATOM%7d O %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+3, ResName, ResNum, d+(tdx), (-j+tdy), 2*l*tdx); printf("ATOM%7d C %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+4, ResName, ResNum, d+(tdx+hdx), j, 0); printf("ATOM%7d O %5s%6d%12.3f%8.3f%8.3f 1.00 0.00 UNKA\n", AtomNum+5, ResName, ResNum, d+(tdx+hdx), j+(-l*b), 0); AtomNum = AtomNum + 6; } function threonine(){ } function tryptophan(){ } function tyrosine(){ } function valine(){ } '