diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..f288702
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0a59cb5
--- /dev/null
+++ b/README.md
@@ -0,0 +1,116 @@
+# SpecDB: A Relational Database for archiving biomolecular NMR Spectra Data
+
+SpecDB is a relational database to store and distribute biomoleculae NMR experimental data. SpecDB stores the raw **F**ree **I**nduction **D**ecay (__fid__) from an NMR experiment in a structured way that matches __fid__ records to biomoleculae sample and experimental meta-data.
+
+
+## Repository Organization
+
+```
+├── LICENSE
+├── README.md
+├── TUTORIAL.md
+├── sample
+│ ├── sample.db
+│ ├── sample_forms/
+│ └── sample_sessions/
+├── specdb
+│ ├── specdb
+│ └── specdb.py
+└── sql
+ ├── specdb.sql
+ └── template.str
+```
+
+Above is the tree layout for SpecDB's repository structure.
+
+* `sample/`: location of sample data for the tutorial
+ - `sample/sample.db`: sample SQLite SpecDB database
+ - `sample/sample_forms/`: contains example forms for different data types to enter into SpecDB
+ - `sample/sample_sessions`: contains example Bruker data collection sessions
+* `specdb`: location of **specdb** python library and command line interface (__CLI__)
+ - `specdb/specdb`: the **specdb** CLI
+ - `specdb/specdb.py`: the **specdb** library. users will typically only interact with the CLI
+* `sql/`: directory where the **SpecDB** SQLite schema resides
+ - `sql/specdb.sql`: the **SpecDB** SQLite schema definitions
+ - `template.str`: the minimal NMR-STAR file **SpecDB** attempts to write
+
+## Getting Started
+
+The goal of SpecDB is to capture and organize time domain data that is generated
+from biomolecular NMR experiments. To make the time domain data useful for
+downstream applications, the experiment's metadata such as protein sequence,
+buffer information, the specific pulse sequence performed, and much more all
+should be captured. The idea behind SpecDB is to provide users with a set of tools to enter sample and experiment metadata into a SQLite database.
+
+This _Getting Started_ guide will cover two common scenarios for users installing SpecDB. (1) on a machine where they have install permissions, and (2) if the user is on a shared cluster where they do not have install permissions.
+
+
+To operate SpecDB on a machine where you do have install permissions, here are the steps we recommend.
+1. clone this repository: `git clone https://github.rpi.edu/RPIBioinformatics/SpecDB.git`
+2. to make SpecDB operate as a command line tool, the `PATH` environment variable needs to amended. `export PATH=$PATH:{location of SpecDB}/SpecDB/specdb/`
+ - if a bash profile file is being amended, be sure to `source` the profile after the `PATH` environment variable is edited
+3. the required 3rd part modules for SpecDB are `pandas`, `ruamel.yaml`, and `pynmrstar`. do `pip3 install pandas ruamel.yaml pynmrstar` to download the three libraries
+4. After the `pip install` SpecDB should be operational. Verify that SpecDB is on the `PATH` and libraries installed with `specdb --help`. The output should be the following:
+
+```
+
+usage: specdb [-h] {create,forms,insert,summary,query,backup,restore} ...
+
+Command line tool for interfacing with SpecDB
+
+positional arguments:
+ {create,forms,insert,summary,query,backup,restore}
+ command description
+ create instantiate a new database
+ forms generate a template form for requested table tables to
+ generate forms for are: `user`, `project`, `target`
+ `construct`, `expression`, `batch`, `buffer`, `pst`,
+ `spectrometer`, and a JSON for a session
+ insert insert a single json file into SpecDB
+ summary make a summary report for SpecDB database. if ran with
+ no table provided, then a summary for every table is
+ made.
+ query query records from SpecDB summary table. If no
+ --output is given then results are simply print to
+ screen
+ backup perform incremental backup. specdb configure must be
+ ran first
+ restore perform database restoration from a SpecDB backup
+
+optional arguments:
+ -h, --help show this help message and exit
+
+example command lines:
+ specdb create --db my.db --backup /backups/my.backup.db
+ specdb query --db my.db --sql "SELECT * FROM table users LIMIT 10"
+ specdb insert --file specdb.yaml --env my.db --write
+ specdb backup --db my.db --backup /backups/my.backup.db
+ specdb forms --table user project --num 3 1
+ specdb summary --table user --db my.db
+
+```
+
+To operate SpecDB in a shared cluster without install permissions, it is first recommended to follow whatever standard operating procedures there are for software installation. If virtual environments are an option, the following steps work for SpecDB:
+1. make a python virtual environment with `venv`. `python3 -m venv {name of your environment}`
+2. to active the environment, `source {name of environment}/bin/activate`
+3. perform the `pip install` described above
+4. to exit the virtual environment do `deactivate {name of environment}`
+
+## Acknowledgements
+
+The functions to perform the incremental backup are taken from the following repository: https://github.com/nokibsarkar/sqlite3-incremental-backup.git.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TUTORIAL.md b/TUTORIAL.md
new file mode 100644
index 0000000..29fc58c
--- /dev/null
+++ b/TUTORIAL.md
@@ -0,0 +1,498 @@
+# SpecDB Tutorial
+
+The purpose of the following tutorial is to provide examples of how to use SpecDB. There are six levels to the tutorial. _(1)_ SpecDB subcommands and help menus. _(2)_ how to instantiate a database, _(3)_ how to make forms, _(4)_ how to insert forms, _(5)_ viewing what is in the database, _(6)_ updating records in the database, _(7)_ querying information from the database.
+
+## 1. SpecDB help menus and subcommands
+
+The first entry point to look for guidance on SpecDB functions is to use the help menus. If `specdb help` results in the help menu for SpecDB, then it is installed correctly. SpecDB has seven sub commands, each listed below and the command line arguments each take:
+
+1. `specdb create --db --backup`
+2. `specdb forms --table --num`
+3. `specdb insert --form --db`
+4. `specdb summary --table --db`
+5. `specdb query --sql --db --out`
+6. `specdb backup --db --backup`
+7. `specdb restore --backup --backup`
+
+The subcommands listed above in the logical order the commands are used in. Each subcommand has a separate help menu from `specdb --help` that can be accessed, (e.g `specdb forms --help`). Users first need to create a SpecDB SQLite database file with `create`. Next, users need to populate the database with information, the `forms` command make the forms for the data fields needed for the SpecDB schema. With a filled form, users use `insert` to insert insert the form into their database. To verify/check what they inserted, users can use `summary` to investigate the contents of any SpecDB table. Users can pull data out of the database with `query`. With `query` users provide a SQL SELECT statement on the SpecDB summary view to pull data out of the database. Commands `backup` and `restore` are for the incremental backup operations.
+
+## 2. Instantiating a new SpecDB database
+
+A SpecDB database can be created with `specdb create`. The location of the database .db file needs to be known by the users using the database, or an environment variable can be set. In this tutorial we are going to create a database for the sample data stored in this repository `./sample/`.
+
+```
+$ specdb create --db sample.db --backup sample.backup.db
+```
+
+## 3. Making forms
+
+Now that a database has been made, we can start adding data to the database. To add data we need to populate a text file form to be read into the database. SpecDB uses YAML to build forms. An example can be seen in `/sample/sample_forms/`
+
+Running `specdb forms --table user` results in the user form being printed to screen. The output should be exactly as seen below.
+
+```
+user: # provide information about a user, REQUIRED: `user_id`
+ user_id: '' # no spaces, must be unique, len <= 8, Ex: KJF
+ given_name: '' # len <= 64, Ex: Keith
+ family_name: '' # len <= 64, Ex: Fraga
+ middle_initials: '' # len <= 16, Ex: J
+ department_and_institution: '' # len <= 128, Ex: MCB UCD
+ country: '' # len <= 32, Ex: USA
+ state_province: '' # len <= 32, Ex: NY
+ city: '' # len <= 32, Ex: Troy
+ postal_code: '' # len <= 32, Ex: 12180
+ role: '' # len <= 64, Ex: postdoc
+ organization_type: '' # len <= 64, Ex: academic
+ email_address: '' # no spaces, must have `@`, len <= 64, Ex: user@mail.com
+```
+
+To fill the form, the output of the `specdb forms` command can be redirected to any file. (Note: the file extension is not strict, tested with `txt`, `yaml`, `yml`. )
+
+```
+$ specdb forms --table user > user.yml
+```
+
+Inspection of the resulting form shows that name of the table this form was created for was created for: `user`. On the same line lists the required items need to be filled into this form for insertion into SpecDB. All items not indicated as required are optional. (Note: optional SpecDB terms may be required for BMRB deposition however).
+
+In the `sample/sample_forms/` directory is a users yaml form pre filled out with some user information as an example. Each line in the form file has a comment describing the restrictions on allowable values for that data item, as a well as an example of what can be used for that respective field. Viewing the `sample/sample_forms/users.yaml` we see there are actually multiple users filled in. The `specdb forms` command has the `--num` option for specifying the number of forms to make for a requested table. In the case of `sample/sample_forms/users.yaml` we requested 3. To make the template to do something like `users.yaml` is:
+
+```
+$ specdb forms --table user --num 3
+user: # # provide information about a user, REQUIRED: `user_id`
+ 0:
+ user_id: '' # no spaces, must be unique, len <= 8, Ex: KJF
+ given_name: '' # len <= 64, Ex: Keith
+ family_name: '' # len <= 64, Ex: Fraga
+ middle_initials: '' # len <= 16, Ex: J
+ department_and_institution: '' # len <= 128, Ex: MCB UCD
+ country: '' # len <= 32, Ex: USA
+ state_province: '' # len <= 32, Ex: NY
+ city: '' # len <= 32, Ex: Troy
+ postal_code: '' # len <= 32, Ex: 12180
+ role: '' # len <= 64, Ex: postdoc
+ organization_type: '' # len <= 64, Ex: academic
+ email_address: '' # no spaces, must have `@`, len <= 64, Ex: user@mail.com
+ 1:
+ user_id: '' # no spaces, must be unique, len <= 8, Ex: KJF
+ given_name: '' # len <= 64, Ex: Keith
+ family_name: '' # len <= 64, Ex: Fraga
+ middle_initials: '' # len <= 16, Ex: J
+ department_and_institution: '' # len <= 128, Ex: MCB UCD
+ country: '' # len <= 32, Ex: USA
+ state_province: '' # len <= 32, Ex: NY
+ city: '' # len <= 32, Ex: Troy
+ postal_code: '' # len <= 32, Ex: 12180
+ role: '' # len <= 64, Ex: postdoc
+ organization_type: '' # len <= 64, Ex: academic
+ email_address: '' # no spaces, must have `@`, len <= 64, Ex: user@mail.com
+ 2:
+ user_id: '' # no spaces, must be unique, len <= 8, Ex: KJF
+ given_name: '' # len <= 64, Ex: Keith
+ family_name: '' # len <= 64, Ex: Fraga
+ middle_initials: '' # len <= 16, Ex: J
+ department_and_institution: '' # len <= 128, Ex: MCB UCD
+ country: '' # len <= 32, Ex: USA
+ state_province: '' # len <= 32, Ex: NY
+ city: '' # len <= 32, Ex: Troy
+ postal_code: '' # len <= 32, Ex: 12180
+ role: '' # len <= 64, Ex: postdoc
+ organization_type: '' # len <= 64, Ex: academic
+ email_address: '' # no spaces, must have `@`, len <= 64, Ex: user@mail.com
+```
+
+This output can be redirected to any file and filled in the with appropriate information.
+
+Forms can be made for different tables to be in the same form. A very common use for this is inserting a buffer into SpecDB. There are two tables in the SpecDB schema that describe buffers, `buffer` and `buffer_components`. `buffer` provides the name of the buffer, the `buffer_id` and the buffer's pH. The `buffer_components` table allows for variable number of components to be added to the buffer. For example, if a buffer with 3 components needed to be added to SpecDB, the following command would generate the correct form:
+
+```$ specdb forms --table buffer buffer_components --num 1 3
+ buffer components go in the `buffer_components` table
+ 0:
+ buffer_id: '' # text identifier for the buffer, must be unique, no spaces, len <= 32, Ex: hn4071
+ buffer_ph: 0.0 # pH of buffer, must be a number, Ex: 8.1
+ buffer_comment: '' # free text field for any notes about the buffer, len <= 128, Ex: made by KJF 12/04
+buffer_components: # describe the component(s) of a buffer, REQUIRED: `buffer_id`, `buffer_component`, `buffer_component_value`, `buffer_component_unit`
+ 0:
+ buffer_id: '' # `buffer_id` this component goes to, must already be in buffer table, Ex: hn4071
+ buffer_component: '' # name of the component, len <= 64, Ex: NaCl
+ buffer_component_value: 0.0 # the numeric concentration value of the component, Ex: 100.0
+ buffer_component_unit: '' # unit of concentration, one of (`mM`, `% (v/v)`, `mg/mL`), Ex: mM
+ 1:
+ buffer_id: '' # `buffer_id` this component goes to, must already be in buffer table, Ex: hn4071
+ buffer_component: '' # name of the component, len <= 64, Ex: NaCl
+ buffer_component_value: 0.0 # the numeric concentration value of the component, Ex: 100.0
+ buffer_component_unit: '' # unit of concentration, one of (`mM`, `% (v/v)`, `mg/mL`), Ex: mM
+ 2:
+ buffer_id: '' # `buffer_id` this component goes to, must already be in buffer table, Ex: hn4071
+ buffer_component: '' # name of the component, len <= 64, Ex: NaCl
+ buffer_component_value: 0.0 # the numeric concentration value of the component, Ex: 100.0
+ buffer_component_unit: '' # unit of concentration, one of (`mM`, `% (v/v)`, `mg/mL`), Ex: mM
+
+```
+
+It is important to note that if the `--num` option is provided, that the number of iterations to take match the number of tables requested. In the above case, the `buffer` form was created once because of the `1` after the `--num` and three `buffer_components` were made because of the `3` after the `1` in the `--num` options. The number of options in `--table` and `--num` are in a one-to-one correspondence with each other. If no `--num` options are provided it is assumed that all tables are produced just once.
+
+Inspecting `sample/sample_forms/complete_sample.yaml` will find all the information required to describe a biomolecular NMR sample. It is recommended that users use `specdb forms` to create the forms they when they need because users can define multiple entities at a time, and one general form will not suffice. However, it is instructive to see all the metadata items that are tracked in SpecDB by looking at `complete_sample.yaml`.
+
+To follow along with the sample forms provided in the repository, perform the following commands:
+
+```
+$ specdb forms --table user --num 3 > user.yaml
+$ specdb forms --table project > project.yaml
+$ specdb forms --table buffer buffer_components --num 1 3 > buffer.yaml
+$ specdb forms --table target construct expression purification_batch pst batch_components > sample.yaml
+$ specdb forms --table spectrometer > spectrometer.yaml
+$ specdb forms --table session > session.yaml
+```
+
+## 4. Inserting forms
+
+In this section, users can practice with the pre-filled forms in `sample/sample_forms/`. To first insert users in a group, the following insert command will insert the user information provided in `user.yaml`.
+
+```
+$ specdb insert --db sample.db --form user.yaml
+information provided is new
+{
+ "user_id": "KJF",
+ "given_name": "Keith",
+ "family_name": "Fraga",
+ "middle_initials": "J",
+ "department_and_institution": "UC MCB",
+ "country": null,
+ "state_province": null,
+ "city": null,
+ "postal_code": null,
+ "role": null,
+ "organization_type": null,
+ "email_address": "kjfraga@ucdavis.edu"
+}
+Must set --write to insert provided information to database
+Aborting
+```
+
+`sample.db` is the database created in section (2) of the tutorial. Running the above commnd results in a Aborting error. This means that SpecDB attempted the insert, but found that the requested information was new and could not complete the insertion. This check is in place to ensure users truly want to insert the requested information. Sometimes the provided information may be new, but new and unique because of a typo and the actual information being inserted is already in the database. To overwrite this check, the `--write` flag must be used.
+
+```
+$ specdb insert --db sample.db --form sample_forms/users.yaml --write
+Inserted data from json file at /Users/kfraga/RESEARCH/SpecDB/code/sample/sample_forms/users.yaml
+```
+
+The last line indicates the data was inserted. Running the `specdb insert` command on the `buffers.yaml` with the `--write` flag results in the following.
+
+```
+$ specdb insert --db sample.db --form sample_forms/buffers.yaml --write
+Inserted data from json file at /Users/kfraga/RESEARCH/SpecDB/code/sample/sample_forms/users.yaml
+```
+
+Now that the buffer is inserted, we can attempt to insert our information about a sample. To learn more about the relationships and definitions of each of the tables in the SpecDB manuscript refer to the manuscript. Each table, from `target` to `pst` needs to be inserted to fully describe a sample. However, typically for each table there is a subset of required data items, so not every data item is required for insertion.
+
+
+```
+$ specdb insert --db sample.db --form sample_forms/sample.yaml --write
+SQLite error on insert on table target
+Err Message:
+FOREIGN KEY constraint failed
+check the template form for instructions and examples
+ensure all ids this table relates to (i.e constructs relate to targets) are inserter already
+Aborting
+```
+
+This insertion results in a different error from before. Here, the error was not because the information was new because the `--write` was on. The error is coming from SQLite that foreign key constraint failed. A foreign key is a relationship between two tables. These foreign keys need to be present in the two tables for SpecDB to allow an insert. The error message is not clear on what column the constrain failure came on, but it says the error came from the `target` table and to inspect the form for what is required for a target. Using `forms` we can see what is required for `target`.
+
+```
+$ specdb forms --table target
+target: # molecular target information, REQUIRED: `target_id`
+ target_id: '' # text identifier for target, must be unique, no spaces, len <= 32, Ex: Db0515
+ target_comment: '' # free field comment, anything to note about target, len <= 128, Ex: from UW-Madison
+ target_sequence: '' # target's molecular seq., any type of code/alphabet, no spaces, len <= 1024, Ex: MGSHHHHILVAM
+ organism_source: '' # organism name for target source, can indicate if target is synthetic, len <= 128, Ex: synthetic
+ gene_name: '' # gene name, len <= 64, Ex: SpikeCoV2
+ project_id: '' # `project_id` target is a member of, must be in project table, Ex: SpikeFraga
+ target_preparer: '' # `user_id` that assigned the target, must be in user table, Ex: KJF
+```
+
+We there are relationships between the `user` table and the `project` table. Inspecting what we tried to add for the target in `sample.yaml` we see:
+
+```
+target:
+ target_id: Db0515
+ target_comment: ''
+ target_sequence: MGPLIEVLA
+ organism_source: synthetic
+ gene_name: ''
+ project_id: DBh
+ target_preparer: GTM
+```
+
+We inserted the user information for `GTM` but not the project id `DBh` this target is associated with. We can solve this by inserting the project information using the `sample/sample_forms/project.yaml` form.
+
+```
+$ specdb insert --db sample.db --form project.yaml --write
+Inserted data from json file at /Users/kfraga/RESEARCH/SpecDB/code/sample/sample_forms/project.yaml
+```
+
+Then re-doing the sample insert we get:
+
+```
+specdb insert --db sample.db --form sample.yaml --write
+Inserted data from json file at /Users/kfraga/RESEARCH/SpecDB/code/sample/sample_forms/sample.yaml
+```
+
+To insert FIDs into SpecDB, we first need to insert the spectrometer information.
+
+```
+$ specdb insert --db sample.db --form spectrometer.yaml --write
+Inserted data from json file at /Users/kfraga/RESEARCH/SpecDB/code/sample/sample_forms/spectrometer.yaml
+```
+
+Inserting FIDs into SpecDB are typically organized into sessions. When FIDs are recorded from a Bruker instrument, they are recorded into sub-directories of a data collection session directory. We mimiced this situation in `sample/sample_sessions/test00/`. In `test00/`, there are two subdirectories, each with a time domain dataset. There is also a `specdb.session.yaml`. This file can be creatd with `specdb forms --table session`. The session yaml describe thes spectrometer this data collection was at, the user who conducted the session, and the sample tube the data was collected at. Contents of this session is displayed below:
+
+```
+session:
+ session_preparer: TAR
+ spectrometer_id: Hu800
+ pst_id: Db0515A.000
+```
+
+All three items in this session are required.
+
+Performing the insert on this session yaml file results in:
+
+```
+$ specdb insert --db sample.db --form sample_sessions/test00/specdb.session.yaml --write
+a ./1/uxnmr.par
+a ./1/prosol_History
+a ./1/pulseprogram
+a ./1/format.temp
+a ./1/audita.txt
+a ./1/fid
+a ./1/scon2
+a ./1/acqu
+a ./1/acqus
+a ./2/uxnmr.par
+a ./2/prosol_History
+a ./2/pulseprogram
+a ./2/acqu2s
+a ./2/format.temp
+a ./2/audita.txt
+a ./2/acqu2
+a ./2/cpdprg3
+a ./2/ser
+a ./2/scon2
+a ./2/acqu
+a ./2/acqus
+Inserted data from form file at /Users/kfraga/RESEARCH/SpecDB/code/sample/sample_sessions/test00/specdb.session.yaml
+```
+
+SpecDB is finding what sub directories have time domain data, finding the parameter files, and inserting the time domain data into the database. The session yaml file changes, reflecting all the information the `specdb insert` found:
+
+```
+session:
+ session_preparer: TAR
+ spectrometer_id: Hu800
+ pst_id: Db0515A.000
+ folder_name: test00
+time_domain_data:
+ '1':
+ subdir_name: '1'
+ pulse_sequence_nickname:
+ probe_id:
+ session_id: 1
+ md5checksum: f1d80ff78a50d207b4d3b13af239b839
+ temperature_from_data: 293.0
+ experiment_date: '2010-09-26 21:33:06.812'
+ pulse_sequence: zgpr
+ probe_info: 1.7_mm_CPTCI_1H-13C/15N/D_Z-GRD_Z108160/0002
+ pst_id: Db0515A.000
+ '2':
+ subdir_name: '2'
+ pulse_sequence_nickname:
+ probe_id:
+ session_id: 1
+ md5checksum: e3c4e84d0ae67e8ca1160ebf6d5b6838
+ temperature_from_data: 293.0
+ experiment_date: '2010-09-26 22:16:43.706'
+ pulse_sequence: hsqcetf3gpsi
+ probe_info: 1.7_mm_CPTCI_1H-13C/15N/D_Z-GRD_Z108160/0002
+ pst_id: Db0515A.000
+```
+
+## 5. View what is in the database
+
+Each time we inserted a form into the database, we did not check that the provided information actually is stored in the database. If the `Inserted into` message comes up after the `insert` then no errors in the insert arrived. We can view a summary of the current entries in a table in the database by using the `specdb summary` command. With `summary` we need to provide the name of the table we want to summarize and in what database file we want to look into.
+
+
+```
+$ specdb summary --table user --db sample.db
+
+ id user_id given_name family_name middle_initial department_and country state_province city postal_code \
+ 3 GTM Gaetano Montelione T None None None None None
+ 1 KJF Keith Fraga J UC MCB None None None None
+ 2 TAR Theresa Ramelot A None None None None None
+
+ role organization_t email_address
+ None None monteg3@rpi.edu
+ None None kjfraga@ucdavis.edu
+ None None ramelt2@rpi.edu
+```
+
+A simple table is printed to screen of the current items in the database. Try it on any other table.
+
+## 6. Update a record in SpecDB
+
+It is often the case that information already in the database needs to be amended or added to. Suppose we want to update a user's information. The strategy is to pull out the information already in the database into a yaml form, edit the form, write it back to the database with the write flag. SpecDB detected when in a form, only a table id is provided, like `user_id`, and the rest of the items are blank. In that case, SpecDB understands that what is being requested is the rest of information for that user. We are going to use this functionality to update a record.
+
+First, make an empty user form.
+
+```
+$ specdb forms --table user > utest.yml
+```
+
+Add only the id of the user we want to edit. In this case we are changing `KJF`. Use any text editor you are comfortable.
+
+```
+cat utest.yml
+user: # provide information about a user, REQUIRED: `user_id`
+ user_id: 'KJF' # no spaces, must be unique, len <= 8, Ex: KJF
+ given_name: '' # len <= 64, Ex: Keith
+ family_name: '' # len <= 64, Ex: Fraga
+ middle_initials: '' # len <= 16, Ex: J
+ department_and_institution: '' # len <= 128, Ex: MCB UCD
+ country: '' # len <= 32, Ex: USA
+ state_province: '' # len <= 32, Ex: NY
+ city: '' # len <= 32, Ex: Troy
+ postal_code: '' # len <= 32, Ex: 12180
+ role: '' # len <= 64, Ex: postdoc
+ organization_type: '' # len <= 64, Ex: academic
+ email_address: '' # no spaces, must have `@`, len <= 64, Ex: user@mail.com
+```
+
+User `specdb insert` to pull the information for user `KJF` out from the database.
+
+```
+$ specdb insert --db sample.db --form utest.yml
+Inserted data from json file at /Users/kfraga/RESEARCH/SpecDB/code/sample/utest.yml
+$ cat utest.yml
+user:
+ user_id: KJF
+ given_name: Keith
+ family_name: Fraga
+ middle_initials: J
+ department_and_institution: UC MCB
+ country: ''
+ state_province: ''
+ city: ''
+ postal_code: ''
+ role: ''
+ organization_type: ''
+ email_address: kjfraga@ucdavis.edu
+```
+
+Edit `utest.yml` to change the first name from Keith to Kevin. (Any example would suffice). Re-insert `utest.yml`. First without `--write`, then with.
+
+```
+$ specdb insert --db sample.db --form utest.yml
+requested data is different than the database
+input information:
+{
+ "user_id": "KJF",
+ "given_name": "Kevin",
+ "family_name": "Fraga",
+ "middle_initials": "J",
+ "department_and_institution": "UC MCB",
+ "country": null,
+ "state_province": null,
+ "city": null,
+ "postal_code": null,
+ "role": null,
+ "organization_type": null,
+ "email_address": "kjfraga@ucdavis.edu"
+}
+database information:
+{
+ "user_id": "KJF",
+ "given_name": "Keith",
+ "family_name": "Fraga",
+ "middle_initials": "J",
+ "department_and_institution": "UC MCB",
+ "country": null,
+ "state_province": null,
+ "city": null,
+ "postal_code": null,
+ "role": null,
+ "organization_type": null,
+ "email_address": "kjfraga@ucdavis.edu"
+}
+Aborting
+$ specdb insert --db sample.db --form utest.yml --write
+Inserted data from json file at /Users/kfraga/RESEARCH/SpecDB/code/sample/utest.yml
+```
+
+Using `summary`, we can see the change.
+
+```
+$ specdb summary --db sample.db --table user
+
+ id user_id given_name family_name middle_initial department_and country state_province city postal_code \
+ 3 GTM Gaetano Montelione T None None None None None
+ 4 KJF Kevin Fraga J UC MCB None None None None
+ 2 TAR Theresa Ramelot A None None None None None
+
+ role organization_t email_address
+ None None monteg3@rpi.edu
+ None None kjfraga@ucdavis.edu
+ None None ramelt2@rpi.edu
+```
+
+## 7. Query information from SpecDB
+
+To query information from SpecDB, some FID data must be inserted first. The `specdb query` command only accepts queries against the summary view in the database (not to be confused with `specdb summary`). To view the contents of the summary view, we can use `specdb summary`.
+
+```
+$ specdb summary --db sample.db --table summary
+
+ id experiment_dat pulse_sequence pulse_sequence md5checksum session_id session_prepar \
+ 1 2010-09-26 21:33... None zgpr f1d80ff78a50d207... 1 TAR
+ 2 2010-09-26 22:16... None hsqcetf3gpsi e3c4e84d0ae67e8c... 1 TAR
+
+ temperature buffer_id pst_id pst_preparer batch_id batch_preparer sample_sequenc expression_id \
+ 293.0 h7.4n50 Db0515A.000 TAR Db0515A None GPLIEVLA Db0515A
+ 293.0 h7.4n50 Db0515A.000 TAR Db0515A None GPLIEVLA Db0515A
+
+ expression_pre construct_id construct_prep target_id target_prepare target_sequenc project \
+ TAR Db0515A KJF Db0515 GTM MGPLIEVLA DBh
+ TAR Db0515A KJF Db0515 GTM MGPLIEVLA DBh
+
+ construct_sequ spectrometer_i field probe_id probehd tube_type zipped_dir
+ MGHHHHHHHSMGPLIEVLA Hu800 800 MHz None 1.7_mm_CPTCI_1H-... NMR tube b'\x1f\x8b\x08\x...
+ MGHHHHHHHSMGPLIEVLA Hu800 800 MHz None 1.7_mm_CPTCI_1H-... NMR tube b'\x1f\x8b\x08\x...
+```
+
+In this example we are going to query for FIDs produced from an HSQC. This can be accomplished with the following query:
+
+```
+specdb query --db sample.db --sql "SELECT * FROM summary WHERE pulse_sequence LIKE '%hsqc%'" --out results
+/Users/kfraga/RESEARCH/SpecDB/code/sample/results/TAR_Db0515A.000_20100926
+```
+
+The above command made a directory `results/` and put the query results in this folder. The naming of the subdirectories underneath `results` goes `{user_id}_{pst_id}_{date}`. Then underneath this results subdirectory is the FID that was found as a result of the query. Note that the whole directory the `ser` file was in was also saved, keeping the auxillary files that were made in during the `ser` file collection.
+
+To produce a NMR-STAR file for this result, just use the `--star` command to produce a STAR file in the directory where the `ser` file is.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sample/sample_forms/buffers.yaml b/sample/sample_forms/buffers.yaml
new file mode 100644
index 0000000..0e2c5f5
--- /dev/null
+++ b/sample/sample_forms/buffers.yaml
@@ -0,0 +1,26 @@
+buffer:
+ '0':
+ buffer_id: h7.4n50
+ buffer_ph: 7.4
+ buffer_comment:
+buffer_components:
+ '0':
+ buffer_id: h7.4n50
+ buffer_component: HEPES
+ buffer_component_value: 20.0
+ buffer_component_unit: mM
+ '1':
+ buffer_id: h7.4n50
+ buffer_component: NaCl
+ buffer_component_value: 50.0
+ buffer_component_unit: mM
+ '2':
+ buffer_id: h7.4n50
+ buffer_component: NaN3
+ buffer_component_value: 0.02
+ buffer_component_unit: '% (v/v)'
+ '3':
+ buffer_id: h7.4n50
+ buffer_component: D20
+ buffer_component_value: 10.0
+ buffer_component_unit: '% (v/v)'
diff --git a/sample/sample_forms/complete_sample.yaml b/sample/sample_forms/complete_sample.yaml
new file mode 100644
index 0000000..85b196a
--- /dev/null
+++ b/sample/sample_forms/complete_sample.yaml
@@ -0,0 +1,94 @@
+user: # provide information about a user, REQUIRED: `user_id`
+ user_id: '' # no spaces, must be unique, len <= 8, Ex: KJF
+ given_name: '' # len <= 64, Ex: Keith
+ family_name: '' # len <= 64, Ex: Fraga
+ middle_initials: '' # len <= 16, Ex: J
+ department_and_institution: '' # len <= 128, Ex: MCB UCD
+ country: '' # len <= 32, Ex: USA
+ state_province: '' # len <= 32, Ex: NY
+ city: '' # len <= 32, Ex: Troy
+ postal_code: '' # len <= 32, Ex: 12180
+ role: '' # len <= 64, Ex: postdoc
+ organization_type: '' # len <= 64, Ex: academic
+ email_address: '' # no spaces, must have `@`, len <= 64, Ex: user@mail.com
+project: # provide information describing a project, REQUIRED: `project_id`
+ structural_genomics: '' # not required, only yes or no
+ project_id: '' # required, must be unique, no spaces, len <= 32, Ex: SpikeFraga
+ project_details: '' # not required, short description, len <= 128, Ex: Spike protein project 2022
+target: # molecular target information, REQUIRED: `target_id`
+ target_id: '' # text identifier for target, must be unique, no spaces, len <= 32, Ex: Db0515
+ target_comment: '' # free field comment, anything to note about target, len <= 128, Ex: from UW-Madison
+ target_sequence: '' # target's molecular seq., any type of code/alphabet, no spaces, len <= 1024, Ex: MGSHHHHILVAM
+ organism_source: '' # organism name for target source, can indicate if target is synthetic, len <= 128, Ex: synthetic
+ gene_name: '' # gene name, len <= 64, Ex: SpikeCoV2
+ project_id: '' # `project_id` target is a member of, must be in project table, Ex: SpikeFraga
+ target_preparer: '' # `user_id` that assigned the target, must be in user table, Ex: KJF
+construct: # molecular construct from a target, REQUIRED: `construct_id`, `construct_sequence`, `target_id`
+ construct_id: '' # text identifier for construct, must be unique, no spaces, len <= 32, Ex: Db0515A
+ construct_sequence: '' # construct sequence, any type of code/alphabet, no spaces, len <= 1024, Ex: MGSHHHINLVAE
+ target_id: '' # `target id` this construct was made for, must already be in target table, Ex: Db0515
+ ext_coefficient_280: 0.0 # extinction coefficient at 280 nm, Ex: 108.7
+ expected_mw: 0.0 # expected molecular weight of construct in Da, Ex: 1211.8
+ construct_comment: '' # free field comment, anything to note about construct, len <= 128, Ex: with primers RE1A/RE1B
+ plasmid_id: '' # plasmid construct DNA sequence is cloned in, len <= 64, Ex: pET218(+)
+ plasmid_id_comment: '' # comments on plasmid, len <= 256, Ex: from Underwood lab
+ construct_preparer: '' # `user_id` who prepared the construct, must already be in user table, Ex: KJF
+ construct_company: '' # if the construct was produced by a company, indicate where it came from, len <= 128, Ex: Genscript
+expression: # describe a molecular expression experiment/results, REQUIRED: `expression_id`, `construct_id`
+ expression_id: '' # text identifier for expression, must be unique, no spaces, len <= 32, Ex: Db0515A.X
+ expression_comment: '' # free field comment, anything of note for expression, len <= 128, Ex: reached 4.5 OD
+ construct_id: '' # `construct_id` this expression was for, must already be in construct table, Ex: Db0515A
+ expression_media: '' # growth media expression was in, len <= 32, Ex: MJ9
+ strain: '' # cellular strain expression was in, len <= 32, Ex: BL21A (+)
+ expression_organism: '' # organism expression was in, len <- 32, Ex: E. colli
+ expression_preparer: '' # `user_id` of person who did the expression, must already be in user table, Ex: KJF
+purification_batch: # describe the purification run for an expression product, REQUIRED: `batch_id`, `expression_id`, `sample_sequence`
+ batch_id: '' # text identifier for batch, must be unique, no spaces, len <= 32, Ex: Db0515.X.batch
+ expression_id: '' # expression run this purification batch is for, must already be in expression table Ex: Db0515.X
+ sample_sequence: '' # sequence of molecule after purification (i.e if there was tag cleaving), any type of code/alphabet, no spaces, len <= 1024, Ex: MQNGPILA
+ purif_comment: '' # free text comment about the purification, len <= 128, Ex: HPLC in RM 204
+ production_method: '' # indicate the purification method, len <= 64, Ex: Ni column only
+ isotopic_labeling_remark: '' # provide the isotopic labeling, preferred method to indicate labeling in the appropriate column below, len <= 64, Ex: NC5
+ iso_13c_enrichment: '' # 13C labeling percentage, must contain `% 13C`, len <= 32, Ex: 100% 13C
+ iso_15n_enrichment: '' # 15N labeling percentage, must contain `% 15N`, len <= 32, Ex: 99% 15N
+ iso_2h_enrichment: '' # 2H labeling percentage, must contain `% 2H`, len <= 32, Ex: 100% 2H
+ iso_19f_Trp_enrichment: '' # 19F-Trp labeling percentage, must contain `% 19F-Trp`, len <= 32, Ex: 11% 19F-Trp
+ iso_19f_Phe_enrichment: '' # 19F-Phe labeling percentage, must contain `% 19F-Phe`, len <= 32, Ex: 9.1% 19F-Phe
+ iso_1hd1_Leu_methyl_enrichment: '' # 1HD1-Leu stereospecific labeling percentage, must contain `% 1HD1-Leu`, len <= 32, Ex: 13.3% 1HD1-Leu
+ iso_1hd2_Leu_methyl_enrichment: '' # 1HD2-Leu stereospecific labeling percentage, must contain `% 1HD2-Leu`, len <= 32, Ex: 15% 1HD2-Leu
+ iso_1hd_Ile_methyl_enrichment: '' # 1HD-Ile labeling percentage, must contain `% 1HD-Ile`, len <= 32, Ex: 50% 1HD-Ile
+ iso_1hg1_Val_methyl_enrichment: '' # 1HG1-Val stererospecific labeling percentage, must contain `% 1HG1-Val`, len <= 32, Ex: 25% 1HG1-Val
+ iso_1hg2_Val_methyl_enrichment: '' # 1HG2-Val stereospecific labeling percentage, must contain `% 1HG2-Val`, len <= 32, Ex: 27%% 1HG2-Val
+ iso_1hb_Ala_methyl_enrichment: '' # 1HB-Ala labeling percentage, must contain `% 1HB-Ala`, len <= 32, Ex: 100% 1HB-Ala
+ batch_preparer: '' # `user_id` of person who did the purification, must already be in user table, Ex: KJF
+buffer: # store all buffers used, their id and their pH, REQUIRED: `buffer_id`, `buffer_pH`, NOTE: the buffer components go in the `buffer_components` table
+ buffer_id: '' # text identifier for the buffer, must be unique, no spaces, len <= 32, Ex: hn4071
+ buffer_ph: 0.0 # pH of buffer, must be a number, Ex: 8.1
+ buffer_comment: '' # free text field for any notes about the buffer, len <= 128, Ex: made by KJF 12/04
+buffer_components: # describe the component(s) of a buffer, REQUIRED: `buffer_id`, `buffer_component`, `buffer_component_value`, `buffer_component_unit`
+ buffer_id: '' # `buffer_id` this component goes to, must already be in buffer table, Ex: hn4071
+ buffer_component: '' # name of the component, len <= 64, Ex: NaCl
+ buffer_component_value: 0.0 # the numeric concentration value of the component, Ex: 100.0
+ buffer_component_unit: '' # unit of concentration, one of (`mM`, `% (v/v)`, `mg/mL`), Ex: mM
+pst: # description of a protein sample tube, not only proteins, REQUIRED: `pst_id`, `pst_preparer`, `sample_ph`, `total_volume`, `volume_unit`, `tube_type`
+ pst_id: '' # text identifier for the pst, must be unique, no spaces, len <= 32, Ex: Db0515A.001
+ prev_pst_id: '' # if pst derived from another pst, give previous `pst_id`, must already be in pst table, Ex: Db0515A.000
+ pst_preparer: '' # `user_id` of user that prepared the sample tube, must be in user table, Ex: KJF
+ pst_comment: '' # free field comment about pst, len <= 128, Ex: new sample
+ sample_type: '' # is sample a solution or solid-state sample, one of (`solution`, `solid state`), Ex: solution
+ solvent_system: '' # solvent system for the sample, len <= 64, Ex: DMSO
+ sample_ph: 0.0 # pst pH, can be different from buffer ph, Ex: 7.1
+ total_volume: 0.0 # numeric volume for total volume in tube, Ex: 2.2
+ volume_unit: '' # unit of volume for volume in tube, one of (`nL`, `uL`, `mL`, `L`), Ex: mL
+ curr_location: '' # current location of tube, len <= 64, Ex: NMR room
+ prev_location: '' # previous location of tube, len <= 64, Ex: Underwood lab
+ create_date: '' # date record added to database, format "YYYY-MM-DD", Ex: 2022-01-01
+ buffer_id: '' # id of buffer in the tube, must already be in `buffer` table, no spaces, len <= 32, Ex: hn4071
+ tube_type: '' # the tube type for sample tube, use `specdb summary --table tubes` to find allowable tube types, Ex: 1-mm Shigemi tube
+batch_components: # describe the purification batches in a pst, REQUIRED: `pst_id`, `batch_id`, `volume`, `volume_unit`, `conc`, `conc_unit`
+ pst_id: '' # text id of sample tube being described, must already be in pst table, Ex: Db0515A.001
+ batch_id: '' # text id of batch in the `pst_id` above, must already be in purification_batch table, Ex: Db0515A.X.batch
+ conc: 0.0 # concentration of sample in the sample tube, numeric, Ex: 10.2
+ conc_unit: '' # concentration units, one of (`ug/mL`, `mg/mL`, `nM`, `uM`, `mM`), Ex: mM
+ mass: 0.0 # mg of protein sample in tube, Ex: 101.1
+
diff --git a/sample/sample_forms/project.yaml b/sample/sample_forms/project.yaml
new file mode 100644
index 0000000..82efa3d
--- /dev/null
+++ b/sample/sample_forms/project.yaml
@@ -0,0 +1,4 @@
+project:
+ structural_genomics: no
+ project_id: DBh
+ project_details: BakerLab hallunicated protein project
diff --git a/sample/sample_forms/sample.yaml b/sample/sample_forms/sample.yaml
new file mode 100644
index 0000000..2f004ec
--- /dev/null
+++ b/sample/sample_forms/sample.yaml
@@ -0,0 +1,67 @@
+target:
+ target_id: Db0515
+ target_comment: ''
+ target_sequence: MGPLIEVLA
+ organism_source: synthetic
+ gene_name: ''
+ project_id: DBh
+ target_preparer: GTM
+construct:
+ construct_id: Db0515A
+ construct_sequence: MGHHHHHHHSMGPLIEVLA
+ target_id: Db0515
+ ext_coefficient_280: 0.0
+ expected_mw: 0.0
+ construct_comment: ''
+ plasmid_id: ''
+ plasmid_id_comment: ''
+ construct_preparer: KJF
+ construct_company: ''
+expression:
+ expression_id: Db0515A
+ expression_comment: ''
+ construct_id: Db0515A
+ expression_media: MJ9
+ strain: ''
+ expression_organism: ''
+ expression_preparer: TAR
+purification_batch:
+ batch_id: Db0515A
+ expression_id: Db0515A
+ sample_sequence: GPLIEVLA
+ purif_comment: ''
+ production_method: Ni column
+ isotopic_labeling_remark: NC
+ iso_13c_enrichment: ''
+ iso_15n_enrichment: ''
+ iso_2h_enrichment: ''
+ iso_19f_Trp_enrichment: ''
+ iso_19f_Phe_enrichment: ''
+ iso_1hd1_Leu_methyl_enrichment: ''
+ iso_1hd2_Leu_methyl_enrichment: ''
+ iso_1hd_Ile_methyl_enrichment: ''
+ iso_1hg1_Val_methyl_enrichment: ''
+ iso_1hg2_Val_methyl_enrichment: ''
+ iso_1hb_Ala_methyl_enrichment: ''
+ batch_preparer: ''
+pst:
+ pst_id: Db0515A.000
+ prev_pst_id: ''
+ pst_preparer: TAR
+ pst_comment: ''
+ sample_type: solution
+ solvent_system: D20
+ sample_ph: 6.1
+ total_volume: 2.0
+ volume_unit: mL
+ curr_location: ''
+ prev_location: ''
+ create_date: ''
+ buffer_id: h7.4n50
+ tube_type: NMR tube
+batch_components:
+ pst_id: Db0515A.000
+ batch_id: Db0515A
+ conc: 10.0
+ conc_unit: mM
+ mass: 0.0
diff --git a/sample/sample_forms/spectrometer.yaml b/sample/sample_forms/spectrometer.yaml
new file mode 100644
index 0000000..b61698c
--- /dev/null
+++ b/sample/sample_forms/spectrometer.yaml
@@ -0,0 +1,7 @@
+spectrometer:
+ spectrometer_id: Hu800
+ manufacturer: Bruker
+ model: Avance III
+ serial_number: ''
+ field_strength: 800 MHz
+ spectrometer_comment: ''
diff --git a/sample/sample_forms/users.yaml b/sample/sample_forms/users.yaml
new file mode 100644
index 0000000..3c98728
--- /dev/null
+++ b/sample/sample_forms/users.yaml
@@ -0,0 +1,40 @@
+user:
+ '0':
+ user_id: KJF
+ given_name: Keith
+ family_name: Fraga
+ middle_initials: J
+ department_and_institution: UC MCB
+ country:
+ state_province:
+ city:
+ postal_code:
+ role:
+ organization_type:
+ email_address: kjfraga@ucdavis.edu
+ '1':
+ user_id: TAR
+ given_name: Theresa
+ family_name: Ramelot
+ middle_initials: A
+ department_and_institution:
+ country:
+ state_province:
+ city:
+ postal_code:
+ role:
+ organization_type:
+ email_address: ramelt2@rpi.edu
+ '2':
+ user_id: GTM
+ given_name: Gaetano
+ family_name: Montelione
+ middle_initials: T
+ department_and_institution:
+ country:
+ state_province:
+ city:
+ postal_code:
+ role:
+ organization_type:
+ email_address: monteg3@rpi.edu
diff --git a/sample/sample_sessions/test00/.DS_Store b/sample/sample_sessions/test00/.DS_Store
new file mode 100644
index 0000000..011ed9e
Binary files /dev/null and b/sample/sample_sessions/test00/.DS_Store differ
diff --git a/sample/sample_sessions/test00/1/acqu b/sample/sample_sessions/test00/1/acqu
new file mode 100644
index 0000000..6ff6bac
--- /dev/null
+++ b/sample/sample_sessions/test00/1/acqu
@@ -0,0 +1,405 @@
+##TITLE= Parameter file, TOPSPIN Version 2.1
+##JCAMPDX= 5.0
+##DATATYPE= Parameter Values
+##NPOINTS= 22 $$ modification sequence number
+##ORIGIN= Bruker BioSpin GmbH
+##OWNER= nmrsu
+$$ 2010-09-26 21:32:08.427 -0400 nmrsu@hector.cabm.rutgers.edu
+$$ /opt/topspin2.1/data/micro_screening/nmr/HR4762D.007_1D_1H/1/acqu
+$$ process /opt/topspin2.1/prog/mod/sipar
+##$ACQT0= 0
+##$AMP= (0..31)
+100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100
+100 100 100 100 100 100 100 100 100 100 100 100 100 100
+##$ANAVPT= 1
+##$AQSEQ= 0
+##$AQ_mod= 3
+##$AUNM=
+##$AUTOPOS= <11 >
+##$BF1= 600.13
+##$BF2= 150.902809
+##$BF3= 600.13
+##$BF4= 600.13
+##$BF5= 600.13
+##$BF6= 600.13
+##$BF7= 600.13
+##$BF8= 600.13
+##$BYTORDA= 0
+##$CFDGTYP= 2
+##$CFRGTYP= 5
+##$CHEMSTR=
+##$CNST= (0..63)
+1 1 145 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+##$CPDPRG= <>
+##$CPDPRG1= <>
+##$CPDPRG2= <>
+##$CPDPRG3= <>
+##$CPDPRG4=
+##$CPDPRG5=
+##$CPDPRG6=
+##$CPDPRG7=
+##$CPDPRG8=
+##$CPDPRGB= <>
+##$CPDPRGT= <>
+##$D= (0..63)
+0 2 0 0 0 0 0 0 0 0.06 0 0 0 0 0 0 0.0002 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$DATE= 0
+##$DBL= (0..7)
+120 120 120 120 120 120 120 120
+##$DBP= (0..7)
+150 150 150 150 150 150 150 150
+##$DBP07= 0
+##$DBPNAM0= <>
+##$DBPNAM1= <>
+##$DBPNAM2= <>
+##$DBPNAM3= <>
+##$DBPNAM4= <>
+##$DBPNAM5= <>
+##$DBPNAM6= <>
+##$DBPNAM7= <>
+##$DBPOAL= (0..7)
+0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
+##$DBPOFFS= (0..7)
+0 0 0 0 0 0 0 0
+##$DE= 6.5
+##$DECBNUC=
+##$DECIM= 16
+##$DECNUC=
+##$DECSTAT= 4
+##$DIGMOD= 1
+##$DIGTYP= 8
+##$DL= (0..7)
+0 120 120 120 120 120 120 120
+##$DP= (0..7)
+150 150 150 150 150 150 150 150
+##$DP07= 0
+##$DPNAME0= <>
+##$DPNAME1= <>
+##$DPNAME2= <>
+##$DPNAME3= <>
+##$DPNAME4= <>
+##$DPNAME5= <>
+##$DPNAME6= <>
+##$DPNAME7= <>
+##$DPOAL= (0..7)
+0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
+##$DPOFFS= (0..7)
+0 0 0 0 0 0 0 0
+##$DQDMODE= 0
+##$DR= 18
+##$DS= 2
+##$DSLIST=
+##$DSPFIRM= 0
+##$DSPFVS= 0
+##$DTYPA= 0
+##$EXP=
+##$F1LIST= <111111111111111>
+##$F2LIST= <222222222222222>
+##$F3LIST= <333333333333333>
+##$FCUCHAN= (0..9)
+0 2 1 0 0 0 0 0 0 0
+##$FL1= 90
+##$FL2= 90
+##$FL3= 90
+##$FL4= 90
+##$FOV= 20
+##$FQ1LIST=
+##$FQ2LIST=
+##$FQ3LIST=
+##$FQ4LIST=
+##$FQ5LIST=
+##$FQ6LIST=
+##$FQ7LIST=
+##$FQ8LIST=
+##$FRQLO3= 0
+##$FRQLO3N= 0
+##$FS= (0..7)
+83 83 83 83 83 83 83 83
+##$FTLPGN= 0
+##$FW= 125000
+##$FnMODE= 0
+##$FnTYPE= 0
+##$GP031= 0
+##$GPNAM0=
+##$GPNAM1=
+##$GPNAM10=
+##$GPNAM11=
+##$GPNAM12=
+##$GPNAM13=
+##$GPNAM14=
+##$GPNAM15=
+##$GPNAM16=
+##$GPNAM17=
+##$GPNAM18=
+##$GPNAM19=
+##$GPNAM2=
+##$GPNAM20=
+##$GPNAM21=
+##$GPNAM22=
+##$GPNAM23=
+##$GPNAM24=
+##$GPNAM25=
+##$GPNAM26=
+##$GPNAM27=
+##$GPNAM28=
+##$GPNAM29=
+##$GPNAM3=
+##$GPNAM30=
+##$GPNAM31=
+##$GPNAM4=
+##$GPNAM5=
+##$GPNAM6=
+##$GPNAM7=
+##$GPNAM8=
+##$GPNAM9=
+##$GPX= (0..31)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$GPY= (0..31)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$GPZ= (0..31)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$GRDPROG= <>
+##$GRPDLY= -1
+##$HDDUTY= 20
+##$HDRATE= 20
+##$HGAIN= (0..3)
+0 0 0 0
+##$HL1= 1
+##$HL2= 35
+##$HL3= 16
+##$HL4= 17
+##$HOLDER= 11
+##$HPMOD= (0..7)
+0 0 0 0 0 0 0 0
+##$HPPRGN= 0
+##$IN= (0..63)
+0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
+0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
+0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
+0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
+0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
+0.001 0.001 0.001 0.001
+##$INF= (0..7)
+0 0 0 0 0 0 0 0
+##$INP= (0..63)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$INSTRUM= <>
+##$L= (0..31)
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+##$LFILTER= 10
+##$LGAIN= -10
+##$LINPSTP= 0
+##$LOCKED= no
+##$LOCKFLD= 0
+##$LOCKGN= 0
+##$LOCKPOW= -20
+##$LOCKPPM= 0
+##$LOCNUC= <2H>
+##$LOCPHAS= 0
+##$LOCSHFT= yes
+##$LOCSW= 0
+##$LTIME= 0.1
+##$MASR= 4200
+##$MASRLST=
+##$NBL= 1
+##$NC= 0
+##$NLOGCH= 1
+##$NS= 1024
+##$NUC1= <1H>
+##$NUC2= <13C>
+##$NUC3=
+##$NUC4=
+##$NUC5=
+##$NUC6=
+##$NUC7=
+##$NUC8=
+##$NUCLEI= 0
+##$NUCLEUS=
+##$O1= 2818.21048
+##$O2= 7469.21502263831
+##$O3= 2850.6175
+##$O4= 2850.47650618253
+##$O5= 2850.47650618253
+##$O6= 2850.47650618253
+##$O7= 2850.47650618253
+##$O8= 2850.47650618253
+##$OBSCHAN= (0..9)
+0 0 0 0 0 0 0 0 0 0
+##$OVERFLW= 0
+##$P= (0..63)
+12 12 24 11 22 18.48 28 56 20000 25 50 80000 80000 0 500 250000 1000 2500
+10000 600 2500 0 0 0 2000 250 0 12 1000 1000 0 1730 20000 0 0 0 0 0 0 160
+2000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1500
+##$PACOIL= (0..15)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$PAPS= 2
+##$PARMODE= 0
+##$PCPD= (0..9)
+100 60 60 100 100 100 100 100 100 100
+##$PHCOR= (0..31)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$PHLIST= <>
+##$PHP= 1
+##$PH_ref= 0
+##$PL= (0..63)
+120 17.5 -0.5 120 120 120 120 120 120 69.9 24.86 37.85 14.24 120 120 6.63
+120 120 17.5 31.48 120 120 120 120 120 120 120 37.85 120 120 14.24 8.21
+120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120
+120 120 120 120 120 120 120 120 120 120 120 120 120 120
+##$PLSTEP= 0.1
+##$PLSTRT= -6
+##$POWMOD= 0
+##$PQPHASE= 0
+##$PQSCALE= 0
+##$PR= 1
+##$PRECHAN= (0..15)
+-1 3 0 4 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
+##$PRGAIN= 0
+##$PROBHD= <05>
+##$PROSOL= no
+##$PULPROG=
+##$PW= 0
+##$PYNM=
+##$QNP= 1
+##$RD= 0
+##$RECCHAN= (0..15)
+0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$RECPH= 0
+##$RECPRE= (0..15)
+-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
+##$RECPRFX= (0..15)
+-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
+##$RECSEL= (0..15)
+0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$RG= 181
+##$RO= 0
+##$ROUTWD1= (0..23)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0
+##$ROUTWD2= (0..23)
+0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0
+##$RSEL= (0..9)
+0 1 2 0 0 0 0 0 0 0
+##$S= (0..7)
+83 4 83 83 83 83 83 83
+##$SEOUT= 0
+##$SFO1= 600.13281821048
+##$SFO2= 150.910278215023
+##$SFO3= 600.1328506175
+##$SFO4= 600.132850476506
+##$SFO5= 600.132850476506
+##$SFO6= 600.132850476506
+##$SFO7= 600.132850476506
+##$SFO8= 600.132850476506
+##$SOLVENT=
+##$SP= (0..31)
+1 86.27 80.25 6.83 4.69 0 75.92 6.83 120 0 51.32 51.32 0 0 8.31 0 150 150
+12.22 78.21 76.3 79.60999 72.28999 150 150 150 150 150 150 40.1 150 14.33
+##$SP07= 0
+##$SPECTR= 0
+##$SPNAM0=
+##$SPNAM1=
+##$SPNAM10=
+##$SPNAM11=
+##$SPNAM12=
+##$SPNAM13=
+##$SPNAM14=
+##$SPNAM15= < >
+##$SPNAM16=
+##$SPNAM17=
+##$SPNAM18=
+##$SPNAM19=
+##$SPNAM2=
+##$SPNAM20=
+##$SPNAM21=
+##$SPNAM22=
+##$SPNAM23=
+##$SPNAM24=
+##$SPNAM25=
+##$SPNAM26=
+##$SPNAM27=
+##$SPNAM28=
+##$SPNAM29=
+##$SPNAM3=
+##$SPNAM30=
+##$SPNAM31=
+##$SPNAM4=
+##$SPNAM5=
+##$SPNAM6=
+##$SPNAM7=
+##$SPNAM8= < >
+##$SPNAM9=
+##$SPOAL= (0..31)
+0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
+0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
+##$SPOFFS= (0..31)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$SUBNAM0= <"">
+##$SUBNAM1= <"">
+##$SUBNAM2= <"">
+##$SUBNAM3= <"">
+##$SUBNAM4= <"">
+##$SUBNAM5= <"">
+##$SUBNAM6= <"">
+##$SUBNAM7= <"">
+##$SUBNAM8= <"">
+##$SUBNAM9= <"">
+##$SW= 16.0220943158157
+##$SWIBOX= (0..15)
+0 1 2 3 0 0 6 0 0 0 0 0 0 0 0 0
+##$SW_h= 9615.38461538462
+##$SWfinal= 0
+##$TD= 8192
+##$TD0= 1
+##$TE= 300
+##$TE2= 300
+##$TE3= 300
+##$TEG= 300
+##$TL= (0..7)
+0 120 120 120 120 120 120 120
+##$TP= (0..7)
+150 150 150 150 150 150 150 150
+##$TP07= 0
+##$TPNAME0= <>
+##$TPNAME1= <>
+##$TPNAME2= <>
+##$TPNAME3= <>
+##$TPNAME4= <>
+##$TPNAME5= <>
+##$TPNAME6= <>
+##$TPNAME7= <>
+##$TPOAL= (0..7)
+0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
+##$TPOFFS= (0..7)
+0 0 0 0 0 0 0 0
+##$TUNHIN= 0
+##$TUNHOUT= 0
+##$TUNXOUT= 0
+##$USERA1=
+##$USERA2=
+##$USERA3=
+##$USERA4=
+##$USERA5=
+##$V9= 5
+##$VALIST=
+##$VCLIST=
+##$VD= 0
+##$VDLIST=
+##$VPLIST=
+##$VTLIST=
+##$WBST= 1024
+##$WBSW= 20
+##$XGAIN= (0..3)
+0 0 0 0
+##$XL= 0
+##$YL= 0
+##$YMAX_a= 0
+##$YMIN_a= 0
+##$ZGOPTNS= <>
+##$ZL1= 120
+##$ZL2= 120
+##$ZL3= 120
+##$ZL4= 120
+##END=
diff --git a/sample/sample_sessions/test00/1/acqus b/sample/sample_sessions/test00/1/acqus
new file mode 100644
index 0000000..f07b868
--- /dev/null
+++ b/sample/sample_sessions/test00/1/acqus
@@ -0,0 +1,406 @@
+##TITLE= Parameter file, TOPSPIN Version 2.1
+##JCAMPDX= 5.0
+##DATATYPE= Parameter Values
+##NPOINTS= 11 $$ modification sequence number
+##ORIGIN= Bruker BioSpin GmbH
+##OWNER= nmrsu
+$$ 2010-09-26 22:15:22.481 -0400 nmrsu@hector.cabm.rutgers.edu
+$$ /opt/topspin2.1/data/micro_screening/nmr/HR4762D.007_1D_1H/1/acqus
+$$ process /opt/topspin2.1/prog/mod/shimcntl
+##$ACQT0= -7.63941940412529
+##$AMP= (0..31)
+100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100
+100 100 100 100 100 100 100 100 100 100 100 100 100 100
+##$ANAVPT= -1
+##$AQSEQ= 0
+##$AQ_mod= 3
+##$AUNM=
+##$AUTOPOS= <11 >
+##$BF1= 600.13
+##$BF2= 150.902809
+##$BF3= 600.13
+##$BF4= 600.13
+##$BF5= 600.13
+##$BF6= 600.13
+##$BF7= 600.13
+##$BF8= 600.13
+##$BYTORDA= 1
+##$CFDGTYP= 2
+##$CFRGTYP= 5
+##$CHEMSTR=
+##$CNST= (0..63)
+1 1 145 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+##$CPDPRG= <>
+##$CPDPRG1= <>
+##$CPDPRG2= <>
+##$CPDPRG3= <>
+##$CPDPRG4=
+##$CPDPRG5=
+##$CPDPRG6=
+##$CPDPRG7=
+##$CPDPRG8=
+##$CPDPRGB= <>
+##$CPDPRGT= <>
+##$D= (0..63)
+0 2 0 0 0 0 0 0 0 0.06 0 0 2e-05 0 0 0 0.0002 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$DATE= 1285553717
+##$DBL= (0..7)
+120 120 120 120 120 120 120 120
+##$DBP= (0..7)
+150 150 150 150 150 150 150 150
+##$DBP07= 0
+##$DBPNAM0= <>
+##$DBPNAM1= <>
+##$DBPNAM2= <>
+##$DBPNAM3= <>
+##$DBPNAM4= <>
+##$DBPNAM5= <>
+##$DBPNAM6= <>
+##$DBPNAM7= <>
+##$DBPOAL= (0..7)
+0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
+##$DBPOFFS= (0..7)
+0 0 0 0 0 0 0 0
+##$DE= 6.5
+##$DECBNUC=
+##$DECIM= 16
+##$DECNUC=
+##$DECSTAT= 4
+##$DIGMOD= 1
+##$DIGTYP= 8
+##$DL= (0..7)
+0 120 120 120 120 120 120 120
+##$DP= (0..7)
+150 150 150 150 150 150 150 150
+##$DP07= 0
+##$DPNAME0= <>
+##$DPNAME1= <>
+##$DPNAME2= <>
+##$DPNAME3= <>
+##$DPNAME4= <>
+##$DPNAME5= <>
+##$DPNAME6= <>
+##$DPNAME7= <>
+##$DPOAL= (0..7)
+0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
+##$DPOFFS= (0..7)
+0 0 0 0 0 0 0 0
+##$DQDMODE= 0
+##$DR= 18
+##$DS= 2
+##$DSLIST=
+##$DSPFIRM= 0
+##$DSPFVS= 12
+##$DTYPA= 0
+##$EXP=
+##$F1LIST= <111111111111111>
+##$F2LIST= <222222222222222>
+##$F3LIST= <333333333333333>
+##$FCUCHAN= (0..9)
+0 2 1 0 0 0 0 0 0 0
+##$FL1= 90
+##$FL2= 90
+##$FL3= 90
+##$FL4= 90
+##$FOV= 20
+##$FQ1LIST=
+##$FQ2LIST=
+##$FQ3LIST=
+##$FQ4LIST=
+##$FQ5LIST=
+##$FQ6LIST=
+##$FQ7LIST=
+##$FQ8LIST=
+##$FRQLO3= 1894230.76923077
+##$FRQLO3N= 0
+##$FS= (0..7)
+83 83 83 83 83 83 83 83
+##$FTLPGN= 0
+##$FW= 125000
+##$FnMODE= 0
+##$FnTYPE= 0
+##$GP031= 0
+##$GPNAM0=
+##$GPNAM1=
+##$GPNAM10=
+##$GPNAM11=
+##$GPNAM12=
+##$GPNAM13=
+##$GPNAM14=
+##$GPNAM15=
+##$GPNAM16=
+##$GPNAM17=
+##$GPNAM18=
+##$GPNAM19=
+##$GPNAM2=
+##$GPNAM20=
+##$GPNAM21=
+##$GPNAM22=
+##$GPNAM23=
+##$GPNAM24=
+##$GPNAM25=
+##$GPNAM26=
+##$GPNAM27=
+##$GPNAM28=
+##$GPNAM29=
+##$GPNAM3=
+##$GPNAM30=
+##$GPNAM31=
+##$GPNAM4=
+##$GPNAM5=
+##$GPNAM6=
+##$GPNAM7=
+##$GPNAM8=
+##$GPNAM9=
+##$GPX= (0..31)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$GPY= (0..31)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$GPZ= (0..31)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$GRDPROG= <>
+##$GRPDLY= -1
+##$HDDUTY= 20
+##$HDRATE= 20
+##$HGAIN= (0..3)
+0 0 0 0
+##$HL1= 1
+##$HL2= 35
+##$HL3= 16
+##$HL4= 17
+##$HOLDER= 0
+##$HPMOD= (0..7)
+0 0 0 0 0 0 0 0
+##$HPPRGN= 0
+##$IN= (0..63)
+0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
+0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
+0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
+0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
+0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
+0.001 0.001 0.001 0.001
+##$INF= (0..7)
+0 0 0 0 0 0 0 0
+##$INP= (0..63)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$INSTRUM=
+##$L= (0..31)
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+##$LFILTER= 100
+##$LGAIN= -15
+##$LINPSTP= 10
+##$LOCKED= yes
+##$LOCKFLD= 4675
+##$LOCKGN= 131.399993896484
+##$LOCKPOW= -10
+##$LOCKPPM= 4.69999980926514
+##$LOCNUC= <2H>
+##$LOCPHAS= 269.6
+##$LOCSHFT= yes
+##$LOCSW= 0
+##$LTIME= 0.200000002980232
+##$MASR= 4200
+##$MASRLST=
+##$NBL= 1
+##$NC= -2
+##$NLOGCH= 1
+##$NS= 1024
+##$NUC1= <1H>
+##$NUC2= <13C>
+##$NUC3=
+##$NUC4=
+##$NUC5=
+##$NUC6=
+##$NUC7=
+##$NUC8=
+##$NUCLEI= 0
+##$NUCLEUS=
+##$O1= 2818.21048
+##$O2= 7469.21502263831
+##$O3= 2850.6175
+##$O4= 2850.47650618253
+##$O5= 2850.47650618253
+##$O6= 2850.47650618253
+##$O7= 2850.47650618253
+##$O8= 2850.47650618253
+##$OBSCHAN= (0..9)
+0 0 0 0 0 0 0 0 0 0
+##$OVERFLW= 0
+##$P= (0..63)
+12 12 24 11 22 18.48 28 56 20000 25 50 80000 80000 0 500 250000 1000 2500
+10000 600 2500 0 0 0 2000 250 0 12 1000 1000 0 1730 20000 0 0 0 0 0 0 160
+2000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1500
+##$PACOIL= (0..15)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$PAPS= 2
+##$PARMODE= 0
+##$PCPD= (0..9)
+100 60 60 100 100 100 100 100 100 100
+##$PHCOR= (0..31)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$PHLIST= <>
+##$PHP= 1
+##$PH_ref= 0
+##$PL= (0..63)
+120 17.5 -0.5 120 120 120 120 120 120 69.9 24.86 37.85 14.24 120 120 6.63
+120 120 17.5 31.48 120 120 120 120 120 120 120 37.85 120 120 14.24 8.21
+120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120
+120 120 120 120 120 120 120 120 120 120 120 120 120 120
+##$PLSTEP= 0.1
+##$PLSTRT= -6
+##$POWMOD= 0
+##$PQPHASE= 0
+##$PQSCALE= 0
+##$PR= 1
+##$PRECHAN= (0..15)
+-1 3 0 4 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
+##$PRGAIN= 0
+##$PROBHD= <1.7 mm CPTCI 1H-13C/15N/D Z-GRD Z108160/0002
+>
+##$PROSOL= no
+##$PULPROG=
+##$PW= 0
+##$PYNM=
+##$QNP= 1
+##$RD= 0
+##$RECCHAN= (0..15)
+0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$RECPH= 0
+##$RECPRE= (0..15)
+-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
+##$RECPRFX= (0..15)
+-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
+##$RECSEL= (0..15)
+0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$RG= 181
+##$RO= 0
+##$ROUTWD1= (0..23)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0
+##$ROUTWD2= (0..23)
+0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0
+##$RSEL= (0..9)
+0 1 2 0 0 0 0 0 0 0
+##$S= (0..7)
+83 4 83 83 83 83 83 83
+##$SEOUT= 0
+##$SFO1= 600.13281821048
+##$SFO2= 150.910278215023
+##$SFO3= 600.1328506175
+##$SFO4= 600.132850476506
+##$SFO5= 600.132850476506
+##$SFO6= 600.132850476506
+##$SFO7= 600.132850476506
+##$SFO8= 600.132850476506
+##$SOLVENT=
+##$SP= (0..31)
+1 86.27 80.25 6.83 4.69 0 75.92 6.83 120 0 51.32 51.32 0 0 8.31 0 150 150
+12.22 78.21 76.3 79.60999 72.28999 150 150 150 150 150 150 40.1 150 14.33
+##$SP07= 0
+##$SPECTR= 0
+##$SPNAM0=
+##$SPNAM1=
+##$SPNAM10=
+##$SPNAM11=
+##$SPNAM12=
+##$SPNAM13=
+##$SPNAM14=
+##$SPNAM15= < >
+##$SPNAM16=
+##$SPNAM17=
+##$SPNAM18=
+##$SPNAM19=
+##$SPNAM2=
+##$SPNAM20=
+##$SPNAM21=
+##$SPNAM22=
+##$SPNAM23=
+##$SPNAM24=
+##$SPNAM25=
+##$SPNAM26=
+##$SPNAM27=
+##$SPNAM28=
+##$SPNAM29=
+##$SPNAM3=
+##$SPNAM30=
+##$SPNAM31=
+##$SPNAM4=
+##$SPNAM5=
+##$SPNAM6=
+##$SPNAM7=
+##$SPNAM8= < >
+##$SPNAM9=
+##$SPOAL= (0..31)
+0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
+0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
+##$SPOFFS= (0..31)
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+##$SUBNAM0= <"">
+##$SUBNAM1= <"">
+##$SUBNAM2= <"">
+##$SUBNAM3= <"">
+##$SUBNAM4= <"">
+##$SUBNAM5= <"">
+##$SUBNAM6= <"">
+##$SUBNAM7= <"">
+##$SUBNAM8= <"">
+##$SUBNAM9= <"">
+##$SW= 16.0220943158157
+##$SWIBOX= (0..15)
+0 1 2 3 0 0 6 0 0 0 0 0 0 0 0 0
+##$SW_h= 9615.38461538462
+##$SWfinal= 0
+##$TD= 8192
+##$TD0= 1
+##$TE= 293
+##$TE2= 300
+##$TE3= 300
+##$TEG= 300
+##$TL= (0..7)
+0 120 120 120 120 120 120 120
+##$TP= (0..7)
+150 150 150 150 150 150 150 150
+##$TP07= 0
+##$TPNAME0= <>
+##$TPNAME1= <>
+##$TPNAME2= <>
+##$TPNAME3= <>
+##$TPNAME4= <>
+##$TPNAME5= <>
+##$TPNAME6= <>
+##$TPNAME7= <>
+##$TPOAL= (0..7)
+0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
+##$TPOFFS= (0..7)
+0 0 0 0 0 0 0 0
+##$TUNHIN= 0
+##$TUNHOUT= 0
+##$TUNXOUT= 0
+##$USERA1=
+##$USERA2=
+##$USERA3=
+##$USERA4=
+##$USERA5=
+##$V9= 5
+##$VALIST=
+##$VCLIST=
+##$VD= 0
+##$VDLIST=
+##$VPLIST=
+##$VTLIST=
+##$WBST= 1024
+##$WBSW= 20
+##$XGAIN= (0..3)
+0 0 0 0
+##$XL= 0
+##$YL= 0
+##$YMAX_a= 38758765
+##$YMIN_a= -62247272
+##$ZGOPTNS= <>
+##$ZL1= 120
+##$ZL2= 120
+##$ZL3= 120
+##$ZL4= 120
+##END=
diff --git a/sample/sample_sessions/test00/1/audita.txt b/sample/sample_sessions/test00/1/audita.txt
new file mode 100644
index 0000000..21d18cf
--- /dev/null
+++ b/sample/sample_sessions/test00/1/audita.txt
@@ -0,0 +1,23 @@
+##TITLE= Audit trail, TOPSPIN Version 2.1
+##JCAMPDX= 5.01
+##ORIGIN= Bruker BioSpin GmbH
+##OWNER= nmrsu
+$$ /opt/topspin2.1/data/micro_screening/nmr/HR4762D.007_1D_1H/1/audita.txt
+##AUDIT TRAIL= $$ (NUMBER, WHEN, WHO, WHERE, PROCESS, VERSION, WHAT)
+( 1,<2010-09-26 22:15:17.520 -0400>,,,,,
+ )
+( 2,<2010-09-26 22:15:23.238 -0400>,,,,,
+ )
+##END=
+
+$$ hash MD5
+$$ 8F 44 24 67 FF 89 A5 C0 B5 C3 70 80 28 EE EA 32
diff --git a/sample/sample_sessions/test00/1/fid b/sample/sample_sessions/test00/1/fid
new file mode 100644
index 0000000..56c7f35
Binary files /dev/null and b/sample/sample_sessions/test00/1/fid differ
diff --git a/sample/sample_sessions/test00/1/format.temp b/sample/sample_sessions/test00/1/format.temp
new file mode 100644
index 0000000..99d85f7
--- /dev/null
+++ b/sample/sample_sessions/test00/1/format.temp
@@ -0,0 +1,181 @@
+EDIT_PAR COMMAND FILE
+
+DI_MODE LONG
+ED_ENTRY ACQU
+ORDER FILE
+
+
+HEADER "F2 - Acquisition Parameters"
+T_NAME Date_
+ TYPE R64
+ CLASS ACQU
+ SUBRANGE 0.0 50000000
+ REL "Date_=itodate(DATE)"
+ INV_REL "DATE=datetoi(Date_,DATE)"
+ FORMAT "%14.0f"
+ TEXT " "
+END
+T_NAME Time
+ TYPE R32
+ CLASS ACQU
+ SUBRANGE 0.0 1000000
+ REL "Time=itotime(DATE)"
+ INV_REL "DATE=timetoi(Time,DATE)"
+ FORMAT "%14.2f"
+ TEXT " "
+END
+NAME INSTRUM
+ TEXT " "
+END
+NAME PROBHD
+ FORMAT "%14.14s"
+ TEXT " "
+END
+NAME PULPROG
+ TEXT " "
+END
+NAME TD
+ TEXT " "
+END
+NAME SOLVENT
+ TEXT " "
+END
+NAME NS
+ TEXT " "
+END
+NAME DS
+ TEXT " "
+END
+T_NAME SWH
+ TYPE R32
+ CLASS ACQU
+ SUBRANGE 0.0 1e8
+ REL "SWH=SW*SFO1"
+ INV_REL "SW=SWH/SFO1"
+ UNIT "Hz"
+ FORMAT "%14.3f Hz"
+ TEXT " "
+END
+T_NAME FIDRES
+ TYPE R32
+ CLASS ACQU
+ SUBRANGE 0.0 100000
+ REL "FIDRES=SW*SFO1/TD"
+ INV_REL "TD = nextpow(SW*SFO1/FIDRES)"
+ UNIT "Hz"
+ FORMAT "%14.6f Hz"
+ TEXT " "
+END
+T_NAME AQ
+ TYPE R32
+ CLASS ACQU
+ SUBRANGE 0.0 1000
+ REL "AQ=aqcalc(SW,SFO1,TD,DIGTYP)"
+ INV_REL "TD=tdcalc(SW,SFO1,1.0e6*AQ,DIGTYP)"
+ UNIT "sec"
+ FORMAT "%14.7f sec"
+ TEXT " "
+END
+NAME RG
+ TEXT " "
+END
+T_NAME DW
+ TYPE R32
+ CLASS ACQU
+ SUBRANGE 0.0 1000000
+ REL "DW=1/(2*SW*SFO1)"
+ INV_REL "SW=1000000/(2*(0.005+DW)*SFO1)"
+ UNIT "usec"
+ FORMAT "%14.3lf usec"
+ TEXT " "
+END
+NAME DE
+ FORMAT "%14.2f usec"
+ TEXT " "
+END
+NAME TE
+ FORMAT "%14.1f K"
+ TEXT " "
+END
+T_NAME D1
+ TYPE R32
+ CLASS ACQU
+ SUBRANGE 0.0 1e38
+ REL "D1=D[1]"
+ INV_REL "D[1]=D1"
+ UNIT "sec"
+ FORMAT "%14.8f sec"
+ TEXT " "
+END
+T_NAME D12
+ TYPE R32
+ CLASS ACQU
+ SUBRANGE 0.0 1e38
+ REL "D12=D[12]"
+ INV_REL "D[12]=D12"
+ UNIT "sec"
+ FORMAT "%14.8f sec"
+ TEXT " "
+END
+NAME TD0
+ TEXT " "
+END
+HEADER "======== CHANNEL f1 ========"
+NAME NUC1
+ NONEDIT
+ TEXT " "
+END
+T_NAME P1
+ TYPE R32
+ CLASS ACQU
+ SUBRANGE 0.0 1.0e10
+ REL "P1=P[1]"
+ INV_REL "P[1]=P1"
+ UNIT "usec"
+ FORMAT "%14.2f usec"
+ TEXT " "
+END
+T_NAME PL1
+ TYPE R32
+ CLASS ACQU
+ SUBRANGE -6.0 1e38
+ REL "PL1=PL[1]"
+ INV_REL "PL[1]=PL1"
+ UNIT "dB"
+ FORMAT "%14.2f dB"
+ TEXT " "
+END
+T_NAME PL9
+ TYPE R32
+ CLASS ACQU
+ SUBRANGE -6.0 1e38
+ REL "PL9=PL[9]"
+ INV_REL "PL[9]=PL9"
+ UNIT "dB"
+ FORMAT "%14.2f dB"
+ TEXT " "
+END
+T_NAME PL1W
+ TYPE R32
+ CLASS ACQU
+ SUBRANGE -6.0 1e38
+ REL "PL1W=63.8*pow(10.0,(-6-PL[1])/10.0)"
+ INV_REL "PL[1]=-6-4.3425*log(PL1W/63.8)"
+ UNIT "no"
+ FORMAT "%14.8f W"
+ TEXT " "
+END
+T_NAME PL9W
+ TYPE R32
+ CLASS ACQU
+ SUBRANGE -6.0 1e38
+ REL "PL9W=63.8*pow(10.0,(-6-PL[9])/10.0)"
+ INV_REL "PL[9]=-6-4.3425*log(PL9W/63.8)"
+ UNIT "no"
+ FORMAT "%14.8f W"
+ TEXT " "
+END
+NAME SFO1
+ FORMAT "%14.7f MHz"
+ TEXT " "
+END
diff --git a/sample/sample_sessions/test00/1/pdata/1/1i b/sample/sample_sessions/test00/1/pdata/1/1i
new file mode 100644
index 0000000..565511a
Binary files /dev/null and b/sample/sample_sessions/test00/1/pdata/1/1i differ
diff --git a/sample/sample_sessions/test00/1/pdata/1/1r b/sample/sample_sessions/test00/1/pdata/1/1r
new file mode 100644
index 0000000..be37f53
Binary files /dev/null and b/sample/sample_sessions/test00/1/pdata/1/1r differ
diff --git a/sample/sample_sessions/test00/1/pdata/1/auditp.txt b/sample/sample_sessions/test00/1/pdata/1/auditp.txt
new file mode 100644
index 0000000..fd08300
--- /dev/null
+++ b/sample/sample_sessions/test00/1/pdata/1/auditp.txt
@@ -0,0 +1,36 @@
+##TITLE= Audit trail, TOPSPIN Version 2.1
+##JCAMPDX= 5.01
+##ORIGIN= Bruker BioSpin GmbH
+##OWNER= nmrsu
+$$ /opt/topspin2.1/data/micro_screening/nmr/HR4762D.007_1D_1H/1/pdata/1/auditp.txt
+##AUDIT TRAIL= $$ (NUMBER, WHEN, WHO, WHERE, PROCESS, VERSION, WHAT)
+( 1,<2010-09-26 22:15:17.520 -0400>,,,,,
+ )
+( 2,<2010-09-26 22:15:23.238 -0400>,,,,,
+ )
+( 3,<2010-09-27 14:01:20.501 -0400>,,,,,
+ )
+( 4,<2010-09-27 14:01:36.356 -0400>,,,,,
+ )
+( 5,<2010-09-27 14:01:54.938 -0400>,,,,,
+ )
+##END=
+
+$$ hash MD5
+$$ 29 B2 63 CE 55 78 52 80 5E D3 65 71 93 69 5A 55
diff --git a/sample/sample_sessions/test00/1/pdata/1/base_info b/sample/sample_sessions/test00/1/pdata/1/base_info
new file mode 100644
index 0000000..2d5531f
--- /dev/null
+++ b/sample/sample_sessions/test00/1/pdata/1/base_info
@@ -0,0 +1,8 @@
+0
+982
+30218
+-1.033667E06
+-1.109416E01
+0.000000E00
+0.000000E00
+0.000000E00
diff --git a/sample/sample_sessions/test00/1/pdata/1/intrng b/sample/sample_sessions/test00/1/pdata/1/intrng
new file mode 100644
index 0000000..1e58cc4
--- /dev/null
+++ b/sample/sample_sessions/test00/1/pdata/1/intrng
@@ -0,0 +1,9 @@
+P 0
+8.923863 7.841310
+5.944642 4.705623
+4.705134 3.597644
+3.597155 3.430910
+3.348276 2.511180
+2.469619 2.160108
+2.159619 1.141609
+1.141120 0.440932
diff --git a/sample/sample_sessions/test00/1/pdata/1/outd b/sample/sample_sessions/test00/1/pdata/1/outd
new file mode 100644
index 0000000..896b602
--- /dev/null
+++ b/sample/sample_sessions/test00/1/pdata/1/outd
@@ -0,0 +1,17 @@
+##TITLE= Parameter file, TOPSPIN Version 2.1
+##JCAMPDX= 5.0
+##DATATYPE= Parameter Values
+##NPOINTS= 1 $$ modification sequence number
+##ORIGIN= Bruker BioSpin GmbH
+##OWNER= nmrsu
+$$ 2010-09-24 16:07:31.492 -0400 nmrsu@hector.cabm.rutgers.edu
+$$ /opt/topspin2.1/prog/curdir/changer/inmrchanger/Sep24-2010-1606-micro_screening/11/data/nmr/HR4762D.007_1D_1H/1/pdata/1/outd
+$$ process /opt/topspin2.1/prog/mod/xwish3
+##$CURPLOT=
+##$CURPRIN= <$hp-laserjet-1300-1>
+##$DFORMAT=
+##$LAYOUT=
+##$LFORMAT=
+##$PFORMAT=
+##$SURQMSG= 1
+##END=
diff --git a/sample/sample_sessions/test00/1/pdata/1/parm.txt b/sample/sample_sessions/test00/1/pdata/1/parm.txt
new file mode 100644
index 0000000..e81a2d8
--- /dev/null
+++ b/sample/sample_sessions/test00/1/pdata/1/parm.txt
@@ -0,0 +1,38 @@
+NAME HR4762D.007_1D_1H
+EXPNO 1
+PROCNO 1
+Date_ 20100926
+Time 22.15
+INSTRUM spect
+PROBHD 1.7 mm CPTCI 1
+PULPROG zgpr
+TD 8192
+SOLVENT H2O+D2O
+NS 1024
+DS 2
+SWH 9615.385 Hz
+FIDRES 1.173753 Hz
+AQ 0.4260860 sec
+RG 181
+DW 52.000 usec
+DE 6.50 usec
+TE 293.0 K
+D1 2.00000000 sec
+D12 0.00002000 sec
+TD0 1
+
+======== CHANNEL f1 ========
+NUC1 1H
+P1 12.00 usec
+PL1 17.50 dB
+PL9 69.90 dB
+PL1W 0.28498414 W
+PL9W 0.00000164 W
+SFO1 600.1328182 MHz
+SI 32768
+SF 600.1299044 MHz
+WDW EM
+SSB 0
+LB 2.00 Hz
+GB 0
+PC 1.00
diff --git a/sample/sample_sessions/test00/1/pdata/1/peaklist.xml b/sample/sample_sessions/test00/1/pdata/1/peaklist.xml
new file mode 100644
index 0000000..7929c94
--- /dev/null
+++ b/sample/sample_sessions/test00/1/pdata/1/peaklist.xml
@@ -0,0 +1,474 @@
+
+
+
+