mipe-1.1/0000755000175000017500000000000010267443221011650 5ustar janjan00000000000000mipe-1.1/csv2mipe.pl0000755000175000017500000002172410267443213013747 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME csv2mipe.pl - Generates MIPE file based on 3 tab-delimited files based on MIPE version v1.1 arguments: * tab-delimited file with PCR-level data * tab-delimited file with SNP-level data * tab-delimited file with assay-level data Columns in file with PCR-level data: pcr_id pcr_modified (might be multiple, divided by semi-colon ";") pcr_project (might be multiple, divided by semi-colon ";") pcr_researcher (might be multiple, divided by semi-colon ";") pcr_species source_type source_id design_seq primer1_oligo primer1_seq primer1_tm primer2_oligo primer2_seq primer2_tm design_remark (might be multiple, divided by semi-colon ";") use_seq use_revcomp use_remark (might be multiple, divided by semi-colon ";") pcr_remark (might be multiple, divided by semi-colon ";") Columns in file with SNP-level data: pcr_id snp_id snp_pos snp_amb snp_remark (might be multiple, divided by semi-colon ";") Columns in file with assay-level data: pcr_id snp_id assay_id assay_type assay_enzyme assay_oligo assay_specific assay_tail assay_strand assay_remark (might be multiple, divided by semi-colon ";") =head1 SYNOPSIS csv2mipe.pl =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my ( $pcr_file, $snp_file, $assay_file ) = @ARGV; #if ( not scalar @ARGV == 3 ) { die "Usage: csv2mipe.pl \n" }; ### Read PCR data open PCR, $pcr_file or die "Cannot open $pcr_file\n"; chomp ( my @pcr_data = ( ) ); close PCR; my %pcr_data; foreach ( @pcr_data ) { if ( scalar (split /\t/, $_) != 19 ) { die "Wrong number of fields in the following line of $pcr_file:\n$_\n" }; my ( $pcr_id, $pcr_modified, $pcr_project, $pcr_researcher, $pcr_species, $source_type, $source_id, $design_seq, $primer1_oligo, $primer1_seq, $primer1_tm, $primer2_oligo, $primer2_seq, $primer2_tm, $design_remark, $use_seq, $use_revcomp, $use_remark, $pcr_remark ) = split /\t/, $_; $pcr_data{$pcr_id}{pcr_modified} = $pcr_modified; $pcr_data{$pcr_id}{pcr_project} = $pcr_project; $pcr_data{$pcr_id}{pcr_researcher} = $pcr_researcher; $pcr_data{$pcr_id}{pcr_species} = $pcr_species; $pcr_data{$pcr_id}{source_type} = $source_type; $pcr_data{$pcr_id}{source_id} = $source_id; $pcr_data{$pcr_id}{design_seq} = $design_seq; $pcr_data{$pcr_id}{primer1_oligo} = $primer1_oligo; $pcr_data{$pcr_id}{primer1_seq} = $primer1_seq; $pcr_data{$pcr_id}{primer1_tm} = $primer1_tm; $pcr_data{$pcr_id}{primer2_oligo} = $primer2_oligo; $pcr_data{$pcr_id}{primer2_seq} = $primer2_seq; $pcr_data{$pcr_id}{primer2_tm} = $primer2_tm; $pcr_data{$pcr_id}{design_remark} = $design_remark; $pcr_data{$pcr_id}{use_seq} = $use_seq; $pcr_data{$pcr_id}{use_revcomp} = $use_revcomp; $pcr_data{$pcr_id}{use_remark} = $use_remark; $pcr_data{$pcr_id}{pcr_remark} = $pcr_remark; } ### Read SNP data open SNP, $snp_file or die "Cannot open $snp_file\n"; chomp ( my @snp_data = ( ) ); close SNP; my %snp_data; foreach ( @snp_data ) { if ( scalar (split /\t/, $_) != 5 ) { die "Wrong number of fields in the following line of $snp_file:\n$_\n" }; my ( $pcr_id, $snp_id, $snp_pos, $snp_amb, $snp_remark ) = split /\t/, $_; $snp_data{$pcr_id}{$snp_id}{snp_pos} = $snp_pos; $snp_data{$pcr_id}{$snp_id}{snp_amb} = $snp_amb; $snp_data{$pcr_id}{$snp_id}{snp_remark} = $snp_remark; } ### Read assay data open ASSAY, $assay_file or die "Cannot open $assay_file\n"; chomp ( my @assay_data = ( ) ); close ASSAY; my %assay_data; foreach ( @assay_data ) { if ( scalar (split /\t/, $_) != 10 ) { die "Wrong number of fields in the following line of $assay_file:\n$_\n" }; my ( $pcr_id, $snp_id, $assay_type, $assay_id, $assay_enzyme, $assay_oligo, $assay_specific, $assay_tail, $assay_strand, $assay_remark ) = split /\t/, $_; $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_type} = $assay_type; $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_enzyme} = $assay_enzyme; $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_oligo} = $assay_oligo; $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_specific} = $assay_specific; $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_tail} = $assay_tail; $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_strand} = $assay_strand; $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_remark} = $assay_remark; } ### Print everything print "\n"; print "\n"; print " 1.0\n"; foreach my $pcr_id ( sort keys %pcr_data ) { print " \n"; print " ", $pcr_id, "\n"; foreach ( split /;/, $pcr_data{$pcr_id}{pcr_modified} ) { print " ", $_, "\n"; } foreach ( split /;/, $pcr_data{$pcr_id}{pcr_project} ) { print " ", $_, "\n"; } foreach ( split /;/, $pcr_data{$pcr_id}{pcr_researcher} ) { print " ", $_, "\n"; } print " ", $pcr_data{$pcr_id}{pcr_species}, "\n"; print " \n"; print " \n"; print " <", $pcr_data{$pcr_id}{source_type}, ">", $pcr_data{$pcr_id}{source_id}, "\n"; print " \n"; print " ", $pcr_data{$pcr_id}{design_seq}, "\n"; print " \n"; print " ", $pcr_data{$pcr_id}{primer1_oligo}, "\n"; print " ", $pcr_data{$pcr_id}{primer1_seq}, "\n"; print " ", $pcr_data{$pcr_id}{primer1_tm}, "\n"; print " \n"; print " \n"; print " ", $pcr_data{$pcr_id}{primer2_oligo}, "\n"; print " ", $pcr_data{$pcr_id}{primer2_seq}, "\n"; print " ", $pcr_data{$pcr_id}{primer2_tm}, "\n"; print " \n"; foreach ( split /;/, $pcr_data{$pcr_id}{design_remark} ) { print " ", $_, "\n"; } print " \n"; print " \n"; print " ", $pcr_data{$pcr_id}{use_seq}, "\n"; print " ", $pcr_data{$pcr_id}{use_revcomp}, "\n"; foreach my $snp_id ( sort keys %{$snp_data{$pcr_id}} ) { print " \n"; print " ", $snp_id, "\n"; print " ", $snp_data{$pcr_id}{$snp_id}{snp_pos}, "\n"; print " ", $snp_data{$pcr_id}{$snp_id}{snp_amb}, "\n"; foreach ( split /;/, $snp_data{$pcr_id}{$snp_id}{snp_remark} ) { print " ", $_, "\n"; } foreach my $assay_id ( sort keys %{$assay_data{$pcr_id}{$snp_id}} ) { print " \n"; print " ", uc $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_type}, "\n"; print " ", $assay_id, "\n"; if ( uc $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_type} eq 'SBE' ) { print " ", $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_oligo}, "\n"; print " ", $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_specific}, "\n"; print " ", $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_tail}, "\n"; print " ", $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_strand}, "\n"; } else { print " ", $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_enzyme}, "\n"; } foreach ( split /;/, $assay_data{$pcr_id}{$snp_id}{$assay_id}{assay_remark} ) { print " ", $_, "\n"; } print " \n"; } print " \n"; } foreach ( split /;/, $pcr_data{$pcr_id}{use_remark} ) { print " ", $_, "\n"; } print " \n"; foreach ( split /;/, $pcr_data{$pcr_id}{pcr_remark} ) { print " ", $_, "\n"; } print " \n"; } print "\n"; mipe-1.1/COPYING0000644000175000017500000006350010267443213012710 0ustar janjan00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), 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 distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey 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 library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! mipe-1.1/README0000644000175000017500000000353010267443213012532 0ustar janjan00000000000000################################################## # MIPE - Minimal Information for PCR Experiments # ################################################## The MIPE format enables (or forces) genomics/genetics researchers to store information about PCR experiments in a structured way. This format (defined in the mipe.xsd file) is intended to be used freely by anyone. However, please reference the manuscript mentioned below. A MIPE compliant file is a XML file that complies to the rules set out in the 'mipe.xsd' file. On unix/linux, this can be checked with the command 'xsdvalid my_file.mipe'. Make sure to change the path in the 'DOCTYPE' line of the template file and your own MIPE files. Several scripts are provided to extract data from a MIPE. For documentation, type 'perldoc one_of_the_scripts.pl'. REFERENCING Please reference this manuscript: Aerts J & Veenendaal T. MIPE - a XML-format to facilitate the storage and exchange of PCR-related data. Online Journal of Bioinformatics 6(2): 114-120 (2005). INSTALLATION Thanks to Steffen Moeller, a debian package is available for mipe. You'd probably want to search Google for 'mipe debian'. Basically, nothing has to be installed. If you want, you can print out the mipe.xsd file and write flat-text files that comply to the criteria in the xsd file, maybe using the template.mipe file. For more information on how the rules in the xsd file should be read, search Google for 'XML XSD'. Several scripts are provided that make it easy to insert/extract data from a MIPE file. These have only been tested on a linux system. Make sure the MIPE file is really MIPE compliant (e.g. no spelling errors in tags or unknown/missing elements) before running them. To check this on a linux system, type "xsdvalid your_file.mipe". Feel free to let me know when you use this format (aerts at users.sourceforge.net). Jan Aerts mipe-1.1/genotype2mipe.pl0000755000175000017500000001200010267443213014771 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME genotype2mipe.pl - Inserts SNP data into MIPE file based on MIPE version v0.9 Make sure SNPs are already defined in the USE part of the PCR record. arguments: * mipe_file * STDIN: tab-delimited list of data, in the following order: PCR ID, sample ID, SNP ID, ambiguity code =head1 SYNOPSIS snp2mipe.pl my_file.mipe < my_data.txt =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my $file = shift; if ( not defined $file ) { die "Please provide filename\n" }; my $data = shift; my $twig = XML::Twig->new( pretty_print => 'indented' # , keep_atts_order => 1 , TwigHandlers => { pcr => \&pcr } ); my @genotype_data = ( ); my %genotype_passed; foreach ( @genotype_data ) { chomp; my ( $pcr_id_in, $sample_id_in, $snp_id_in, $genotype_in ) = split /\t/, $_; $genotype_passed{$sample_id_in}{$snp_id_in} = 0; } $twig->parsefile($file); $twig->print; foreach my $sample ( sort keys %genotype_passed ) { foreach my $snp ( sort keys %{$genotype_passed{$sample}} ) { if ( $genotype_passed{$sample}{$snp} == 0 ) { print STDERR "Data for sample $sample on SNP $snp not imported\n"; } } } exit; sub pcr { my ( $twig, $pcr ) = @_; my $pcr_id = $pcr->first_child('id')->text; LINE: foreach my $input_line ( @genotype_data ) { chomp $input_line; my ( $pcr_id_in, $sample_id_in, $snp_id_in, $genotype_in ) = split /\t/, $input_line; if ( $pcr_id =~ /$pcr_id_in/ ) { my $use = $pcr->first_child('use'); if ( not defined $use ) { print STDERR "No USE part defined for PCR $pcr_id\n"; next LINE; } my @snps = $use->children('snp'); my @samples = $use->children('sample'); my $new_sample = 1; foreach my $sample ( @samples ) { if ( $sample->first_child('id')->text eq $sample_id_in ) { $new_sample = 0; my @genotypes = $sample->children('genotype'); my $new_genotype = 1; foreach my $genotype ( @genotypes ) { if ( $genotype->first_child('snp_id')->text eq $snp_id_in ) { $new_genotype = 0; my $remark_elt = XML::Twig::Elt->new('remark', 'prev_amb ' . $genotype->first_child('amb')->text); $genotype->first_child('amb')->set_text($genotype_in); $remark_elt->paste('last_child', $genotype); $genotype_passed{$sample_id_in}{$snp_id_in} = 1; } } if ( $new_genotype ) { my $snp_id_found = 0; foreach my $snp ( @snps ) { if ( $snp->first_child('id')->text eq $snp_id_in ) { $snp_id_found = 1; } } if ( not $snp_id_found ) { print STDERR "SNP ID $snp_id_in not defined in MIPE file\n"; next LINE; } my $snp_id_elt = XML::Twig::Elt->new('snp_id', $snp_id_in); my $amb_elt = XML::Twig::Elt->new('amb', $genotype_in); my $genotype_elt = XML::Twig::Elt->new('genotype', ''); $snp_id_elt->paste('first_child', $genotype_elt); $amb_elt->paste('last_child', $genotype_elt); $genotype_elt->paste('last_child', $sample); $genotype_passed{$sample_id_in}{$snp_id_in} = 1; } } } if ( $new_sample ) { my $snp_id_found = 0; foreach my $snp ( @snps ) { if ( $snp->first_child('id')->text eq $snp_id_in ) { $snp_id_found = 1; } } if ( not $snp_id_found ) { print STDERR "SNP ID $snp_id_in not defined in MIPE file\n"; next LINE; } my $sample_id_elt = XML::Twig::Elt->new('id', $sample_id_in); my $snp_id_elt = XML::Twig::Elt->new('snp_id', $snp_id_in); my $amb_elt = XML::Twig::Elt->new('amb', $genotype_in); my $genotype_elt = XML::Twig::Elt->new('genotype',''); my $sample_elt = XML::Twig::Elt->new('sample',''); $snp_id_elt->paste('first_child', $genotype_elt); $amb_elt->paste('last_child', $genotype_elt); $sample_id_elt->paste('first_child', $sample_elt); $genotype_elt->paste('last_child', $sample_elt); if ( scalar $use->children('remark') > 0 ) { my @use_remarks = $use->children('remark'); my $first_remark = $use_remarks[0]; $sample_elt->paste('before', $first_remark); } else { $sample_elt->paste('last_child', $use); } $genotype_passed{$sample_id_in}{$snp_id_in} = 1; } } } } mipe-1.1/mipe.dtd0000644000175000017500000000463310267443213013306 0ustar janjan00000000000000 mipe-1.1/mipe.xsd0000644000175000017500000002316210267443213013327 0ustar janjan00000000000000 mipe-1.1/mipe06to07.pl0000755000175000017500000002217210267443213014027 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; my $file = shift; if ( not defined $file ) { die "Please provide name of v0.6 mipe file\n" }; print '', "\n"; print '', "\n"; my $twig = XML::Twig->new( TwigHandlers => { mipe => \&root } , pretty_print => 'indented' ); $twig->parsefile($file); sub root { my ( $twig, $root ) = @_; print '', "\n"; print ' 0.7', "\n"; my @pcr = $root->children('pcr'); foreach my $pcr ( @pcr ) { print " \n"; print die_print(' ', 'id', $pcr->first_child('id')->text); my @modified = $pcr->children('modified'); foreach ( @modified ) { print conditional_print(' ', 'modified', $_->text); } my @project = $pcr->children('project'); foreach ( @project ) { print conditional_print(' ', 'project', $_->text); } my @researcher = $pcr->children('researcher'); foreach ( @researcher ) { print conditional_print(' ', 'researcher', $_->text); } my @species = $pcr->children('species'); foreach ( @species ) { print conditional_print(' ', 'species', $_->text); } ######DESIGN###### print " \n"; my $design = $pcr->first_child('design'); ####SOURCE#### print " \n"; my $source = $design->first_child('source'); if ( defined $source->first_child('accession') ) { print conditional_print(' ','accession', $source->first_child('accession')->text) }; if ( defined $source->first_child('file') ) { print conditional_print(' ','file', $source->first_child('file')->text) }; if ( defined $source->first_child('seq') ) { print conditional_print(' ','seq', $source->first_child('seq')->text) }; if ( defined $source->first_child('name') ) { print conditional_print(' ','name', $source->first_child('name')->text) }; if ( defined $source->first_child('species') ) { print conditional_print(' ','species', $source->first_child('species')->text) }; if ( defined $source->first_child('type') ) { print conditional_print(' ','type', $source->first_child('type')->text) }; my @remarks = $source->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark',$_->text); } print " \n"; if ( defined $design->first_child('pos') ) { print conditional_print(' ','pos', $design->first_child('pos')->text) }; if ( defined $design->first_child('seq') ) { print conditional_print(' ','seq', $design->first_child('seq')->text) }; print " \n"; my $primer1 = $design->first_child('primer1'); if ( defined $primer1->first_child('oligo') ) { print conditional_print(' ','oligo', $primer1->first_child('oligo')->text) }; if ( defined $primer1->first_child('seq') ) { print conditional_print(' ','seq', $primer1->first_child('seq')->text) }; if ( defined $primer1->first_child('tm') ) { print conditional_print(' ','tm', $primer1->first_child('tm')->text) }; @remarks = $primer1->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark',$_->text); } print " \n"; print " \n"; my $primer2 = $design->first_child('primer2'); if ( defined $primer2->first_child('oligo') ) { print conditional_print(' ','oligo', $primer2->first_child('oligo')->text) }; if ( defined $primer2->first_child('seq') ) { print conditional_print(' ','seq', $primer2->first_child('seq')->text) }; if ( defined $primer2->first_child('tm') ) { print conditional_print(' ','tm', $primer2->first_child('tm')->text) }; @remarks = $primer2->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark',$_->text); } print " \n"; if ( defined $design->first_child('program') ) { print conditional_print(' ','program', $design->first_child('program')->text) }; @remarks = $design->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark',$_->text); } print " \n"; ######USE###### if ( defined $pcr->first_child('use') ) { print " \n"; my $use = $pcr->first_child('use'); if ( defined $use->first_child('seq') ) { print conditional_print(' ','seq', $use->first_child('seq')->text) }; if ( defined $use->first_child('revcomp') ) { print conditional_print(' ','revcomp', $use->first_child('revcomp')->text) }; ####SNP#### my @snp = $use->children('snp'); foreach my $snp ( @snp ) { print " \n"; print die_print(' ','id', $snp->first_child('id')->text); if ( defined $snp->first_child('pos') ) { print conditional_print(' ','pos', $snp->first_child('pos')->text) }; if ( defined $snp->first_child('pos_design') ) { print conditional_print(' ','pos_design', $snp->first_child('pos_design')->text) }; if ( defined $snp->first_child('pos_source') ) { print conditional_print(' ','pos_source', $snp->first_child('pos_source')->text) }; if ( defined $snp->first_child('amb') ) { print conditional_print(' ','amb', $snp->first_child('amb')->text) }; if ( defined $snp->first_child('rank') ) { print conditional_print(' ','rank', $snp->first_child('rank')->text) }; my @sbe = $snp->children('sbe'); foreach my $sbe ( @sbe ) { print " \n"; print die_print(' ','id', $sbe->first_child('id')->text); if ( defined $sbe->first_child('oligo') ) { print conditional_print(' ','oligo', $sbe->first_child('oligo')->text) }; if ( defined $sbe->first_child('specific') ) { print conditional_print(' ','specific', $sbe->first_child('specific')->text) }; if ( defined $sbe->first_child('tail') ) { print conditional_print(' ','tail', $sbe->first_child('tail')->text) }; if ( defined $sbe->first_child('strand') ) { print conditional_print(' ','strand', $sbe->first_child('strand')->text) }; @remarks = $sbe->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } print " \n"; } ####SAMPLE#### my @sample = $use->children('sample'); foreach my $sample ( @sample ) { print " \n"; print die_print(' ','id', $sample->first_child('id')->text); if ( defined $sample->first_child('file') ) { print conditional_print(' ','file', $sample->first_child('file')->text) }; my @genotype = $sample->children('genotype'); foreach my $genotype ( @genotype ) { print " \n"; print die_print(' ','snp_id', $genotype->first_child('snp_id')->text); print die_print(' ','amb', $genotype->first_child('amb')->text); @remarks = $genotype->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } @remarks = $sample->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } @remarks = $use->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } @remarks = $pcr->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } my @remarks = $root->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print "\n"; } sub conditional_print { my ( $prefix, $name, $field ) = @_; if ( not defined $field ) { return }; my $output; foreach ( $field ) { $output .= $prefix . '<' .$name . '>' . $field . '' . "\n"; } return $output; } sub die_print { my ( $prefix,$name, $field ) = @_; if ( not defined $field ) { die "No info for $name\n" }; my $output; foreach ( $field ) { $output .= $prefix . '<' .$name . '>' . $field . '' . "\n"; } return $output; } mipe-1.1/mipe08to09.pl0000755000175000017500000002723710267443213014042 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; my $file = shift; if ( not defined $file ) { die "Please provide name of v0.8 mipe file\n" }; print '', "\n"; print '', "\n"; my $twig = XML::Twig->new( TwigHandlers => { mipe => \&root } , pretty_print => 'indented' ); $twig->parsefile($file); print STDERR "Check your PCR profiles (especially the annealing temp) and the SBE assays!!\n"; sub root { my ( $twig, $root ) = @_; print '', "\n"; print ' 0.9', "\n"; my @pcr = $root->children('pcr'); foreach my $pcr ( @pcr ) { print " \n"; print die_print(' ', 'id', $pcr->first_child('id')->text); my @modified = $pcr->children('modified'); foreach ( @modified ) { print conditional_print(' ', 'modified', $_->text); } my @project = $pcr->children('project'); foreach ( @project ) { print conditional_print(' ', 'project', $_->text); } my @researcher = $pcr->children('researcher'); foreach ( @researcher ) { print conditional_print(' ', 'researcher', $_->text); } my @species = $pcr->children('species'); foreach ( @species ) { print conditional_print(' ', 'species', $_->text); } ######DESIGN###### print " \n"; my $design = $pcr->first_child('design'); ####SOURCE#### print " \n"; my $source = $design->first_child('source'); if ( defined $source->first_child('accession') ) { print conditional_print(' ','accession', $source->first_child('accession')->text) }; if ( defined $source->first_child('file') ) { print conditional_print(' ','file', $source->first_child('file')->text) }; if ( defined $source->first_child('seq') ) { print conditional_print(' ','seq', $source->first_child('seq')->text) }; if ( defined $source->first_child('name') ) { print conditional_print(' ','name', $source->first_child('name')->text) }; if ( defined $source->first_child('species') ) { print conditional_print(' ','species', $source->first_child('species')->text) }; if ( defined $source->first_child('type') ) { print conditional_print(' ','type', $source->first_child('type')->text) }; my @remarks = $source->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark',$_->text); } print " \n"; if ( defined $design->first_child('pos') ) { print conditional_print(' ','pos', $design->first_child('pos')->text) }; if ( defined $design->first_child('seq') ) { print conditional_print(' ','seq', $design->first_child('seq')->text) }; print " \n"; my $primer1 = $design->first_child('primer1'); if ( defined $primer1->first_child('oligo') ) { print conditional_print(' ','oligo', $primer1->first_child('oligo')->text) }; if ( defined $primer1->first_child('seq') ) { print conditional_print(' ','seq', $primer1->first_child('seq')->text) }; if ( defined $primer1->first_child('tm') ) { print conditional_print(' ','tm', $primer1->first_child('tm')->text) }; @remarks = $primer1->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark',$_->text); } print " \n"; print " \n"; my $primer2 = $design->first_child('primer2'); if ( defined $primer2->first_child('oligo') ) { print conditional_print(' ','oligo', $primer2->first_child('oligo')->text) }; if ( defined $primer2->first_child('seq') ) { print conditional_print(' ','seq', $primer2->first_child('seq')->text) }; if ( defined $primer2->first_child('tm') ) { print conditional_print(' ','tm', $primer2->first_child('tm')->text) }; @remarks = $primer2->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark',$_->text); } print " \n"; if ( defined $design->first_child('program') ) { print " \n"; print " ", uc $design->first_child('program')->text, "\n"; if ( (uc $design->first_child('program')->text) =~ /KNOR/ ) { ( my $anneal_temp = uc $design->first_child('program')->text ) =~ s/KNOR//; print " \n"; print " 95 degrees C\n"; print " \n"; print " \n"; print " \n"; print " 35\n"; print " \n"; print " 95 degrees C\n"; print " \n"; print " \n"; print " \n"; print " ", $anneal_temp, " degrees C\n"; print " \n"; print " \n"; print " \n"; print " 72 degrees C\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " 72 degrees C\n"; print " \n"; print " \n"; } elsif ( (uc $design->first_child('program')->text) =~ /KIP/ ) { ( my $anneal_temp = uc $design->first_child('program')->text ) =~ s/KIP//; print " \n"; print " 95 degrees C\n"; print " \n"; print " \n"; print " \n"; print " 35\n"; print " \n"; print " 95 degrees C\n"; print " \n"; print " \n"; print " \n"; print " ", $anneal_temp, " degrees C\n"; print " \n"; print " \n"; print " \n"; print " 72 degrees C\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " 72 degrees C\n"; print " \n"; print " \n"; } print " \n"; } @remarks = $design->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark',$_->text); } print " \n"; ######USE###### if ( defined $pcr->first_child('use') ) { print " \n"; my $use = $pcr->first_child('use'); if ( defined $use->first_child('seq') ) { print conditional_print(' ','seq', $use->first_child('seq')->text) }; if ( defined $use->first_child('revcomp') ) { print conditional_print(' ','revcomp', $use->first_child('revcomp')->text) }; ####SNP#### my @snp = $use->children('snp'); foreach my $snp ( @snp ) { print " \n"; print die_print(' ','id', $snp->first_child('id')->text); if ( defined $snp->first_child('pos') ) { print conditional_print(' ','pos', $snp->first_child('pos')->text) }; if ( defined $snp->first_child('pos_design') ) { print conditional_print(' ','pos_design', $snp->first_child('pos_design')->text) }; if ( defined $snp->first_child('pos_source') ) { print conditional_print(' ','pos_source', $snp->first_child('pos_source')->text) }; if ( defined $snp->first_child('amb') ) { print conditional_print(' ','amb', $snp->first_child('amb')->text) }; if ( defined $snp->first_child('rank') ) { print conditional_print(' ','rank', $snp->first_child('rank')->text) }; my @sbe = $snp->children('sbe'); foreach my $sbe ( @sbe ) { print " \n"; print " sbe\n"; print die_print(' ','id', $sbe->first_child('id')->text); if ( defined $sbe->first_child('oligo') ) { print conditional_print(' ','oligo', $sbe->first_child('oligo')->text) }; if ( defined $sbe->first_child('specific') ) { print conditional_print(' ','specific', $sbe->first_child('specific')->text) }; if ( defined $sbe->first_child('tail') ) { print conditional_print(' ','tail', $sbe->first_child('tail')->text) }; if ( defined $sbe->first_child('strand') ) { print conditional_print(' ','strand', $sbe->first_child('strand')->text) }; @remarks = $sbe->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } @remarks = $snp->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } ####SAMPLE#### my @sample = $use->children('sample'); foreach my $sample ( @sample ) { print " \n"; print die_print(' ','id', $sample->first_child('id')->text); if ( defined $sample->first_child('file') ) { print conditional_print(' ','file', $sample->first_child('file')->text) }; my @genotype = $sample->children('genotype'); foreach my $genotype ( @genotype ) { print " \n"; print die_print(' ','snp_id', $genotype->first_child('snp_id')->text); print die_print(' ','amb', $genotype->first_child('amb')->text); @remarks = $genotype->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } @remarks = $sample->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } @remarks = $use->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } @remarks = $pcr->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } my @remarks = $root->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print "\n"; } sub conditional_print { my ( $prefix, $name, $field ) = @_; if ( not defined $field ) { return }; my $output; foreach ( $field ) { $output .= $prefix . '<' .$name . '>' . $field . '' . "\n"; } return $output; } sub die_print { my ( $prefix,$name, $field ) = @_; if ( not defined $field ) { die "No info for $name\n" }; my $output; foreach ( $field ) { $output .= $prefix . '<' .$name . '>' . $field . '' . "\n"; } return $output; } mipe-1.1/mipe0_9to1_0.pl0000755000175000017500000003155610267443213014330 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; my $file = shift; if ( not defined $file ) { die "Please provide name of v0.9 mipe file\n" }; print '', "\n"; my $twig = XML::Twig->new( TwigHandlers => { mipe => \&root } , pretty_print => 'indented' ); $twig->parsefile($file); sub root { my ( $twig, $root ) = @_; print '', "\n"; print ' 1.0', "\n"; my @pcr = $root->children('pcr'); foreach my $pcr ( @pcr ) { print " text, "'>\n"; print die_print(' ', 'id', $pcr->first_child('id')->text); my @modified = $pcr->children('modified'); foreach ( @modified ) { print conditional_print(' ', 'modified', $_->text); } my @project = $pcr->children('project'); foreach ( @project ) { print conditional_print(' ', 'project', $_->text); } my @researcher = $pcr->children('researcher'); foreach ( @researcher ) { print conditional_print(' ', 'researcher', $_->text); } my @species = $pcr->children('species'); foreach ( @species ) { print conditional_print(' ', 'species', $_->text); } ######DESIGN###### print " \n"; my $design = $pcr->first_child('design'); ####SOURCE#### print " \n"; my $source = $design->first_child('source'); if ( defined $source->first_child('accession') ) { print conditional_print(' ','accession', $source->first_child('accession')->text) }; if ( defined $source->first_child('file') ) { print conditional_print(' ','file', $source->first_child('file')->text) }; if ( defined $source->first_child('seq') ) { print conditional_print(' ','seq', $source->first_child('seq')->text) }; if ( defined $source->first_child('name') ) { print conditional_print(' ','name', $source->first_child('name')->text) }; if ( defined $source->first_child('species') ) { print conditional_print(' ','species', $source->first_child('species')->text) }; if ( defined $source->first_child('type') ) { print conditional_print(' ','type', $source->first_child('type')->text) }; my @remarks = $source->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark',$_->text); } print " \n"; if ( defined $design->first_child('pos') ) { print conditional_print(' ','range', $design->first_child('pos')->text) }; if ( defined $design->first_child('seq') ) { print conditional_print(' ','seq', $design->first_child('seq')->text) }; print " \n"; my $primer1 = $design->first_child('primer1'); if ( defined $primer1->first_child('oligo') ) { print conditional_print(' ','oligo', $primer1->first_child('oligo')->text) }; if ( defined $primer1->first_child('seq') ) { print conditional_print(' ','seq', $primer1->first_child('seq')->text) }; if ( defined $primer1->first_child('tm') ) { print conditional_print(' ','tm', $primer1->first_child('tm')->text) }; @remarks = $primer1->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark',$_->text); } print " \n"; print " \n"; my $primer2 = $design->first_child('primer2'); if ( defined $primer2->first_child('oligo') ) { print conditional_print(' ','oligo', $primer2->first_child('oligo')->text) }; if ( defined $primer2->first_child('seq') ) { print conditional_print(' ','seq', $primer2->first_child('seq')->text) }; if ( defined $primer2->first_child('tm') ) { print conditional_print(' ','tm', $primer2->first_child('tm')->text) }; @remarks = $primer2->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark',$_->text); } print " \n"; if ( defined $design->first_child('profile') ) { print " \n"; if ( defined $design->first_child('profile')->first_child('program') ) { print conditional_print(' ','program',$design->first_child('profile')->first_child('program')->text) }; if ( defined $design->first_child('profile')->first_child('predenaturation') ) { print " \n"; if ( defined $design->first_child('profile')->first_child('predenaturation')->first_child('temp') ) { print conditional_print(' ','temp',$design->first_child('profile')->first_child('predenaturation')->first_child('temp')->text) }; if ( defined $design->first_child('profile')->first_child('predenaturation')->first_child('temp') ) { print conditional_print(' ','time',$design->first_child('profile')->first_child('predenaturation')->first_child('time')->text) }; print " \n"; } my @cycles = $design->first_child('profile')->first_child('cycle'); foreach my $cycle ( @cycles ) { print " \n"; if ( defined $cycle->first_child('number') ) { print conditional_print(' ','number',$cycle->first_child('number')->text) }; if ( defined $cycle->first_child('denaturation') ) { print " \n"; if ( defined $cycle->first_child('denaturation')->first_child('temp') ) { print conditional_print(' ','temp',$cycle->first_child('denaturation')->first_child('temp')->text) }; if ( defined $cycle->first_child('denaturation')->first_child('time') ) { print conditional_print(' ','time',$cycle->first_child('denaturation')->first_child('time')->text) }; print " \n"; } if ( defined $cycle->first_child('annealing') ) { print " \n"; if ( defined $cycle->first_child('annealing')->first_child('temp') ) { print conditional_print(' ','temp',$cycle->first_child('annealing')->first_child('temp')->text) }; if ( defined $cycle->first_child('annealing')->first_child('time') ) { print conditional_print(' ','time',$cycle->first_child('annealing')->first_child('time')->text) }; print " \n"; } if ( defined $cycle->first_child('elongation') ) { print " \n"; if ( defined $cycle->first_child('elongation')->first_child('temp') ) { print conditional_print(' ','temp',$cycle->first_child('elongation')->first_child('temp')->text) }; if ( defined $cycle->first_child('elongation')->first_child('time') ) { print conditional_print(' ','time',$cycle->first_child('elongation')->first_child('time')->text) }; print " \n"; } print " \n"; } if ( defined $design->first_child('profile')->first_child('postelongation') ) { print " \n"; if ( defined $design->first_child('profile')->first_child('postelongation')->first_child('temp') ) { print conditional_print(' ','temp',$design->first_child('profile')->first_child('postelongation')->first_child('temp')->text) }; if ( defined $design->first_child('profile')->first_child('postelongation')->first_child('temp') ) { print conditional_print(' ','time',$design->first_child('profile')->first_child('postelongation')->first_child('time')->text) }; print " \n"; } print " \n"; } @remarks = $design->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark',$_->text); } print " \n"; ######USE###### if ( defined $pcr->first_child('use') ) { print " \n"; my $use = $pcr->first_child('use'); if ( defined $use->first_child('seq') ) { print conditional_print(' ','seq', $use->first_child('seq')->text) }; if ( defined $use->first_child('revcomp') ) { print conditional_print(' ','revcomp', $use->first_child('revcomp')->text) }; ####SNP#### my @snp = $use->children('snp'); foreach my $snp ( @snp ) { print " text, "'>\n"; print die_print(' ','id', $snp->first_child('id')->text); if ( defined $snp->first_child('pos') ) { print conditional_print(' ','pos', $snp->first_child('pos')->text) }; if ( defined $snp->first_child('pos_design') ) { print conditional_print(' ','pos_design', $snp->first_child('pos_design')->text) }; if ( defined $snp->first_child('pos_source') ) { print conditional_print(' ','pos_source', $snp->first_child('pos_source')->text) }; if ( defined $snp->first_child('amb') ) { print conditional_print(' ','amb', $snp->first_child('amb')->text) }; if ( defined $snp->first_child('rank') ) { print conditional_print(' ','rank', $snp->first_child('rank')->text) }; my @sbe = $snp->children('sbe'); foreach my $sbe ( @sbe ) { print " text, "'>\n"; print " sbe\n"; print die_print(' ','id', $sbe->first_child('id')->text); if ( defined $sbe->first_child('oligo') ) { print conditional_print(' ','oligo', $sbe->first_child('oligo')->text) }; if ( defined $sbe->first_child('specific') ) { print conditional_print(' ','specific', $sbe->first_child('specific')->text) }; if ( defined $sbe->first_child('tail') ) { print conditional_print(' ','tail', $sbe->first_child('tail')->text) }; if ( defined $sbe->first_child('strand') ) { print conditional_print(' ','strand', $sbe->first_child('strand')->text) }; @remarks = $sbe->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } @remarks = $snp->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } ####SAMPLE#### my @sample = $use->children('sample'); foreach my $sample ( @sample ) { print " text, "'>\n"; print die_print(' ','id', $sample->first_child('id')->text); if ( defined $sample->first_child('file') ) { print conditional_print(' ','file', $sample->first_child('file')->text) }; my @genotype = $sample->children('genotype'); foreach my $genotype ( @genotype ) { print " \n"; print die_print(' ','snp_id', $genotype->first_child('snp_id')->text); print die_print(' ','amb', $genotype->first_child('amb')->text); @remarks = $genotype->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } @remarks = $sample->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } @remarks = $use->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } @remarks = $pcr->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print " \n"; } my @remarks = $root->children('remark'); foreach ( @remarks ) { print conditional_print(' ','remark', $_->text); } print "\n"; } sub conditional_print { my ( $prefix, $name, $field ) = @_; if ( not defined $field ) { return }; my $output; foreach ( $field ) { $output .= $prefix . '<' .$name . '>' . $field . '' . "\n"; } return $output; } sub die_print { my ( $prefix,$name, $field ) = @_; if ( not defined $field ) { die "No info for $name\n" }; my $output; foreach ( $field ) { $output .= $prefix . '<' .$name . '>' . $field . '' . "\n"; } return $output; } mipe-1.1/mipe2dbSTS.pl0000755000175000017500000002216110267443213014127 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME mipe2dbSTS.pl - Generates input file for submission to dbSTS included in output: STS section of dbSTS submission based on MIPE version v1.1 arguments: * mipe_file * config file * (optional) list of PCR IDs The config file consists of lines containing a key and a value, separated by an equal sign ('='). The key consists of the lowercase name of the NCBI submission file (see website dbSTS), followed by an underscore and the lowercase name of the field in that file. The following fields should be defined in the config file: pub_title= pub_authors= source_name= source_organism= cont_name= cont_fax= cont_tel= cont_email= cont_lab= cont_inst= cont_addr= protocol_name= protocol_protocol= buffer_name= buffer_buffer= sts_pcr_profile= For protocol_protocol, buffer_buffer and sts_pcr_profile, more lines are necessary (see example). An example of a config file look like this: pub_title=Genetic mapping of chicken SNPs pub_authors=Aerts,J.A.; Veenendaal,T.; Crooijmans,R.P.M.A; Groenen,M.A.M source_name=Chicken genomic DNA source_organism=Gallus gallus cont_name=Jan Aerts cont_fax=+31 317 483929 cont_tel=+31 317 483397 cont_email=jan.aerts@wur.nl cont_lab=Animal Breeding and Genomics Group cont_inst=Wageningen University cont_addr=PO Box 338, 6700 AH Wageningen, The Netherlands protocol_name=Protocol_Aerts protocol_protocol=Template: 30-60 ng protocol_protocol=Primer: each 4 uM protocol_protocol=dNTPs: each 200 uM protocol_protocol=Taq: 0.3 units protocol_protocol=Volume: 12 ul buffer_name=Buffer_Aerts buffer_buffer=MgCl2: 1.5 mM buffer_buffer=(NH4)2SO4: 20 mM buffer_buffer=Tris-HCl: 75 mM buffer_buffer=Tween 20: 0.01% (w/v) buffer_buffer=pH: 8.8 =head1 BUGS Unknown. If you encounter one, please let me know (jan.aerts@wur.nl). =head1 SYNOPSIS mipe2dbSTS.pl your_file.mipe dbSTS.config =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my %amb_codes = ( M => ['A', 'C'] , R => ['A', 'G'] , W => ['A', 'T'] , S => ['C', 'G'] , Y => ['C', 'T'] , K => ['G', 'T'] , V => ['A', 'C', 'G'] , H => ['A', 'C', 'T'] , D => ['A', 'G', 'T'] , B => ['C', 'G', 'T'] , N => ['A', 'C', 'G', 'T'] ); my ( $mipe_file, $config_file ) = @ARGV; if ( not defined $mipe_file or not defined $config_file ) { die "Please provide filenames\n" }; chomp (my @pcr_ids = grep { /[a-zA-Z0-9]/ } ()); my %config; open CONFIG, $config_file || die "Cannot open config file $config_file\n"; chomp ( my @config = ( ) ); close CONFIG; foreach ( @config ) { my ( $key, $value ) = split /=/, $_; if ( $key ne 'protocol_protocol' and $key ne 'buffer_buffer' and $key ne 'sts_pcr_profile' ) { $config{$key} = $value; } elsif ( $key eq 'protocol_protocol' ) { push @{$config{'protocol_protocol'}}, $value; } elsif ( $key eq 'buffer_buffer' ) { push @{$config{'buffer_buffer'}}, $value; } } print pub(); print source(); print contact(); print protocol(); print buffer(); print sts(); sub pub { my $to_print; $to_print .= "TYPE: PUB\n"; $to_print .= "TITLE:\n"; $to_print .= $config{'pub_title'} . "\n"; $to_print .= "AUTHORS:\n"; $to_print .= $config{'pub_authors'} . "\n"; $to_print .= "STATUS: 1\n"; $to_print .= "||\n"; return $to_print; } sub source { my $to_print; $to_print .= "TYPE: SOURCE\n"; $to_print .= "NAME: " . $config{'source_name'} . "\n"; $to_print .= "ORGANISM: " . $config{'source_organism'} . "\n"; $to_print .= "||\n"; return $to_print; } sub contact { my $to_print; $to_print .= "TYPE: CONT\n"; $to_print .= "NAME: " . $config{'cont_name'} . "\n"; $to_print .= "FAX: " . $config{'cont_fax'} . "\n"; $to_print .= "TEL: " . $config{'cont_tel'} . "\n"; $to_print .= "EMAIL: " . $config{'cont_email'} . "\n"; $to_print .= "LAB: " . $config{'cont_lab'} . "\n"; $to_print .= "INST: " . $config{'cont_inst'} . "\n"; $to_print .= "ADDR: " . $config{'cont_addr'} . "\n"; $to_print .= "||\n"; return $to_print; } sub protocol { my $to_print; $to_print .= "TYPE: PROTOCOL\n"; $to_print .= "NAME: " . $config{'protocol_name'} . "\n"; $to_print .= "PROTOCOL:\n"; foreach ( @{$config{'protocol_protocol'}} ) { $to_print .= " " . $_ . "\n"; } $to_print .= "||\n"; return $to_print; } sub buffer { my $to_print; $to_print .= "TYPE: BUFFER\n"; $to_print .= "NAME: " . $config{'buffer_name'} . "\n"; $to_print .= "BUFFER:\n"; foreach ( @{$config{'buffer_buffer'}} ) { $to_print .= " " . $_ . "\n"; } $to_print .= "||\n"; return $to_print; } sub sts { my $twig = XML::Twig->new( TwigHandlers => { pcr => \&pcr } , pretty_print => 'indented' ); $twig->parsefile($mipe_file); exit; } sub pcr { my ( $twig, $pcr ) = @_; my $to_include = 0; my $pcr_id = $pcr->{att}->{id}; if ( scalar @pcr_ids > 0 ) { $to_include = 0; foreach ( @pcr_ids ) { if ( $pcr_id =~ /$_/i ) { $to_include = 1; } } } else { $to_include = 1; } if ( $to_include ) { my $design = $pcr->first_child('design'); my %snps; print "TYPE: STS\n"; print "STATUS: New\n"; print "CONT_NAME: ", $config{'cont_name'}, "\n"; print "PROTOCOL: ", $config{'protocol_name'}, "\n"; print "BUFFER: ", $config{'buffer_name'}, "\n"; print "SOURCE: ", $config{'source_name'}, "\n"; print "CITATION:\nGenetic mapping of chicken SNPs\n"; print "STS#: ", $pcr_id, "\n"; print "SIZE: ", length $design->first_child('seq')->text, "\n"; print "F_PRIMER: ", $design->first_child('primer1')->first_child('seq')->text, "\n"; print "R_PRIMER: ", $design->first_child('primer2')->first_child('seq')->text, "\n"; print "DNA_TYPE: Genomic\n"; print "PCR_PROFILE:\n"; if ( defined $design->first_child('profile') ) { my $profile = $design->first_child('profile'); if ( defined $profile->first_child('predenaturation') ) { print " Presoak: ", $profile->first_child('predenaturation')->first_child('temp')->text, " for ", $profile->first_child('predenaturation')->first_child('time')->text, "\n"; } if ( defined $profile->first_child('cycle') ) { my @cycles = $profile->children('cycle'); foreach ( @cycles ) { print " Denaturation: ", $_->first_child('denaturation')->first_child('temp')->text, " for ", $_->first_child('denaturation')->first_child('time')->text, "\n"; print " Annealing: ", $_->first_child('annealing')->first_child('temp')->text, " for ", $_->first_child('annealing')->first_child('time')->text, "\n"; print " Elongation: ", $_->first_child('elongation')->first_child('temp')->text, " for ", $_->first_child('elongation')->first_child('time')->text, "\n"; print " PCR cycles: ", $_->first_child('number')->text, "\n"; } } if ( defined $profile->first_child('postelongation') ) { print " Presoak: ", $profile->first_child('postelongation')->first_child('temp')->text, " for ", $profile->first_child('postelongation')->first_child('time')->text, "\n"; } } else { print " UNKNOWN\n"; } print "PUBLIC:\n"; if ( defined $pcr->first_child('use') ) { my $use = $pcr->first_child('use'); my @snps = $use->children('snp'); if ( scalar @snps > 0 ) { print "COMMENT:\n"; print " Polymorphism(s) (positions as in sequence):\n"; } foreach my $snp ( @snps ) { if ( defined $snp->first_child('pos_design') ) { my $snp_amb = $snp->first_child('amb')->text; if ( $use->first_child('revcomp')->text == 1 ) { $snp_amb =~ tr/ACGTMRWSYKVHDBN /TGCAKYWSRMBDHVN /s; } print " ID=", $snp->{att}->{id}, "\n"; print " Position=", $snp->first_child('pos_design')->text, "\n"; print " Ambiguity=", $snp_amb, "\n"; } } } print "SEQUENCE:\n"; my $seq = $design->first_child('seq')->text; $seq =~ s/(.{50})/$1\n/g; print $seq, "\n"; print "||\n"; } } mipe-1.1/mipe2fas.pl0000755000175000017500000000430010267443213013714 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME mipe2fas.pl - Generates FASTA file included in output: FASTA formatted seq based on MIPE version v1.1 arguments: * [design|use] * mipe_file * (optional) list of PCR IDs =head1 SYNOPSIS mipe2fasta.pl [design|use] your_file.mipe =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my ( $design_or_use, $file, @pcr_ids ) = @ARGV; if ( not defined $file ) { die "Please provide filename\n" }; if ( (uc $design_or_use) ne 'DESIGN' and (uc $design_or_use) ne 'USE' ) { die "Usage: mipe2fas.pl [design|use] file.mipe\n"; } my $twig = XML::Twig->new( TwigHandlers => { pcr => \&pcr } , pretty_print => 'indented' ); $twig->parsefile($file); exit; sub pcr { my ( $twig, $pcr ) = @_; my $to_include = 0; my $pcr_id = $pcr->{att}->{id}; if ( scalar @pcr_ids > 0 ) { $to_include = 0; foreach ( @pcr_ids ) { if ( $pcr_id =~ /$_/i ) { $to_include = 1; } } } else { $to_include = 1; } if ( $to_include ) { print '>', $pcr_id, "\n"; my $seq; if ( uc $design_or_use eq 'DESIGN' ) { $seq = $pcr->first_child('design')->first_child('seq')->text || ''; } else { $seq = $pcr->first_child('use')->first_child('seq')->text || ''; } $seq =~ s/(.{50})/$1\n/g; print $seq, "\n"; } } mipe-1.1/mipe2genotypes.pl0000755000175000017500000000575210267443213015174 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; use Data::Dumper; =head1 NAME mipe2genotypes.pl - Generates list of genotypes from a MIPE file included in output: PCR ID, list of SNP IDs, genotypes for each sample based on MIPE version v1.1 arguments: * mipe_file * (optional) list of PCR IDs =head1 SYNOPSIS mipe2genotypes.pl your_file.mipe =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my ( $file, @pcr_ids ) = @ARGV; if ( not defined $file ) { die "Please provide filename\n" }; my $twig = XML::Twig->new( TwigHandlers => { pcr => \&pcr } , pretty_print => 'indented' ); $twig->parsefile($file); exit; sub pcr { my ( $twig, $pcr ) = @_; my $to_include = 0; my $pcr_id = $pcr->{att}->{id}; if ( scalar @pcr_ids > 0 ) { $to_include = 0; foreach ( @pcr_ids ) { if ( $pcr_id =~ /$_/i ) { $to_include = 1; } } } else { $to_include = 1; } if ( $to_include ) { print $pcr_id, "\n"; if ( not defined $pcr->first_child('use') ) { print "\tNo use part defined\n"; } else { my @snps = $pcr->first_child('use')->children('snp'); my %snps; foreach my $snp ( @snps ) { my $snp_id = $snp->{att}->{id}; my $snp_pos = $snp->first_child('pos')->text; $snps{$snp_id} = $snp_pos; } my @samples = $pcr->first_child('use')->children('sample'); my %diplotypes; foreach my $sample ( @samples ) { my $sample_id = $sample->{att}->{id}; my @sample_snps = $sample->children('genotype'); foreach my $sample_snp ( @sample_snps ) { my $sample_snp_id = $sample_snp->first_child('snp_id')->text; my $sample_snp_amb = $sample_snp->first_child('amb')->text; $diplotypes{$sample_id}{$snps{$sample_snp_id}} = $sample_snp_amb; } } print join(';', ( sort { $a <=> $b } values %snps ) ), "\n"; foreach my $sample ( sort keys %diplotypes ) { print $sample, "\t"; foreach my $snp_pos ( sort { $a <=> $b } values %snps ) { print ( $diplotypes{$sample}{$snp_pos} || ' ' ); } print "\n"; } } } } mipe-1.1/mipe2html.pl0000755000175000017500000002575010267443213014123 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use CGI ':standard'; use XML::Twig; =head1 NAME mipe2html.pl - Generates HTML page based on MIPE file based on MIPE version v1.1 arguments: * mipe_file * (optional) list of PCR IDs =head1 SYNOPSIS mipe2html.pl your_file.mipe =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my ( $file, @pcr_ids ) = @ARGV; if ( not defined $file ) { die "Please provide filename\n" }; print header, start_html('Overview MIPE file'), h1('Overview of MIPE file: ', $file); print "Page created by mipe2html.pl (see http://mipe.sourceforge.net)", br, "\n"; print "

