# R’s matplot function in MATLAB

By default, MATLAB’s plot function draws no markers in the figure that it produces. One may explicitly specify a marker and a line style following the line specification string syntax; however, only one marker type and line style may be applied to a single data set.

Further we present a simple MATLAB function that implements the same functionality as R’s matplot function and allows to set style for each data line shown.

# Creating GIF animations of protein molecules with PyMOL

PyMOL is an open-source molecular visualization system useful for producing high-quality figures of protein structures. Besides static figures, PyMOL can also generate animations with the mpng command that writes movie frames to separate files. However, mpng provides no options to customize the produced images. Here we describe an appoach to get a customized looped animation in PyMOL and present a Python script implementing it. The script is based on Maximilian Ebert’s solution from the PyMOL mailing list.

# Determining OS X version in Makefile

There is a number of ways to set up compilation options depending on an environment, including sophisticated tools like Autoconf and CMake. The most basic and commonly used approach is to include environment-specific options in a makefile for GNU Make. A typical example is choosing different options for Linux, Windows and OS X. Here we extend this example by considering the OS X version.

# Fast vector product in MATLAB

The MATLAB function cross implements the vector product for two kinds of input data: a pair of vectors and a pair of N-D arrays. Surprisingly, it works slower for successive computations of cross products for 3-D vector pairs than the following naive implementation.


function C = cross3d(A, B)

C = [A(2)*B(3) - A(3)*B(2), ...
A(3)*B(1) - A(1)*B(3), ...
A(1)*B(2) - A(2)*B(1)];

end



Further, we estimate the median running time of cross and cross3d in a reproducible way using MATLAB scripts.

# Vectorized atomic masses in MATLAB

It is often convenient to obtain atomic masses for a given array of element names in a vectorized way. For example, one may use it to calculate the weighed RMSD (wRMSD) between two conformations of a protein specified by their atom coordinates $\{\, x_i \,\}_{i=1}^n$ and $\{\, y_i \,\}_{i=1}^n$:

$\mathrm{wRMSD} = \sqrt{\frac{1}{n} \sum_{i=1}^n w_i (x_i - y_i)^2}$,

where $x_i, y_i \in \mathbb{R}^3$ and $w_i$ denotes the atomic mass of the ith atom.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 5, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5081385374069214, "perplexity": 3141.0628924353337}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-13/segments/1521257647251.74/warc/CC-MAIN-20180320013620-20180320033620-00159.warc.gz"}