BACKGROUND
mass spectrometry has proven essential in structural studies in which biopolymer molecules of a variety of polymer chemistries are involved.
indeed, while proteins were once the main biopolymeric analytes studied by mass spectrometry, oligoribonucleotides and saccharides also are routinely analyzed today and mass spectrometry is used, for example, for the characterization of dna-protein complexes or for the gas phase sequencing of saccharides .
the current and ever-increasing variety of mass spectrometer designs affords a rather large array of experiments that can be performed on different biopolymers.
thus, the variety of polymer chemistries analyzable by mass spectrometry is compounded by the variety of mass spectrometric experiments, producing an extremely diverse set of mass data to be either predicted or analysed with the help of appropriate software tools.
it is noteworthy that, while some experiments are almost completely automatable , a majority of the experiments being performed in mass spectrometry facilities are neither automatable nor high-throughput.
for example, one field of biochemistry that has massively benefited from the mass spectrometry improvements over the last ten years is the one involving fine structural characterizations of chemically modified biopolymers, like the post-translational modification studies in protein biochemistry .
studies like the ones described in  <cit>  and  <cit>  were not automatable at the time these were performed, and fact is that these are still not automatable today: flexible tools are still needed to help human-driven interpretation of mass spectrometric data obtained on structurally complex biological analytes.
as soon as biopolymers were successfully analyzed by mass spectrometry, a number of tools were made available to perform calculations on proteins or nucleic acids.
these tools might be used across the network, such as the tools accessible at the expasy portal  <cit>  or the ones published in  <cit> .
locally-installed software is also available, with the massxpert software  <cit> , the gpmaw program  or the sos program  <cit> .
one problem with the current situation, though, is that each of these programs was designed to work with a given polymer chemistry, thus each time a mass spectrometric analysis is performed on a different biopolymer, a different tool has to be used.
the gnu polyxmass software framework was designed to bring a solution to the problem above by providing a number of modules where the user might 1) define any number of polymer chemistries, 2) use polymer chemistry definitions to perform quick mass calculations and 3) graphically edit polymer sequences and perform complex simulations of chemical reactions and mass spectrometric experiments.
implementation
creating mass spectrometry software usable with any kind of polymer chemistry did require to elaborate and implement an abstraction layer between on the one hand, the graphical sequence editor and on the other hand, the simulation and mass computation engines.
the implementation of this abstraction layer takes the final form of a number of packages, as described below.
software development and source tree architecture
the software is developed on a debian gnu/linux platform in the "testing/etch" version.
this project is structured in a number of packages, two of which are binary packages  and two of which are data packages .
the binary packages
the libpolyxmass and polyxmass-bin packages contain code that is exclusively written in the c language.
the dependencies of the gnu polyxmass software are described in figure  <dig>  to maintain a clean separation between low-level code and graphical user interface high-level code, the software project is organized in two distinct code trees: libpolyxmass and polyxmass-bin .
thus, the code in libpolyxmass deals with the modelling of all the chemical entities and reactions  and with a number of housekeeping functions .
the code in polyxmass-bin is directly related to the graphical user interface functionality, thus relying on a number of graphics-oriented libraries .
the data packages
the polyxmass-common and polyxmass-data packages contain polymer chemistry data files and example polymer sequence files ; the former package is considered essential and contains the reference atom definition file  along with all the files that make together the "protein" polymer chemistry definition.
the latter package is optional and contains the polymer chemistry definition data for polymer types "dna", "rna" and "saccharide".
configuration data are stored in simple text format files which are read by home-coded functions .
code is subjected to versioning control  and is available from
terminological issues
before describing the details of the software project, it is necessary to put forth terminological decisions we had to take.
indeed, each bio-polymer chemistry has its own set of specific terms to refer to chemical entities in its realm.
for example, sugars have "reducing ends" and "monoses", proteins have "n-terminal" and "c-terminal" ends and "residues", and nucleic acids have "3'-oh" and "5'-p" ends and "nucleotides".
during the development of gnu polyxmass, we promoted the use of a unified glossary in describing bio-polymer entities, so as to be as generic as possible.
"monomer" refers to the chemical entity that has become part of a polymer sequence chain, that is after its polymerization .
the denomination of the extremities of the polymer sequence are "left end" and "right end" .
the chemical groups that cap the polymer sequence are called "caps".
there is one chemical cap per end.
finally, the equivalent of a protein sequence is called "polymer sequence" and the equivalent of an oligonucleotide is called an "oligomer".
RESULTS
the software complexity has been concealed behind an intuitive graphical user interface.
gnu polyxmass is mainly operated through a single binary program  that integrates three distinct functionalities organized in modules that can be conveniently called through menu items:
• polyxdef: this module lets the user perform the definition of atoms and of brand new polymer chemistries ;
• polyxcalc: this module provides a desktop polymer chemistry-aware mass calculator in which mass computations can be performed without the need to edit polymer sequences;
• polyxedit: this module provides the main functionalities of the software framework.
it provides a polymer sequence editor in an environment where the user will trigger all the biochemical and mass spectrometric simulations through simple menu interactions.
in the following section, the operation of each module will be reviewed, along with a description of its tasks.
the polyxdef module
the polyxdef module is used to perform atom definitions  and polymer chemistry definitions .
the use of the module is very intuitive.
the formats of the files saved by the polyxdef module are described below, along with explanations about the rationale for their specific design.
atom definition file format
no mass is ever hard-coded in the software: in gnu polyxmass, any entity that is ponderable  must have a formula associated with it.
when masses are computed, formulas are challenged against an atom definition file that lists, for each chemical element, its corresponding isotopic mass/abundance pairs.
the following excerpt from the atoms.xml file in the distribution shows the xml structure that was used to allow the dynamic generation of fully characterized atoms.
<atom>
<name>hydrogen</name>
<symbol>h</symbol>
<isotope>
<mass> <dig> </mass>
<abund> <dig> </abund>
</isotope>
<isotope>
<mass> <dig> </mass>
<abund> <dig> </abund>
</isotope>
</atom>
each chemical element has a monoisotopic mass that corresponds to the lightest isotope's mass; the average mass is computed by considering all the isotopes of the chemical element.
the atom average masses are computed dynamically once, when the atom definition file is loaded from disk.
there can be any number of distinct atom definition files on the system.
polymer chemistry definition file format
the polymer chemistry definition constitutes the most evident mechanism by which to achieve a full uncoupling between the sequence editor and the mass calculation engine.
each polymer chemistry type  has such a definition file, where all aspects of its chemistry are documented.
the following code excerpts were taken from the protein.xml file in the distribution.
they illustrate the way in which the polymer chemistry definition is parted into xml nodes documenting the different chemical entities that make such chemical definition: monomers, modifications, chemical/enzymatic cleavages, gas-phase fragmentations, chemical end caps, ionization rule.
all of these entities are reviewed below.
monomers
<codelen>3</codelen>
<monomers>
<mnm>
<name>glycine</name>
<code>g</code>
<formula>c2h3no</formula>
</mnm>
...
</monomers>
because polymers are the result of the concatenation of monomers, listing the monomers that might enter in the composition of the polymer sequence is obviously the first step in defining a polymer chemistry.
monomers are defined as having a name, a code and a formula.
the <codelen> element specifies the number of characters allowed to define a monomer code.
this is a value that has a polymer chemistry definition scope.
one common arbitrary limitation with mass spectrometry programs is that the editing of the sequence can be performed using only one letter-long monomer codes .
gnu polyxmass removes this limitation with the design and implementation of sophisticated algorithms that make it possible to use any number of alphabetical characters to form a monomer code.
the syntactic rule governing the formation of a code is that the first letter must be uppercase and all the remaining ones lowercase.
this is particularly useful when working with modified monomers, in which case using more letters may help differentiating monomers with different modifications.
for example, with a <codelen> element of value  <dig>  'y' could be used for un-modified tyrosinyl residues, "yp" after its phosphorylation and "ys" after its sulphation.
modifications
<modifs>
<mdf>
<name>phosphorylation</name>
<actform>-h+h2po3</actform>
</mdf>
...
</modifs>
modifications also are polymer chemistry-specific.
note the peculiar formula which characterizes them, which is called an "actform", short for "action-formula".
the net mass change, upon modification of the polymer sequence, is applied after computation of the net formula by subtracting the atoms prefixed with the '-' sign from the atoms prefixed with the '+'  sign.
this notation has the advantage of being more meaningful from a chemical reaction standpoint, as it closely represents it, with the interplay of the leaving and the entering groups at the target biopolymer molecule level.
cleavage specifications
<cleavespecs>
<cls>
<name>cyanogenbromide</name>
<pattern>m/</pattern>
<clr>
<re-mnm-code>m</re-mnm-code>
<re-actform>-ch2s+o</re-actform>
</clr>
</cls>
<cls>
<name>trypsin</name>
<pattern>k/;r/;-k/p</pattern>
</cls>
...
</cleavespecs>
enzymatic/chemical cleavage agents  belong to the polymer chemistry definition.
the example of cyanogen bromide, as a cleaving chemical agent, illustrates the flexibility of the definition language: when a protein sequence is cleaved with cyanogen bromide, the methionyl residue that got cleaved at its c-terminal side is chemically transformed to a homoseryl residue.
that reaction is described using the actform "-ch2s + o" and is only applied to the generated peptides if the methionyl residue is located at its c-terminus .
fragmentation specifications
<fragspecs>
<fgs>
<name>a</name>
<end>le</end>
<actform>-c101</actform>
<fgr>
<name>a-fgr-1</name>
<actform>-h2o</actform>
<prev-mnm-code>e</prev-mnm-code>
<this-mnm-code>d</this-mnm-code>
<next-mnm-code>f</next-mnm-code>
<comment>comment here!</comment>
</fgr>
...
</fgs>
...
<fgs>
<name>imm</name>
<end>ne</end>
<actform>-c1o1+h1</actform>
</fgs>
</fragspecs>
gas-phase fragmentation patterns  are defined using a powerful syntax.
a fragmentation specification lists the following data:
• name: this is the name of the fragmentation pattern, and will be used to craft each fragment's name;
• end: this datum specifies which side of the polymer chain will make the fragment after the fragmentation occurred.
in protein chemistry, the 'a' fragmentation pattern describes the ions corresponding to the sequence portion left of the fragmentation location  <cit> .
in gnu polyxmass, three values are acceptable: "le" for left end, "re" for right end and "ne" for specific fragmentation cases like immonium ions in protein chemistry;
• fgr: any number of fragmentation rules  can be defined that will be applied to the fragment ions if sequence topological conditions are verified.
the example a-fgr- <dig> fragrule states that if fragmentation occurs at a monomer of code 'd'  and that the previous monomer in sequence has a code 'e' and that the next monomer in sequence has a code 'f', then the actform "-h2o" should be applied to the fragment ion;
this fragmentation specification grammar is flexible enough to allow the description of highly complex fragmentation patterns such as those observed in saccharidic gas-phase fragmentations  <cit> .
indeed, fragmentation patterns that depend on the identity of the monomer at which the fragmentation occurs  can be modelled using the provided grammar.
for example, the "a-b" fragmentation pattern observed in oligonucleotide fragmentation is easily supported in gnu polyxmass.
internal fragments generation is not supported yet.
end cap chemistry
<leftcap>+h</leftcap>
<rightcap>+oh</rightcap>
the mere concatenation of monomers only yields a residual chain of monomers, and not a polymer in its finished polymerization state.
thus, it is necessary to provide chemical definitions of how the residual monomeric chain gets capped to finish the polymerization.
in protein chemistry, the left  and right  caps are the proton and the hydroxyl group, respectively.
ionization rule
<ionizerule>
<actform>+h</actform>
<charge>1</charge>
<level>1</level>
</ionizerule>
a default ionization rule is defined in the <ionizerule> element according to the following scheme:
• actform: this is the chemical representation of the ionization reaction.
for proteins, protonation is by far the most often used ionization mechanism, while for a number of polymers  the best ionization mechanism is not protonation, but cationization with metal ions;
• charge: this is the charge that is brought to the polymer sequence after the ionization reaction took place.
protonation-based ionizations bring a charge of one;
• level: this is the number of times that the ionization reaction should be performed on the polymer sequence.
usually mono-protonation is the preferred ionization level for peptides.
once a polymer chemistry has been defined, its definition file might be used to compute masses with the calculator  or to edit sequences and to trigger biochemical and mass spectrometric simulations on these .
the polyxcalc module
the polyxcalc module is shown in figure  <dig>  by default, any computation might be performed by using atoms and formulas.
however, if a polymer chemistry definition is loaded into the calculator, then all the chemical entities defined in it are made available for the calculations.
this is illustrated in the figure, where the "protein" polymer definition was loaded.
it is possible to feed the calculator with initial masses  so that they are taken into account during the calculations.
interestingly, it is possible to program the calculator with a simple text file, which leads to the creation of a "chemical pad" .
clicking onto one chempad button triggers the computation that was programmed for it.
there is no limitation on the number of buttons available in the chempad.
there might be one chempad configuration file per polymer chemistry definition or a single default configuration file that will be used whatever the polymer chemistry being loaded in the calculator.
a scrolling logbook recorder ensures that all the operations are logged in their smallest detail.
the polyxedit module
the polyxedit module is the most featureful module of the program.
this section first describes the critical mechanisms that ensure that all the simulations performed with polymer sequences are using the proper polymer chemistry definition.
next, the different functionalities presented by polyxedit will be reviewed briefly.
chemical consistency between a sequence and the biochemical and mass spectrometric simulations
because gnu polyxmass allows any number of polymer sequences of any polymer chemistry to be open simultaneously, it is essential that the thread connecting a given polymer sequence to its related polymer chemistry definition be permanently in order.
this essential trait of gnu polyxmass is illustrated in figure  <dig> where the left shaded area represents the memory status of the program, with four polymer sequences opened .
the first two sequences are of the same "protein" polymer chemistry definition, while the other ones are of polymer chemistry definitions "dna" and "protein-nmr".
each sequence stores a pointer to its corresponding polymer chemistry definition .
all the polymer chemistry definitions in use at any given point in time are stored in a global array .
reference counting management of the polymer chemistry definitions ensure the tightest memory use.
each polymer chemistry definition is required to have an atom definition with which to calculate masses and therefore must store a pointer to its corresponding atom definition .
because any number of polymer sequences of any polymer chemistry definition might be open at any given point in time, it is necessary to store all the available atom definitions in an array ad hoc .
the non-shaded part of the figure shows the mechanisms by which the program ensures, upon opening of a polymer sequence file, that the proper polymer chemistry definition is available, either already in memory or accessible on the disk.
indeed, a polymer chemistry definition is absolutely required in order to interpret correctly the sequence data contained in the sequence file: a given sequence–like "atgc", for example–might mean different things depending on the polymer chemistry for which it was edited .
the action "open sequence file" triggers code that will inspect the polymer sequence file in search for a <type> xml element that documents the polymer chemistry definition of the sequence.
that discovery process yields, in our example, "protein" as the polymer chemistry definition type.
thus, the sequence being opened is a protein sequence.
the algorithm checks if the polymer chemistry definition is already available in the global array of polymer chemistry definitions.
if so, there is no need to load that chemistry definition file into memory and the program goes on to load the polymer sequence.
if not, the program has to first load the polymer chemistry definition from a file.
the name of that file is discovered by reading a dictionary file that makes the link between a polymer chemistry definition  and the location of its corresponding file on disk.
when the polymer chemistry definition file is successfully loaded, it is made available to the whole program by storing its pointer in the global array of polymer chemistry definitions mentioned above.
the loading of the polymer sequence can continue, and if successful, the sequence will point to the polymer chemistry definition just loaded.
this mechanism enforces the rule that any given sequence loaded from disk has to be attached to the proper polymer chemistry definition, thus ensuring that the biochemical and mass spectrometric simulations that are performed on the sequence actually make use of the proper chemical entities as defined in the right polymer chemistry definition file.
graphical editing of polymer sequences
polymer sequence editing will certainly be reminiscent of any simple text file editing task; however, the internals of the polymer sequence editor are rather innovative.
indeed, from a graphical perspective, the polymer sequence editor enables a complete decoupling between the polymer sequence as it is stored in the polymer sequence xml file and the way it gets represented graphically.
this is shown in figure  <dig>  which shows two polymer sequences: a "protein" sequence on the left and a "saccharide" sequence on the right.
the mechanism that allows this differential display of sequences of different polymer chemistry definitions is based on dictionary files.
each polymer chemistry definition has a dictionary  that lists, for each monomer code, the corresponding graphics file to be used to render it graphically in the sequence editor .
the user is empowered to define any aspect of that graphical rendering since the graphical files can be freely modified or created anew.
noteworthy, if the graphics files are stored in the scalar vector graphics  format, then the program will be able to scale the sequence representation still retaining the best definition for the screen it is displayed onto .
this effect is obtained by rendering in memory–with the new resolution–each svg file as a portable network graphics  pixmap.
the png pixmaps are then graphically composited onto the sequence editor canvas to reconstitute the polymer sequence.
chemical modifications of the monomers can be rendered graphically by compositing a transparent pixmap onto the monomer icon to be modified.
for example, in the left sequence of figure  <dig>  the 's' monomer icon was modified by compositing onto it a transparent pixmap with a red 'p' graphical element .
this is unlimitedly configurable, because the transparent graphics files representing chemical modifications are–like described above– freely modifiable or can be created anew.
available simulations
when a polymer sequence is opened in the sequence editor, as shown in figure  <dig>  all the simulations and computations are automatically made available in the editor menus.
the simulations and computations that are available through the sequence editor menus are:
• chemical modifications of individual monomers or of the polymer sequence as a whole on its left/right ends ;
• chemical/enzymatic cleavage of a polymer sequence, with automatic fully configurable mass calculations ;
• gas-phase fragmentation of an oligomer, with automatic fully configurable mass calculations.
the process here is in any aspect comparable to what was described above for the cleavage of polymer sequences;
• mass-to-charge  ratio calculations with the ability to change the chemical ionization agent on the fly ;
• calculation of the composition of a polymer sequence ;
• isoelectric point calculations of polymer sequences, optionally taking into account chemical modifications ;
• matching operations between data extracted from a real mass spectrum and data generated in silico by gnu polyxmass.
the procedure is to deisotope the mass spectrum and to compute the centroid for the remaining peaks.
all the centroid peaks are listed in a peak list.
such list is then fed into gnu polyxmass and all the masses it contains can be matched with a gnu polyxmass-generated theoretical mass spectrum.
• annotation of the whole polymer sequence or of single monomers;
• fully customizable find/replace operations;
• full reporting of all the results in a spreadsheet-friendly ascii format.
CONCLUSIONS
the gnu polyxmass software is an integrated mass spectrometric software framework that allows biochemists and massists to perform biochemical and mass spectrometric simulations on polymer sequences of any polymer chemistry.
the software design that drove the implementation of gnu polyxmass constitutes an improvement over the current situation, in which each time a mass spectrometric experiment is performed on a different polymer chemistry , the data it yields have to be analyzed using a different software tool.
we find gnu polyxmass useful in our day-to-day mass spectrometric work on proteins and peptides, serving as a mass data prediction and mass data analysis tool.
we also have used gnu polyxmass successfully as an education tool, as it behaves exactly like a mass spectrometer, allowing a great number of mass spectrometry concepts to be experimented virtually.
this software framework was implemented with configurability and flexibility in mind and with the idea that no arbitrary limit should be imposed on the user.
it is published under a free software license in the hope to form a community around it, to continue and further its adoption and development as a research and education tool.
future developments
the gnu polyxmass software framework will be made extensible by use of the python scripting language.
further, it is envisaged to integrate a mass spectrum visualization tool that will be able to render mass spectrometric data files of recently published xml-based open formats mzxml  <cit>  and mzdata  <cit> .
easy graphical differential display between theoretically and experimentally obtained mass spectra might thus be made possible in gnu polyxmass.
features like cross-links and ramification of polymers are being elaborated upon and might find their way in future releases.
availability and requirements
• project name: gnu polyxmass;
• project home page:
• operating system: gnu/linux, unix, mac os x/fink;
• programming language: c;
• license: gnu general public license;
authors' contributions
the author developed the ideas presented in this paper, did the software project analysis, designed the data file formats, programmed all the software, did the testing, and wrote the report.

 mass spectrometry has proven essential in structural studies in which biopolymer molecules of a variety of polymer chemistries are involved. indeed, while proteins were once the main biopolymeric analytes studied by mass spectrometry, oligoribonucleotides and saccharides also are routinely analyzed today and mass spectrometry is used, for example, for the characterization of dna-protein complexes or for the gas phase sequencing of saccharides. the current and ever-increasing variety of mass spectrometer designs affords a rather large array of experiments that can be performed on different biopolymers. thus, the variety of polymer chemistries analyzable by mass spectrometry is compounded by the variety of mass spectrometric experiments, producing an extremely diverse set of mass data to be either predicted or analysed with the help of appropriate software tools. it is noteworthy that, while some experiments are almost completely automatable, a majority of the experiments being performed in mass spectrometry facilities are neither automatable nor high-throughput. for example, one field of biochemistry that has massively benefited from the mass spectrometry improvements over the last ten years is the one involving fine structural characterizations of chemically modified biopolymers, like the post-translational modification studies in protein biochemistry. studies like the ones described in and were not automatable at the time these were performed, and fact is that these are still not automatable today: flexible tools are still needed to help human-driven interpretation of mass spectrometric data obtained on structurally complex biological analytes. as soon as biopolymers were successfully analyzed by mass spectrometry, a number of tools were made available to perform calculations on proteins or nucleic acids. these tools might be used across the network, such as the tools accessible at the expasy portal or the ones published in. locally-installed software is also available, with the massxpert software, the gpmaw program or the sos program. one problem with the current situation, though, is that each of these programs was designed to work with a given polymer chemistry, thus each time a mass spectrometric analysis is performed on a different biopolymer, a different tool has to be used. the gnu polyxmass software framework was designed to bring a solution to the problem above by providing a number of modules where the user might 1) define any number of polymer chemistries, 2) use polymer chemistry definitions to perform quick mass calculations and 3) graphically edit polymer sequences and perform complex simulations of chemical reactions and mass spectrometric experiments. implementation creating mass spectrometry software usable with any kind of polymer chemistry did require to elaborate and implement an abstraction layer between on the one hand, the graphical sequence editor and on the other hand, the simulation and mass computation engines. the implementation of this abstraction layer takes the final form of a number of packages, as described below. software development and source tree architecture the software is developed on a debian gnu/linux platform in the "testing/etch" version. this project is structured in a number of packages, two of which are binary packages and two of which are data packages. the binary packages the libpolyxmass and polyxmass-bin packages contain code that is exclusively written in the c language. the dependencies of the gnu polyxmass software are described in figure to maintain a clean separation between low-level code and graphical user interface high-level code, the software project is organized in two distinct code trees: libpolyxmass and polyxmass-bin. thus, the code in libpolyxmass deals with the modelling of all the chemical entities and reactions and with a number of housekeeping functions. the code in polyxmass-bin is directly related to the graphical user interface functionality, thus relying on a number of graphics-oriented libraries. the data packages the polyxmass-common and polyxmass-data packages contain polymer chemistry data files and example polymer sequence files; the former package is considered essential and contains the reference atom definition file along with all the files that make together the "protein" polymer chemistry definition. the latter package is optional and contains the polymer chemistry definition data for polymer types "dna", "rna" and "saccharide". configuration data are stored in simple text format files which are read by home-coded functions. code is subjected to versioning control and is available from terminological issues before describing the details of the software project, it is necessary to put forth terminological decisions we had to take. indeed, each bio-polymer chemistry has its own set of specific terms to refer to chemical entities in its realm. for example, sugars have "reducing ends" and "monoses", proteins have "n-terminal" and "c-terminal" ends and "residues", and nucleic acids have "3'-oh" and "5'-p" ends and "nucleotides". during the development of gnu polyxmass, we promoted the use of a unified glossary in describing bio-polymer entities, so as to be as generic as possible. "monomer" refers to the chemical entity that has become part of a polymer sequence chain, that is after its polymerization. the denomination of the extremities of the polymer sequence are "left end" and "right end". the chemical groups that cap the polymer sequence are called "caps". there is one chemical cap per end. finally, the equivalent of a protein sequence is called "polymer sequence" and the equivalent of an oligonucleotide is called an "oligomer".  the software complexity has been concealed behind an intuitive graphical user interface. gnu polyxmass is mainly operated through a single binary program that integrates three distinct functionalities organized in modules that can be conveniently called through menu items: • polyxdef: this module lets the user perform the definition of atoms and of brand new polymer chemistries; • polyxcalc: this module provides a desktop polymer chemistry-aware mass calculator in which mass computations can be performed without the need to edit polymer sequences; • polyxedit: this module provides the main functionalities of the software framework. it provides a polymer sequence editor in an environment where the user will trigger all the biochemical and mass spectrometric simulations through simple menu interactions. in the following section, the operation of each module will be reviewed, along with a description of its tasks. the polyxdef module the polyxdef module is used to perform atom definitions and polymer chemistry definitions. the use of the module is very intuitive. the formats of the files saved by the polyxdef module are described below, along with explanations about the rationale for their specific design. atom definition file format no mass is ever hard-coded in the software: in gnu polyxmass, any entity that is ponderable must have a formula associated with it. when masses are computed, formulas are challenged against an atom definition file that lists, for each chemical element, its corresponding isotopic mass/abundance pairs. the following excerpt from the atoms.xml file in the distribution shows the xml structure that was used to allow the dynamic generation of fully characterized atoms. <atom>    <name>hydrogen</name>    <symbol>h</symbol>    <isotope>          <mass> </mass>          <abund> </abund>    </isotope>    <isotope>          <mass> </mass>          <abund> </abund>    </isotope> </atom> each chemical element has a monoisotopic mass that corresponds to the lightest isotope's mass; the average mass is computed by considering all the isotopes of the chemical element. the atom average masses are computed dynamically once, when the atom definition file is loaded from disk. there can be any number of distinct atom definition files on the system. polymer chemistry definition file format the polymer chemistry definition constitutes the most evident mechanism by which to achieve a full uncoupling between the sequence editor and the mass calculation engine. each polymer chemistry type has such a definition file, where all aspects of its chemistry are documented. the following code excerpts were taken from the protein.xml file in the distribution. they illustrate the way in which the polymer chemistry definition is parted into xml nodes documenting the different chemical entities that make such chemical definition: monomers, modifications, chemical/enzymatic cleavages, gas-phase fragmentations, chemical end caps, ionization rule. all of these entities are reviewed below. monomers <codelen>3</codelen> <monomers>    <mnm>       <name>glycine</name>       <code>g</code>       <formula>c2h3no</formula>    </mnm>   ... </monomers> because polymers are the result of the concatenation of monomers, listing the monomers that might enter in the composition of the polymer sequence is obviously the first step in defining a polymer chemistry. monomers are defined as having a name, a code and a formula. the <codelen> element specifies the number of characters allowed to define a monomer code. this is a value that has a polymer chemistry definition scope. one common arbitrary limitation with mass spectrometry programs is that the editing of the sequence can be performed using only one letter-long monomer codes. gnu polyxmass removes this limitation with the design and implementation of sophisticated algorithms that make it possible to use any number of alphabetical characters to form a monomer code. the syntactic rule governing the formation of a code is that the first letter must be uppercase and all the remaining ones lowercase. this is particularly useful when working with modified monomers, in which case using more letters may help differentiating monomers with different modifications. for example, with a <codelen> element of value'y' could be used for un-modified tyrosinyl residues, "yp" after its phosphorylation and "ys" after its sulphation. modifications <modifs>    <mdf>       <name>phosphorylation</name>       <actform>-h+h2po3</actform>    </mdf>   ... </modifs> modifications also are polymer chemistry-specific. note the peculiar formula which characterizes them, which is called an "actform", short for "action-formula". the net mass change, upon modification of the polymer sequence, is applied after computation of the net formula by subtracting the atoms prefixed with the'-' sign from the atoms prefixed with the'+' sign. this notation has the advantage of being more meaningful from a chemical reaction standpoint, as it closely represents it, with the interplay of the leaving and the entering groups at the target biopolymer molecule level. cleavage specifications <cleavespecs>    <cls>       <name>cyanogenbromide</name>       <pattern>m/</pattern>       <clr>          <re-mnm-code>m</re-mnm-code>          <re-actform>-ch2s+o</re-actform>       </clr>    </cls>    <cls>       <name>trypsin</name>       <pattern>k/;r/;-k/p</pattern>    </cls>   ... </cleavespecs> enzymatic/chemical cleavage agents belong to the polymer chemistry definition. the example of cyanogen bromide, as a cleaving chemical agent, illustrates the flexibility of the definition language: when a protein sequence is cleaved with cyanogen bromide, the methionyl residue that got cleaved at its c-terminal side is chemically transformed to a homoseryl residue. that reaction is described using the actform "-ch2s + o" and is only applied to the generated peptides if the methionyl residue is located at its c-terminus. fragmentation specifications <fragspecs>    <fgs>       <name>a</name>       <end>le</end>       <actform>-c101</actform>       <fgr>          <name>a-fgr-1</name>          <actform>-h2o</actform>          <prev-mnm-code>e</prev-mnm-code>          <this-mnm-code>d</this-mnm-code>          <next-mnm-code>f</next-mnm-code>          <comment>comment here!</comment>       </fgr>      ...    </fgs>   ...    <fgs>       <name>imm</name>       <end>ne</end>       <actform>-c1o1+h1</actform>    </fgs> </fragspecs> gas-phase fragmentation patterns are defined using a powerful syntax. a fragmentation specification lists the following data: • name: this is the name of the fragmentation pattern, and will be used to craft each fragment's name; • end: this datum specifies which side of the polymer chain will make the fragment after the fragmentation occurred. in protein chemistry, the'a' fragmentation pattern describes the ions corresponding to the sequence portion left of the fragmentation location. in gnu polyxmass, three values are acceptable: "le" for left end, "re" for right end and "ne" for specific fragmentation cases like immonium ions in protein chemistry; • fgr: any number of fragmentation rules can be defined that will be applied to the fragment ions if sequence topological conditions are verified. the example a-fgr- fragrule states that if fragmentation occurs at a monomer of code'd' and that the previous monomer in sequence has a code'e' and that the next monomer in sequence has a code'f', then the actform "-h2o" should be applied to the fragment ion; this fragmentation specification grammar is flexible enough to allow the description of highly complex fragmentation patterns such as those observed in saccharidic gas-phase fragmentations. indeed, fragmentation patterns that depend on the identity of the monomer at which the fragmentation occurs can be modelled using the provided grammar. for example, the "a-b" fragmentation pattern observed in oligonucleotide fragmentation is easily supported in gnu polyxmass. internal fragments generation is not supported yet. end cap chemistry <leftcap>+h</leftcap> <rightcap>+oh</rightcap> the mere concatenation of monomers only yields a residual chain of monomers, and not a polymer in its finished polymerization state. thus, it is necessary to provide chemical definitions of how the residual monomeric chain gets capped to finish the polymerization. in protein chemistry, the left and right caps are the proton and the hydroxyl group, respectively. ionization rule <ionizerule>    <actform>+h</actform>    <charge>1</charge>    <level>1</level> </ionizerule> a default ionization rule is defined in the <ionizerule> element according to the following scheme: • actform: this is the chemical representation of the ionization reaction. for proteins, protonation is by far the most often used ionization mechanism, while for a number of polymers the best ionization mechanism is not protonation, but cationization with metal ions; • charge: this is the charge that is brought to the polymer sequence after the ionization reaction took place. protonation-based ionizations bring a charge of one; • level: this is the number of times that the ionization reaction should be performed on the polymer sequence. usually mono-protonation is the preferred ionization level for peptides. once a polymer chemistry has been defined, its definition file might be used to compute masses with the calculator or to edit sequences and to trigger biochemical and mass spectrometric simulations on these. the polyxcalc module the polyxcalc module is shown in figure by default, any computation might be performed by using atoms and formulas. however, if a polymer chemistry definition is loaded into the calculator, then all the chemical entities defined in it are made available for the calculations. this is illustrated in the figure, where the "protein" polymer definition was loaded. it is possible to feed the calculator with initial masses so that they are taken into account during the calculations. interestingly, it is possible to program the calculator with a simple text file, which leads to the creation of a "chemical pad". clicking onto one chempad button triggers the computation that was programmed for it. there is no limitation on the number of buttons available in the chempad. there might be one chempad configuration file per polymer chemistry definition or a single default configuration file that will be used whatever the polymer chemistry being loaded in the calculator. a scrolling logbook recorder ensures that all the operations are logged in their smallest detail. the polyxedit module the polyxedit module is the most featureful module of the program. this section first describes the critical mechanisms that ensure that all the simulations performed with polymer sequences are using the proper polymer chemistry definition. next, the different functionalities presented by polyxedit will be reviewed briefly. chemical consistency between a sequence and the biochemical and mass spectrometric simulations because gnu polyxmass allows any number of polymer sequences of any polymer chemistry to be open simultaneously, it is essential that the thread connecting a given polymer sequence to its related polymer chemistry definition be permanently in order. this essential trait of gnu polyxmass is illustrated in figure where the left shaded area represents the memory status of the program, with four polymer sequences opened. the first two sequences are of the same "protein" polymer chemistry definition, while the other ones are of polymer chemistry definitions "dna" and "protein-nmr". each sequence stores a pointer to its corresponding polymer chemistry definition. all the polymer chemistry definitions in use at any given point in time are stored in a global array. reference counting management of the polymer chemistry definitions ensure the tightest memory use. each polymer chemistry definition is required to have an atom definition with which to calculate masses and therefore must store a pointer to its corresponding atom definition. because any number of polymer sequences of any polymer chemistry definition might be open at any given point in time, it is necessary to store all the available atom definitions in an array ad hoc. the non-shaded part of the figure shows the mechanisms by which the program ensures, upon opening of a polymer sequence file, that the proper polymer chemistry definition is available, either already in memory or accessible on the disk. indeed, a polymer chemistry definition is absolutely required in order to interpret correctly the sequence data contained in the sequence file: a given sequence–like "atgc", for example–might mean different things depending on the polymer chemistry for which it was edited. the action "open sequence file" triggers code that will inspect the polymer sequence file in search for a <type> xml element that documents the polymer chemistry definition of the sequence. that discovery process yields, in our example, "protein" as the polymer chemistry definition type. thus, the sequence being opened is a protein sequence. the algorithm checks if the polymer chemistry definition is already available in the global array of polymer chemistry definitions. if so, there is no need to load that chemistry definition file into memory and the program goes on to load the polymer sequence. if not, the program has to first load the polymer chemistry definition from a file. the name of that file is discovered by reading a dictionary file that makes the link between a polymer chemistry definition and the location of its corresponding file on disk. when the polymer chemistry definition file is successfully loaded, it is made available to the whole program by storing its pointer in the global array of polymer chemistry definitions mentioned above. the loading of the polymer sequence can continue, and if successful, the sequence will point to the polymer chemistry definition just loaded. this mechanism enforces the rule that any given sequence loaded from disk has to be attached to the proper polymer chemistry definition, thus ensuring that the biochemical and mass spectrometric simulations that are performed on the sequence actually make use of the proper chemical entities as defined in the right polymer chemistry definition file. graphical editing of polymer sequences polymer sequence editing will certainly be reminiscent of any simple text file editing task; however, the internals of the polymer sequence editor are rather innovative. indeed, from a graphical perspective, the polymer sequence editor enables a complete decoupling between the polymer sequence as it is stored in the polymer sequence xml file and the way it gets represented graphically. this is shown in figure which shows two polymer sequences: a "protein" sequence on the left and a "saccharide" sequence on the right. the mechanism that allows this differential display of sequences of different polymer chemistry definitions is based on dictionary files. each polymer chemistry definition has a dictionary that lists, for each monomer code, the corresponding graphics file to be used to render it graphically in the sequence editor. the user is empowered to define any aspect of that graphical rendering since the graphical files can be freely modified or created anew. noteworthy, if the graphics files are stored in the scalar vector graphics format, then the program will be able to scale the sequence representation still retaining the best definition for the screen it is displayed onto. this effect is obtained by rendering in memory–with the new resolution–each svg file as a portable network graphics pixmap. the png pixmaps are then graphically composited onto the sequence editor canvas to reconstitute the polymer sequence. chemical modifications of the monomers can be rendered graphically by compositing a transparent pixmap onto the monomer icon to be modified. for example, in the left sequence of figure the's' monomer icon was modified by compositing onto it a transparent pixmap with a red'p' graphical element. this is unlimitedly configurable, because the transparent graphics files representing chemical modifications are–like described above– freely modifiable or can be created anew. available simulations when a polymer sequence is opened in the sequence editor, as shown in figure all the simulations and computations are automatically made available in the editor menus. the simulations and computations that are available through the sequence editor menus are: • chemical modifications of individual monomers or of the polymer sequence as a whole on its left/right ends; • chemical/enzymatic cleavage of a polymer sequence, with automatic fully configurable mass calculations; • gas-phase fragmentation of an oligomer, with automatic fully configurable mass calculations. the process here is in any aspect comparable to what was described above for the cleavage of polymer sequences; • mass-to-charge ratio calculations with the ability to change the chemical ionization agent on the fly; • calculation of the composition of a polymer sequence; • isoelectric point calculations of polymer sequences, optionally taking into account chemical modifications; • matching operations between data extracted from a real mass spectrum and data generated in silico by gnu polyxmass. the procedure is to deisotope the mass spectrum and to compute the centroid for the remaining peaks. all the centroid peaks are listed in a peak list. such list is then fed into gnu polyxmass and all the masses it contains can be matched with a gnu polyxmass-generated theoretical mass spectrum. • annotation of the whole polymer sequence or of single monomers; • fully customizable find/replace operations; • full reporting of all the results in a spreadsheet-friendly ascii format.  the gnu polyxmass software is an integrated mass spectrometric software framework that allows biochemists and massists to perform biochemical and mass spectrometric simulations on polymer sequences of any polymer chemistry. the software design that drove the implementation of gnu polyxmass constitutes an improvement over the current situation, in which each time a mass spectrometric experiment is performed on a different polymer chemistry, the data it yields have to be analyzed using a different software tool. we find gnu polyxmass useful in our day-to-day mass spectrometric work on proteins and peptides, serving as a mass data prediction and mass data analysis tool. we also have used gnu polyxmass successfully as an education tool, as it behaves exactly like a mass spectrometer, allowing a great number of mass spectrometry concepts to be experimented virtually. this software framework was implemented with configurability and flexibility in mind and with the idea that no arbitrary limit should be imposed on the user. it is published under a free software license in the hope to form a community around it, to continue and further its adoption and development as a research and education tool. future developments the gnu polyxmass software framework will be made extensible by use of the python scripting language. further, it is envisaged to integrate a mass spectrum visualization tool that will be able to render mass spectrometric data files of recently published xml-based open formats mzxml and mzdata. easy graphical differential display between theoretically and experimentally obtained mass spectra might thus be made possible in gnu polyxmass. features like cross-links and ramification of polymers are being elaborated upon and might find their way in future releases. availability and requirements • project name: gnu polyxmass; • project home page: • operating system: gnu/linux, unix, mac os x/fink; • programming language: c; • license: gnu general public license; authors' contributions the author developed the ideas presented in this paper, did the software project analysis, designed the data file formats, programmed all the software, did the testing, and wrote the report. 