"; my $requested; if ( scalar @pcr_ids == 0 ) { $requested = 'all'; } else { $requested = join(';', @pcr_ids); } print "Requested PCR products: ", $requested, br, "\n"; print hr; my $twig = XML::Twig->new( TwigHandlers => { pcr => \&pcr } , pretty_print => 'indented' ); $twig->parsefile($file); print end_html; print "\n"; exit; sub pcr { my ( $twig, $pcr ) = @_; my $to_include = 0; my $pcr_id = $pcr->{att}->{id}; if ( scalar @pcr_ids > 0 ) { $to_include = 0; foreach ( @pcr_ids ) { if ( $pcr_id =~ /$_/i ) { $to_include = 1; } } } else { $to_include = 1; } if ( $to_include ) { print h2('PCR ID: ', $pcr_id), "\n"; my @projects = $pcr->children('project'); my @projects_text; foreach ( @projects ) { push @projects_text, $_->text; } if ( scalar @projects_text > 0 ) { print "Projects: ", join(', ', @projects_text), br, "\n"; } my @researchers = $pcr->children('researcher'); my @researchers_text; foreach ( @researchers ) { push @researchers_text, $_->text; } if ( scalar @researchers_text > 0 ) { print "Researchers: ", join(', ', @researchers_text), br; } my @remarks = $pcr->children('remark'); if ( scalar @remarks > 0 ) { print h5('Remarks'); print "", "\n"; foreach ( @remarks ) { print "\n"; } print "
", $_->text, "
", br, "\n"; } print h3('Design'), "\n"; my $design_seq = $pcr->first_child('design')->first_child('seq')->text; $design_seq =~ s/(.{10})/$1 /g; $design_seq =~ s/(.{55})/$1\
\n/g; print "seq:\n"; print "

