BACKGROUND
rnas and proteins are linear polymers composed of a limited set of building blocks  that may spontaneously fold into complex three-dimensional shapes  <cit> .
in both rna and proteins, the order of building blocks held together by covalent bonds is called the primary structure, the local conformation of the chain stabilized mostly by hydrogen bonds is the secondary structure, while the path of the chain in three dimensions  resulting from various long-range interactions is the tertiary structure.
it is known that many proteins and rnas undergo conformational transitions.
macromolecules and their parts may also exhibit structural disorder, i.e.
fluctuations between many different conformations  <cit> .
the functions of proteins and rnas typically involve physical interactions with other molecules in the cell, which are dependent on the structure and plasticity of the interacting partners.
thus, the functions of proteins and rnas alike depend on the 3d structure and dynamics of these molecules, which in turn are encoded in their linear, i.e.
unidimensional  sequences  <cit> .
while three-dimensional macromolecular structures represent an information-rich framework for studying biological functions, visualizing and analyzing them is difficult both for humans and computer programs.
two-dimensional  flat images are more readily discernible to the eye and more memorable than complex 3d images.
as a matter of fact, 3d structures of macromolecules , can be represented as square symmetrical matrices containing data about the proximity of residue or atom pairs in the molecule  <cit> .
values stored in the matrix may represent e.g.
euclidean distances between particular atoms, such matrix is then called a distance map).
if only binary information about residue-residue interactions is included, a matrix is called a contact map.
in a contact map, a residue-residue interaction may be qualified by an euclidean distance below a given threshold or by a particular type of contact.
the representation of macromolecular structure by its 2d map is independent on the coordinate frame , which makes it useful for both visualization and structure comparison.
contact maps can be also enriched with additional information, e.g.
to discriminate different types of contacts or to indicate the chirality in 3d , which is otherwise lost upon the conversion to a 2d representation.
it has been demonstrated that the 3d structure of a protein  can be recovered from its contact map representation, with the reconstructed and original structures similar up to the resolution of the contact map representation  <cit> .
this rationalizes the development of computational tools for analysis and visualization of macromolecular 2d maps, as an alternative to dealing directly with 3d structures.
in fact, complex structures of rna molecules have been traditionally described as 2d diagrams, exemplified by the popular “cloverleaf” representation of the trna molecule.
such diagrams emphasize “orthodox” pairing of bases with their watson-crick edges, and with the use of additional symbols or colors they can also display other types of pairing, using the hoogsteen and sugar edges  <cit> .
however, a single nucleotide residue can interact with more than one nucleotide at a time .
in this situation secondary structure plots become illegible due to crossing of multiple lines indicating long-distance contacts.
on the other hand, the same type of information can be represented  with a square symmetrical matrix containing data about different types of interactions e.g.
discriminated by the use of different colors.
with only a little training, one can learn to quickly distinguish e.g.
helices and complex tertiary arrangements, such as pseudoknots.
similarities between distantly related rnas can be seen easily in contact maps, even when the 3d structures superimpose poorly.
the development of computational tools for molecular structure visualization must keep up with the growing amount of bioinformatics data and the definition of new data types.
structure visualization, analysis, and annotation tools play an increasingly important role in research, contributing significantly to understanding the biological function of macromolecules.
there is a number of tools capable of calculating, displaying, and analyzing protein contact maps, including vmd  <cit> , seqx  <cit> , pconpy  <cit> , or cmview  <cit> .
while some of these methods are able to display contacts of the protein component to the nucleic acid ligand, they do not produce a 2d map if rna structure alone is provided as input, and they do not discriminate between different types of nucleotide interactions.
as more and more rna structures are determined by experimental methods or predicted by computational techniques, it becomes increasingly important to reinforce current state-of-art 3d rna modeling tools with 2d visualization capabilities.
thus, we developed a computer program dedicated to structural maps of rnas and rna-protein or ligand-complexes, with particular emphasis on visualization of different types of interactions mediated by edges or faces of nucleotide bases, i.e.
pairing and stacking.
implementation
programming language, systems, external programs
rnamap2d was developed based on its predecessor protmap2d  <cit> .
the core programming language of rnamap2d is python.
the program uses the biopython  <cit>  and pycogent  <cit>  libraries to handle pdb structures.
rnamap2d is available for linux, windows and macosx.
to create a windows executable version of the program, we used the py2exe  <dig> .
<dig> tool and to build a macosx version, py2app  <dig> .
<dig>  respectively.
hardware requirements for rnamap2d are very modest as of  <dig>  i.e.
<dig> ghz processor and  <dig> mb ram memory.
in analogy to a number of programs for determination of protein secondary structure from 3d coordinates  <cit>  that differ from each other in definition of structures and algorithms for their detection, there exist various tools for determination of contacts from rna 3d structures.
we have adapted rnamap2d to use rnaview  <cit>  for base pair calculation.
however, rnaview is not available for windows, therefore we added our own procedure for calculating base/nucleotide pairs, developed in moderna  <cit> .
for every pair of residues considered, it superimposes reference frames of all known pairs types as well as predicts the presence of h-bonds characteristic for a given pair type based on interatomic distances and angles.
this makes the latter procedure sensitive to distortions of the relative conformation of the nucleotide.
according to our tests this procedure agrees with rnaview in assignment of ~95% of canonical base pairs.
at startup, rnamap2d checks for the presence of the installed rnaview program, and uses it by default for base pair interactions classification, while in its absence our modules are used.
user skills
rnamap2d requires no programming or scripting skills to make use of all of its features, regardless of the platform.
the windows and macosx versions require no installation, except for downloading and unpacking the distribution file.
linux distribution is a set of bytecode python files that require the installation of all modules cited at the beginning of this section prior to the use of the program.
users are provided with a comprehensive manual and a readme file that explains all installation steps.
all versions provide the same functionalities except for the above-mentioned absence of rnaview for the windows platform.
our program has an easy-to-use graphic user interface that allows for customizing the final contact or distance map, and by setting all the important parameters.
rnamap2d navigation scheme design allows for making a step back from the final map view to the main options panel in order to refine parameters and promptly visualize the desired output.
the intermediate results of calculations are stored in the computer memory to keep the data processing time at a minimum.
distance and contact maps can be saved and uploaded as text files in a variety of formats, including e.g.
the ones used in casp or by the phylip package.
maps can be also exported and uploaded as microsoft office excel™ spreadsheets.
finally, images of maps can be exported as png, bmp, and tiff files.
speed
to optimize the speed of rnamap2d, we used c and c++ libraries that are accessible under python: wxpython , numeric and numpy .
also, the core calculation routine in rnamap2d is the determination of distances and contacts between atoms and residues.
we used the kdtree algorithm  <cit>  as implemented in biopython, which has log-linear calculation time, fastest known to date.
as an example, for a molecule of the size of  <dig> nucleotide residues, the calculation time reaches  <dig> time units .
it compares favorably e.g.
with an alternative approach used by the pconpy program for protein contact maps  <cit>  that relies on a naïve double loop for calculating a contact map.
for the molecule of identical size, the calculation time would reach  <dig> units, which is five times slower.
this is because time complexity of most such algorithms is of the order of o. please note however, that the calculation time for rna molecules longer than  <dig> bases can be quite long if no rnaview plugin is installed.
bearing this in mind, we designed an additional “no pairings ” contact map calculation mode that bypasses the pairing calculation algorithm and can be used alternatively for large rna structures, in order to obtain a raw contact map very quickly.
RESULTS
based on our previous experience with protein 2d map analysis and core parts of the protmap2d code  <cit> , we developed rnamap2d, a standalone tool for calculation, visualization and analysis of contact and distance maps of nucleic acid structures and structures of protein-nucleic acid complexes.
protmap2d was designed to perform various tasks on proteins only.
as a consequence, it has no generic or specific capabilities that could address tasks specific to nucleic acids or complexes formed by nucleic acids.
also, protmap2d cannot visualize contacts made by macromolecules with ligands or ions.
on the other hand, the interaction of rna with ions is essential for the formation and stability of its 3d structure  <cit> , therefore rna-ion contacts shouldn’t be neglected in structural analyses.
rnamap2d is therefore an independent program, with multiple features specific for rna, and not simply an upgrade of protmap2d.
our method can serve to analyze dna as well as rna.
however we expect that because of regularity of dna structures, this type of nucleic acid will not be frequently analyzed on the 2d level, hence the program’s name includes only rna as the key input molecule.
for simplicity, in this article we refer mostly to rna alone.
rnamap2d can calculate a contact map or a distance map of an rna structure, compare two alternative 3d models of rna .
our program can analyze an ensemble of structures , with two alternative statistics measures.
rnamap2d is also capable of visualizing a contact map of protein-rna complex, and a series of such models, e.g.
originating from a protein-rna docking experiment.
rnamap2d can also calculate, visualize and export rna secondary structure in a common dot-bracket format.
secondary structure can be also imported and displayed as a 2d diagram – in this case all contacts visualized by rnamap2d will correspond to watson-crick base pairs, as other types of contacts are not represented in traditional secondary structure representations.
rnamap2d generates interactive 2d maps, with a possibility to zoom in onto particular fragments.
zooming is enabled when a user presses a mouse button over a map and drags a rectangle-shaped area.
the content of this area is shown in a separate window, with a sequence ruler, range indicator and a possibility of resizing.
also, when a user hovers a mouse cursor over a specific contact, a window appears with information about the residue pair, including residue index, residue name and binary  contact information.
additional interaction schemes specific to different tasks are available, such as color panels, fields to input certain value limits etc., which are described below in specific sections.
output options for 2d maps include a number of image formats , and various text formats developed initially for storing the results of comparative analyses of protein sequences and structures: casp  <cit> , eva  <cit> , phylip  <cit>  and clans  <cit> .
rnamap2d can also encode maps in formats such as csv or ms excel™ spreadsheets, which can be easily read and analyzed with many third-party tools.
the program is also capable of reading a map encoded as a text or excel file, e.g.
a file exported from rnamap2d and edited in a third-party program.
in the section below we highlight some of the tasks of rnamap2d that we find most typical in our own research on rna structures.
all tasks and options are extensively documented in the user’s manual, which is provided on the program’s website.
the program is also accompanied by a tutorial, which intends to demonstrate all standard features for a user without any prior knowledge.
a set of pdb structures and other files is also provided, so that users do not have to search for appropriate input in order to test and see all the features described in the tutorial .
rna contact map
rnamap2d works on the level of residues rather than individual atoms.
a user can specify the definition of atoms used to calculate the presence of a contact: the type of atoms to be included in calculations , a maximal distance  between the specified atoms to form a contact, and a minimal residue separation along the sequence .
if multiple atoms are considered, it is sufficient for any pair of atoms from two residues to fall below the distance threshold to have this residues classified as in contact; rnamap2d does not generate a map of contacts between individual atoms, only maps information about proximal atoms on the respective residues.
however individual heteroatom records found in pdb files that represent ions or ligand atoms are treated as separate residues.
if the pdb file contains several models, the user can choose a specific model to be analyzed by the program.
for oligomeric structures, in most analyses it is also possible to specify chain identifiers to limit the analysis to certain chains of the molecule.
auxiliary options are: graphic sequence delimiter  and grid-like lines that separate chains .
a contact map can be visualized as a black-and-white picture, with no distinction between contacts, symbolized as white dots against black background .
following the calculation of the contact map, the user can choose independent color schemes in order to highlight and visualize contacts that belong to one of the  <dig> base pair families, three special groups , or to one of the four stacking classes  <cit> .
the coloring is indicated by invoking an option panel, which appears as a separate window.
rnamap2d presents an option to color contacts made by ligands or ions, which appear as additional “residues” following the sequence of macromolecules .
rna distance map
distance maps are richer in data than contact maps, and essentially preserve all the information required to infer the details of 3d structure, with the exception of the handedness, which can be imposed on a higher level of reasoning, because we know the stereochemistry of nucleic acid structures .
as with contact maps, rnamap2d does not generate a map of distances between individual atoms; if multiple atoms are considered per residue, the shortest distance is taken for each pair of residues.
one option for visualization of distance maps is the contact map view.
this feature allows the user to optionally convert a distance map into a series of contact maps, calculated at different thresholds.
new contact maps are calculated and visualized instantly, as the user changes the maximal distance parameter defining a contact , by using a mouse roller.
this enables a user to establish a subjectively optimal distance threshold parameter value for the purpose of obtaining a contact map that highlights certain molecular features .
following the calculation of a distance map, the user is given an option to define the absolute distance limits, by entering minimal or maximal distance and the minimal sequential separation of nucleotides to be considered.
the results are visualized instantly as well .
rna secondary structure
the calculated secondary structure can be written in the popular vienna  <cit>  format as a dot-bracket string.
rnamap2d recognizes pseudoknots, for which special bracket symbols  are used in the dot-bracket string.
if an rna secondary structure file is uploaded, rnamap2d can display the watson-crick base pairs as a simplified contact map.
rnamap2d can read the vienna, ct, and bpseq secondary structure formats.
pseudoknotted base pairs are shown in grey .
contact maps of complexes involving different types of molecules
nucleic acids usually function in complex with proteins, and many structures of protein-nucleic acid complexes have been determined experimentally.
in the pdb database, there are  <dig> such entries as of april 11th  <dig>  contributing to  <dig> % of the total pdb records.
rnamap2d is capable of either extracting nucleic acid chains from a complex structure in order to visualize them separately or it can include the coordinates of the protein component and display protein-nucleic acid interactions.
a contact map of a protein-nucleic acid complex is visually divided into three distinct parts for intra-protein contacts, intra-nucleic acid contacts and intermolecular contacts between the two entities.
these three categories can be colored differently for better visual distinction.
whenever possible, rnamap2d utilizes protein secondary structure definitions found in a pdb file, and displays them  along the ruler of the contact map, alongside the rna secondary structure bars .
comparison of contact maps
rnamap2d can compare two rna structures in two modes: molecules that have an identical number of residues, or molecules that contain a common chain with residues with corresponding numbers.
the input can be either a single pdb file with two models, or two separate files, e.g.
a 3d model and a reference structure.
the sequences do not need to be identical.
thus, it is possible to compare two models of the same rna , sub-structures of different molecules, e.g.
homologs with similar structure but different sequence, etc.
in either case, two contact maps are shown concurrently, with the first structure in the lower-left triangle, the second in the upper-right triangle.
contacts common to both structures are shown as white dots, while contacts specific to either structure are in grey.
in figure  <dig> and  <dig>  we compared the crystal structure of the azoarcus group i intron  with a 3d model for built on a template from the twort phage using moderna  <cit> .
the reference structure is 198nt long and contains several tertiary contacts that were constructed using a second template from tetrahymena.
twelve residues at the 3′ end are not present in the model.
the all-atom rmsd of the model versus crystal structure is  <dig>  Å. the contact map analysis allowed us to identify small differences in contacts between the model and the reference structure, mainly in loops and in the tertiary motifs.
figure  <dig> illustrates another example, namely the comparison of one of our models constructed in the framework of the ‘rna puzzles’ challenge  <cit> .
for this modeling exercise, the secondary structure of the ‘rna square’ molecule  <cit>  composed of eight individual strands, as well as three-dimensional coordinates of the four strands were provided, and the task was to model the structure and contacts made by the four “missing” strands.
figure  <dig>  presents a superpositon of the crystal structure  shown in cyan and a model generated by the bujnicki group shown in red.
this model has been evaluated as the most accurate prediction for this molecule within the rna puzzles challenge  <cit> .
the comparison of contact maps with rnamap2d shows that secondary structures have been modeled correctly, and a significant fraction of tertiary contacts observed in the crystal structure  are also present in the theoretical model .
comparison of structural ensembles
another ability of rnamap2d is to analyze results of calculations, which typically generate not just one solution, but entire ensembles.
such studies include rna and rnp structure determination by nmr , and computational structure modeling approaches, such as de novo folding  or protein-rna docking .
for such ensembles comprising sets of complexes  a statistical contact map can be calculated to visualize the frequencies of contacts in the ensemble as shades of grey .
rnamap2d users can choose between two ways to display contacts that vary through the model ensemble file.
in both cases, white fields on the map represent 100% frequency across a model set, and black fields represent no contacts.
for contacts that appear only in a fraction of models, one option of visualization presents a relative frequency of contacts, where and shades of grey correspond to intermediate values .
another option is to present all “partial” contacts by one shade of grey.
in an example analysis, we have analyzed the noncanonical base pairs in a part of the 3′ utr from turnip crinkle virus genomic rna.
this 102-nt structural element binds to the large ribosomal subunit to promote translation.
the structure consists of three main helices.
in the nmr structure ,  <dig> models have been deposited.
rnamap2d can be used to check e.g.
whether noncanonical base pairs are maintained in all the models.
we used rnamap2d to generate a contact map for the ensemble and then colored noncanical pairs in blue.
we have inspected individual pairs in the map zoomed to a fullscreen mode and generated a statistics map and exported the contact frequencies to an excel table.
in the contact map, regions that vary in the ensemble  are immediately visible as grey areas.
for instance tertiary interactions between hairpin loop 37– <dig> and the structure  fluctuate, and base pairing in this region is not stable.
in total, we identified  <dig> noncanonical base pairs, of which four differ in at least one of the  <dig> models.
the three noncanonical pairs g9-g <dig>  g29-u <dig>  and a70-c <dig>  differ in only one of the models.
the fourth pair, cis-watson-watson u67-c <dig>  is present in four models only.
it varies a lot between the models and the participating bases can also pair in the cis-watson-hoogsteen mode.
residues adjacent to a <dig> and c <dig> display some flexibility in the contact map as well.
this pair is located in an internal loop that is important for switching between translation and replication in the virus  <cit> .
we conclude that rnamap2d helps to identify regions that undergo conformational changes by highlighting them in the graphical output, and enables their quantitative examination in a tabular report.
CONCLUSIONS
rnamap2d is a new tool for calculation and visualization of nucleic acid contact and distance maps.
our aim was to facilitate analyses of rna structures that focus on type and location of short-range interactions, without taking the spatial conformation of the backbone into account.
rnamap2d is also capable of analyzing protein-nucleic acid complexes.
rnamap2d is applicable in various scenarios, ranging from comparison of rna 2d and 3d structural predictions with each other and with the native structure, to analyses of trajectories from md simulations of nucleic acid structures, to studies of rna/dna-protein and rna/dna-ligand interactions and analyses of macromolecular docking experiments.
protmap2d and rnamap2d both provide researchers with an extensive suite of programs for analyses and visualization of macromolecular structures.
rnamap2d runs on any modern operating system, is very fast and has an intuitive interface.
both programs serve as a complete platform that supplements the existing 3d visualization tools, with sophisticated 2d map capabilities.
availability and requirements
project name: rnamap2d
project home page: http://iimcb.genesilico.pl/rnamap2d.html
operating systems: windows, linux, macosx.
programming languages: python , c/c++
software packages : none
software packages : python  <dig> , biopython  <dig> , pycogent  <dig> , wxpython  <dig> .
<dig>  pil  <dig> .
<dig>  numeric  <dig> , numpy  <dig> .
<dig>  pyexcelerator  <dig> .3
other requirements: rnaview program is recommended as an optional plugin.
please refer to user’s manual and readme file for installation instructions to be found on the rnamap2d project home page.
hardware requirements: min.
<dig> mb ram, 1ghz cpu or better .
license: rnamap2d is distributed under free academic license.
please refer to the home page for the license document.
restriction for non-academics: users willing to use rnamap2d for non-academic purposes should contact the corresponding author for details.
please note that this license will not affect commercial usage of rnaview.
please contact authors of rnaview for a separate license.
abbreviations
pdb: protein databank; pil: python image library; casp: critical assessment of techniques for protein structure prediction; csv: comma-separated values; ct: connectivity table.
competing interests
authors declare that they have no competing interests.
authors’ contributions
ns participated in majority of the code implementation, including most of the features specific for rna.
mp co-supervised the work of ns, contributed the code of protmap2d, participated in the development of the code, developed the final version of the software, and drafted the manuscript.
kr co-supervised the work of ns, and participated in the development of the code.
jmb conceived of the study, participated in design and coordination, and edited the manuscript.
all authors read and approved the final manuscript.

 rnas and proteins are linear polymers composed of a limited set of building blocks that may spontaneously fold into complex three-dimensional shapes. in both rna and proteins, the order of building blocks held together by covalent bonds is called the primary structure, the local conformation of the chain stabilized mostly by hydrogen bonds is the secondary structure, while the path of the chain in three dimensions resulting from various long-range interactions is the tertiary structure. it is known that many proteins and rnas undergo conformational transitions. macromolecules and their parts may also exhibit structural disorder, i.e. fluctuations between many different conformations. the functions of proteins and rnas typically involve physical interactions with other molecules in the cell, which are dependent on the structure and plasticity of the interacting partners. thus, the functions of proteins and rnas alike depend on the 3d structure and dynamics of these molecules, which in turn are encoded in their linear, i.e. unidimensional sequences. while three-dimensional macromolecular structures represent an information-rich framework for studying biological functions, visualizing and analyzing them is difficult both for humans and computer programs. two-dimensional flat images are more readily discernible to the eye and more memorable than complex 3d images. as a matter of fact, 3d structures of macromolecules, can be represented as square symmetrical matrices containing data about the proximity of residue or atom pairs in the molecule. values stored in the matrix may represent e.g. euclidean distances between particular atoms, such matrix is then called a distance map). if only binary information about residue-residue interactions is included, a matrix is called a contact map. in a contact map, a residue-residue interaction may be qualified by an euclidean distance below a given threshold or by a particular type of contact. the representation of macromolecular structure by its 2d map is independent on the coordinate frame, which makes it useful for both visualization and structure comparison. contact maps can be also enriched with additional information, e.g. to discriminate different types of contacts or to indicate the chirality in 3d, which is otherwise lost upon the conversion to a 2d representation. it has been demonstrated that the 3d structure of a protein can be recovered from its contact map representation, with the reconstructed and original structures similar up to the resolution of the contact map representation. this rationalizes the development of computational tools for analysis and visualization of macromolecular 2d maps, as an alternative to dealing directly with 3d structures. in fact, complex structures of rna molecules have been traditionally described as 2d diagrams, exemplified by the popular “cloverleaf” representation of the trna molecule. such diagrams emphasize “orthodox” pairing of bases with their watson-crick edges, and with the use of additional symbols or colors they can also display other types of pairing, using the hoogsteen and sugar edges. however, a single nucleotide residue can interact with more than one nucleotide at a time. in this situation secondary structure plots become illegible due to crossing of multiple lines indicating long-distance contacts. on the other hand, the same type of information can be represented with a square symmetrical matrix containing data about different types of interactions e.g. discriminated by the use of different colors. with only a little training, one can learn to quickly distinguish e.g. helices and complex tertiary arrangements, such as pseudoknots. similarities between distantly related rnas can be seen easily in contact maps, even when the 3d structures superimpose poorly. the development of computational tools for molecular structure visualization must keep up with the growing amount of bioinformatics data and the definition of new data types. structure visualization, analysis, and annotation tools play an increasingly important role in research, contributing significantly to understanding the biological function of macromolecules. there is a number of tools capable of calculating, displaying, and analyzing protein contact maps, including vmd, seqx, pconpy, or cmview. while some of these methods are able to display contacts of the protein component to the nucleic acid ligand, they do not produce a 2d map if rna structure alone is provided as input, and they do not discriminate between different types of nucleotide interactions. as more and more rna structures are determined by experimental methods or predicted by computational techniques, it becomes increasingly important to reinforce current state-of-art 3d rna modeling tools with 2d visualization capabilities. thus, we developed a computer program dedicated to structural maps of rnas and rna-protein or ligand-complexes, with particular emphasis on visualization of different types of interactions mediated by edges or faces of nucleotide bases, i.e. pairing and stacking. implementation programming language, systems, external programs rnamap2d was developed based on its predecessor protmap2d. the core programming language of rnamap2d is python. the program uses the biopython and pycogent libraries to handle pdb structures. rnamap2d is available for linux, windows and macosx. to create a windows executable version of the program, we used the py2exe. tool and to build a macosx version, py2app. respectively. hardware requirements for rnamap2d are very modest as of i.e. ghz processor and mb ram memory. in analogy to a number of programs for determination of protein secondary structure from 3d coordinates that differ from each other in definition of structures and algorithms for their detection, there exist various tools for determination of contacts from rna 3d structures. we have adapted rnamap2d to use rnaview for base pair calculation. however, rnaview is not available for windows, therefore we added our own procedure for calculating base/nucleotide pairs, developed in moderna. for every pair of residues considered, it superimposes reference frames of all known pairs types as well as predicts the presence of h-bonds characteristic for a given pair type based on interatomic distances and angles. this makes the latter procedure sensitive to distortions of the relative conformation of the nucleotide. according to our tests this procedure agrees with rnaview in assignment of ~95% of canonical base pairs. at startup, rnamap2d checks for the presence of the installed rnaview program, and uses it by default for base pair interactions classification, while in its absence our modules are used. user skills rnamap2d requires no programming or scripting skills to make use of all of its features, regardless of the platform. the windows and macosx versions require no installation, except for downloading and unpacking the distribution file. linux distribution is a set of bytecode python files that require the installation of all modules cited at the beginning of this section prior to the use of the program. users are provided with a comprehensive manual and a readme file that explains all installation steps. all versions provide the same functionalities except for the above-mentioned absence of rnaview for the windows platform. our program has an easy-to-use graphic user interface that allows for customizing the final contact or distance map, and by setting all the important parameters. rnamap2d navigation scheme design allows for making a step back from the final map view to the main options panel in order to refine parameters and promptly visualize the desired output. the intermediate results of calculations are stored in the computer memory to keep the data processing time at a minimum. distance and contact maps can be saved and uploaded as text files in a variety of formats, including e.g. the ones used in casp or by the phylip package. maps can be also exported and uploaded as microsoft office excel™ spreadsheets. finally, images of maps can be exported as png, bmp, and tiff files. speed to optimize the speed of rnamap2d, we used c and c++ libraries that are accessible under python: wxpython, numeric and numpy. also, the core calculation routine in rnamap2d is the determination of distances and contacts between atoms and residues. we used the kdtree algorithm as implemented in biopython, which has log-linear calculation time, fastest known to date. as an example, for a molecule of the size of nucleotide residues, the calculation time reaches time units. it compares favorably e.g. with an alternative approach used by the pconpy program for protein contact maps that relies on a naïve double loop for calculating a contact map. for the molecule of identical size, the calculation time would reach units, which is five times slower. this is because time complexity of most such algorithms is of the order of o. please note however, that the calculation time for rna molecules longer than bases can be quite long if no rnaview plugin is installed. bearing this in mind, we designed an additional “no pairings ” contact map calculation mode that bypasses the pairing calculation algorithm and can be used alternatively for large rna structures, in order to obtain a raw contact map very quickly.  based on our previous experience with protein 2d map analysis and core parts of the protmap2d code, we developed rnamap2d, a standalone tool for calculation, visualization and analysis of contact and distance maps of nucleic acid structures and structures of protein-nucleic acid complexes. protmap2d was designed to perform various tasks on proteins only. as a consequence, it has no generic or specific capabilities that could address tasks specific to nucleic acids or complexes formed by nucleic acids. also, protmap2d cannot visualize contacts made by macromolecules with ligands or ions. on the other hand, the interaction of rna with ions is essential for the formation and stability of its 3d structure, therefore rna-ion contacts shouldn’t be neglected in structural analyses. rnamap2d is therefore an independent program, with multiple features specific for rna, and not simply an upgrade of protmap2d. our method can serve to analyze dna as well as rna. however we expect that because of regularity of dna structures, this type of nucleic acid will not be frequently analyzed on the 2d level, hence the program’s name includes only rna as the key input molecule. for simplicity, in this article we refer mostly to rna alone. rnamap2d can calculate a contact map or a distance map of an rna structure, compare two alternative 3d models of rna. our program can analyze an ensemble of structures, with two alternative statistics measures. rnamap2d is also capable of visualizing a contact map of protein-rna complex, and a series of such models, e.g. originating from a protein-rna docking experiment. rnamap2d can also calculate, visualize and export rna secondary structure in a common dot-bracket format. secondary structure can be also imported and displayed as a 2d diagram – in this case all contacts visualized by rnamap2d will correspond to watson-crick base pairs, as other types of contacts are not represented in traditional secondary structure representations. rnamap2d generates interactive 2d maps, with a possibility to zoom in onto particular fragments. zooming is enabled when a user presses a mouse button over a map and drags a rectangle-shaped area. the content of this area is shown in a separate window, with a sequence ruler, range indicator and a possibility of resizing. also, when a user hovers a mouse cursor over a specific contact, a window appears with information about the residue pair, including residue index, residue name and binary contact information. additional interaction schemes specific to different tasks are available, such as color panels, fields to input certain value limits etc., which are described below in specific sections. output options for 2d maps include a number of image formats, and various text formats developed initially for storing the results of comparative analyses of protein sequences and structures: casp, eva, phylip and clans. rnamap2d can also encode maps in formats such as csv or ms excel™ spreadsheets, which can be easily read and analyzed with many third-party tools. the program is also capable of reading a map encoded as a text or excel file, e.g. a file exported from rnamap2d and edited in a third-party program. in the section below we highlight some of the tasks of rnamap2d that we find most typical in our own research on rna structures. all tasks and options are extensively documented in the user’s manual, which is provided on the program’s website. the program is also accompanied by a tutorial, which intends to demonstrate all standard features for a user without any prior knowledge. a set of pdb structures and other files is also provided, so that users do not have to search for appropriate input in order to test and see all the features described in the tutorial. rna contact map rnamap2d works on the level of residues rather than individual atoms. a user can specify the definition of atoms used to calculate the presence of a contact: the type of atoms to be included in calculations, a maximal distance between the specified atoms to form a contact, and a minimal residue separation along the sequence. if multiple atoms are considered, it is sufficient for any pair of atoms from two residues to fall below the distance threshold to have this residues classified as in contact; rnamap2d does not generate a map of contacts between individual atoms, only maps information about proximal atoms on the respective residues. however individual heteroatom records found in pdb files that represent ions or ligand atoms are treated as separate residues. if the pdb file contains several models, the user can choose a specific model to be analyzed by the program. for oligomeric structures, in most analyses it is also possible to specify chain identifiers to limit the analysis to certain chains of the molecule. auxiliary options are: graphic sequence delimiter and grid-like lines that separate chains. a contact map can be visualized as a black-and-white picture, with no distinction between contacts, symbolized as white dots against black background. following the calculation of the contact map, the user can choose independent color schemes in order to highlight and visualize contacts that belong to one of the base pair families, three special groups, or to one of the four stacking classes. the coloring is indicated by invoking an option panel, which appears as a separate window. rnamap2d presents an option to color contacts made by ligands or ions, which appear as additional “residues” following the sequence of macromolecules. rna distance map distance maps are richer in data than contact maps, and essentially preserve all the information required to infer the details of 3d structure, with the exception of the handedness, which can be imposed on a higher level of reasoning, because we know the stereochemistry of nucleic acid structures. as with contact maps, rnamap2d does not generate a map of distances between individual atoms; if multiple atoms are considered per residue, the shortest distance is taken for each pair of residues. one option for visualization of distance maps is the contact map view. this feature allows the user to optionally convert a distance map into a series of contact maps, calculated at different thresholds. new contact maps are calculated and visualized instantly, as the user changes the maximal distance parameter defining a contact, by using a mouse roller. this enables a user to establish a subjectively optimal distance threshold parameter value for the purpose of obtaining a contact map that highlights certain molecular features. following the calculation of a distance map, the user is given an option to define the absolute distance limits, by entering minimal or maximal distance and the minimal sequential separation of nucleotides to be considered. the results are visualized instantly as well. rna secondary structure the calculated secondary structure can be written in the popular vienna format as a dot-bracket string. rnamap2d recognizes pseudoknots, for which special bracket symbols are used in the dot-bracket string. if an rna secondary structure file is uploaded, rnamap2d can display the watson-crick base pairs as a simplified contact map. rnamap2d can read the vienna, ct, and bpseq secondary structure formats. pseudoknotted base pairs are shown in grey. contact maps of complexes involving different types of molecules nucleic acids usually function in complex with proteins, and many structures of protein-nucleic acid complexes have been determined experimentally. in the pdb database, there are such entries as of april 11th contributing to % of the total pdb records. rnamap2d is capable of either extracting nucleic acid chains from a complex structure in order to visualize them separately or it can include the coordinates of the protein component and display protein-nucleic acid interactions. a contact map of a protein-nucleic acid complex is visually divided into three distinct parts for intra-protein contacts, intra-nucleic acid contacts and intermolecular contacts between the two entities. these three categories can be colored differently for better visual distinction. whenever possible, rnamap2d utilizes protein secondary structure definitions found in a pdb file, and displays them along the ruler of the contact map, alongside the rna secondary structure bars. comparison of contact maps rnamap2d can compare two rna structures in two modes: molecules that have an identical number of residues, or molecules that contain a common chain with residues with corresponding numbers. the input can be either a single pdb file with two models, or two separate files, e.g. a 3d model and a reference structure. the sequences do not need to be identical. thus, it is possible to compare two models of the same rna, sub-structures of different molecules, e.g. homologs with similar structure but different sequence, etc. in either case, two contact maps are shown concurrently, with the first structure in the lower-left triangle, the second in the upper-right triangle. contacts common to both structures are shown as white dots, while contacts specific to either structure are in grey. in figure  and we compared the crystal structure of the azoarcus group i intron with a 3d model for built on a template from the twort phage using moderna. the reference structure is 198nt long and contains several tertiary contacts that were constructed using a second template from tetrahymena. twelve residues at the 3′ end are not present in the model. the all-atom rmsd of the model versus crystal structure is Å. the contact map analysis allowed us to identify small differences in contacts between the model and the reference structure, mainly in loops and in the tertiary motifs. figure  illustrates another example, namely the comparison of one of our models constructed in the framework of the ‘rna puzzles’ challenge. for this modeling exercise, the secondary structure of the ‘rna square’ molecule composed of eight individual strands, as well as three-dimensional coordinates of the four strands were provided, and the task was to model the structure and contacts made by the four “missing” strands. figure  presents a superpositon of the crystal structure shown in cyan and a model generated by the bujnicki group shown in red. this model has been evaluated as the most accurate prediction for this molecule within the rna puzzles challenge. the comparison of contact maps with rnamap2d shows that secondary structures have been modeled correctly, and a significant fraction of tertiary contacts observed in the crystal structure are also present in the theoretical model. comparison of structural ensembles another ability of rnamap2d is to analyze results of calculations, which typically generate not just one solution, but entire ensembles. such studies include rna and rnp structure determination by nmr, and computational structure modeling approaches, such as de novo folding or protein-rna docking. for such ensembles comprising sets of complexes a statistical contact map can be calculated to visualize the frequencies of contacts in the ensemble as shades of grey. rnamap2d users can choose between two ways to display contacts that vary through the model ensemble file. in both cases, white fields on the map represent 100% frequency across a model set, and black fields represent no contacts. for contacts that appear only in a fraction of models, one option of visualization presents a relative frequency of contacts, where and shades of grey correspond to intermediate values. another option is to present all “partial” contacts by one shade of grey. in an example analysis, we have analyzed the noncanonical base pairs in a part of the 3′ utr from turnip crinkle virus genomic rna. this 102-nt structural element binds to the large ribosomal subunit to promote translation. the structure consists of three main helices. in the nmr structure, models have been deposited. rnamap2d can be used to check e.g. whether noncanonical base pairs are maintained in all the models. we used rnamap2d to generate a contact map for the ensemble and then colored noncanical pairs in blue. we have inspected individual pairs in the map zoomed to a fullscreen mode and generated a statistics map and exported the contact frequencies to an excel table. in the contact map, regions that vary in the ensemble are immediately visible as grey areas. for instance tertiary interactions between hairpin loop 37– and the structure fluctuate, and base pairing in this region is not stable. in total, we identified noncanonical base pairs, of which four differ in at least one of the models. the three noncanonical pairs g9-g g29-u and a70-c differ in only one of the models. the fourth pair, cis-watson-watson u67-c is present in four models only. it varies a lot between the models and the participating bases can also pair in the cis-watson-hoogsteen mode. residues adjacent to a and c display some flexibility in the contact map as well. this pair is located in an internal loop that is important for switching between translation and replication in the virus. we conclude that rnamap2d helps to identify regions that undergo conformational changes by highlighting them in the graphical output, and enables their quantitative examination in a tabular report.  rnamap2d is a new tool for calculation and visualization of nucleic acid contact and distance maps. our aim was to facilitate analyses of rna structures that focus on type and location of short-range interactions, without taking the spatial conformation of the backbone into account. rnamap2d is also capable of analyzing protein-nucleic acid complexes. rnamap2d is applicable in various scenarios, ranging from comparison of rna 2d and 3d structural predictions with each other and with the native structure, to analyses of trajectories from md simulations of nucleic acid structures, to studies of rna/dna-protein and rna/dna-ligand interactions and analyses of macromolecular docking experiments. protmap2d and rnamap2d both provide researchers with an extensive suite of programs for analyses and visualization of macromolecular structures. rnamap2d runs on any modern operating system, is very fast and has an intuitive interface. both programs serve as a complete platform that supplements the existing 3d visualization tools, with sophisticated 2d map capabilities. availability and requirements project name: rnamap2d project home page: http://iimcb.genesilico.pl/rnamap2d.html operating systems: windows, linux, macosx. programming languages: python, c/c++ software packages: none software packages: python, biopython, pycogent, wxpython. pil. numeric, numpy. pyexcelerator.3 other requirements: rnaview program is recommended as an optional plugin. please refer to user’s manual and readme file for installation instructions to be found on the rnamap2d project home page. hardware requirements: min. mb ram, 1ghz cpu or better. license: rnamap2d is distributed under free academic license. please refer to the home page for the license document. restriction for non-academics: users willing to use rnamap2d for non-academic purposes should contact the corresponding author for details. please note that this license will not affect commercial usage of rnaview. please contact authors of rnaview for a separate license. abbreviations pdb: protein databank; pil: python image library; casp: critical assessment of techniques for protein structure prediction; csv: comma-separated values; ct: connectivity table. competing interests authors declare that they have no competing interests. authors’ contributions ns participated in majority of the code implementation, including most of the features specific for rna. mp co-supervised the work of ns, contributed the code of protmap2d, participated in the development of the code, developed the final version of the software, and drafted the manuscript. kr co-supervised the work of ns, and participated in the development of the code. jmb conceived of the study, participated in design and coordination, and edited the manuscript. all authors read and approved the final manuscript. 