the framework is organized into three modules, all accessible from one single binary program. we developed a software to address the lack of an integrated software framework able to deal with different polymer chemistries. the gnu polyxmass software framework performs common chemical simulations–along with simultaneous mass spectrometric calculations–for any kind of linear bio-polymeric analyte. the scientist who uses mass spectrometry to characterize polymeric analytes of different chemistries is provided with a single software framework for his data prediction/analysis needs, whatever the polymer chemistry being involved. the modules let the user to 1) define brand new polymer chemistries, 2) perform quick mass calculations using a desktop calculator paradigm, 3) graphically edit polymer sequences and perform chemical/mass spectrometric simulations. nowadays, a variety of polymers can be analyzed by mass spectrometry. this imposes a heavy overhead to researchers who do mass spectrometry on a variety of polymers, as each polymer type will require a different software tool to perform data simulations and analyses. however, all the software tools available to date are polymer chemistry-specific. any aspect of the mass calculations, polymer chemistry reactions or graphical polymer sequence editing is configurable.
 nowadays, a variety of polymers can be analyzed by mass spectrometry. the detailed interpretation of the spectra requires a huge number of "hypothesis cycles", comprising the following three actions 1) put forth a structural hypothesis, 2) test it, 3) validate it. this time-consuming and painstaking data scrutiny is alleviated by using specialized software tools. however, all the software tools available to date are polymer chemistry-specific. this imposes a heavy overhead to researchers who do mass spectrometry on a variety of polymers, as each polymer type will require a different software tool to perform data simulations and analyses. we developed a software to address the lack of an integrated software framework able to deal with different polymer chemistries.  the gnu polyxmass software framework performs common chemical simulations–along with simultaneous mass spectrometric calculations–for any kind of linear bio-polymeric analyte. the framework is organized into three modules, all accessible from one single binary program. the modules let the user to 1) define brand new polymer chemistries, 2) perform quick mass calculations using a desktop calculator paradigm, 3) graphically edit polymer sequences and perform chemical/mass spectrometric simulations. any aspect of the mass calculations, polymer chemistry reactions or graphical polymer sequence editing is configurable.  the scientist who uses mass spectrometry to characterize polymeric analytes of different chemistries is provided with a single software framework for his data prediction/analysis needs, whatever the polymer chemistry being involved. 