", $design_seq, "
\n"; print "pos on source: ", $pcr->first_child('design')->first_child('range')->text, br, "\n"; print h4('Source'), "\n"; if ( defined $pcr->first_child('design')->first_child('source')->first_child('seq') ) { my $source_seq = $pcr->first_child('design')->first_child('source')->first_child('seq')->text; $source_seq =~ s/(.{10})/$1 /g; $source_seq =~ s/(.{55})/$1\
\n/g; print "Seq:\n"; print "
", $source_seq, "
\n"; } elsif ( defined $pcr->first_child('design')->first_child('source')->first_child('file') ) { print "File: ", $pcr->first_child('design')->first_child('source')->first_child('file')->text, br, "\n"; } elsif ( defined $pcr->first_child('design')->first_child('source')->first_child('accession') ) { print "Accession: ", $pcr->first_child('design')->first_child('source')->first_child('accession')->text, br, "\n"; } else { die "No valid MIPE file (source)\n" }; my $source_name = ( defined $pcr->first_child('design')->first_child('source')->first_child('name') ) ? $pcr->first_child('design')->first_child('source')->first_child('name')->text : 'UNKNOWN'; my $source_species = ( defined $pcr->first_child('design')->first_child('source')->first_child('species') ) ? $pcr->first_child('design')->first_child('source')->first_child('species')->text : 'UNKNOWN'; print "name: ", $source_name, br, "\n"; print "species: ", $source_species, br, "\n"; print h4('Primer1'), "\n"; print "oligo: ", $pcr->first_child('design')->first_child('primer1')->first_child('oligo')->text, br, "\n"; print "seq: ", $pcr->first_child('design')->first_child('primer1')->first_child('seq')->text, br, "\n"; print "Tm: ", $pcr->first_child('design')->first_child('primer1')->first_child('tm')->text, br, "\n"; print h4('Primer2'), "\n"; print "oligo: ", $pcr->first_child('design')->first_child('primer2')->first_child('oligo')->text, br, "\n"; print "seq: ", $pcr->first_child('design')->first_child('primer2')->first_child('seq')->text, br, "\n"; print "Tm: ", $pcr->first_child('design')->first_child('primer2')->first_child('tm')->text, br, "\n"; print h3('Use'), "\n"; if ( not defined $pcr->first_child('use') ) { print "No data for use", br, "\n"; } else { if ( defined $pcr->first_child('use')->first_child('seq') ) { my $use_seq = $pcr->first_child('use')->first_child('seq')->text; $use_seq =~ s/(.{10})/$1 /g; $use_seq =~ s/(.{55})/$1\
\n/g; print "seq:\n"; print "
", $use_seq, "
\n"; } else { print "seq: unknown", br; } if ( defined $pcr->first_child('use')->first_child('revcomp') ) { print "revcomp: ", $pcr->first_child('use')->first_child('revcomp')->text, br, "\n"; } else { print "revcomp: 0", br, "\n"; } my @snps = $pcr->first_child('use')->children('snp'); my %snps; foreach my $snp ( @snps ) { my $snp_id = $snp->{att}->{id}; $snps{$snp_id}{amb} = ( defined $snp->first_child('amb') ) ? $snp->first_child('amb')->text : ''; $snps{$snp_id}{pos} = $snp->first_child('pos')->text || die "File not in MIPE format (SNP pos)\n"; $snps{$snp_id}{pos_design} = ( defined $snp->first_child('pos_design') ) ? $snp->first_child('pos_design')->text : ''; $snps{$snp_id}{pos_source} = ( defined $snp->first_child('pos_source') ) ? $snp->first_child('pos_source')->text : ''; $snps{$snp_id}{rank} = ( defined $snp->first_child('rank') ) ? $snp->first_child('rank')->text : ''; my @remarks = $snp->children('remark'); if ( scalar @remarks > 0 ) { $snps{$snp_id}{remarks} = 1; my @remarks_text; foreach ( @remarks ) { push @remarks_text, $_->text; } $snps{$snp_id}{remarks_text} = join ('; ', @remarks_text); } else { $snps{$snp_id}{remarks} = 0; } } my @samples = $pcr->first_child('use')->children('sample'); my %samples; my %genotypes; foreach my $sample ( @samples ) { my $sample_id = $sample->{att}->{id}; $samples{$sample_id}{file} = ( defined $sample->first_child('file') ) ? $sample->first_child('file')->text : ''; my @genotypes = $sample->children('genotype'); foreach my $genotype ( @genotypes ) { my $snp_id = $genotype->first_child('snp_id')->text || die "File not in MIPE format (genotype)\n"; $genotypes{$sample_id}{$snp_id} = $genotype->first_child('amb')->text; } } print h4('SNPs'), "\n"; if ( scalar keys %snps == 0 ) { print "No SNPs", br, "\n"; } else { print "\n"; print "\n"; foreach my $snp_id ( sort { $snps{$a}{pos} <=> $snps{$b}{pos} } keys %snps ) { print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "\n"; } print "
pospos_designpos_sourceambrankremarks?
$snp_id
$snps{$snp_id}{pos}
$snps{$snp_id}{pos_design}
$snps{$snp_id}{pos_source}
$snps{$snp_id}{amb}
$snps{$snp_id}{rank}
$snps{$snp_id}{remarks}
", br, "\n"; } print h5('SNP remarks'), "\n"; print "\n"; print "\n"; my $found_snp_remark = 0; foreach my $snp_id ( sort { $snps{$a}{pos} <=> $snps{$b}{pos} } keys %snps ) { if ( defined $snps{$snp_id}{remarks_text} ) { print "\n"; $found_snp_remark = 1; } } print "
remark
$snp_id$snps{$snp_id}{remarks_text}
", br, "\n"; if ( $found_snp_remark == 0 ) { print "No SNPs with remark\n"; } print h4('Samples'), "\n"; if ( scalar keys %samples == 0 ) { print "No samples", br, "\n"; } else { print "\n"; print "\n"; print "\n"; foreach my $sample_id ( sort keys %samples ) { print ""; print ""; print ""; print "\n"; } print "
Sample meta data
file
$sample_id$samples{$sample_id}{file}
", br, "\n"; if ( scalar keys %genotypes == 0 ) { print "No genotyping data", br, "\n"; } else { print "\n"; print "\n"; print ""; foreach my $snp_id ( sort { $snps{$a}{pos} <=> $snps{$b}{pos} } keys %snps ) { print ""; } print "\n"; foreach my $sample_id ( sort keys %samples ) { print ""; foreach my $snp_id ( sort { $snps{$a}{pos} <=> $snps{$b}{pos} } keys %snps ) { my $genotype = ( defined $genotypes{$sample_id}{$snp_id} ) ? $genotypes{$sample_id}{$snp_id} : ''; my $genotype_text; if ( $genotype eq 'A' ) { print ''; } elsif ( $genotype eq 'T' ) { print ''; } elsif ( $genotype eq 'G' ) { print ''; } elsif ( $genotype eq 'C' ) { print ''; } else { print ""; } } print "\n"; } print "
Sample genotyping data
", $snps{$snp_id}{pos}, "
", $sample_id, "
A
T
G
C
", $genotype, "
", br, "\n"; } } } print hr; } } mipe-1.1/mipe2pcroverview.pl0000755000175000017500000000622110267443213015522 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME mipe2pcroverview.pl - Generates overview of PCRs from a MIPE file included in output: PCR ID, projects, researchers, number of SNPs, length of PCR fragment, remarks based on MIPE version v1.1 arguments: * mipe_file * (optional) list of PCR IDs =head1 SYNOPSIS mipe2pcroverview.pl your_file.mipe =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my ( $file, @pcr_ids ) = @ARGV; if ( not defined $file ) { die "Please provide filename\n" }; my $twig = XML::Twig->new( TwigHandlers => { pcr => \&pcr } , pretty_print => 'indented' ); $twig->parsefile($file); exit; sub pcr { my ( $twig, $pcr ) = @_; my $to_include = 0; my $pcr_id = $pcr->{att}->{id}; if ( scalar @pcr_ids > 0 ) { $to_include = 0; foreach ( @pcr_ids ) { if ( $pcr_id =~ /$_/i ) { $to_include = 1; } } } else { $to_include = 1; } if ( $to_include ) { my @researchers = $pcr->children('researcher'); my $researchers; if ( scalar @researchers > 0 ) { foreach ( @researchers ) { $researchers .= $_->text . ';'; } chop $researchers; } else { $researchers = 'NONE'; } my @projects = $pcr->children('project'); my $projects; if ( scalar @projects > 0 ) { foreach ( @projects ) { $projects .= $_->text . ';'; } chop $projects; } else { $projects = 'NONE'; } my $length = 'UNKNOWN'; if ( defined $pcr->next_elt('design')->first_child('seq') ) { $length = length $pcr->next_elt('design')->first_child('seq')->text; } elsif ( defined $pcr->next_elt('design')->first_child('pos') ) { my @range = split /\-/, $pcr->next_elt('design')->first_child('pos')->text; $length = $range[1] - $range[0]; } my $remarks; my @remarks = $pcr->children('remark'); if ( scalar @remarks == 0 ) { $remarks = 'NO REMARK'; } else { foreach ( @remarks ) { $remarks .= $_->text . '; '; } chop $remarks; chop $remarks; } my @snps = ( defined $pcr->first_child('use') ) ? $pcr->first_child('use')->children('snp') : (); print $pcr_id, "\t", $projects, "\t", $researchers, "\t", scalar @snps, " SNPs\t", $length, "bp\t", $remarks, "\n"; } } mipe-1.1/mipe2pcrprimers.pl0000755000175000017500000000523210267443213015336 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME mipe2pcrprimers.pl - Generates list of pcrprimers from a MIPE file based on MIPE version v1.1 arguments: * mipe_file * (optional) list of PCR IDs =head1 SYNOPSIS mipe2pcrprimers.pl your_file.mipe =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my ( $file, @pcr_ids ) = @ARGV; if ( not defined $file ) { die "Please provide filename\n" }; my $twig = XML::Twig->new( TwigHandlers => { pcr => \&pcr } , pretty_print => 'indented' ); $twig->parsefile($file); exit; sub pcr { my ( $twig, $pcr ) = @_; my $to_include = 0; my $pcr_id = $pcr->{att}->{id}; if ( scalar @pcr_ids > 0 ) { $to_include = 0; foreach ( @pcr_ids ) { if ( $pcr_id =~ /$_/i ) { $to_include = 1; } } } else { $to_include = 1; } if ( $to_include ) { my $primer1 = $pcr->next_elt('design')->next_elt('primer1'); my $primer1_oligo = ( defined $primer1->first_child('oligo') ) ? $primer1->first_child('oligo')->text : 'NO OLIGO'; my $primer1_seq = ( defined $primer1->first_child('seq') ) ? $primer1->first_child('seq')->text : 'NO SEQ'; my $primer1_tm = ( defined $primer1->first_child('tm') ) ? $primer1->first_child('tm')->text : 'NO TM'; my $primer2 = $pcr->next_elt('design')->next_elt('primer2'); my $primer2_oligo = ( defined $primer2->first_child('oligo') ) ? $primer2->first_child('oligo')->text : 'NO OLIGO'; my $primer2_seq = ( defined $primer2->first_child('seq') ) ? $primer2->first_child('seq')->text : 'NO SEQ'; my $primer2_tm = ( defined $primer2->first_child('tm') ) ? $primer2->first_child('tm')->text : 'NO TM'; print $pcr_id, "\tFW\t", $primer1_oligo, "\t", $primer1_seq, "\t", $primer1_tm, "\tREV\t", $primer2_oligo, "\t", $primer2_seq, "\t", $primer2_tm, "\n"; } } mipe-1.1/mipe2putativesbeprimers.pl0000755000175000017500000000570210267443213017107 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME mipe2putativesbeprimers.pl - Generates list of putative SBE primers from a MIPE file included in output: PCR ID, SNP ID, putative forward SBE primer, putative reverse SBE primer based on MIPE version v1.1 arguments: * mipe_file * (optional) list of PCR IDs =head1 SYNOPSIS mipe2putativesbeprimers.pl your_file.mipe =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my $sbe_length = 35; my ( $file, @pcr_ids ) = @ARGV; if ( not defined $file ) { die "Please provide filename\n" }; my $twig = XML::Twig->new( TwigHandlers => { pcr => \&pcr } , pretty_print => 'indented' ); $twig->parsefile($file); exit; sub pcr { my ( $twig, $pcr ) = @_; my $to_include = 0; my $pcr_id = $pcr->{att}->{id}; if ( scalar @pcr_ids > 0 ) { $to_include = 0; foreach ( @pcr_ids ) { if ( $pcr_id =~ /$_/i ) { $to_include = 1; } } } else { $to_include = 1; } if ( $to_include ) { if ( defined $pcr->first_child('use') ) { if ( defined $pcr->first_child('use')->first_child('seq') ) { my $use_seq = $pcr->first_child('use')->first_child('seq')->text; my @snps = $pcr->first_child('use')->children('snp'); foreach my $snp ( @snps ) { my $snp_id = $snp->{att}->{id}; if ( $snp->first_child('pos')->text > 0 ) { my $snp_pos = $snp->first_child('pos')->text; my $fw_start = ( $snp_pos > $sbe_length) ? $snp_pos - $sbe_length - 1 : 0; my $fw_length = ( $snp_pos > $sbe_length ) ? $sbe_length : $snp_pos - 1; my $rev_start = $snp_pos; my $rev_length = $sbe_length; my $fw_primer = substr($use_seq, $fw_start, $fw_length); my $rev_primer = substr($use_seq, $rev_start, $rev_length); ( $rev_primer = reverse $rev_primer ) =~ tr/actgACTG/tgacTGAC/; print $pcr_id, "\t", $snp_id, "\t", $fw_primer, "\t", $rev_primer, "\n"; } else { print $pcr_id, "\t", $snp_id, "\tSNP POSITION BEFORE START OF SEQUENCE\n"; } } } } } } mipe-1.1/mipe2sbeprimers.pl0000755000175000017500000000610210267443213015320 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME mipe2sbeprimers.pl - Generates list of SBE primers from a MIPE file included in output: PCR ID, SNP ID, SBE ID, SBE oligo, SBE strand, SBE tail, SBE specific, SBE remark based on MIPE version v1.1 arguments: * mipe_file * (optional) list of PCR IDs =head1 SYNOPSIS mipe2sbeprimers.pl your_file.mipe =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my ( $file, @pcr_ids ) = @ARGV; if ( not defined $file ) { die "Please provide filename\n" }; my $twig = XML::Twig->new( TwigHandlers => { pcr => \&pcr } , pretty_print => 'indented' ); $twig->parsefile($file); exit; sub pcr { my ( $twig, $pcr ) = @_; my $to_include = 0; my $pcr_id = $pcr->{att}->{id}; if ( scalar @pcr_ids > 0 ) { $to_include = 0; foreach ( @pcr_ids ) { if ( $pcr_id =~ /$_/i ) { $to_include = 1; } } } else { $to_include = 1; } if ( $to_include ) { if ( defined $pcr->first_child('use') ) { my @snps = $pcr->first_child('use')->children('snp'); foreach my $snp ( @snps ) { my $snp_id = $snp->{att}->{id}; my @assays = $snp->children('assay'); foreach my $assay ( @assays ) { if ( (uc $assay->first_child('type')->text) eq 'SBE' ) { my $sbe_id = $assay->{att}->{id}; my $sbe_oligo = ( defined $assay->first_child('oligo') ) ? $assay->first_child('oligo')->text : 'NO OLIGO'; my $sbe_specific = ( defined $assay->first_child('specific') ) ? $assay->first_child('specific')->text : 'NO SPECIFIC'; my $sbe_tail = ( defined $assay->first_child('tail') ) ? $assay->first_child('tail')->text : 'NO TAIL'; my $sbe_strand = ( defined $assay->first_child('strand') ) ? $assay->first_child('strand')->text : 'NO STRAND'; my $sbe_remark; if ( scalar $assay->children('remark') > 0 ) { foreach ( $assay->children('remark') ) { $sbe_remark .= $_->text . ';'; } chop $sbe_remark; } else { $sbe_remark = 'NO REMARK'; } print $pcr_id, "\t", $snp_id, "\t", $sbe_id, "\t", $sbe_oligo, "\t", $sbe_strand, "\t", $sbe_tail, "\t", $sbe_specific, "\t", $sbe_remark, "\n"; } } } } } } mipe-1.1/mipe2snps.pl0000755000175000017500000001303210267443213014130 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME mipe2snps.pl - Generates list of SNPs from a MIPE file included in output: PCR ID, SNP ID, SNP pos, SNP amb, allele freqs, number of animals genotyped, SNP rank, flanking seqs, SNP remarks based on MIPE version v1.1 arguments: * mipe_file * (optional) list of PCR IDs =head1 SYNOPSIS mipe2snps.pl your_file.mipe =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my %amb_codes = ( M => ['A', 'C'] , R => ['A', 'G'] , W => ['A', 'T'] , S => ['C', 'G'] , Y => ['C', 'T'] , K => ['G', 'T'] , V => ['A', 'C', 'G'] , H => ['A', 'C', 'T'] , D => ['A', 'G', 'T'] , B => ['C', 'G', 'T'] , N => ['A', 'C', 'G', 'T'] ); my ( $file, @pcr_ids ) = @ARGV; if ( not defined $file ) { die "Please provide filename\n" }; my $twig = XML::Twig->new( TwigHandlers => { pcr => \&pcr } , pretty_print => 'indented' ); $twig->parsefile($file); exit; sub pcr { my ( $twig, $pcr ) = @_; my $to_include = 0; my $pcr_id = $pcr->{att}->{id}; if ( scalar @pcr_ids > 0 ) { $to_include = 0; foreach ( @pcr_ids ) { if ( $pcr_id =~ /$_/i ) { $to_include = 1; } } } else { $to_include = 1; } if ( $to_include ) { if ( defined $pcr->first_child('use') ) { my $use_seq; my $snp_seq; if ( defined $pcr->first_child('use')->first_child('seq') ) { $use_seq = $pcr->first_child('use')->first_child('seq')->text; } my @snps = $pcr->first_child('use')->children('snp'); foreach my $snp ( @snps ) { my $snp_id = $snp->{att}->{id}; my $snp_amb = ( defined $snp->first_child('amb') ) ? $snp->first_child('amb')->text : 'NO AMB'; my $snp_pos = ( defined $snp->first_child('pos') ) ? $snp->first_child('pos')->text : 'NO POS'; my $snp_pos_design = ( defined $snp->first_child('pos_design') ) ? $snp->first_child('pos_design')->text : 'NO POS_DESIGN'; my $snp_pos_source = ( defined $snp->first_child('pos_source') ) ? $snp->first_child('pos_source')->text : 'NO POS_SOURCE'; my $snp_rank = ( defined $snp->first_child('rank') ) ? $snp->first_child('rank')->text : 'NO RANK'; my @snp_remarks = $snp->children('remark'); my $snp_remark = 'NO REMARK'; my %occurences; my $snp_minorallelefreq = 'NO FREQS'; my $number_of_samples = 0; if ( defined $pcr->first_child('use')->first_child('sample') ) { my @samples = $pcr->first_child('use')->children('sample'); foreach my $sample ( @samples ) { my @genotypes = $sample->children('genotype'); foreach my $genotype ( @genotypes ) { if ( $genotype->first_child('snp_id')->text eq $snp_id ) { $number_of_samples++; $occurences{$genotype->first_child('amb')->text}++; } } } my %freqs; $snp_minorallelefreq = ''; foreach my $allele ( keys %occurences ) { if ( $allele eq 'A' or $allele eq 'C' or $allele eq 'G' or $allele eq 'T' ) { $freqs{$allele} = 2*$occurences{$allele}; } else{ foreach my $code ( keys %amb_codes ) { if ( $allele eq $code ) { foreach my $key ( @{$amb_codes{$code}} ) { $freqs{$key} += $occurences{$allele}; } } } } } my $total_alleles; foreach my $allele ( keys %freqs ) { $total_alleles += $freqs{$allele}; } foreach my $allele ( keys %freqs ) { $freqs{$allele} /= $total_alleles; } foreach my $allele ( sort { $freqs{$a} <=> $freqs{$b} } keys %freqs ) { $snp_minorallelefreq .= $allele . '(' . sprintf("%.2f", $freqs{$allele}) . ');' } chop $snp_minorallelefreq; } if ( defined $use_seq and defined $snp->first_child('pos') ) { my $_amb; $snp_seq = substr($use_seq, $snp_pos - 11, 10); if ( defined $snp->first_child('amb') ) { $_amb = $snp->first_child('amb')->text; } else { $_amb = 'N'; } $snp_seq .= $_amb; $snp_seq .= substr($use_seq, $snp_pos, 10); } else { $snp_seq = 'UNKNOWN'; } if ( scalar @snp_remarks > 0 ) { my @remark_text; foreach ( @snp_remarks ) { push @remark_text, $_->text; } $snp_remark = join('; ', @remark_text); } print $pcr_id, "\t", $snp_id, "\t", $snp_pos, "\t", $snp_pos_design, "\t", $snp_pos_source, "\t", $snp_amb, "\t", $snp_minorallelefreq, "\t", $number_of_samples, "\t", $snp_rank, "\t", $snp_seq, "\t", $snp_remark, "\n"; } } } } mipe-1.1/mipeCheckSanity.pl0000755000175000017500000001547010267443213015300 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; #use warnings; use XML::Twig; use Data::Dumper; =head1 NAME mipeCheckSanity.pl - Check sanity of MIPE file, focussing on contents (vs 'form', that can be checked using xmllint) based on MIPE version v0.9 arguments: * mipe_file * (optional) list of PCR IDs =head1 SYNOPSIS mipe2genotypes.pl your_file.mipe =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my %amb_codes = ( M => ['A', 'C'] , R => ['A', 'G'] , W => ['A', 'T'] , S => ['C', 'G'] , Y => ['C', 'T'] , K => ['G', 'T'] , V => ['A', 'C', 'G'] , H => ['A', 'C', 'T'] , D => ['A', 'G', 'T'] , B => ['C', 'G', 'T'] , N => ['A', 'C', 'G', 'T'] ); my ( $file, @pcr_ids ) = @ARGV; if ( not defined $file ) { die "Please provide filename\n" }; my $twig = XML::Twig->new( TwigHandlers => { pcr => \&pcr } , pretty_print => 'indented' ); $twig->parsefile($file); exit; sub pcr { my ( $twig, $pcr ) = @_; my $to_include = 0; my $pcr_id = $pcr->first_child('id')->text; if ( scalar @pcr_ids > 0 ) { $to_include = 0; foreach ( @pcr_ids ) { if ( $pcr_id =~ /$_/i ) { $to_include = 1; } } } else { $to_include = 1; } if ( $to_include ) { #####Check that there is a USE part if ( not defined $pcr->first_child('use') ) { print "WARNING\tCHECK01\t", $pcr->first_child('id')->text, "\tNo use part defined\n"; next; } #####Check that snp_id in genotypes actually is defined as a SNP { my @snps = $pcr->first_child('use')->children('snp'); my %snps; foreach my $snp ( @snps ) { $snps{$snp->first_child('id')->text} = 1; } my @samples = $pcr->first_child('use')->children('sample'); foreach my $sample ( @samples ) { my @sample_snps = $sample->children('genotype'); foreach my $sample_snp ( @sample_snps ) { if ( not defined $snps{$sample_snp->first_child('snp_id')->text} ) { print "ERROR\tCHECK02\t", $pcr_id, "\tSample ", $sample->first_child('id')->text, ": genotype SNP ID: ", $sample_snp->first_child('snp_id')->text, " not defined as SNP\n"; } } } } #####Check if SBE primer sequence and SNP position are in concordance with piece of use seq { my $use_seq = $pcr->first_child('use')->first_child('seq')->text; my @snps = $pcr->first_child('use')->children('snp'); foreach my $snp ( @snps ) { my $snp_pos = $snp->first_child('pos')->text; my @assays = $snp->children('assay'); foreach my $assay ( @assays ) { if ( (uc $assay->first_child('type')->text) eq 'SBE' ) { my $sbe_specific = $assay->first_child('specific')->text; my $sbe_strand = $assay->first_child('strand')->text; if ( uc $sbe_strand =~ /^F/ ) { if ( not uc $sbe_specific eq uc substr($use_seq, ($snp_pos-(length $sbe_specific)-1), length $sbe_specific) ) { print "ERROR\tCHECK03\t", $pcr->first_child('id')->text, "\tSBE_SEQ does not comply with SNP pos and USE SEQ\t", $assay->first_child('id')->text, "\tSBE=", $sbe_specific, "\tUSE=", substr($use_seq, ($snp_pos-(length $sbe_specific)), length $sbe_specific), "\n"; } } else { $sbe_specific = reverse $sbe_specific; $sbe_specific =~ tr/ACGTacgt/TGCAtgca/; if ( not uc $sbe_specific eq uc substr($use_seq, $snp_pos, length $sbe_specific) ) { print "ERROR\tCHECK03\t", $pcr->first_child('id')->text, "\tSBE_SEQ does not comply with SNP pos and USE SEQ\t", $assay->first_child('id')->text, "\tSBE=", $sbe_specific, "\tUSE=", substr($use_seq, $snp_pos, length $sbe_specific), "\n"; } } } } } } #####Check if PCR primers can be found back in DESIGN sequence { my $design = $pcr->first_child('design'); my $primer1_seq = uc $design->first_child('primer1')->first_child('seq')->text; ( my $primer2_seq = reverse uc $design->first_child('primer2')->first_child('seq')->text ) =~ tr/ACGTacgt/TGCAtgca/; my $design_seq = uc $design->first_child('seq')->text; if ( not $design_seq =~ /$primer1_seq/ ) { print "ERROR\tCHECK04\t", $pcr->first_child('id')->text, "\tPRIMER1_SEQ cannot be found back in DESIGN_SEQ\t", $primer1_seq, "\n"; } if ( not $design_seq =~ /$primer2_seq/ ) { print "ERROR\tCHECK04\t", $pcr->first_child('id')->text, "\tPRIMER2_SEQ cannot be found back in DESIGN_SEQ\t", $primer2_seq, "\n"; } } #####Check if SNP ambiguity code is in concordance with USE sequence { my $use_seq = $pcr->first_child('use')->first_child('seq')->text; my @snps = $pcr->first_child('use')->children('snp'); foreach my $snp ( @snps ) { if ( not defined $snp->first_child('amb') ) { next }; my $snp_id = $snp->first_child('id')->text; my $snp_pos = $snp->first_child('pos')->text; my $snp_amb = $snp->first_child('amb')->text; my $use_allele = substr($use_seq, $snp_pos-1, 1); my $good = 0; if ( uc $use_allele eq uc $snp_amb ) { $good = 1; } if ( uc $use_allele eq 'N' ) { $good = 1; } foreach my $amb_allele ( @{$amb_codes{$snp_amb}} ) { if ( uc $amb_allele eq uc $use_allele ) { $good = 1; } } if ( not $good ) { print "ERROR\tCHECK05\t", $pcr->first_child('id')->text, "\t", $snp->first_child('id')->text, "\tSNP ambiguity code (=", $snp_amb, ") does not comply with allele at SNP position in USE seq (=", $use_allele, ") (check CHECK03)\n"; } } } #####Check for empty elements { if ( $pcr->first_child('id')->text eq '' ) { print "ERROR\tCHECK06\tNo PCR ID\n"; } my @descendants = $pcr->descendants; foreach my $descendant ( @descendants ) { if ( scalar $descendant->descendants == 0 ) { if ( $descendant->text eq '' ) { print "WARNING\tCHECK06\tEmpty element in ", $pcr->first_child('id')->text, "\n"; } } } } } } mipe-1.1/overview_format.pdf0000644000175000017500000012006510267443213015566 0ustar janjan00000000000000%PDF-1.4 % 1 0 obj << /Length 2 0 R /Filter /FlateDecode >> stream x՜͎ }DԷE@^ {˾~J"YRIROF{ĪٔDE-\r_?]~{u?}UZ}/Op}g|wiigQgmQ;;Xm"yAH /MC0R }& эC88,Ka'އ!>`R~zpK m;G$\rS_n8eT]O] txp&\fMi3v;礶i;Elw_ {ًCL p>I |w~H)1iDŽ!Nj'g}cӫͷ#+Eo/8~qe/ӘkxϪ8q*J\gL-9j0]7`5CK bC1Ðqt̴7߰֬q ~Ay q O ^33z7"H nOW/h6k_܉ e F;}6>i"t6}-o@Z-4z(LgFNz5:y&!Gfvym!q91|"k nu:Cތ:[*F@8kXah7ULMicҁ'o5:;ZyĀmW#qm<+eNDV`Q 1guqK&E4vi zJUp}kO3o sV40W Ϡ͋݇GO0>֌[5w|b/v覽[#a`ĉmwa톙VhH'vچ^~jOjz2D0n|:I8sdžDrftNkK/yIwZiA(+T{. ^ {cy}mEbV8& `mu?"987d*'%KG˖oH+ƨK',i~a@XO D^FSi<@noEgsű䖶B*d.Bi&" yg%S<^T Z 4 ScCO1 ȀʦzmK>#"6I&V uc'e?DQNR Q(|#Uȕ2fsh.Aӻ.cJHi[6ݥZeWE dM2V2 ä @'!"!%(!Q%Q%QnlHⓩ># Z  |Nw ؟Hy[2mz‡R qIߐ+e8oN IݐԒXՒX;OB6DBJ&1>S --4EB6DBJJ::糆G1qlh$#%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s/B:j^m ) XMܔ|g걙kj>Вy#^?;y}u(1j7jk#K! ѧxdi,KH,d@}I}.SdLڵU.O2Vz=YԞNQ[)"93ZusZCvYymC. AK#CyՆ)!#ԒPK-6i , atdo&!LhXۍQR } e(0EfByFl>/P:69͚~ِٓ!%S~NZ< $!3)By(y"㡼,lGByl `P|'Bn^|o4ja+6PK 6Cկ` UgS M!K~ +| (/ 041&Z(+@ԑ +DP UBflChcR.ZT^`9ϏICyO!!ԿP#6il& /\P҇DË$ 9H05EWO!g) ͳZz jCO=k8T#h2wV_žfe^i0{0ْn@=}ÏL8-dx"wJ 8{oZ=yfݦ)&?!Ml dtCޘzn0Bf?o5Õld+oaنs ; %\bXuh7Pa(JKN-(9lR?aSُ<.,>{uuϝu:CNiM&RѨ4   Scv3}J V ?,` .`> endobj 8 0 obj << /Length 259 /Filter /FlateDecode >> stream x]n0EHYGAHm$}`X*ê7QՍ3wwҦ}j;#:0(-fqQiH% ,I[gSU#fV؝oNSzWRXjK$[n_}ʠP~jX߄8[.q="K,\j_hqnAeǦޠ (OGpnѴ{082R)˖Bi/K{endstream endobj 9 0 obj << /Type /Font /Subtype /TrueType /BaseFont /CAAAAA+TimesNewRomanPS-BoldMT /FirstChar 0 /LastChar 6 /Widths [ 777 666 443 500 556 556 333 ] /FontDescriptor 7 0 R /ToUnicode 8 0 R >> endobj 10 0 obj << /Length 11 0 R /Filter /FlateDecode /Length1 38408 >> stream xܼy|U8~oUuW]WZޗtwI:DRH%`$, $QP dQۨopT3:,2AG7q >߿]{ν:ܳSEHUW7a Wa(BnBR\t\w5BF9K^bZ mj-47P W\}ԏ@׭Z~Wϵ- +V\ס{P\qEoP?P귽뮺z5 N"t3^Rt*IU5Z`Lffwx}, #X #`?^l< N-pL=h \^AQ zB.4"ڈB F8 aP3r`څ>B~):>MQas([-, j@?AxJ>J2K'OCOh%z oƟ#?A;38yEVFŇgpՏdEN7[a*E7( 9\^>\AKٓ17*ANЏC@1<~w)>h̭COWPrZdž#n]0~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> `0r1U'mTtʡCЫSN?v:}8ڊлwC7xw;׀ 9$y։ KXmԧwXm6_D涭6a9)"m+^H-c-Z?SA endstream endobj 11 0 obj 22886 endobj 12 0 obj << /Type /FontDescriptor /FontName /BAAAAA+TimesNewRomanPSMT /Flags 4 /FontBBox [ -568 -306 2027 1006 ] /ItalicAngle 0 /Ascent 891 /Descent -216 /CapHeight 1006 /StemV 80 /FontFile2 10 0 R >> endobj 13 0 obj << /Length 417 /Filter /FlateDecode >> stream x]n0EHCM&)RcC½nUuxcvmˠm\E0F5m= sՇA4.wة12[4Aq=՞KkY0(KqTYTfhøOeykWʞ$ 8.Uݖa M wgl=fq.'0G@c@ 0F2R 3j,9bF֌d - L IQZ'ݴY3BO'aixM@ A4}R}5P4$hOg=1xDC$ 4O~:7* 4߯z?ߙїendstream endobj 14 0 obj << /Type /Font /Subtype /TrueType /BaseFont /BAAAAA+TimesNewRomanPSMT /FirstChar 0 /LastChar 42 /Widths [ 777 777 277 500 443 250 333 722 333 500 443 333 666 500 389 500 500 500 666 500 277 500 277 443 500 500 500 610 333 500 722 277 500 500 500 500 500 250 889 333 556 250 500 ] /FontDescriptor 12 0 R /ToUnicode 13 0 R >> endobj 15 0 obj << /F1 14 0 R /F2 9 0 R >> endobj 16 0 obj << /Font 15 0 R /ProcSet [ /PDF ] >> endobj 3 0 obj << /Type /Pages /Resources 16 0 R /MediaBox [ 0 0 595 842 ] /Kids [ 4 0 R ] /Count 1 >> endobj 17 0 obj << /Type /Catalog /Pages 3 0 R >> endobj 18 0 obj << /Author /Producer /CreationDate (D:20040530093959+02'00') >> endobj xref 0 19 0000000000 65535 f 0000000017 00000 n 0000003291 00000 n 0000040121 00000 n 0000003318 00000 n 0000003425 00000 n 0000014972 00000 n 0000014998 00000 n 0000015251 00000 n 0000015592 00000 n 0000015823 00000 n 0000038817 00000 n 0000038844 00000 n 0000039094 00000 n 0000039594 00000 n 0000039998 00000 n 0000040054 00000 n 0000040258 00000 n 0000040318 00000 n trailer << /Size 19 /Root 17 0 R /Info 18 0 R >> startxref 40536 %%EOF mipe-1.1/removePcrFromMipe.pl0000755000175000017500000000360510267443213015616 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME removePcrFromMipe.pl - Removes PCR data from MIPE file based on MIPE version v0.7 arguments: * mipe_file * STDIN: PCR ID =head1 SYNOPSIS removePcrFromMipe.pl my_file.mipe < my_data.txt =head1 AUTHOR Jan Aerts (jan.aerts@wur.nl) =cut my $file = shift; if ( not defined $file ) { die "Please provide filename\n" }; my $twig = XML::Twig->new( pretty_print => 'indented' # , keep_atts_order => 1 , TwigHandlers => { pcr => \&pcr } ); my @pcr_data = ( ); my %pcr_passed; foreach my $pcr_id_in ( @pcr_data ) { chomp $pcr_id_in; $pcr_passed{$pcr_id_in} = 0; } $twig->parsefile($file); $twig->print; foreach ( sort keys %pcr_passed ) { if ( $pcr_passed{$_} == 0 ) { print STDERR "Data for $_ could not be removed from MIPE file; $_ not present\n"; } } sub pcr { my ( $twig, $pcr ) = @_; my $pcr_id = $pcr->first_child('id')->text; foreach my $pcr_id_in ( @pcr_data ) { chomp $pcr_id_in; if ( $pcr_id eq $pcr_id_in ) { $pcr->delete; $pcr_passed{$pcr_id_in} = 1; } } } mipe-1.1/removeSbeFromMipe.pl0000755000175000017500000000464110267443213015604 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME removeSbeFromMipe.pl - Removes SBE data from MIPE file based on MIPE version v0.9 arguments: * mipe_file * STDIN: tab-delimited list of data, in the following order: PCR ID, SNP ID, SBE ID =head1 SYNOPSIS removeSbeFromMipe.pl my_file.mipe < my_data.txt =head1 AUTHOR Jan Aerts (jan.aerts@wur.nl) =cut my $file = shift; if ( not defined $file ) { die "Please provide filename\n" }; my $twig = XML::Twig->new( pretty_print => 'indented' # , keep_atts_order => 1 , TwigHandlers => { pcr => \&pcr } ); my @assay_data = ( ); my %assay_passed; foreach ( @assay_data ) { chomp; my ( $pcr_id_in, $snp_id_in, $assay_id_in ) = split /\t/, $_; $assay_passed{$assay_id_in} = 0; } $twig->parsefile($file); $twig->print; foreach ( sort keys %assay_passed ) { if ( $assay_passed{$_} == 0 ) { print STDERR "Data for $_ could not be removed from MIPE file; $_ not present\n"; } } sub pcr { my ( $twig, $pcr ) = @_; my $pcr_id = $pcr->first_child('id')->text; foreach my $input_line ( @assay_data ) { chomp $input_line; my ( $pcr_id_in, $snp_id_in, $assay_id_in ) = split /\t/, $input_line; if ( $pcr_id eq $pcr_id_in ) { my @snps = $pcr->next_elt('use')->children('snp'); foreach my $snp ( @snps ) { if ( $snp->first_child('id')->text eq $snp_id_in ) { my @assays = $snp->children('assay'); foreach my $assay ( @assays ) { if ( $assay->first_child('id')->text eq $assay_id_in ) { $assay->delete; $assay_passed{$assay_id_in} = 1; } } } } } } } mipe-1.1/removeSnpFromMipe.pl0000755000175000017500000000476010267443213015635 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME removeSnpFromMipe.pl - Removes SNP data from MIPE file based on MIPE version v0.9 arguments: * mipe_file * STDIN: tab-delimited list of data, in the following order: PCR ID, SNP ID =head1 SYNOPSIS removeSnpFromMipe.pl my_file.mipe < my_data.txt =head1 AUTHOR Jan Aerts (jan.aerts@wur.nl) =cut my $file = shift; if ( not defined $file ) { die "Please provide filename\n" }; my $twig = XML::Twig->new( pretty_print => 'indented' # , keep_atts_order => 1 , TwigHandlers => { pcr => \&pcr } ); my @snp_data = ( ); my %snp_passed; foreach ( @snp_data ) { chomp; my ( $pcr_id_in, $snp_id_in ) = split /\t/, $_; $snp_passed{$snp_id_in} = 0; } $twig->parsefile($file); $twig->print; foreach ( sort keys %snp_passed ) { if ( $snp_passed{$_} == 0 ) { print STDERR "Data for $_ could not be removed from MIPE file; $_ not present\n"; } } sub pcr { my ( $twig, $pcr ) = @_; my $pcr_id = $pcr->first_child('id')->text; foreach my $input_line ( @snp_data ) { chomp $input_line; my ( $pcr_id_in, $snp_id_in ) = split /\t/, $input_line; if ( $pcr_id eq $pcr_id_in ) { my @snps = $pcr->next_elt('use')->children('snp'); foreach my $snp ( @snps ) { if ( $snp->first_child('id')->text eq $snp_id_in ) { $snp->delete; $snp_passed{$snp_id_in} = 1; } } my @samples = $pcr->next_elt('use')->children('sample'); foreach my $sample ( @samples ) { my @genotypes = $sample->children('genotype'); foreach my $genotype ( @genotypes ) { if ( $genotype->first_child('snp_id')->text eq $snp_id_in ) { $genotype->delete; } } } } } } mipe-1.1/sbe2mipe.pl0000755000175000017500000000767310267443213013734 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME sbe2mipe.pl - Inserts SBE data into MIPE file CAUTION: DOES NOT WORK AT THE MOMENT!! based on MIPE version v1.1 arguments: * mipe_file * STDIN: tab-delimited list of data, in the following order: PCR ID, SNP ID, SBE ID, SBE oligo, SBE specific, SBE tail, SBE strand, SBE remark =head1 SYNOPSIS sbe2mipe.pl my_file.mipe < my_data.txt =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my $file = shift; if ( not defined $file ) { die "Please provide filename\n" }; my $twig = XML::Twig->new( pretty_print => 'indented' , keep_atts_order => 1 , TwigHandlers => { pcr => \&pcr } ); my @assay_data = ( ); my %assay_passed; foreach ( @assay_data ) { chomp; my ( $pcr_id_in, $snp_id_in, $assay_id_in, $assay_oligo_in, $assay_specific_in, $assay_tail_in, $assay_strand_in, $assay_remark_in ) = split /\t/, $_; $assay_passed{$assay_id_in} = 0; } $twig->parsefile($file); $twig->print; foreach ( sort keys %assay_passed ) { if ( $assay_passed{$_} == 0 ) { print STDERR "Data for $_ not imported\n"; } } exit; sub pcr { my ( $twig, $pcr ) = @_; my $pcr_id = $pcr->{att}->{id}; foreach my $input_line ( @assay_data ) { chomp $input_line; my ( $pcr_id_in, $snp_id_in, $assay_id_in, $assay_oligo_in, $assay_specific_in, $assay_tail_in, $assay_strand_in, $assay_remark_in ) = split /\t/, $input_line; if ( $pcr_id =~ /$pcr_id_in/ ) { my @snps = $pcr->next_elt('use')->children('snp'); foreach my $snp ( @snps ) { if ( $snp->{att}->{id}; =~ /$snp_id_in/ ) { my $assay = XML::Twig::Elt->new('assay', ''); my $type = XML::Twig::Elt->new('type', 'sbe'); $type->paste('last_child', $assay); if ( defined $assay_id_in ) { my $id = XML::Twig::Elt->new('id', $assay_id_in); $id->paste('last_child', $assay); }; if ( defined $assay_oligo_in ) { my $oligo = XML::Twig::Elt->new('oligo', $assay_oligo_in); $oligo->paste('last_child', $assay); }; if ( defined $assay_specific_in ) { my $specific = XML::Twig::Elt->new('specific', $assay_specific_in); $specific->paste('last_child', $assay); }; if ( defined $assay_tail_in ) { my $tail = XML::Twig::Elt->new('tail', $assay_tail_in); $tail->paste('last_child', $assay); }; if ( defined $assay_strand_in ) { my $strand = XML::Twig::Elt->new('strand', $assay_strand_in); $strand->paste('last_child', $assay); }; if ( defined $assay_remark_in ) { my $remark = XML::Twig::Elt->new('remark', $assay_remark_in); $remark->paste('last_child', $assay); }; my $snp_id = $snp->{att}->{id};; my @snp_pos = $snp->children('pos'); my $snp_pos = $snp_pos[0]; if ( defined $snp_pos ) { $assay->paste('after', $snp_pos); } elsif ( defined $snp_id ) { $assay->paste('after', $snp_id); } else { $assay->paste('first_child', $snp_id); }; $assay_passed{$assay_id_in} = 1; } } } } } mipe-1.1/snp2mipe.pl0000755000175000017500000000706410267443213013755 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME snp2mipe.pl - Inserts SNP data into MIPE file CAUTION: DOES NOT WORK WITH MIPEv1.0 YET!! based on MIPE version v0.9 arguments: * mipe_file * STDIN: tab-delimited list of data, in the following order: PCR ID, SNP ID, SNP pos, SNP amb, SNP rank, SNP remark =head1 SYNOPSIS snp2mipe.pl my_file.mipe < my_data.txt =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my $file = shift; if ( not defined $file ) { die "Please provide filename\n" }; my $data = shift; my $twig = XML::Twig->new( pretty_print => 'indented' # , keep_atts_order => 1 , TwigHandlers => { pcr => \&pcr } ); my @snp_data = ( ); my %snp_passed; foreach ( @snp_data ) { chomp; my ( $pcr_id_in, $snp_id_in, $snp_pos_in, $snp_amb_in, $snp_rank_in, $snp_remark_in ) = split /\t/, $_; $snp_passed{$snp_id_in} = 0; } $twig->parsefile($file); $twig->print; foreach ( sort keys %snp_passed ) { if ( $snp_passed{$_} == 0 ) { print STDERR "Data for $_ not imported\n"; } } exit; sub pcr { my ( $twig, $pcr ) = @_; my $pcr_id = $pcr->first_child('id')->text; foreach my $input_line ( @snp_data ) { chomp $input_line; my ( $pcr_id_in, $snp_id_in, $snp_pos_in, $snp_amb_in, $snp_rank_in, $snp_remark_in ) = split /\t/, $input_line; if ( $pcr_id =~ /$pcr_id_in/ ) { my $snp = XML::Twig::Elt->new('snp', ''); if ( defined $snp_id_in ) { my $id = XML::Twig::Elt->new('id', $snp_id_in); $id->paste('last_child', $snp); }; if ( defined $snp_pos_in ) { my $pos = XML::Twig::Elt->new('pos', $snp_pos_in); $pos->paste('last_child', $snp); }; if ( defined $snp_amb_in ) { my $amb = XML::Twig::Elt->new('amb', $snp_amb_in); $amb->paste('last_child', $snp); }; if ( defined $snp_rank_in ) { my $rank = XML::Twig::Elt->new('rank', $snp_rank_in); $rank->paste('last_child', $snp); }; if ( defined $snp_remark_in ) { my $remark = XML::Twig::Elt->new('remark', $snp_remark_in); $remark->paste('last_child', $snp); }; my @use = $pcr->children('use'); my $use = $use[0]; if ( not defined $use ) { $use = XML::Twig::Elt->new('use', ''); my @pcr_remarks = $pcr->children('remark'); if ( scalar @pcr_remarks > 0 ) { my $pcr_remark = $pcr_remarks[0]; $use->paste('before', $pcr_remark); } else { $use->paste('last_child', $pcr); } } my @use_remarks = $use->children('remark'); if ( scalar @use_remarks > 0 ) { my $use_remark = $use_remarks[0]; $snp->paste('before', $use_remark); } else { $snp->paste('last_child', $use); } $snp_passed{$snp_id_in} = 1; } } } mipe-1.1/snpPosOnDesign.pl0000755000175000017500000001022410267443213015121 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME snpPosOnDesign.pl - Adds pos_design to SNP based on MIPE version v1.1 arguments: * mipe_file * STDIN: tab-delimited list of data, in the following order: PCR ID, SNP ID =head1 SYNOPSIS snpPosOnDesign.pl your_file.mipe < my_data.txt =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my $file = shift; if ( not defined $file ) { die "Please provide filename\n" }; my $data = shift; my $twig = XML::Twig->new( pretty_print => 'indented' # , keep_atts_order => 1 , TwigHandlers => { pcr => \&pcr } ); my @snp_data = ( ); my %snp_passed; foreach ( @snp_data ) { chomp; my ( $pcr_id_in, $snp_id_in ) = split /\t/, $_; $snp_passed{$snp_id_in} = 0; } $twig->parsefile($file); $twig->print; foreach ( sort keys %snp_passed ) { if ( $snp_passed{$_} == 0 ) { print STDERR "Position of $_ on design sequence not calculated\n"; } } exit; sub pcr { my ( $twig, $pcr ) = @_; my $pcr_id = $pcr->{att}->{id}; foreach my $input_line ( @snp_data ) { chomp $input_line; my ( $pcr_id_in, $snp_id_in ) = split /\t/, $input_line; if ( $pcr_id =~ /$pcr_id_in/ ) { my $revcomp = 0; if ( defined $pcr->first_child('use') and defined $pcr->first_child('use')->first_child('seq') ) { if ( defined $pcr->first_child('use')->first_child('revcomp') ) { $revcomp = $pcr->first_child('use')->first_child('revcomp')->text; } my @snps = $pcr->first_child('use')->children('snp'); my $design_seq = uc($pcr->first_child('design')->first_child('seq')->text); my $use_seq = uc($pcr->first_child('use')->first_child('seq')->text); foreach my $snp ( @snps ) { my $snp_id = $snp->->{att}->{id}; if ( $snp_id =~ /$snp_id_in/ and not defined $snp->first_child('pos_design') ) { my $snp_pos_elt = $snp->first_child('pos'); my $snp_pos = $snp_pos_elt->text; if ( $snp_pos > 10 and $snp_pos < ( (length $use_seq) - 10 ) ) { my ( $snp_seq_left, $snp_seq_right, $snp_seq ); my $stars; if ( $revcomp == 0 ) { $snp_seq_left = substr($use_seq, $snp_pos - 11, 10); $stars = ( $snp_seq_left =~ tr/*/*/ ); $snp_seq_left =~ s/\*//g; ( $snp_seq_right = substr($use_seq, $snp_pos, 10) ) =~ s/\*//g; $snp_seq = $snp_seq_left . '.' . $snp_seq_right; } else { ( $snp_seq_left = substr($use_seq, $snp_pos - 11, 10) ) =~ s/\*//g; ( $snp_seq_left = reverse $snp_seq_left ) =~ tr/acgtACGT/tgcaTGCA/; $snp_seq_right = substr($use_seq, $snp_pos, 10); $stars = ( $snp_seq_right =~ tr/*/*/ ); $snp_seq_right =~ s/\*//g; ( $snp_seq_right = reverse $snp_seq_right ) =~ tr/acgtACGT/tgcaTGCA/; $snp_seq = $snp_seq_right . '.' . $snp_seq_left; } my %design_pos; while ( $design_seq =~ /($snp_seq)/g ) { $design_pos{($-[0]+11-$stars)} = $2; } if ( scalar keys %design_pos > 0 ) { my $snp_design_pos_text = join ';', keys %design_pos; my $snp_design_pos = XML::Twig::Elt->new('pos_design', $snp_design_pos_text); $snp_design_pos->paste('after', $snp_pos_elt); $snp_passed{$snp_id_in} = 1; } } } } } } } } mipe-1.1/snpPosOnSource.pl0000755000175000017500000000605310267443213015155 0ustar janjan00000000000000#!/usr/bin/perl # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library ('COPYING'); if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use XML::Twig; =head1 NAME snpPosOnSource.pl - Adds pos_source to SNP based on MIPE version v1.1 arguments: * mipe_file * STDIN: tab-delimited list of data, in the following order: PCR ID, SNP ID =head1 SYNOPSIS snpPosOnSource.pl your_file.mipe < my_data.txt =head1 ADDITIONAL INFO See http://mipe.sourceforge.net =head1 AUTHOR Jan Aerts (jan.aerts@bbsrc.ac.uk) =cut my $file = shift; if ( not defined $file ) { die "Please provide filename\n" }; my $data = shift; my $twig = XML::Twig->new( pretty_print => 'indented' # , keep_atts_order => 1 , TwigHandlers => { pcr => \&pcr } ); my @snp_data = ( ); my %snp_passed; foreach ( @snp_data ) { chomp; my ( $pcr_id_in, $snp_id_in ) = split /\t/, $_; $snp_passed{$snp_id_in} = 0; } $twig->parsefile($file); $twig->print; foreach ( sort keys %snp_passed ) { if ( $snp_passed{$_} == 0 ) { print STDERR "Position of $_ on source sequence not calculated\n"; } } exit; sub pcr { my ( $twig, $pcr ) = @_; my $pcr_id = $pcr->{att}->{id}; foreach my $input_line ( @snp_data ) { chomp $input_line; my ( $pcr_id_in, $snp_id_in ) = split /\t/, $input_line; if ( $pcr_id =~ /$pcr_id_in/ ) { my $revcomp = 0; if ( defined $pcr->first_child('use') and defined $pcr->first_child('design')->first_child('pos') ) { if ( defined $pcr->first_child('use')->first_child('revcomp') ) { $revcomp = $pcr->first_child('use')->first_child('revcomp'); } my @snps = $pcr->first_child('use')->children('snp'); foreach my $snp ( @snps ) { my $snp_id = $snp->{att}->{id}; if ( $snp_id =~ /$snp_id_in/ and defined $snp->first_child('pos_design') and not defined $snp->first_child('pos_source') ) { my $snp_pos_design = $snp->first_child('pos_design'); my ( $source_start, $source_stop ) = split /-/, $pcr->first_child('design')->first_child('pos')->text; my $snp_pos_source_text = $snp_pos_design->text + $source_start - 1; my $snp_pos_source_elt = XML::Twig::Elt->new('pos_source', $snp_pos_source_text); $snp_pos_source_elt->paste('after', $snp_pos_design); $snp_passed{$snp_id_in} = 1; } } } } } } mipe-1.1/template.mipe0000644000175000017500000001252610267443213014346 0ustar janjan00000000000000 1.0