molecular structures, however, can be represented as 2d maps of interactions between the individual residues, which are easier to visualize and compare, and which can be reconverted to 3d structures with reasonable precision. it also discriminates between different types of base pairing and stacking. the program addresses the problem of paucity of bioinformatics tools dedicated to analyzing rna 2d maps, given the growing number of experimentally solved rna structures in the protein data bank repository, as well as the growing number of tools for rna 2d and 3d structure prediction. three-dimensional structures of proteins, nucleic acids, or their complexes, are difficult to visualize in detail on flat surfaces, and algorithms for their spatial superposition and comparison are computationally costly. there are many visualization tools for maps of protein structures, but few for nucleic acids. we developed rnamap2d, a platform-independent software tool for calculation, visualization and analysis of contact and distance maps for nucleic acid molecules and their complexes with proteins or ligands. contact mapsdistance mapsrna secondary structurerna base pairingrna stackingprotein-rna complexdocking the structures of biological macromolecules provide a framework for studying their biological functions. rnamap2d allows for calculation and analysis of contacts and distances between various classes of atoms in nucleic acid, protein, and small ligand molecules. rnamap2d is an easy to use method to visualize, analyze and compare structures of nucleic acid molecules and their complexes with other molecules, such as proteins or ligands and metal ions.
 the structures of biological macromolecules provide a framework for studying their biological functions. three-dimensional structures of proteins, nucleic acids, or their complexes, are difficult to visualize in detail on flat surfaces, and algorithms for their spatial superposition and comparison are computationally costly. molecular structures, however, can be represented as 2d maps of interactions between the individual residues, which are easier to visualize and compare, and which can be reconverted to 3d structures with reasonable precision. there are many visualization tools for maps of protein structures, but few for nucleic acids.  we developed rnamap2d, a platform-independent software tool for calculation, visualization and analysis of contact and distance maps for nucleic acid molecules and their complexes with proteins or ligands. the program addresses the problem of paucity of bioinformatics tools dedicated to analyzing rna 2d maps, given the growing number of experimentally solved rna structures in the protein data bank repository, as well as the growing number of tools for rna 2d and 3d structure prediction. rnamap2d allows for calculation and analysis of contacts and distances between various classes of atoms in nucleic acid, protein, and small ligand molecules. it also discriminates between different types of base pairing and stacking.  rnamap2d is an easy to use method to visualize, analyze and compare structures of nucleic acid molecules and their complexes with other molecules, such as proteins or ligands and metal ions. its special features make it a very useful tool for analysis of tertiary structures of rnas. rnamap2d for windows/linux/macosx is freely available for academic users at http://iimcb.genesilico.pl/rnamap2d.html contact mapsdistance mapsrna secondary structurerna base pairingrna stackingprotein-rna complexdocking 