Plotting a table of numbers as an image using R Problem : How to plot a table of numbers such that the values are represented by color? Solution : Use the function below by handing it a matrix of numbers. It will plot the matrix with a color scale based on the highest and lowest values in the matrix. Optional arguments are: usage: myImagePlot (m) where m is a matrix of numbers optional arguments: myImagePlot (m, xlabels, ylabels, zlim, title=c("my title")) xLabels and yLabels are vectors of strings to label the rows and columns. zlim is a vector containing a low and high value to use for the color scale. For example, you might have a table of gene expression values which you want to represent visually. Alternatively, you might want to display a table of correlation coefficients between a set of DNA microarrays. ="" td="" ="" td="" 1.) A panel of gene expression values. 2.) A table of correlation values illustrating how identical samples placed on several different DNA microarrays correlate with one another. The images above were generated as follows: myImagePlot(bm , yLabels=c(as.character(baylies )), title=c("Sig Genes")) notes : bm is a dataframe with numbers in the first three columns. The code above references the first 25 entries of the first 3 columns. The row labels are taken from the second column of another data frame called baylies. myImagePlot(cm, xLabels=c(targets$SlideNumber), title=c("stage 12-14 array correlation matrix"), zlim=c(0,1)) notes : cm is a matrix of correlation values. You can load the function below into your R session by copy and paste, or you can load it directly using the source command: source(" http://www.phaget4.org/R/myImagePlot.R ") image plot function # ----- Define a function for plotting a matrix ----- # myImagePlot - function(x, ...){ min - min(x) max - max(x) yLabels - rownames(x) xLabels - colnames(x) title -c() # check for additional function arguments if( length(list(...)) ){ Lst - list(...) if( !is.null(Lst$zlim) ){ min - Lst$zlim max - Lst$zlim } if( !is.null(Lst$yLabels) ){ yLabels - c(Lst$yLabels) } if( !is.null(Lst$xLabels) ){ xLabels - c(Lst$xLabels) } if( !is.null(Lst$title) ){ title - Lst$title } } # check for null values if( is.null(xLabels) ){ xLabels - c(1:ncol(x)) } if( is.null(yLabels) ){ yLabels - c(1:nrow(x)) } layout(matrix(data=c(1,2), nrow=1, ncol=2), widths=c(4,1), heights=c(1,1)) # Red and green range from 0 to 1 while Blue ranges from 1 to 0 ColorRamp - rgb( seq(0,1,length=256), # Red seq(0,1,length=256), # Green seq(1,0,length=256)) # Blue ColorLevels - seq(min, max, length=length(ColorRamp)) # Reverse Y axis reverse - nrow(x) : 1 yLabels - yLabels x - x # Data Map par(mar = c(3,5,2.5,2)) image(1:length(xLabels), 1:length(yLabels), t(x), col=ColorRamp, xlab="", ylab="", axes=FALSE, zlim=c(min,max)) if( !is.null(title) ){ title(main=title) } axis(BELOW-1, at=1:length(xLabels), labels=xLabels, cex.axis=0.7) axis(LEFT -2, at=1:length(yLabels), labels=yLabels, las= HORIZONTAL-1, cex.axis=0.7) # Color Scale par(mar = c(3,2.5,2.5,2)) image(1, ColorLevels, matrix(data=ColorLevels, ncol=length(ColorLevels),nrow=1), col=ColorRamp, xlab="",ylab="", xaxt="n") layout(1) } # ----- END plot function ----- #
MATLAB Functions What is a MATLAB function? A MATLAB “function” is a MATLAB program that performs a sequence of operations specified in a text file (called an m-file because it must be saved with a file extension of *.m). A function accepts one or more MATLAB variables as inputs, operates on them in some way, and then returns one or more MATLAB variables as outputs and may also generate plots, etc. (sometimes a function doesn’t return any output variables but instead just generates plots, etc.). How do I Create a new MATLAB function? Since an m-file is nothing more than a text file it can be created using any text editor – however, MATLAB provides its own editor that provides some particular features that are useful when writing/editing functions. To open a new m-file: In the MATLAB command window, go to FILE on the toolbar, select NEW, then select M-FILE. This opens the MATLAB editor/debugger and gives an empty file in which you can create whatever m-file you want. What do I have to put on the First Line of a MATLAB function? The 1st line of a function must contain the “function definition,” which has a general structure like this (see also the specific example below) 1 : function = function_name(In_1,In_2,…,In_M) where Out_1,Out_2,…,Out_N are the N output variables and In_1,In_2,…,In_M are the M input variables; If there is only a single output variable use: function Out_1 = function_name(In_1,In_2,…,In_M) If there is no output variable use: function function_name(In_1,In_2,…,In_M) What do I have to put after the 1 line? After the first line, you just put a sequence of MATLAB commands – with one command per line – just like you are computing in MATLAB in the command line environment. This sequence of commands is what makes up your program – you perform computations using the input variables and other variables you create within the function and in doing so, you create the output variables you desire. How do I use the input variables in a MATLAB function? When you are writing the lines that make up your function you can use the names of the input variables defined in the first line just like they are previously created variables. So if In_1 is one of the input variables you could then do something like this: y=In_1.^2; This takes the values in In_1, squares them, and assigns the result to the variable y. Note: putting a semicolon at the end of an expression stops the display of the result – a good idea unless you really WANT to see the result (sometimes useful when debugging or verifying a function). How do I make the output variables in a MATLAB function? On any line in your function you can assign any result you compute to any one of the output variables specified. For example: Out_1=cos(y); will compute the cosine of the values in the variable y and then assigns the result to the variable Out_1, which will then be output by the function (assuming that Out_1 was specified as an output variable name). How do I Save a MATLAB function? Once you have finished writing your function you have to save it as an m-file before you can use it. This is done in the same way you save a file in any other application: • go to FILE, and SAVE. • type in the name that you want to use o it is best to always use the “function name” as the “file name” o you don’t need to explicitly specify the file type as *.m • navigate to the folder where you want to save the function file o see below for more details on “Where to Save an M-File?” • click on SAVE Where to Save an M-File? It doesn’t really matter where you store it… BUT when you want to use it, it needs to be somewhere in “MATLAB’s path”or should be in MATLAB’s present working directory (PWD) • the path specifies all the folders where MATLAB will look for a function’s file when the function is run • the PWD specifies a single folder that MATLAB considers its primary folder for storing things – it is generally advisable to specify an appropriate PWD each time you start up MATLAB and specify it to be wherever you have the m-files you are working on o Click on FILE, click on SET PATH, click on BROWSE, navigate to the folder you want as PWD and click on it, and then click OK How do I Run an M-File? Once you have a function saved as an m-file with a name the same as the function name and in a folder that is either the PWD or is in MATLAB’s path, you can run it from the command line: = function_name(In_1,In_2,…,In_M) How do I Test an M-File? Once you have a file written you need to test it. When you try to run it the first time there is a good chance that it will have some syntax error that will cause its operation to terminate – MATLAB will tell you on what line the operation was stopped, so you can focus immediately on somewhere further along in the function and will give you some idea if what the problem is. Just keep at it and you’ll eventually get it to run, but here is a tip: • open the m-file that you are debugging • click on DEBUG on the toolbar at top • click on STOP IF ERROR o note: there some other options that can be useful, so try them out • Now when you run your function and it encounters an error, it will stop and will put you into a mode that will allow you to view all the variables at the point at which the error occurred o When you are stopped (i.e., “in debug mode”) you have a different prompt than MATLAB’s standard prompt o To quit from the debug mode click on DEBUG and the click on QUIT DEBUGGING • When you are all done using this feature you can turn it off by clicking on DEBUG on the toolbar and then clicking on STOP IF ERROR (which should be checked to indicate that it was turned on) Then you are returned to having the standard prompt Then, once you have it running without any syntax errors or warnings, you need to test it to verify that it really does what you intended it to do. Obviously, for simple functions you may be able to verify that it works by running a few examples and checking that the outputs are what you expect. Usually you need to do quite a few test cases to ensure that it is working correct. For more complex functions (or when you discover that the outputs don’t match what you expect) you may want to check some of the intermediate results that you function computes to verify that they are working properly. To do this you set “breakpoints” that stop the operation of the function at a specified line and allow you then view from the command: • open the m-file that you are debugging • put the cursor in the line at which you want to set a breakpoint • click on DEBUG on the toolbar at top and then click SET/CLEAR BREAKPOINT • Now when you run your function, it will stop at that line and will put you into a mode that will allow you to view all the variables at that point • When you are stopped (i.e., “in debug mode”) you have a different prompt than MATLAB’s standard prompt o When you are all done using this feature you can turn it off by repeating the process used to set the breakpoint Once you have it stopped, any variable that has been computed up to that point can be inspected (plot it, look at its values, check its size, check if it is row or column, etc. You can even modify a variable’s contents to correct a problem). Note that the ONLY variable you have access to are those that have been created inside the function or have been passed to it via the input arguments. Note that you can set multiple breakpoints at a time – once you have stopped at the first one you can click on DEBUG and then click on CONTINUE and it will pick up execution immediately where it left off (but with the modified variables if you changed anything). Note also that once you have a function stopped in debug mode you can “single-step” through the next several lines: click on DEBUG and click on SINGLE STEP. Comments on Programming Style 1. In many ways, programming in MATLAB is a lot like programming in C, but there are some significant differences. Most notably, MATLAB can operate directly on vectors and matrices whereas in C you must operate directly on individual elements of an array. Because of this, loops are MUCH less common in MATLAB than they are in C: in C, if you want to add two vectors you have to loop over the elements in the vectors, adding an element to an element in each iteration of the loop; in MATLAB, you just issue a command to add the two vectors together and the vector addition of all the elements is done with this single command. 2. The “comment symbol” in MATLAB is %. Anything that occurs after a % on a line is considered to be comments. 3. It is often helpful to put several comment lines right after the function definition line. These comments explain what the function does, what the inputs and outputs are, and how to call the function. 4. Putting in lots of comments helps you and others understand what the function does – from a grading point of view you will have a higher probability of getting full credit if you write comments that tell me what your code is doing . FROM:http://www.ws.binghamton.edu/fowler/fowler%20personal%20page/EE521_files/MATLAB%20Functions.pdf
Curve fitting is the process of constructing a curve, or mathematical function , that has the best fit to a series of data points, possibly subject to constraints. Curve fitting can involve either interpolation , where an exact fit to the data is required, or smoothing , in which a "smooth" function is constructed that approximately fits the data. A related topic is regression analysis , which focuses more on questions of statistical inference such as how much uncertainty is present in a curve that is fit to data observed with random errors. Fitted curves can be used as an aid for data visualization, to infer values of a function where no data are available, and to summarize the relationships among two or more variables. Extrapolation refers to the use of a fitted curve beyond the range of the observed data, and is subject to a greater degree of uncertainty since it may reflect the method used to construct the curve as much as it reflects the observed data.
Drug design From Wikipedia, the free encyclopedia Jump to: navigation , search Not to be confused with Designer drug . Drug design , also sometimes referred to as rational drug design or structure based drug design, is the inventive process of finding new medications based on the knowledge of the biological target . The drug is most commonly an organic small molecule which activates or inhibits the function of a biomolecule such as a protein which in turn results in a therapeutic benefit to the patient . In the most basic sense, drug design involves design of small molecules that are complementary in shape and charge to the biomolecular target to which they interact and therefore will bind to it. Drug design frequently but not necessarily relies on computer modeling techniques. This type of modeling is often referred to as computer-aided drug design . The phrase "drug design" is to some extent a misnomer . What is really meant by drug design is ligand design. Modeling techniques for prediction of binding affinity are reasonably successful. However there are many other properties such as bioavailability , metabolic half-life , lack of side effects , etc. that first must be optimized before a ligand can become a safe and efficacious drug. These other characteristics are often difficult to optimize using rational drug design techniques. Contents 1 Background 2 Types 2.1 Ligand based 2.2 Structure based 2.2.1 Active site identification 2.2.2 Ligand fragment link 2.2.3 Scoring method 3 Rational drug discovery 4 Computer-assisted drug design 5 Examples 6 See also 7 References 8 External links Background Typically a drug target is a key molecule involved in a particular metabolic or signaling pathway that is specific to a disease condition or pathology , or to the infectivity or survival of a microbial pathogen . Some approaches attempt to inhibit the functioning of the pathway in the diseased state by causing a key molecule to stop functioning. Drugs may be designed that bind to the active region and inhibit this key molecule. Another approach may be to enhance the normal pathway by promoting specific molecules in the normal pathways that may have been affected in the diseased state. In addition, these drugs should also be designed in such a way as not to affect any other important "off-target" molecules or antitargets that may be similar in appearance to the target molecule, since drug interactions with off-target molecules may lead to undesirable side effects . Sequence homology is often used to identify such risks. Most commonly, drugs are organic small molecules produced through chemical synthesis, but biopolymer-based drugs (also known as biologics ) produced through biological processes are becoming increasingly more common. In addition mRNA based gene silencing technologies may have therapeutic applications. Types Flow charts of two strategies of structure-based drug design There are two major types of drug design. The first is referred to as ligand-based drug design and the second, structure-based drug design . Ligand based Ligand-based drug design (or indirect drug design ) relies on knowledge of other molecules that bind to the biological target of interest. These other molecules may be used to derive a pharmacophore model which defines the minimum necessary structural characteristics a molecule must possess in order to bind to the target. In other words, a model of the biological target may be built based on the knowledge of what binds to it and this model in turn may be used to design new molecular entities that interact with the target. Alternatively, a quantitative structure-activity relationship (QSAR) in which a correlation between calculated properties of molecules and their experimentally determined biological activity may be derived. These QSAR relationships in turn may be used to predict the activity of new analogs. Structure based Structure-based drug design (or direct drug design ) relies on knowledge of the three dimensional structure of the biological target obtained through methods such as x-ray crystallography or NMR spectroscopy . If an experimental structure of a target is not available, it may be possible to create a homology model of the target based on the experimental structure of a related protein. Using the structure of the biological target, candidate drugs that are predicted to bind with high affinity and selectivity to the target may be designed using interactive graphics and the intuition of a medicinal chemist . Alternatively various automated computational procedures may be used to suggest new drug candidates. As experimental methods such as X-ray crystallography and NMR develop, the amount of information concerning 3D structures of biomolecular targets has increased dramatically. In parallel, information about the structural dynamics and electronic properties about ligands has also increased. This has encouraged the rapid development of the structure-based drug design. Current methods for structure-based drug design can be divided roughly into two categories. The first category is about “finding” ligands for a given receptor, which is usually referred as database searching. In this case, a large number of potential ligand molecules are screened to find those fitting the binding pocket of the receptor. This method is usually referred as ligand-based drug design. The key advantage of database searching is that it saves synthetic effort to obtain new lead compounds. Another category of structure-based drug design methods is about “building” ligands, which is usually referred as receptor-based drug design. In this case, ligand molecules are built up within the constraints of the binding pocket by assembling small pieces in a stepwise manner. These pieces can be either individual atoms or molecular fragments. The key advantage of such a method is that novel structures, not contained in any database, can be suggested. These techniques are raising much excitement to the drug design community. Active site identification Active site identification is the first step in this program. It analyzes the protein to find the binding pocket, derives key interaction sites within the binding pocket, and then prepares the necessary data for Ligand fragment link. The basic inputs for this step are the 3D structure of the protein and a pre-docked ligand in PDB format, as well as their atomic properties. Both ligand and protein atoms need to be classified and their atomic properties should be defined, basically, into four atomic types: hydrophobic atom : all carbons in hydrocarbon chains or in aromatic groups. H-bond donor : Oxygen and nitrogen atoms bonded to hydrogen atom(s). H-bond acceptor : Oxygen and sp2 or sp hybridized nitrogen atoms with lone electron pair(s). Polar atom : Oxygen and nitrogen atoms that are neither H-bond donor nor H-bond acceptor, sulfur, phosphorus, halogen, metal and carbon atoms bonded to hetero-atom(s). The space inside the ligand binding region would be studied with virtual probe atoms of the four types above so the chemical environment of all spots in the ligand binding region can be known. Hence we are clear what kind of chemical fragments can be put into their corresponding spots in the ligand binding region of the receptor. Ligand fragment link Flow chart for structure based drug design When we want to plant “seeds” into different regions defined by the previous section, we need a fragments database to choose fragments from. The term “fragment” is used here to describe the building blocks used in the construction process. The rationale of this algorithm lies in the fact that organic structures can be decomposed into basic chemical fragments. Although the diversity of organic structures is infinite, the number of basic fragments is rather limited. Before the first fragment, i.e. the seed, is put into the binding pocket, and other fragments can be added one by one, it is useful to identify potential problems. First, the possibility for the fragment combinations is huge. A small perturbation of the previous fragment conformation would cause great difference in the following construction process. At the same time, in order to find the lowest binding energy on the Potential energy surface (PES) between planted fragments and receptor pocket, the scoring function calculation would be done for every step of conformation change of the fragments derived from every type of possible fragments combination. Since this requires a large amount of computation, one may think using other possible strategies to let the program works more efficiently. When a ligand is inserted into the pocket site of a receptor, conformation favor for these groups on the ligand that can bind tightly with receptor should be taken priority. Therefore it allows us to put several seeds at the same time into the regions that have significant interactions with the seeds and adjust their favorite conformation first, and then connect those seeds into a continuous ligand in a manner that make the rest part of the ligand having the lowest energy. The conformations of the pre-placed seeds ensuring the binding affinity decide the manner that ligand would be grown. This strategy reduces calculation burden for the fragment construction efficiently. On the other hand, it reduces the possibility of the combination of fragments, which reduces the number of possible ligands that can be derived from the program. These two strategies above are well used in most structure-based drug design programs. They are described as “ Grow ” and “ Link ”. The two strategies are always combined in order to make the construction result more reliable. Scoring method Main article: Scoring functions for docking Structure-based drug design attempts to use the structure of proteins as a basis for designing new ligands by applying accepted principles of molecular recognition. The basic assumption underlying structure-based drug design is that a good ligand molecule should bind tightly to its target. Thus, one of the most important principles for designing or obtaining potential new ligands is to predict the binding affinity of a certain ligand to its target and use it as a criterion for selection. A breakthrough work was done by Böhm to develop a general-purposed empirical function in order to describe the binding energy. The concept of the “Master Equation” was raised. The basic idea is that the overall binding free energy can be decomposed into independent components which are known to be important for the binding process. Each component reflects a certain kind of free energy alteration during the binding process between a ligand and its target receptor. The Master Equation is the linear combination of these components. According to Gibbs free energy equation, the relation between dissociation equilibrium constant, K d and the components of free energy alternation was built. The sub models of empirical functions differ due to the consideration of researchers. It has long been a scientific challenge to design the sub models. Depending on the modification of them, the empirical scoring function is improved and continuously consummated. Rational drug discovery In contrast to traditional methods of drug discovery which rely on trial-and-error testing of chemical substances on cultured cells or animals , and matching the apparent effects to treatments, rational drug design begins with a hypothesis that modulation of a specific biological target may have therapeutic value. In order for a biomolecule to be selected as a drug target, two essential pieces of information are required. The first is evidence that modulation of the target will have therapeutic value. This knowledge may come from, for example, disease linkage studies that show an association between mutations in the biological target and certain disease states. The second is that the target is "drugable". This means that it is capable of binding to a small molecule and that its activity can be modulated by the small molecule. Once a suitable target has been identified, the target is normally cloned and expressed . The expressed target is then used to establish a screening assay . In addition, the three-dimensional structure of the target may be determined. The search for small molecules that bind to the target is begun by screening libraries of potential drug compounds. This may be done by using the screening assay (a "wet screen"). In addition, if the structure of the target is available, a virtual screen may be performed of candidate drugs. Ideally the candidate drug compounds should be " drug-like ", that is they should possess properties that are predicted to lead to oral bioavailability , adequate chemical and metabolic stability, and minimal toxic effects. Several methods are available to estimate druglikeness such Lipinski's Rule of Five and a range of scoring methods such as Lipophilic efficiency . Several methods for predicting drug metabolism have been proposed in the scientific literature, and a recent example is SPORCalc. Due to the complexity of the drug design process, two terms of interest are still serendipity and bounded rationality . Those challenges are caused by the large chemical space describing potential new drugs without side-effects . Computer-assisted drug design Computer-assisted drug design uses computational chemistry to discover, enhance, or study drugs and related biologically active molecules . The most fundamental goal is to predict whether a given molecule will bind to a target and if so how strongly. Molecular mechanics or molecular dynamics are most often used to predict the conformation of the small molecule and to model conformational changes in the biological target that may occur when the small molecule binds to it. Semi-empirical , ab initio quantum chemistry methods , or density functional theory are often used to provide optimized parameters for the molecular mechanics calculations and also provide an estimate of the electronic properties (electrostatic potential, polarizability , etc.) of the drug candidate which will influence binding affinity. Molecular mechanics methods may also be used to provide semi-quantitative prediction of the binding affinity. Alternatively knowledge based scoring function may be used to provide binding affinity estimates. These methods use linear regression , machine learning , neural nets or other statistical techniques to derive predictive binding affinity equations by fitting experimental affinities to computationally derived interaction energies between the small molecule and the target. Ideally the computational method should be able to predict affinity before a compound is synthesized and hence in theory only one compound needs to be synthesized. The reality however is that present computational methods provide at best only qualitative accurate estimates of affinity. Therefore in practice it still takes several iterations of design, synthesis, and testing before an optimal molecule is discovered. On the other hand, computational methods have accelerated discovery by reducing the number of iterations required and in addition have often provided more novel small molecule structures. Drug design with the help of computers may be used at any of the following stages of drug discovery: hit identification using virtual screening (structure- or ligand-based design) hit-to-lead optimization of affinity and selectivity (structure-based design, QSAR , etc.) lead optimization optimization of other pharmaceutical properties while maintaining affinity Flowchart of a Usual Clustering Analysis for Structure-Based Drug Design In order to overcome the insufficient prediction of binding affinity calculated by recent scoring functions, the protein-ligand interaction and compound 3D structure information are used to analysis. For structure-based drug design, several post-screening analysis focusing on protein-ligand interaction has been developed for improving enrichment and effectively mining potential candidates: Consensus scoring Selecting candidates by voting of multiple scoring functions May lose the relationship between protein-ligand structural information and scoring criterion Geometric analysis Comparing protein-ligand interactions by visually inspecting individual structures Becoming intractable when the number of complexes to be analyzed increasing Cluster analysis Represent and cluster candidates according to protein-ligand 3D information Needs meaningful representation of protein-ligand interactions. Examples A particular example of rational drug design involves the use of three-dimensional information about biomolecules obtained from such techniques as x-ray crystallography and NMR spectroscopy. This approach to drug discovery is sometimes referred to as structure-based drug design. The first unequivocal example of the application of structure-based drug design leading to an approved drug is the carbonic anhydrase inhibitor dorzolamide which was approved in 1995. Another important case study in rational drug design is imatinib , a tyrosine kinase inhibitor designed specifically for the bcr-abl fusion protein that is characteristic for Philadelphia chromosome -positive leukemias ( chronic myelogenous leukemia and occasionally acute lymphocytic leukemia ). Imatinib is substantially different from previous drugs for cancer , as most agents of chemotherapy simply target rapidly dividing cells, not differentiating between cancer cells and other tissues. Additional examples include: Many of the atypical antipsychotics Cimetidine , the prototypical H 2 -receptor antagonist from which the later members of the class were developed Selective COX-2 inhibitor NSAIDs Dorzolamide , a carbonic anhydrase inhibitor used to treat glaucoma Enfuvirtide , a peptide HIV entry inhibitor Nonbenzodiazepines like zolpidem and zopiclone Probenecid SSRIs (selective serotonin reuptake inhibitors), a class of antidepressants Zanamivir , an antiviral drug Isentress , HIV Integrase inhibitor Case studies 5-HT3 antagonists Acetylcholine receptor agonists Angiotensin receptor blockers Bcr-Abl tyrosine kinase inhibitors Cannabinoid receptor antagonists CCR5 receptor antagonists Cyclooxygenase 2 inhibitors Dipeptidyl peptidase-4 inhibitors HIV protease inhibitors NK1 receptor antagonists Non-nucleoside reverse transcriptase inhibitors Proton pump inibitors Triptans TRPV1 antagonists Renin inhibitors Discovery and development of small molecule c-Met inhibitors See also Bioinformatics Cheminformatics Drug development Drug discovery List of pharmaceutical companies Medicinal chemistry Molecular Conceptor Molecular design software References ^ Madsen, Ulf; Krogsgaard-Larsen, Povl; Liljefors, Tommy (2002). Textbook of Drug Design and Discovery . Washington, DC: Taylor Francis. ISBN 0-415-28288-8 . ^ Cohen, N. Claude (1996). Guidebook on Molecular Modeling in Drug Design . Boston: Academic Press. ISBN 012178245x . ^ Guner, Osman F. (2000). Pharmacophore Perception, Development, and use in Drug Design . La Jolla, Calif: International University Line. ISBN 0-9636817-6-1 . ^ Leach, Andrew R.; Harren Jhoti (2007). Structure-based Drug Discovery . Berlin: Springer. ISBN 1-4020-4406-2 . ^ a b Wang R,Gao Y,Lai L (2000). "LigBuilder: A Multi-Purpose Program for Structure-Based Drug Design". Journal of Molecular Modeling 6 (7-8): 498–516. doi : 10.1007/s0089400060498 . ^ a b Schneider G, Fechner U (August 2005). "Computer-based de novo design of drug-like molecules". Nat Rev Drug Discov 4 (8): 649–63. doi : 10.1038/nrd1799 . PMID 16056391 . ^ Jorgensen WL (March 2004). "The many roles of computation in drug discovery". Science 303 (5665): 1813–8. doi : 10.1126/science.1096361 . PMID 15031495 . ^ Verlinde CL, Hol WG (July 1994). "Structure-based drug design: progress, results and challenges". Structure 2 (7): 577–87. doi : 10.1016/S0969-2126(00)00060-5 . PMID 7922037 . ^ Böhm HJ (June 1994). "The development of a simple empirical scoring function to estimate the binding constant for a protein-ligand complex of known three-dimensional structure". J. Comput. Aided Mol. Des. 8 (3): 243–56. doi : 10.1007/BF00126743 . PMID 7964925 . ^ Gohlke H, Hendlich M, Klebe G (January 2000). "Knowledge-based scoring function to predict protein-ligand interactions". J. Mol. Biol. 295 (2): 337–56. doi : 10.1006/jmbi.1999.3371 . PMID 10623530 . ^ Clark RD, Strizhev A, Leonard JM, Blake JF, Matthew JB (January 2002). "Consensus scoring for ligand/protein interactions". J. Mol. Graph. Model. 20 (4): 281–95. doi : 10.1016/S1093-3263(01)00125-5 . PMID 11858637 . ^ Wang R, Lai L, Wang S (January 2002). "Further development and validation of empirical scoring functions for structure-based binding affinity prediction". J. Comput. Aided Mol. Des. 16 (1): 11–26. doi : 10.1023/A:1016357811882 . PMID 12197663 . ^ Smith J, Stein V (April 2009). "SPORCalc: A development of a database analysis that provides putative metabolic enzyme reactions for ligand-based drug design". Computational Biology and Chemistry 33 (2): 149–59. doi : 10.1016/j.compbiolchem.2008.11.002 . PMID 19157988 . ^ Rajamani R, Good AC (May 2007). "Ranking poses in structure-based lead discovery and optimization: current trends in scoring function development". Curr Opin Drug Discov Devel 10 (3): 308–15. PMID 17554857 . ^ de Azevedo WF, Dias R (December 2008). "Computational methods for calculation of ligand-binding affinity". Curr Drug Targets 9 (12): 1031–9. doi : 10.2174/138945008786949405 . PMID 19128212 . ^ Liang S, Meroueh SO, Wang G, Qiu C, Zhou Y (May 2009). "Consensus scoring for enriching near-native structures from protein-protein docking decoys" . Proteins 75 (2): 397–403. doi : 10.1002/prot.22252 . PMC 2656599 . PMID 18831053 . http://www.pubmedcentral.nih.gov/articlerender.fcgi?tool=pmcentrezartid=2656599 . ^ Oda A, Tsuchida K, Takakura T, Yamaotsu N, Hirono S (2006). "Comparison of consensus scoring strategies for evaluating computational models of protein-ligand complexes". J Chem Inf Model 46 (1): 380–91. doi : 10.1021/ci050283k . PMID 16426072 . ^ Deng Z, Chuaqui C, Singh J (January 2004). "Structural interaction fingerprint (SIFt): a novel method for analyzing three-dimensional protein-ligand binding interactions". J. Med. Chem. 47 (2): 337–44. doi : 10.1021/jm030331x . PMID 14711306 . ^ Amari S, Aizawa M, Zhang J, Fukuzawa K, Mochizuki Y, Iwasawa Y, Nakata K, Chuman H, Nakano T (2006). "VISCANA: visualized cluster analysis of protein-ligand interaction based on the ab initio fragment molecular orbital method for virtual ligand screening". J Chem Inf Model 46 (1): 221–30. doi : 10.1021/ci050262q . PMID 16426058 . ^ Greer J, Erickson JW, Baldwin JJ, Varney MD (April 1994). "Application of the three-dimensional structures of protein target molecules in structure-based drug design". Journal of Medicinal Chemistry 37 (8): 1035–54. doi : 10.1021/jm00034a001 . PMID 8164249 . ^ Hendrik Timmerman; Klaus Gubernator; Hans-Joachim Böhm; Raimund Mannhold; Hugo Kubinyi (1998). Structure-based Ligand Design (Methods and Principles in Medicinal Chemistry) . Weinheim: Wiley-VCH. ISBN 3-527-29343-4 . ^ http://autodock.scripps.edu/news/autodocks-role-in-developing-the-first-clinically-approved-hiv-integrase-inhibitor
Variants of three genes related to clopidogrel metabolism and platelet receptor function – CYP2C19, ABCB1, and ITGB3 – appear to be independent risk factors for early stent thrombosis, beyond the already known clinical and angiographic risk factors, according to a report in the Oct. 26 issue of JAMA. A risk-prediction model that incorporated both genetic and clinical data had greater sensitivity and specificity at predicting early stent thrombosis than did a clinical model alone, said Dr. Guillaume Cayla of Institut de Cardiologie, INSERM Unite Mixte de Recherche, Salpetriere Hospital, Paris, and his associates. The researchers assessed all of the 23 genetic variants that have been reported to correlate with clopidogrel pharmacogenetics and arterial thrombosis to determine which ones contribute most to early stent thrombosis. They used a nationwide French registry of patients who had definite stent thrombosis within 30 days of implantation to identify 123 cases, then matched these for age and sex with 246 control subjects who had no stent thrombosis. Peripheral blood samples from these 369 subjects were genotyped for the suspect genetic variations. Only four variations in three genes were found to be significantly associated with early stent thrombosis. First, the CYP2C19 loss-of-function allele occurred in 49% of cases but only 26% of controls. Second, the CYP2C19 gain-of-function allele occurred in only 20% of cases but in 33% of controls. These findings strengthen the current evidence that CYP2C19 plays a predominant role in clopidogrel metabolism, Dr. Cayla and his colleagues said. "The effects of different genes according to different ethnic groups may warrant dedicated studies." Third, an ABCB1 variant occurred in 32% of cases but only 19% of controls. "The ABCB1 gene encodes a drug efflux transporter, P-glycoprotein, that modulates clopidogrel absorption. It has been previously associated with reduced clopidogrel response, but with variable clinical consequences," they noted. And fourth, an ITGB3 variant occurred in only 16% of cases but 28% of controls. The ITGB3 gene encodes for integrin beta-3, "a component of the glycoprotein IIb/IIIa platelet receptor, which mediates the final pathway of platelet aggregation," they said. There was a dose-response relationship in that risk of early stent thrombosis climbed steadily with carriage of an increasing number of these risk alleles, the investigators said. A risk-prediction model that combined genetic data with clinical data had significantly greater power to predict early stent thrombosis than did a clinical model alone. The combined model had 67% sensitivity and 79% specificity in this regard, compared with 60% sensitivity and 70% specificity for the model using only clinical data. "Patients in the highest tertile of risk using the combined clinical and genetic model had a sevenfold increased risk of early stent thrombosis vs. patients in the lowest tertile," Dr. Cayla and his associates said ( JAMA 2011;306:1765-74 ). The researchers also found that two nongenetic factors – loading dose of clopidogrel and the concomitant use of proton pump inhibitors (PPIs) – were significantly related to early stent thrombosis. Cases were much more likely than controls to have received a low loading dose of clopidogrel at stent implantation. And cases also were much more likely than controls to be taking PPIs, which have been suspected of interfering with clopidogrel metabolism. Unlike the genetic risk factors, both clopidogrel dose and PPI use are modifiable risk factors, they noted. This study was limited in that patients with the most severe early stent thrombosis died before they could be included in the study, so the genotype-phenotype relation remains unknown for them. "Stent malappositions or underexpansions are other important factors associated with stent thrombosis that were not evaluated," the investigators said. In addition, the study findings may apply only to white patients because virtually all the subjects, who were drawn from the general population in France, were white. "The effects of different genes according to different ethnic groups may warrant dedicated studies," they added. This study was funded by ACTION, the Société Francaise de Cardiologie, the Fédération Francaise de Cardiologie, and INSERM. The French registry of patients with early stent thrombosis was partially supported by Eli Lilly and the SGAM Foundation. Dr. Cayla and his associates reported ties to numerous industry sources. 来源: http://www.internalmedicinenews.com/news/cardiovascular-disease/single-article/variations-in-three-genes-predict-early-stent-thrombosis/2e03d029e5.html
自动I/O数字读入系统 中島翔太, 北園優希,陸慧敏,張力峰,芹川聖一 Recently, measuring instruments that automatically record measurement values by using the communication function of PC and RS232C have been widely used. However, there are a lot of measuring instruments that cannot communicate with an external instrument at present. Also, the ones that have the communication function are very expensive. The system that reads the instruction value from the image is by taking a picture of the measuring instrument with a camera. However, because the specification of the target measuring instrument has been limited, versatility of this system is low. Therefore,this paper proposes a strong numerical recognition system that doesn't depend on the model of a digital measuring instrument. The experiments showed that the proposed method has the characteristics of fast speed, efficiency and strong anti-interference. 2-a numeric reading system for digital meter without IO interface.pdf
Passing a Scalar Let’s look at a simple example of C code and its MEX-file equivalent. Here is a C computational function that takes a scalar and doubles it. #include math.h void timestwo(double y ) { y = 2.0*x ; return; } Below is the same function written in the MEX-file format. /* * ============================================================= * timestwo.c - example found in API guide * * Computational function that takes a scalar and doubles it. * * This is a MEX-file for MATLAB. * Copyright (c) 1984-2000 The MathWorks, Inc. * ============================================================= */ /* $Revision: 1.8 $ */ #include "mex.h" void timestwo(double y ) { y = 2.0*x ; } void mexFunction(int nlhs, mxArray *plhs ) { double *x, *y; int mrows, ncols; /* Check for proper number of arguments. */ if (nrhs != 1) { mexErrMsgTxt("One input required."); } else if (nlhs 1) { mexErrMsgTxt("Too many output arguments"); } /* The input must be a noncomplex scalar double.*/ mrows = mxGetM(prhs ); ncols = mxGetN(prhs ); if (!mxIsDouble(prhs ) || mxIsComplex(prhs ) || !(mrows == 1 ncols == 1)) { mexErrMsgTxt("Input must be a noncomplex scalar double."); } /* Create matrix for the return argument. */ plhs = mxCreateDoubleMatrix(mrows,ncols, mxREAL); /* Assign pointers to each input and output. */ x = mxGetPr(prhs ); y = mxGetPr(plhs ); /* Call the timestwo subroutine. */ timestwo(y,x); } In C, function argument checking is done at compile time. In MATLAB, you can pass any number or type of arguments to your M-function, which is responsible for argument checking. This is also true for MEX-files. Your program must safely handle any number of input or output arguments of any supported type. To compile and link this example source file at the MATLAB prompt, type mex timestwo.c This carries out the necessary steps to create the MEX-file called timestwo with an extension corresponding to the platform on which you’re running. You can now call timestwo as if it were an M-function. x = 2; y = timestwo(x) y = 4 You can create and compile MEX-files in MATLAB or at your operating system’s prompt. MATLAB uses mex.m, an M-file version of the mex script, and your operating system uses mex.bat on Windows and mex.sh on UNIX. In either case, typing mex filename at the prompt produces a compiled version of your MEX-file. In the above example, scalars are viewed as 1-by-1 matrices. Alternatively, you can use a special API function called mxGetScalar that returns the values of scalars instead of pointers to copies of scalar variables. This is the alternative code (error checking has been omitted for brevity). /* * ============================================================= * timestwoalt.c - example found in API guide * * Use mxGetScalar to return the values of scalars instead of * pointers to copies of scalar variables. * * This is a MEX-file for MATLAB. * Copyright (c) 1984-2000 The MathWorks, Inc. * ============================================================= */ /* $Revision: 1.5 $ */ #include "mex.h" void timestwo_alt(double *y, double x) { *y = 2.0*x; } void mexFunction(int nlhs, mxArray *plhs ) { double *y; double x; /* Create a 1-by-1 matrix for the return argument. */ plhs = mxCreateDoubleMatrix(1, 1, mxREAL); /* Get the scalar value of the input x. */ /* Note: mxGetScalar returns a value, not a pointer. */ x = mxGetScalar(prhs ); /* Assign a pointer to the output. */ y = mxGetPr(plhs ); /* Call the timestwo_alt subroutine. */ timestwo_alt(y,x); } This example passes the input scalar x by value into the timestwo_alt subroutine, but passes the output scalar y by reference. Exsample2:PassingStrings AnyMATLABdatatypecanbepassedtoandfromMEX-files.Forexample, thisCcodeacceptsastringandreturnsthecharactersinreverseorder. /* *============================================================= *revord.c *Exampleforillustratinghowtocopythestringdatafrom *MATLABtoaC-stylestringandbackagain. * *Takesastringandreturnsastringinreverseorder. * *ThisisaMEX-fileforMATLAB. *Copyright(c)1984-2000TheMathWorks,Inc. *============================================================ */ /*$Revision:1.10$*/ #include"mex.h" voidrevord(char*input_buf,intbuflen,char*output_buf) { inti; /*Reversetheorderoftheinputstring.*/ for(i=0;ibuflen-1;i++) *(output_buf+i)=*(input_buf+buflen-i-2); } Inthisexample,theAPIfunctionmxCallocreplacescalloc,thestandardC functionfordynamicmemoryallocation.mxCallocallocatesdynamicmemory usingtheMATLABmemorymanagerandinitializesittozero.Youmustuse mxCallocinanysituationwhereCwouldrequiretheuseofcalloc.Thesame istrueformxMallocandmxRealloc;usemxMallocinanysituationwhereC wouldrequiretheuseofmallocandusemxReallocwhereCwouldrequire realloc. NoteMATLABautomaticallyfreesupmemoryallocatedwiththemx allocationroutines(mxCalloc,mxMalloc,mxRealloc)uponexitingyour MEX-file.Ifyoudon’twantthistohappen,usetheAPIfunction mexMakeMemoryPersistent. BelowisthegatewayroutinethatcallstheCcomputationalroutinerevord. voidmexFunction(intnlhs,mxArray*plhs ) { char*input_buf,*output_buf; intbuflen,status; /*Checkforpropernumberofarguments.*/ if(nrhs!=1) mexErrMsgTxt("Oneinputrequired."); elseif(nlhs1) mexErrMsgTxt("Toomanyoutputarguments."); /*Inputmustbeastring.*/ if(mxIsChar(prhs )!=1) mexErrMsgTxt("Inputmustbeastring."); /*Inputmustbearowvector.*/ if(mxGetM(prhs )!=1) mexErrMsgTxt("Inputmustbearowvector."); /*Getthelengthoftheinputstring.*/ buflen=(mxGetM(prhs )*mxGetN(prhs ))+1; /*Allocatememoryforinputandoutputstrings.*/ input_buf=mxCalloc(buflen,sizeof(char)); output_buf=mxCalloc(buflen,sizeof(char)); /*Copythestringdatafromprhs intoaCstring *input_buf.*/ status=mxGetString(prhs ,input_buf,buflen); if(status!=0) mexWarnMsgTxt("Notenoughspace.Stringistruncated."); /*CalltheCsubroutine.*/ revord(input_buf,buflen,output_buf); /*SetC-stylestringoutput_buftoMATLABmexFunctionoutput*/ plhs =mxCreateString(output_buf); return; } Thegatewayroutineallocatesmemoryfortheinputandoutputstrings.Since theseareCstrings,theyneedtobeonegreaterthanthenumberofelements intheMATLABstring.NexttheMATLABstringiscopiedtotheinputstring. Boththeinputandoutputstringsarepassedtothecomputationalsubroutine (revord),whichloadstheoutputinreverseorder.Notethattheoutputbuffer isavalidnull-terminatedCstringbecausemxCallocinitializesthememoryto 0.TheAPIfunctionmxCreateStringthencreatesaMATLABstringfromthe Cstring,output_buf.Finally,plhs ,theleft-handsidereturnargumentto MATLAB,issettotheMATLABarrayyoujustcreated. ByisolatingvariablesoftypemxArrayfromthecomputationalsubroutine,you canavoidhavingtomakesignificantchangestoyouroriginalCcode. Inthisexample,typing x='helloworld'; y=revord(x) produces Thestringtoconvertis'helloworld'. y= dlrowolleh