diff --git a/LICENSE.txt b/LICENSE.txt index 94a9ed0..d645695 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,674 +1,202 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/alignment/AlignmentFilters.cpp b/alignment/AlignmentFilters.cpp index df5d177..2e02915 100644 --- a/alignment/AlignmentFilters.cpp +++ b/alignment/AlignmentFilters.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "alignment/AlignmentFilters.hh" diff --git a/alignment/AlignmentFilters.hh b/alignment/AlignmentFilters.hh index 26373af..4d94631 100644 --- a/alignment/AlignmentFilters.hh +++ b/alignment/AlignmentFilters.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/alignment/AlignmentTweakers.cpp b/alignment/AlignmentTweakers.cpp index 136318d..fd839da 100644 --- a/alignment/AlignmentTweakers.cpp +++ b/alignment/AlignmentTweakers.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "alignment/AlignmentTweakers.hh" diff --git a/alignment/AlignmentTweakers.hh b/alignment/AlignmentTweakers.hh index d703daf..8797935 100644 --- a/alignment/AlignmentTweakers.hh +++ b/alignment/AlignmentTweakers.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/alignment/GraphAlignmentOperations.cpp b/alignment/GraphAlignmentOperations.cpp index 26f06d1..86e79c1 100644 --- a/alignment/GraphAlignmentOperations.cpp +++ b/alignment/GraphAlignmentOperations.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "alignment/GraphAlignmentOperations.hh" diff --git a/alignment/GraphAlignmentOperations.hh b/alignment/GraphAlignmentOperations.hh index 1a98e31..333a6a0 100644 --- a/alignment/GraphAlignmentOperations.hh +++ b/alignment/GraphAlignmentOperations.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/alignment/GreedyAlignmentIntersector.cpp b/alignment/GreedyAlignmentIntersector.cpp index 4f399d6..aebffa1 100644 --- a/alignment/GreedyAlignmentIntersector.cpp +++ b/alignment/GreedyAlignmentIntersector.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "alignment/GreedyAlignmentIntersector.hh" diff --git a/alignment/GreedyAlignmentIntersector.hh b/alignment/GreedyAlignmentIntersector.hh index 5450040..bddf025 100644 --- a/alignment/GreedyAlignmentIntersector.hh +++ b/alignment/GreedyAlignmentIntersector.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/alignment/HighQualityBaseRunFinder.cpp b/alignment/HighQualityBaseRunFinder.cpp index 4d1afac..ae8245c 100644 --- a/alignment/HighQualityBaseRunFinder.cpp +++ b/alignment/HighQualityBaseRunFinder.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "alignment/HighQualityBaseRunFinder.hh" diff --git a/alignment/HighQualityBaseRunFinder.hh b/alignment/HighQualityBaseRunFinder.hh index 721441c..7fc5849 100644 --- a/alignment/HighQualityBaseRunFinder.hh +++ b/alignment/HighQualityBaseRunFinder.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/alignment/SoftclippingAligner.cpp b/alignment/SoftclippingAligner.cpp index 7436f6b..b419ed5 100644 --- a/alignment/SoftclippingAligner.cpp +++ b/alignment/SoftclippingAligner.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "alignment/SoftclippingAligner.hh" diff --git a/alignment/SoftclippingAligner.hh b/alignment/SoftclippingAligner.hh index a2d4179..af77ce2 100644 --- a/alignment/SoftclippingAligner.hh +++ b/alignment/SoftclippingAligner.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/alignment/tests/AlignmentTweakersTest.cpp b/alignment/tests/AlignmentTweakersTest.cpp index 29ac73d..a5df47f 100644 --- a/alignment/tests/AlignmentTweakersTest.cpp +++ b/alignment/tests/AlignmentTweakersTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "alignment/AlignmentTweakers.hh" diff --git a/alignment/tests/GraphAlignmentOperationsTest.cpp b/alignment/tests/GraphAlignmentOperationsTest.cpp index be4cb98..767af56 100644 --- a/alignment/tests/GraphAlignmentOperationsTest.cpp +++ b/alignment/tests/GraphAlignmentOperationsTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "alignment/GraphAlignmentOperations.hh" diff --git a/alignment/tests/GreedyAlignmentIntersectorTest.cpp b/alignment/tests/GreedyAlignmentIntersectorTest.cpp index 0ed0187..7fc624f 100644 --- a/alignment/tests/GreedyAlignmentIntersectorTest.cpp +++ b/alignment/tests/GreedyAlignmentIntersectorTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "alignment/GreedyAlignmentIntersector.hh" diff --git a/alignment/tests/HighQualityBaseRunFinderTest.cpp b/alignment/tests/HighQualityBaseRunFinderTest.cpp index 73605e7..28275eb 100644 --- a/alignment/tests/HighQualityBaseRunFinderTest.cpp +++ b/alignment/tests/HighQualityBaseRunFinderTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "alignment/HighQualityBaseRunFinder.hh" diff --git a/alignment/tests/SoftclippingAlignerTest.cpp b/alignment/tests/SoftclippingAlignerTest.cpp index 5c03818..145eef5 100644 --- a/alignment/tests/SoftclippingAlignerTest.cpp +++ b/alignment/tests/SoftclippingAlignerTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "alignment/SoftclippingAligner.hh" @@ -89,4 +90,4 @@ TEST_P(AligningReads, RealReadEndingInManyLowQualityBases_Aligned) INSTANTIATE_TEST_CASE_P( AlignerTestsInst, AligningReads, ::testing::Values(std::string("path-aligner"), std::string("dag-aligner")), ); -*/ \ No newline at end of file +*/ diff --git a/classification/AlignmentClassifier.cpp b/classification/AlignmentClassifier.cpp index 13301fd..70a91dd 100644 --- a/classification/AlignmentClassifier.cpp +++ b/classification/AlignmentClassifier.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include diff --git a/classification/AlignmentClassifier.hh b/classification/AlignmentClassifier.hh index 473e825..7d261a5 100644 --- a/classification/AlignmentClassifier.hh +++ b/classification/AlignmentClassifier.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/classification/ClassifierOfAlignmentsToVariant.cpp b/classification/ClassifierOfAlignmentsToVariant.cpp index 2715750..fafc1c3 100644 --- a/classification/ClassifierOfAlignmentsToVariant.cpp +++ b/classification/ClassifierOfAlignmentsToVariant.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "classification/ClassifierOfAlignmentsToVariant.hh" diff --git a/classification/ClassifierOfAlignmentsToVariant.hh b/classification/ClassifierOfAlignmentsToVariant.hh index bd8112f..8f6b571 100644 --- a/classification/ClassifierOfAlignmentsToVariant.hh +++ b/classification/ClassifierOfAlignmentsToVariant.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/classification/tests/AlignmentClassifierTest.cpp b/classification/tests/AlignmentClassifierTest.cpp index b078bcb..8d86352 100644 --- a/classification/tests/AlignmentClassifierTest.cpp +++ b/classification/tests/AlignmentClassifierTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "classification/AlignmentClassifier.hh" @@ -163,4 +164,4 @@ TEST(ObtainingCanonicalAlignment, FlankingAndSpanningRead_ClassifiedAsFlanking) const list Alignments = { spanning_Alignment, flanking_Alignment }; EXPECT_EQ(flanking_Alignment, alignment_classifier.GetCanonicalAlignment(Alignments)); -} \ No newline at end of file +} diff --git a/classification/tests/AlignmentSummaryTest.cpp b/classification/tests/AlignmentSummaryTest.cpp index 4350056..cdf4568 100644 --- a/classification/tests/AlignmentSummaryTest.cpp +++ b/classification/tests/AlignmentSummaryTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include @@ -66,4 +67,4 @@ TEST(SummarizingAlignments, TypicalAlignments_Summarized) EXPECT_EQ(expected_counts_of_flanking_reads, counts_of_flanking_reads); EXPECT_EQ(expected_counts_of_spanning_reads, counts_of_spanning_reads); } -*/ \ No newline at end of file +*/ diff --git a/classification/tests/ClassifierOfAlignmentsToVariantTest.cpp b/classification/tests/ClassifierOfAlignmentsToVariantTest.cpp index 31166e1..249b478 100644 --- a/classification/tests/ClassifierOfAlignmentsToVariantTest.cpp +++ b/classification/tests/ClassifierOfAlignmentsToVariantTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "classification/ClassifierOfAlignmentsToVariant.hh" diff --git a/common/Common.cpp b/common/Common.cpp index a8ddc00..ad1341e 100644 --- a/common/Common.cpp +++ b/common/Common.cpp @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "common/Common.hh" diff --git a/common/Common.hh b/common/Common.hh index 0bd5a9a..0296fee 100644 --- a/common/Common.hh +++ b/common/Common.hh @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/common/CountTable.cpp b/common/CountTable.cpp index 23a322d..4ee6f17 100644 --- a/common/CountTable.cpp +++ b/common/CountTable.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "common/CountTable.hh" diff --git a/common/CountTable.hh b/common/CountTable.hh index ff54736..051c5e7 100644 --- a/common/CountTable.hh +++ b/common/CountTable.hh @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/common/GenomicRegion.cpp b/common/GenomicRegion.cpp index 3a9746f..6c9732b 100644 --- a/common/GenomicRegion.cpp +++ b/common/GenomicRegion.cpp @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "common/GenomicRegion.hh" diff --git a/common/GenomicRegion.hh b/common/GenomicRegion.hh index c1a9ba9..3ec829d 100644 --- a/common/GenomicRegion.hh +++ b/common/GenomicRegion.hh @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/common/HtsHelpers.cpp b/common/HtsHelpers.cpp index 85169d1..dcc95ef 100644 --- a/common/HtsHelpers.cpp +++ b/common/HtsHelpers.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "common/HtsHelpers.hh" @@ -80,12 +81,19 @@ namespace htshelpers alignmentStats.matePos = htsAlignPtr->core.mpos; uint32_t samFlag = htsAlignPtr->core.flag; - alignmentStats.isMapped = !(samFlag & SamFlags::kIsUnmapped); - alignmentStats.isMateMapped = !(samFlag & SamFlags::kIsMateUnmapped); + alignmentStats.isPaired = samFlag & BAM_FPAIRED; + alignmentStats.isMapped = !(samFlag & BAM_FUNMAP); + alignmentStats.isMateMapped = !(samFlag & BAM_FMUNMAP); return alignmentStats; } + bool isPrimaryAlignment(bam1_t* htsAlignPtr) + { + return !((htsAlignPtr->core.flag & BAM_FSECONDARY) || + (htsAlignPtr->core.flag & BAM_FSUPPLEMENTARY)); + } + static string lowercaseLowQualityBases(const string& bases, const string& quals, int lowBaseQualityCutoff = 20) { const int qualityScoreOffset = 33; @@ -103,7 +111,7 @@ namespace htshelpers Read decodeRead(bam1_t* htsAlignPtr) { const uint32_t samFlag = htsAlignPtr->core.flag; - const bool isFirstMate = samFlag & SamFlags::kIsFirstMate; + const bool isFirstMate = samFlag & BAM_FREAD1; const string fragmentId = bam_get_qname(htsAlignPtr); MateNumber mateNumber = isFirstMate ? MateNumber::kFirstMate : MateNumber::kSecondMate; diff --git a/common/HtsHelpers.hh b/common/HtsHelpers.hh index 02a2a27..a3b1619 100644 --- a/common/HtsHelpers.hh +++ b/common/HtsHelpers.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -35,18 +36,8 @@ namespace ehunter namespace htshelpers { - enum SamFlags - { - kIsUnmapped = 0x4, - kIsMateUnmapped = 0x8, - kIsFirstMate = 0x40, - kIsSecondMate = 0x80, - // kSecondaryAlign = 0x100, - // kSupplementaryAlignment = 0x800, - kIsNotPrimaryLine = 0x900 - }; - LinearAlignmentStats decodeAlignmentStats(bam1_t* htsAlignPtr); + bool isPrimaryAlignment(bam1_t* htsAlignPtr); Read decodeRead(bam1_t* htsAlignPtr); ReferenceContigInfo decodeContigInfo(bam_hdr_t* htsHeaderPtr); diff --git a/common/Parameters.cpp b/common/Parameters.cpp index cbc5655..80808ee 100644 --- a/common/Parameters.cpp +++ b/common/Parameters.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "common/Parameters.hh" diff --git a/common/Parameters.hh b/common/Parameters.hh index 3548901..41caacf 100644 --- a/common/Parameters.hh +++ b/common/Parameters.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -35,8 +36,15 @@ namespace ehunter { +enum class AnalysisMode +{ + kSeeking, + kStreaming +}; + enum class LogLevel { + kTrace, kDebug, kInfo, kWarn, @@ -86,37 +94,18 @@ private: class SampleParameters { public: - SampleParameters( - std::string id, Sex sex, int readLength, - boost::optional optionalHaplotypeDepth) + SampleParameters(std::string id, Sex sex) : id_(std::move(id)) , sex_(sex) - , readLength_(readLength) - , optionalHaplotypeDepth_(optionalHaplotypeDepth) { } const std::string& id() const { return id_; } const Sex& sex() const { return sex_; } - int readLength() const { return readLength_; } - - double haplotypeDepth() const - { - if (!optionalHaplotypeDepth_) - { - throw std::logic_error("Attempting to access unset depth parameter"); - } - return *optionalHaplotypeDepth_; - } - - bool isHaplotypeDepthSet() const { return optionalHaplotypeDepth_.is_initialized(); } - void setHaplotypeDepth(double haplotypeDepth) { optionalHaplotypeDepth_ = haplotypeDepth; } private: std::string id_; Sex sex_; - int readLength_; - boost::optional optionalHaplotypeDepth_; }; class HeuristicParameters @@ -124,7 +113,7 @@ class HeuristicParameters public: HeuristicParameters( int regionExtensionLength, int qualityCutoffForGoodBaseCall, bool skipUnaligned, const std::string& alignerType, - int kmerLenForAlignment = 14, int paddingLength = 10, int seedAffixTrimLength = 5) + int kmerLenForAlignment = 14, int paddingLength = 10, int seedAffixTrimLength = 14) : regionExtensionLength_(regionExtensionLength) , qualityCutoffForGoodBaseCall_(qualityCutoffForGoodBaseCall) , skipUnaligned_(skipUnaligned) @@ -159,11 +148,12 @@ class ProgramParameters public: ProgramParameters( InputPaths inputPaths, OutputPaths outputPaths, SampleParameters sample, HeuristicParameters heuristics, - LogLevel logLevel) + AnalysisMode analysisMode, LogLevel logLevel) : inputPaths_(std::move(inputPaths)) , outputPaths_(std::move(outputPaths)) , sample_(std::move(sample)) , heuristics_(std::move(heuristics)) + , analysisMode_(analysisMode) , logLevel_(logLevel) { } @@ -172,6 +162,7 @@ public: const OutputPaths& outputPaths() const { return outputPaths_; } SampleParameters& sample() { return sample_; } const HeuristicParameters& heuristics() const { return heuristics_; } + AnalysisMode analysisMode() const { return analysisMode_; } LogLevel logLevel() const { return logLevel_; } private: @@ -179,6 +170,7 @@ private: OutputPaths outputPaths_; SampleParameters sample_; HeuristicParameters heuristics_; + AnalysisMode analysisMode_; LogLevel logLevel_; }; diff --git a/common/Reference.cpp b/common/Reference.cpp index dceeb9f..a5c9dc6 100644 --- a/common/Reference.cpp +++ b/common/Reference.cpp @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "common/Reference.hh" @@ -33,29 +34,48 @@ using std::vector; namespace ehunter { -FastaReference::FastaReference( - const string& referencePath, - const ReferenceContigInfo& contigInfo) +FastaReference::FastaReference(const string& referencePath, const ReferenceContigInfo& contigInfo) : referencePath_(referencePath) - , contigInfo_(contigInfo) + , fastaContigInfo_({}) + , bamHeaderContigInfo_(contigInfo) { htsFastaIndexPtr_ = fai_load(referencePath_.c_str()); + + std::vector> internalNamesAndSizes; + + for (int contigIndex = 0; contigIndex != faidx_nseq(htsFastaIndexPtr_); ++contigIndex) + { + const char* sequenceName = faidx_iseq(htsFastaIndexPtr_, contigIndex); + int64_t sequenceLength = faidx_seq_len(htsFastaIndexPtr_, sequenceName); + internalNamesAndSizes.emplace_back(sequenceName, sequenceLength); + } + + fastaContigInfo_ = ReferenceContigInfo(internalNamesAndSizes); + assertConsistency(); +} + +void FastaReference::assertConsistency() const +{ + // This is a stub for a function that should throw an error unless all of the following holds + // 1. Every reference sequence (used in the catalog) has an ID from the BAM header (up to 'chr' mismatches) + // 2. Same name refers to same chromosome (coordinate system) } FastaReference::~FastaReference() { fai_destroy(htsFastaIndexPtr_); } string FastaReference::getSequence(const string& contigName, int64_t start, int64_t end) const { + const int contigIndex = fastaContigInfo_.getContigId(contigName); + const char* contigNamePtr = faidx_iseq(htsFastaIndexPtr_, contigIndex); + int extractedLength; // This htslib function is 0-based closed but our coordinates are half open - char* sequencePtr = faidx_fetch_seq(htsFastaIndexPtr_, contigName.c_str(), start, end - 1, &extractedLength); + char* sequencePtr = faidx_fetch_seq(htsFastaIndexPtr_, contigNamePtr, start, end - 1, &extractedLength); if (!sequencePtr || extractedLength < 0 || extractedLength < end - start) { const string encoding(contigName + ":" + to_string(start) + "-" + to_string(end)); - const string message = "Cannot extract " + encoding + " from " + referencePath_ - + "; chromosome names must match exactly (e.g. chr1 and 1 are distinct names) " - + "and coordinates cannot be past the end of the chromosome"; + const string message = "Unable to extract " + encoding + " from " + referencePath_; throw std::runtime_error(message); } @@ -68,7 +88,7 @@ string FastaReference::getSequence(const string& contigName, int64_t start, int6 string FastaReference::getSequence(const GenomicRegion& region) const { - return getSequence(contigInfo_.getContigName(region.contigIndex()), region.start(), region.end()); + return getSequence(bamHeaderContigInfo_.getContigName(region.contigIndex()), region.start(), region.end()); } } diff --git a/common/Reference.hh b/common/Reference.hh index 0cbaeff..44e7167 100644 --- a/common/Reference.hh +++ b/common/Reference.hh @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -25,6 +26,7 @@ #include #include #include +#include #include // Include the fai class from samtools @@ -64,13 +66,19 @@ public: std::string getSequence(const std::string& contigIndex, int64_t start, int64_t end) const override; std::string getSequence(const GenomicRegion& region) const override; - const ReferenceContigInfo& contigInfo() const override { return contigInfo_; } + const ReferenceContigInfo& contigInfo() const override { return bamHeaderContigInfo_; } private: + // A stub for verifying consistency of contig information in FASTA index and BAM header + void assertConsistency() const; + std::string referencePath_; faidx_t* htsFastaIndexPtr_; - ReferenceContigInfo contigInfo_; + // fastaContigInfo_ is meant for internal use only; it should not be exposed though public interface of the class + ReferenceContigInfo fastaContigInfo_; + // bamHeaderContigInfo_ is meant to be exposed through the public interface + ReferenceContigInfo bamHeaderContigInfo_; }; } diff --git a/common/ReferenceContigInfo.cpp b/common/ReferenceContigInfo.cpp index 98b0b79..0bf1670 100644 --- a/common/ReferenceContigInfo.cpp +++ b/common/ReferenceContigInfo.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "common/ReferenceContigInfo.hh" @@ -30,6 +31,23 @@ using std::vector; namespace ehunter { + +namespace +{ + // Removes "chr" prefix from contig names that contain it; adds it to contigs that don't + string generateAlternativeContigName(const string& originalName) + { + if (originalName.length() > 3 && originalName.substr(0, 3) == "chr") + { + return originalName.substr(3); + } + else + { + return "chr" + originalName; + } + } +} + ReferenceContigInfo::ReferenceContigInfo(vector> namesAndSizes) : namesAndSizes_(std::move(namesAndSizes)) { @@ -54,7 +72,12 @@ int64_t ReferenceContigInfo::getContigSize(int32_t contigIndex) const int32_t ReferenceContigInfo::getContigId(const std::string& contigName) const { - const auto entry = nameToIndex_.find(contigName); + auto entry = nameToIndex_.find(contigName); + if (entry == nameToIndex_.end()) + { + entry = nameToIndex_.find(generateAlternativeContigName(contigName)); + } + if (entry == nameToIndex_.end()) { throw std::logic_error("Invalid contig name " + contigName); @@ -82,4 +105,4 @@ std::ostream& operator<<(std::ostream& out, const ReferenceContigInfo& contigInf return out; } -} \ No newline at end of file +} diff --git a/common/ReferenceContigInfo.hh b/common/ReferenceContigInfo.hh index f4b6ff4..d1b6635 100644 --- a/common/ReferenceContigInfo.hh +++ b/common/ReferenceContigInfo.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -50,4 +51,4 @@ private: std::ostream& operator<<(std::ostream& out, const ReferenceContigInfo& contigInfo); -} \ No newline at end of file +} diff --git a/common/tests/CountTableTest.cpp b/common/tests/CountTableTest.cpp index 99a3141..4633f96 100644 --- a/common/tests/CountTableTest.cpp +++ b/common/tests/CountTableTest.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "common/CountTable.hh" diff --git a/common/tests/GenomicRegionTest.cpp b/common/tests/GenomicRegionTest.cpp index f93eb85..c11d1c5 100644 --- a/common/tests/GenomicRegionTest.cpp +++ b/common/tests/GenomicRegionTest.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "common/GenomicRegion.hh" @@ -91,4 +92,4 @@ TEST(MergingRegions, IncludedRegions_Merged) regions = merge(regions); vector expected_regions = { GenomicRegion(1, 90, 300) }; ASSERT_EQ(expected_regions, regions); -} \ No newline at end of file +} diff --git a/docs/01_Introduction.md b/docs/01_Introduction.md index 0429f4c..718e3d9 100644 --- a/docs/01_Introduction.md +++ b/docs/01_Introduction.md @@ -1,9 +1,10 @@ # A guide to Expansion Hunter software -Expansion Hunter is a tool to estimate sizes of short tandem repeats by -performing a targeted search through a BAM/CRAM file for reads that span, flank, -and are fully contained in each repeat. Newer versions of the program provide -limited support for insertions, deletions, and sequence swaps. +Expansion Hunter is a tool for targeted genotyping of short tandem repeats and +flanking variants. It operates by performing a targeted search through a +BAM/CRAM file for reads that span, flank, and are fully contained in each +repeat. Newer versions of the program provide limited support for insertions, +deletions, and substitutions. In order to use Expansion Hunter you need to (1) download the latest release or build the program from source, (2) obtain a set of files specifying repeat diff --git a/docs/02_Installation.md b/docs/02_Installation.md index 49d3fa7..69621cd 100644 --- a/docs/02_Installation.md +++ b/docs/02_Installation.md @@ -11,7 +11,7 @@ Prerequisites: - A recent version of [GCC](https://gcc.gnu.org/) or [clang](http://clang.llvm.org/) compiler supporting C++11 standard - - [CMake](https://cmake.org/) version 3.2.0 or above + - [CMake](https://cmake.org/) version 3.5.0 or above - [Boost C++ Libraries](http://www.boost.org/) version 1.57.0 or above diff --git a/docs/03_Usage.md b/docs/03_Usage.md index 42c6ff4..fcc21d8 100644 --- a/docs/03_Usage.md +++ b/docs/03_Usage.md @@ -26,10 +26,6 @@ optional arguments. * `--sex ` Specifies sex of the sample; can be either `male` or `female` (default). This parameter only affects repeats on sex chromosomes. -* `--genome-coverage ` Specifies read depth on diploid chromosomes. - Specifying read depth is required for BAM files containing a subset of - alignments or CRAMs. - * `--region-extension-length ` Specifies how far from on/off-target regions to search for informative reads. Set to 1000 by default. diff --git a/docs/04_VariantCatalogFiles.md b/docs/04_VariantCatalogFiles.md index 34a21b5..64d44e3 100644 --- a/docs/04_VariantCatalogFiles.md +++ b/docs/04_VariantCatalogFiles.md @@ -93,17 +93,19 @@ repeats with repeat units CAG and CCG separated by the sequence CAACAG. Fields `ReferenceRegion` and `VariantStatus` contain reference region and status of each constituent repeat. By default, the program assigns an identifier to each variant consisting of the locus id and reference region. So the two repeats -receive ids HTT_4:3076603-3076660 and HTT_4:3076666-3076693 respectively. +receive ids HTT_4:3076603-3076660 and HTT_4:3076666-3076693 respectively. An +optional field `VariantId` allows to assign custom variant ids to each +variant. The following section describes loci-specification records that the catalogs are comprised of. -## The structure of loci-specification records +## Structure of a locus-specification record -When a region contains a single variant, there is no difference between the -repeat and the region containing it. So field names refer only to the repeat as -shown in the table below. +When locus contains a single variant, there is no difference between the +variant and the locus containing it. So field names refer to the variant +itself. * `LocusId` Unique identifier of the entire locus @@ -117,6 +119,11 @@ shown in the table below. * `VariantType` Can be either `RareRepeat`, `RareRepeat`, or `SmallVariant` with the latter corresponding to insertions deletions or sequence swaps. +* `VariantId` Optional array of unique variant ids. If missing, variant ids + are synthesized according to this rule: If there is only one variant in + a locus then it gets the same id as the locus itself. If locus contains + multiple variants, each one of them gets id of the form `_`. + * `OfftargetRegions` Array of regions where informative reads may misalign; only used for variants of type `RareRepeat`. diff --git a/filtering/OrientationPredictor.cpp b/filtering/OrientationPredictor.cpp index 0144be0..da10382 100644 --- a/filtering/OrientationPredictor.cpp +++ b/filtering/OrientationPredictor.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "filtering/OrientationPredictor.hh" diff --git a/filtering/OrientationPredictor.hh b/filtering/OrientationPredictor.hh index 4fee191..e8ba203 100644 --- a/filtering/OrientationPredictor.hh +++ b/filtering/OrientationPredictor.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/filtering/tests/OrientationPredictorTest.cpp b/filtering/tests/OrientationPredictorTest.cpp index 57383a6..8c9ad49 100644 --- a/filtering/tests/OrientationPredictorTest.cpp +++ b/filtering/tests/OrientationPredictorTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "filtering/OrientationPredictor.hh" diff --git a/genotyping/AlleleChecker.cpp b/genotyping/AlleleChecker.cpp new file mode 100644 index 0000000..26385a2 --- /dev/null +++ b/genotyping/AlleleChecker.cpp @@ -0,0 +1,105 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "genotyping/AlleleChecker.hh" + +#include +#include +#include + +#include + +namespace ehunter +{ + +namespace +{ +double poissonLogPmf(double lambda, double count) { + return count * log(lambda) - lambda - boost::math::lgamma(count + 1); +} + +double logBeta(int a, int b) { + return boost::math::lgamma(a) + boost::math::lgamma(b) - boost::math::lgamma(a+b); +} + +double logBinomCoef(int n, int k) { + return -boost::math::log1p(n) - logBeta(n - k + 1, k+1); +} + +double binomLogPmf(int n, double p, int count) { + return logBinomCoef(n, count) + count * log(p) + (n-count) * boost::math::log1p(-p); +} + +} + + +AlleleCheckSummary +AlleleChecker::check(double haplotypeDepth, int targetAlleleCount, int otherAlleleCount) const +{ + if (haplotypeDepth <= 0) + { + throw std::runtime_error("Haplotype depth must be positive"); + } + + if (targetAlleleCount < 0 || otherAlleleCount < 0) + { + throw std::runtime_error("Negative read counts are not allowed"); + } + + const int totalReadCount = targetAlleleCount + otherAlleleCount; + const double ll0 = (totalReadCount > 0) ? binomLogPmf(totalReadCount, errorRate_, targetAlleleCount) : 0; + const double ll1 = poissonLogPmf(haplotypeDepth, targetAlleleCount); + + AlleleCheckSummary result; + result.LikelihoodRatio = (ll1 - ll0) / log(10); + if (result.LikelihoodRatio < -log10(llrThreshold_)) + { + result.Status = AlleleStatus::kAbsent; + } + else if (result.LikelihoodRatio > log10(llrThreshold_)) + { + result.Status = AlleleStatus::kPresent; + } + else + { + result.Status = AlleleStatus::kUncertain; + } + return result; +} + + +std::ostream& operator<<(std::ostream& out, AlleleStatus status) +{ + switch (status) + { + case AlleleStatus::kAbsent: + out << "Absent"; + break; + case AlleleStatus::kPresent: + out << "Present"; + break; + case AlleleStatus::kUncertain: + out << "Uncertain"; + break; + } + + return out; +} + +} diff --git a/genotyping/AlleleChecker.hh b/genotyping/AlleleChecker.hh new file mode 100644 index 0000000..f370c3d --- /dev/null +++ b/genotyping/AlleleChecker.hh @@ -0,0 +1,75 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#pragma once + +#include + +#include "common/Common.hh" + +namespace ehunter +{ + +enum class AlleleStatus +{ + kPresent, + kAbsent, + kUncertain +}; + +/// Results from the AlleleChecker on one allele +struct AlleleCheckSummary +{ + AlleleStatus Status; + double LikelihoodRatio; // Log10(LR) for the allele being present +}; + +/* + * Genotyper checking for presence (>= 1 allele) of a given 'Key' allele + */ +class AlleleChecker +{ +public: + AlleleChecker(double errorRate = 0.02, double llrThreshold = 10000) + : errorRate_(errorRate) + , llrThreshold_(llrThreshold) + { + if (errorRate <= 0 || errorRate >= 1) + { + throw std::runtime_error("Error rate must be positive and less than 1"); + } + if (llrThreshold < 0) + { + throw std::runtime_error("Likelihood Ratio threshold must be positive"); + } + } + + AlleleCheckSummary check(double haplotypeDepth, int targetAlleleCount, int otherAlleleCount) const; + +private: + // Rate of 'false' key-allele observations + double errorRate_; + // If the likelihood ratio threshold in favor of presence or absence + // is not at least this strong, return no call. + double llrThreshold_; +}; + +std::ostream& operator<<(std::ostream& out, AlleleStatus status); + +} diff --git a/genotyping/AllelePresenceChecker.cpp b/genotyping/AllelePresenceChecker.cpp deleted file mode 100644 index 19b3a6e..0000000 --- a/genotyping/AllelePresenceChecker.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// -// Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#include "genotyping/AllelePresenceChecker.hh" - -#include -#include - -namespace ehunter -{ - -static double poissonLogLikelihood(double lambda, double count) -{ - return count * log(lambda) - lambda - boost::math::lgamma(count + 1); -} - -AllelePresenceStatus -AllelePresenceChecker::check(double haplotypeDepth, int targetAlleleCount, int otherAlleleCount) const -{ - if (haplotypeDepth <= 0) - { - throw std::runtime_error("Haplotype depth must be positive"); - } - - if (targetAlleleCount < 0 || otherAlleleCount < 0) - { - throw std::runtime_error("Negative read counts are not allowed"); - } - - const int totalReadCount = targetAlleleCount + otherAlleleCount; - double ll0 = (totalReadCount > 0) ? poissonLogLikelihood(errorRate_ * totalReadCount, targetAlleleCount) : 0; - double ll1 = poissonLogLikelihood(haplotypeDepth, targetAlleleCount); - if (abs(ll0 - ll1) < log(llrThreshold_)) - { - return AllelePresenceStatus::kUncertain; - } - - return (ll1 > ll0) ? AllelePresenceStatus::kPresent : AllelePresenceStatus::kAbsent; -} - -std::ostream& operator<<(std::ostream& out, AllelePresenceStatus status) -{ - switch (status) - { - case AllelePresenceStatus::kAbsent: - out << "Absent"; - break; - case AllelePresenceStatus::kPresent: - out << "Present"; - break; - case AllelePresenceStatus::kUncertain: - out << "Uncertain"; - break; - } - - return out; -} - -} diff --git a/genotyping/AllelePresenceChecker.hh b/genotyping/AllelePresenceChecker.hh deleted file mode 100644 index 794f2aa..0000000 --- a/genotyping/AllelePresenceChecker.hh +++ /dev/null @@ -1,67 +0,0 @@ -// -// Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#pragma once - -#include - -#include "common/Common.hh" - -namespace ehunter -{ - -enum class AllelePresenceStatus -{ - kPresent, - kAbsent, - kUncertain -}; - -/* - * Genotyper checking for presence (>= 1 allele) of a given 'Key' allele - */ -class AllelePresenceChecker -{ -public: - AllelePresenceChecker(double errorRate = 0.02, double llrThreshold = 10000) - : errorRate_(errorRate) - , llrThreshold_(llrThreshold) - { - if (errorRate <= 0 || errorRate >= 1) - { - throw std::runtime_error("Error rate must be positive and less than 1"); - } - if (llrThreshold < 0) - { - throw std::runtime_error("Likelihood Ratio threshold must be positive"); - } - } - - AllelePresenceStatus check(double haplotypeDepth, int targetAlleleCount, int otherAlleleCount) const; - -private: - // Rate of 'false' key-allele observations - double errorRate_; - // If the likelihood ratio threshold in favor of presence or absence - // is not at least this strong, return no call. - double llrThreshold_; -}; - -std::ostream& operator<<(std::ostream& out, AllelePresenceStatus status); - -} diff --git a/genotyping/RepeatGenotype.cpp b/genotyping/RepeatGenotype.cpp index 7c0a78a..5b5ef37 100644 --- a/genotyping/RepeatGenotype.cpp +++ b/genotyping/RepeatGenotype.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "genotyping/RepeatGenotype.hh" diff --git a/genotyping/RepeatGenotype.hh b/genotyping/RepeatGenotype.hh index 10e792d..0c73beb 100644 --- a/genotyping/RepeatGenotype.hh +++ b/genotyping/RepeatGenotype.hh @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/genotyping/RepeatGenotyper.cpp b/genotyping/RepeatGenotyper.cpp index bc086d7..4da3b30 100644 --- a/genotyping/RepeatGenotyper.cpp +++ b/genotyping/RepeatGenotyper.cpp @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "genotyping/RepeatGenotyper.hh" diff --git a/genotyping/RepeatGenotyper.hh b/genotyping/RepeatGenotyper.hh index 2eef2fa..3e684ea 100644 --- a/genotyping/RepeatGenotyper.hh +++ b/genotyping/RepeatGenotyper.hh @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/genotyping/RepeatLength.cpp b/genotyping/RepeatLength.cpp index 124423f..16ab386 100644 --- a/genotyping/RepeatLength.cpp +++ b/genotyping/RepeatLength.cpp @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "genotyping/RepeatLength.hh" diff --git a/genotyping/RepeatLength.hh b/genotyping/RepeatLength.hh index dc91ba9..194d0b7 100644 --- a/genotyping/RepeatLength.hh +++ b/genotyping/RepeatLength.hh @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/genotyping/ShortRepeatGenotyper.cpp b/genotyping/ShortRepeatGenotyper.cpp index 5dc28eb..929766e 100644 --- a/genotyping/ShortRepeatGenotyper.cpp +++ b/genotyping/ShortRepeatGenotyper.cpp @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "genotyping/ShortRepeatGenotyper.hh" diff --git a/genotyping/ShortRepeatGenotyper.hh b/genotyping/ShortRepeatGenotyper.hh index 59d24b1..2c0afe2 100644 --- a/genotyping/ShortRepeatGenotyper.hh +++ b/genotyping/ShortRepeatGenotyper.hh @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // // Defines classes and methods for GenotypeRepeat and haplotype likelihood diff --git a/genotyping/SmallVariantGenotype.cpp b/genotyping/SmallVariantGenotype.cpp index 1330dec..f4c9b34 100644 --- a/genotyping/SmallVariantGenotype.cpp +++ b/genotyping/SmallVariantGenotype.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "genotyping/SmallVariantGenotype.hh" diff --git a/genotyping/SmallVariantGenotype.hh b/genotyping/SmallVariantGenotype.hh index 0604692..5df1a78 100644 --- a/genotyping/SmallVariantGenotype.hh +++ b/genotyping/SmallVariantGenotype.hh @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/genotyping/SmallVariantGenotyper.cpp b/genotyping/SmallVariantGenotyper.cpp index 9f587ad..f387555 100644 --- a/genotyping/SmallVariantGenotyper.cpp +++ b/genotyping/SmallVariantGenotyper.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Sai Chen // Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "genotyping/SmallVariantGenotyper.hh" diff --git a/genotyping/SmallVariantGenotyper.hh b/genotyping/SmallVariantGenotyper.hh index 686ca03..c9e90e5 100644 --- a/genotyping/SmallVariantGenotyper.hh +++ b/genotyping/SmallVariantGenotyper.hh @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Sai Chen , // Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/genotyping/tests/AlleleCheckerTest.cpp b/genotyping/tests/AlleleCheckerTest.cpp new file mode 100644 index 0000000..f5ef9ce --- /dev/null +++ b/genotyping/tests/AlleleCheckerTest.cpp @@ -0,0 +1,77 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "genotyping/AlleleChecker.hh" + +#include + +#include "gtest/gtest.h" + +#include "common/Common.hh" + +using namespace ehunter; + +TEST(AlleleChecker, ThrowsWithIllegalParameter) +{ + ASSERT_ANY_THROW(new AlleleChecker(1)); + ASSERT_ANY_THROW(new AlleleChecker(0.01, -1)); + + AlleleChecker checker; + ASSERT_ANY_THROW(checker.check(0.0, 10, 20)); + ASSERT_ANY_THROW(checker.check(15.0, -1, 20)); +} + +TEST(AlleleChecker, NoReads) +{ + AlleleChecker checker; + EXPECT_EQ(AlleleStatus::kAbsent, checker.check(15.0, 0, 0).Status); +} + +TEST(AlleleChecker, NormalCoverage) +{ + AlleleChecker checker; + EXPECT_EQ(AlleleStatus::kPresent, checker.check(15.0, 30, 30).Status); + EXPECT_EQ(AlleleStatus::kPresent, checker.check(15.0, 10, 45).Status); + EXPECT_EQ(AlleleStatus::kPresent, checker.check(15.0, 10, 0).Status); + EXPECT_EQ(AlleleStatus::kPresent, checker.check(15.0, 50, 60).Status); + + EXPECT_EQ(AlleleStatus::kAbsent, checker.check(15.0, 0, 30).Status); + EXPECT_EQ(AlleleStatus::kAbsent, checker.check(15.0, 1, 60).Status); + EXPECT_EQ(AlleleStatus::kAbsent, checker.check(15.0, 1, 5).Status); + + EXPECT_EQ(AlleleStatus::kUncertain, checker.check(15.0, 5, 30).Status); + EXPECT_EQ(AlleleStatus::kUncertain, checker.check(15.0, 1, 0).Status); +} + +TEST(AlleleChecker, LowCoverageCall) +{ + AlleleChecker checker; + EXPECT_EQ(AlleleStatus::kUncertain, checker.check(5.0, 0, 15).Status); + EXPECT_EQ(AlleleStatus::kUncertain, checker.check(5.0, 1, 5).Status); + EXPECT_EQ(AlleleStatus::kPresent, checker.check(5.0, 7, 5).Status); + +} + +TEST(AllelePresenceChecker, HighCoverage) +{ + AlleleChecker checker; + EXPECT_EQ(AlleleStatus::kPresent, checker.check(1500.0, 1000, 4500).Status); + EXPECT_EQ(AlleleStatus::kAbsent, checker.check(1500.0, 300, 4500).Status); + EXPECT_EQ(AlleleStatus::kUncertain, checker.check(1500.0, 509, 4500).Status); +} diff --git a/genotyping/tests/AllelePresenceCheckerTest.cpp b/genotyping/tests/AllelePresenceCheckerTest.cpp deleted file mode 100644 index 4aeb674..0000000 --- a/genotyping/tests/AllelePresenceCheckerTest.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// -// Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#include "genotyping/AllelePresenceChecker.hh" - -#include - -#include "gtest/gtest.h" - -#include "common/Common.hh" - -using namespace ehunter; - -TEST(AllelePresenceChecker, ThrowsWithIllegalParameter) -{ - ASSERT_ANY_THROW(new AllelePresenceChecker(1)); - ASSERT_ANY_THROW(new AllelePresenceChecker(0.01, -1)); - - AllelePresenceChecker presenseChecker; - ASSERT_ANY_THROW(presenseChecker.check(0.0, 10, 20)); - ASSERT_ANY_THROW(presenseChecker.check(15.0, -1, 20)); -} - -TEST(AllelePresenceChecker, NoReads) -{ - AllelePresenceChecker checker; - EXPECT_EQ(AllelePresenceStatus::kAbsent, checker.check(15.0, 0, 0)); -} - -TEST(AllelePresenceChecker, AllelePresent) -{ - AllelePresenceChecker checker; - EXPECT_EQ(AllelePresenceStatus::kPresent, checker.check(15.0, 30, 30)); - EXPECT_EQ(AllelePresenceStatus::kPresent, checker.check(15.0, 10, 45)); - EXPECT_EQ(AllelePresenceStatus::kPresent, checker.check(15.0, 10, 0)); - EXPECT_EQ(AllelePresenceStatus::kPresent, checker.check(15.0, 50, 60)); -} - -TEST(AllelePresenceChecker, AlleleAbsent) -{ - AllelePresenceChecker checker; - EXPECT_EQ(AllelePresenceStatus::kAbsent, checker.check(15.0, 0, 30)); - EXPECT_EQ(AllelePresenceStatus::kAbsent, checker.check(15.0, 1, 60)); - EXPECT_EQ(AllelePresenceStatus::kAbsent, checker.check(15.0, 1, 5)); -} - -TEST(AllelePresenceChecker, NoCall) -{ - AllelePresenceChecker checker; - EXPECT_EQ(AllelePresenceStatus::kUncertain, checker.check(15.0, 5, 30)); - EXPECT_EQ(AllelePresenceStatus::kUncertain, checker.check(15.0, 1, 0)); -} - -TEST(AllelePresenceChecker, HighReads) -{ - AllelePresenceChecker checker; - EXPECT_EQ(AllelePresenceStatus::kPresent, checker.check(150.0, 100, 450)); - EXPECT_EQ(AllelePresenceStatus::kAbsent, checker.check(150.0, 20, 600)); - EXPECT_EQ(AllelePresenceStatus::kUncertain, checker.check(150.0, 40, 200)); -} diff --git a/genotyping/tests/CMakeLists.txt b/genotyping/tests/CMakeLists.txt index a9a831c..27b5024 100644 --- a/genotyping/tests/CMakeLists.txt +++ b/genotyping/tests/CMakeLists.txt @@ -14,6 +14,6 @@ add_executable(SmallVariantGenotyperTest SmallVariantGenotyperTest.cpp) target_link_libraries(SmallVariantGenotyperTest genotyping gtest_main) add_test(NAME SmallVariantGenotyperTest COMMAND SmallVariantGenotyperTest) -add_executable(AllelePresenceCheckerTest AllelePresenceCheckerTest.cpp) -target_link_libraries(AllelePresenceCheckerTest genotyping gtest_main) -add_test(NAME AllelePresenceCheckerTest COMMAND AllelePresenceCheckerTest) \ No newline at end of file +add_executable(AlleleCheckerTest AlleleCheckerTest.cpp) +target_link_libraries(AlleleCheckerTest genotyping gtest_main) +add_test(NAME AlleleCheckerTest COMMAND AlleleCheckerTest) \ No newline at end of file diff --git a/genotyping/tests/GenotypeTest.cpp b/genotyping/tests/GenotypeTest.cpp index 9aaf2ae..4ed22c9 100644 --- a/genotyping/tests/GenotypeTest.cpp +++ b/genotyping/tests/GenotypeTest.cpp @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "genotyping/genotype.h" diff --git a/genotyping/tests/RepeatGenotypeTest.cpp b/genotyping/tests/RepeatGenotypeTest.cpp index 1c76e82..149b7fd 100644 --- a/genotyping/tests/RepeatGenotypeTest.cpp +++ b/genotyping/tests/RepeatGenotypeTest.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "genotyping/RepeatGenotype.hh" diff --git a/genotyping/tests/RepeatGenotyperTest.cpp b/genotyping/tests/RepeatGenotyperTest.cpp index 1c90576..570f675 100644 --- a/genotyping/tests/RepeatGenotyperTest.cpp +++ b/genotyping/tests/RepeatGenotyperTest.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "genotyping/RepeatGenotyper.hh" diff --git a/genotyping/tests/ShortRepeatGenotyperTest.cpp b/genotyping/tests/ShortRepeatGenotyperTest.cpp index 67ad131..3c7e74e 100644 --- a/genotyping/tests/ShortRepeatGenotyperTest.cpp +++ b/genotyping/tests/ShortRepeatGenotyperTest.cpp @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "genotyping/ShortRepeatGenotyper.hh" diff --git a/genotyping/tests/SmallVariantGenotyperTest.cpp b/genotyping/tests/SmallVariantGenotyperTest.cpp index db0a310..dce4484 100644 --- a/genotyping/tests/SmallVariantGenotyperTest.cpp +++ b/genotyping/tests/SmallVariantGenotyperTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Sai Chen // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "genotyping/SmallVariantGenotyper.hh" @@ -52,4 +53,4 @@ TEST(SmallVariantGenotyper, RegularGenotye) SmallVariantGenotype alt_genotype(AlleleType::kAlt, AlleleType::kAlt); SmallVariantGenotype gt2 = *genotyper.genotype(1, 20); EXPECT_EQ(alt_genotype, gt2); -} \ No newline at end of file +} diff --git a/input/CatalogLoading.cpp b/input/CatalogLoading.cpp index 64b3e87..7162f8b 100644 --- a/input/CatalogLoading.cpp +++ b/input/CatalogLoading.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "input/CatalogLoading.hh" @@ -111,9 +112,23 @@ static VariantTypeFromUser decodeVariantTypeFromUser(const string& encoding) } } -static LocusDescriptionFromUser loadUserDescription( - Json& locusJson, - const ReferenceContigInfo& contigInfo) +static vector generateIds(const std::string& locusId, const Json& variantRegionEncodings) +{ + if (variantRegionEncodings.size() == 1) + { + return { locusId }; + } + + vector variantIds; + for (const string& regionEncoding : variantRegionEncodings) + { + variantIds.push_back(locusId + "_" + regionEncoding); + } + + return variantIds; +} + +static LocusDescriptionFromUser loadUserDescription(Json& locusJson, const ReferenceContigInfo& contigInfo) { LocusDescriptionFromUser userDescription; @@ -148,6 +163,19 @@ static LocusDescriptionFromUser loadUserDescription( } } + if (checkIfFieldExists(locusJson, "VariantId")) + { + makeArray(locusJson["VariantId"]); + for (const string& variantId : locusJson["VariantId"]) + { + userDescription.variantIds.push_back(variantId); + } + } + else + { + userDescription.variantIds = generateIds(userDescription.locusId, locusJson["ReferenceRegion"]); + } + if (checkIfFieldExists(locusJson, "OfftargetRegions")) { assertRecordIsArray(locusJson["OfftargetRegions"]); @@ -162,10 +190,7 @@ static LocusDescriptionFromUser loadUserDescription( } RegionCatalog loadLocusCatalogFromDisk( - const string& catalogPath, - Sex sampleSex, - const HeuristicParameters& heuristicParams, - const Reference& reference) + const string& catalogPath, Sex sampleSex, const HeuristicParameters& heuristicParams, const Reference& reference) { std::ifstream inputStream(catalogPath.c_str()); @@ -182,9 +207,8 @@ RegionCatalog loadLocusCatalogFromDisk( for (auto& locusJson : catalogJson) { LocusDescriptionFromUser userDescription = loadUserDescription(locusJson, reference.contigInfo()); - LocusSpecification locusSpec - = decodeLocusSpecification(userDescription, sampleSex, reference, heuristicParams); - catalog.emplace(std::make_pair(locusSpec.regionId(), locusSpec)); + LocusSpecification locusSpec = decodeLocusSpecification(userDescription, sampleSex, reference, heuristicParams); + catalog.emplace(std::make_pair(locusSpec.locusId(), locusSpec)); } return catalog; diff --git a/input/CatalogLoading.hh b/input/CatalogLoading.hh index c0c0d39..9fb34b2 100644 --- a/input/CatalogLoading.hh +++ b/input/CatalogLoading.hh @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -32,9 +33,7 @@ namespace ehunter { RegionCatalog loadLocusCatalogFromDisk( - const std::string& catalogPath, - Sex sampleSex, - const HeuristicParameters& heuristicParams, + const std::string& catalogPath, Sex sampleSex, const HeuristicParameters& heuristicParams, const Reference& reference); } diff --git a/input/GraphBlueprint.cpp b/input/GraphBlueprint.cpp index ad9b82d..e158b7d 100644 --- a/input/GraphBlueprint.cpp +++ b/input/GraphBlueprint.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "input/GraphBlueprint.hh" diff --git a/input/GraphBlueprint.hh b/input/GraphBlueprint.hh index 8f9a365..637fa2a 100644 --- a/input/GraphBlueprint.hh +++ b/input/GraphBlueprint.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/input/LocusSpecDecoding.cpp b/input/LocusSpecDecoding.cpp index f55829e..d778026 100644 --- a/input/LocusSpecDecoding.cpp +++ b/input/LocusSpecDecoding.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "input/LocusSpecDecoding.hh" @@ -55,14 +56,12 @@ static vector addFlankingRegions(int kExtensionLength, const vect } static string extendLocusStructure( - const Reference& reference, const vector& referenceRegions, - const string& flanklessLocusStructure) + const Reference& reference, const vector& referenceRegions, const string& flanklessLocusStructure) { const auto& leftFlank = referenceRegions.front(); const auto& rightFlank = referenceRegions.back(); - return reference.getSequence(leftFlank) + flanklessLocusStructure - + reference.getSequence(rightFlank); + return reference.getSequence(leftFlank) + flanklessLocusStructure + reference.getSequence(rightFlank); } static vector @@ -91,18 +90,6 @@ addReferenceRegionsForInterruptions(const GraphBlueprint& blueprint, const vecto return completedReferenceRegions; } -static vector -combine(const std::string& prefix, const ReferenceContigInfo& contigInfo, const vector& regions) -{ - vector combinedStrings; - for (const auto& region : regions) - { - combinedStrings.push_back(prefix + "_" + encode(contigInfo, region)); - } - - return combinedStrings; -} - static GenomicRegion mergeRegions(const vector& regions) { const int kMaxMergeDistance = 500; @@ -222,9 +209,7 @@ static VariantSubtype determineVariantSubtype( } static optional determineReferenceNode( - const GraphBlueprintFeature& feature, - const Reference& reference, - const GenomicRegion& referenceRegion) + const GraphBlueprintFeature& feature, const Reference& reference, const GenomicRegion& referenceRegion) { if (feature.type == GraphBlueprintFeatureType::kSkippableRepeat @@ -250,25 +235,20 @@ static optional determineReferenceNode( } LocusSpecification decodeLocusSpecification( - const LocusDescriptionFromUser& userDescription, - Sex sampleSex, - const Reference& reference, + const LocusDescriptionFromUser& userDescription, Sex sampleSex, const Reference& reference, const HeuristicParameters& heuristicParams) { assertValidity(userDescription); const int kExtensionLength = heuristicParams.regionExtensionLength(); auto referenceRegionsWithFlanks = addFlankingRegions(kExtensionLength, userDescription.referenceRegions); - auto completeLocusStructure = extendLocusStructure( - reference, referenceRegionsWithFlanks, userDescription.locusStructure); + auto completeLocusStructure + = extendLocusStructure(reference, referenceRegionsWithFlanks, userDescription.locusStructure); GraphBlueprint blueprint = decodeFeaturesFromRegex(completeLocusStructure); graphtools::Graph locusGraph = makeRegionGraph(blueprint, userDescription.locusId); auto completeReferenceRegions = addReferenceRegionsForInterruptions(blueprint, referenceRegionsWithFlanks); - vector variantIds - = combine(userDescription.locusId, reference.contigInfo(), userDescription.referenceRegions); - GenomicRegion referenceRegionForEntireLocus = mergeRegions(userDescription.referenceRegions); vector targetReadExtractionRegions; @@ -281,17 +261,16 @@ LocusSpecification decodeLocusSpecification( targetReadExtractionRegions.push_back(referenceRegionForEntireLocus.extend(kExtensionLength)); } - const auto& contigName - = reference.contigInfo().getContigName(referenceRegionForEntireLocus.contigIndex()); + const auto& contigName = reference.contigInfo().getContigName(referenceRegionForEntireLocus.contigIndex()); AlleleCount expectedAlleleCount = determineExpectedAlleleCount(sampleSex, contigName); NodeToRegionAssociation referenceRegionsOfGraphNodes = associateNodesWithReferenceRegions(blueprint, locusGraph, completeReferenceRegions); - LocusSpecification regionSpec( + LocusSpecification locusSpec( userDescription.locusId, targetReadExtractionRegions, expectedAlleleCount, locusGraph, referenceRegionsOfGraphNodes); - regionSpec.setOfftargetReadExtractionRegions(userDescription.offtargetRegions); + locusSpec.setOfftargetReadExtractionRegions(userDescription.offtargetRegions); int variantIndex = 0; for (const auto& feature : blueprint) @@ -301,22 +280,22 @@ LocusSpecification decodeLocusSpecification( const GenomicRegion& referenceRegion = userDescription.referenceRegions.at(variantIndex); VariantTypeFromUser variantDescription = userDescription.variantTypesFromUser.at(variantIndex); + const string& variantId = userDescription.variantIds[variantIndex]; VariantType variantType = determineVariantType(feature.type); VariantSubtype variantSubtype = determineVariantSubtype(feature.type, variantDescription, referenceRegion); - optional optionalReferenceNode - = determineReferenceNode(feature, reference, referenceRegion); + optional optionalReferenceNode = determineReferenceNode(feature, reference, referenceRegion); VariantClassification classification(variantType, variantSubtype); - regionSpec.addVariantSpecification( - variantIds[variantIndex], classification, referenceRegion, feature.nodeIds, optionalReferenceNode); + locusSpec.addVariantSpecification( + variantId, classification, referenceRegion, feature.nodeIds, optionalReferenceNode); ++variantIndex; } } - return regionSpec; + return locusSpec; } void assertValidity(const LocusDescriptionFromUser& userDescription) diff --git a/input/LocusSpecDecoding.hh b/input/LocusSpecDecoding.hh index e27d90f..d4a1428 100644 --- a/input/LocusSpecDecoding.hh +++ b/input/LocusSpecDecoding.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -43,6 +44,7 @@ struct LocusDescriptionFromUser { std::string locusId; std::string locusStructure; + std::vector variantIds; std::vector referenceRegions; std::vector targetRegions; std::vector offtargetRegions; @@ -52,9 +54,7 @@ struct LocusDescriptionFromUser void assertValidity(const LocusDescriptionFromUser& userDescription); LocusSpecification decodeLocusSpecification( - const LocusDescriptionFromUser& userDescription, - Sex sampleSex, - const Reference& reference, + const LocusDescriptionFromUser& userDescription, Sex sampleSex, const Reference& reference, const HeuristicParameters& heuristicParams); } diff --git a/input/ParameterLoading.cpp b/input/ParameterLoading.cpp index 2ce490d..5382802 100644 --- a/input/ParameterLoading.cpp +++ b/input/ParameterLoading.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "input/ParameterLoading.hh" @@ -62,6 +63,7 @@ struct UserParameters int qualityCutoffForGoodBaseCall; bool skipUnaligned; + string analysisMode; string logLevel; }; @@ -70,34 +72,42 @@ boost::optional tryParsingUserParameters(int argc, char** argv) UserParameters params; // clang-format off - po::options_description usage("Allowed options"); - usage.add_options() - ("help", "Print help message") - ("version", "Print version number") - ("reads", po::value(¶ms.htsFilePath)->required(), "BAM/CRAM file with aligned reads") - ("reference", po::value(¶ms.referencePath)->required(), "FASTA file with reference genome") - ("variant-catalog", po::value(¶ms.catalogPath)->required(), "JSON file with variants to genotype") - ("output-prefix", po::value(¶ms.outputPrefix)->required(), "Prefix for the output files") - ("region-extension-length", po::value(¶ms.regionExtensionLength)->default_value(1000), "How far from on/off-target regions to search for informative reads") - ("read-length", po::value(), "Read length") - ("genome-coverage", po::value(), "Read depth on diploid chromosomes") - ("sex", po::value(¶ms.sampleSexEncoding)->default_value("female"), "Sex of the sample; must be either male or female") - ("aligner", po::value(¶ms.alignerType)->default_value("dag-aligner"), "dag-aligner or path-aligner") - ("log-level", po::value(¶ms.logLevel)->default_value("info"), "debug, info, warn, error"); + po::options_description basicOptions("Basic options"); + basicOptions.add_options() + ("help,h", "Print help message") + ("version,v", "Print version number") + ("reads", po::value(¶ms.htsFilePath)->required(), "BAM/CRAM file with aligned reads") + ("reference", po::value(¶ms.referencePath)->required(), "FASTA file with reference genome") + ("variant-catalog", po::value(¶ms.catalogPath)->required(), "JSON file with variants to genotype") + ("output-prefix", po::value(¶ms.outputPrefix)->required(), "Prefix for the output files") + ("region-extension-length", po::value(¶ms.regionExtensionLength)->default_value(1000), "How far from on/off-target regions to search for informative reads") + ("sex", po::value(¶ms.sampleSexEncoding)->default_value("female"), "Sex of the sample; must be either male or female") + ("log-level", po::value(¶ms.logLevel)->default_value("info"), "trace, debug, info, warn, or error"); // clang-format on + // clang-format off + po::options_description advancedOptions("Advanced options"); + advancedOptions.add_options() + ("aligner,a", po::value(¶ms.alignerType)->default_value("dag-aligner"), "Specify which aligner to use (dag-aligner or path-aligner)") + ("analysis-mode,m", po::value(¶ms.analysisMode)->default_value("seeking"), "Specify which analysis workflow to use (seeking or streaming)"); + // clang-format on + + po::options_description cmdlineOptions; + cmdlineOptions.add(basicOptions).add(advancedOptions); + if (argc == 1) { - std::cerr << usage << std::endl; + std::cerr << cmdlineOptions << std::endl; return boost::optional(); } po::variables_map argumentMap; - po::store(po::command_line_parser(argc, argv).options(usage).run(), argumentMap); + po::store(po::command_line_parser(argc, argv).options(cmdlineOptions).run(), argumentMap); if (argumentMap.count("help")) { - std::cerr << usage << std::endl; + std::cerr << basicOptions << std::endl; + std::cerr << advancedOptions << std::endl; return boost::optional(); } @@ -128,10 +138,10 @@ static void assertWritablePath(const string& pathEncoding) const fs::path pathToDirectory = path.parent_path(); const bool thereIsNoDirectory = pathToDirectory.empty(); - const bool pathLeadsExistingDirectory = fs::is_directory(pathToDirectory); + const bool pathLeadsToExistingDirectory = fs::is_directory(pathToDirectory); const bool filenameIsValid = fs::portable_posix_name(path.filename().string()); - if (!filenameIsValid || (!thereIsNoDirectory && !pathLeadsExistingDirectory)) + if (!filenameIsValid || (!thereIsNoDirectory && !pathLeadsToExistingDirectory)) { throw std::invalid_argument(pathEncoding + " is not a valid output path"); } @@ -140,8 +150,9 @@ static void assertWritablePath(const string& pathEncoding) static void assertPathToExistingFile(const string& pathEncoding) { const fs::path path(pathEncoding); + const bool isPathToExistingFile = fs::exists(path) && fs::is_regular_file(path); - if (fs::is_directory(path) && !fs::exists(path)) + if (!isPathToExistingFile) { throw std::invalid_argument(pathEncoding + " is not a path to an existing file"); } @@ -223,37 +234,38 @@ void assertValidity(const UserParameters& userParameters) + to_string(kMinQualityCutoffForGoodBaseCall) + " and " + to_string(kMaxQualityCutoffForGoodBaseCall); throw std::invalid_argument(message); } - - if (userParameters.logLevel != "debug" && userParameters.logLevel != "info" && userParameters.logLevel != "warn" - && userParameters.logLevel != "error") - { - const string message = "Log level must be set to one either debug, info, warn, or error"; - throw std::invalid_argument(message); - } } SampleParameters decodeSampleParameters(const UserParameters& userParams) { fs::path boostHtsFilePath(userParams.htsFilePath); auto sampleId = boostHtsFilePath.stem().string(); - Sex sex = decodeSampleSex(userParams.sampleSexEncoding); + return SampleParameters(sampleId, sex); +} - int readLength - = userParams.optionalReadLength ? *userParams.optionalReadLength : extractReadLength(userParams.htsFilePath); - - optional optionalHaplotypeDepth; - - if (userParams.optionalGenomeCoverage) +AnalysisMode decodeAnalysisMode(const string& encoding) +{ + if (encoding == "streaming") { - optionalHaplotypeDepth = *userParams.optionalGenomeCoverage / 2; + return AnalysisMode::kStreaming; + } + else if (encoding == "seeking") + { + return AnalysisMode::kSeeking; + } + else + { + throw std::logic_error("Invalid encoding of data input mode '" + encoding + "'"); } - - return SampleParameters(sampleId, sex, readLength, optionalHaplotypeDepth); } LogLevel decodeLogLevel(const string& encoding) { + if (encoding == "trace") + { + return LogLevel::kTrace; + } if (encoding == "debug") { return LogLevel::kDebug; @@ -297,9 +309,29 @@ boost::optional tryLoadingProgramParameters(int argc, char** userParams.regionExtensionLength, userParams.qualityCutoffForGoodBaseCall, userParams.skipUnaligned, userParams.alignerType); - LogLevel logLevel = decodeLogLevel(userParams.logLevel); + LogLevel logLevel; + try + { + logLevel = decodeLogLevel(userParams.logLevel); + } + catch (std::logic_error) + { + const string message = "Log level must be set to either trace, debug, info, warn, or error"; + throw std::invalid_argument(message); + } + + AnalysisMode analysisMode; + try + { + analysisMode = decodeAnalysisMode(userParams.analysisMode); + } + catch (std::logic_error) + { + const string message = "Analysis mode must be set to either streaming or seeking"; + throw std::invalid_argument(message); + } - return ProgramParameters(inputPaths, outputPaths, sampleParameters, heuristicParameters, logLevel); + return ProgramParameters(inputPaths, outputPaths, sampleParameters, heuristicParameters, analysisMode, logLevel); } } diff --git a/input/ParameterLoading.hh b/input/ParameterLoading.hh index 06c8880..d8e5b85 100644 --- a/input/ParameterLoading.hh +++ b/input/ParameterLoading.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/input/RegionGraph.cpp b/input/RegionGraph.cpp index f2173e3..b490287 100644 --- a/input/RegionGraph.cpp +++ b/input/RegionGraph.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "input/RegionGraph.hh" diff --git a/input/RegionGraph.hh b/input/RegionGraph.hh index 718393f..1125517 100644 --- a/input/RegionGraph.hh +++ b/input/RegionGraph.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/input/SampleStats.cpp b/input/SampleStats.cpp index 4168848..03161ec 100644 --- a/input/SampleStats.cpp +++ b/input/SampleStats.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "input/SampleStats.hh" @@ -85,12 +86,6 @@ int extractReadLength(const string& htsFilePath) return readLength; } -bool isBamFile(const string& htsFilePath) -{ - string extension = boost::filesystem::extension(htsFilePath); - return extension == ".bam"; -} - ReferenceContigInfo extractReferenceContigInfo(const std::string& htsFilePath) { samFile* htsFilePtr = sam_open(htsFilePath.c_str(), "r"); @@ -105,7 +100,7 @@ ReferenceContigInfo extractReferenceContigInfo(const std::string& htsFilePath) throw std::runtime_error("Failed to read the header of " + htsFilePath); } - return htshelpers::decodeContigInfo(htsHeaderPtr); + return htshelpers::decodeContigInfo(htsHeaderPtr); } } diff --git a/input/SampleStats.hh b/input/SampleStats.hh index 2accbcd..794f7d9 100644 --- a/input/SampleStats.hh +++ b/input/SampleStats.hh @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -31,9 +32,6 @@ namespace ehunter // Returns the length of the first read in a HTS file int extractReadLength(const std::string& htsFilePath); -// Checks if a file is in the BAM format by checking the extension -bool isBamFile(const std::string& htsFilePath); - ReferenceContigInfo extractReferenceContigInfo(const std::string& htsFilePath); } diff --git a/input/tests/GraphBlueprintTest.cpp b/input/tests/GraphBlueprintTest.cpp index 1c14eda..ffdf480 100644 --- a/input/tests/GraphBlueprintTest.cpp +++ b/input/tests/GraphBlueprintTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "input/GraphBlueprint.hh" @@ -59,4 +60,4 @@ TEST(ParsingTokens, TypicalTokens_Parsed) FeatureTypeAndSequences expectedResult = { GraphBlueprintFeatureType::kSwap, { "AAA", "TTT" } }; EXPECT_EQ(expectedResult, parser.parse("(AAA|TTT)")); } -} \ No newline at end of file +} diff --git a/input/tests/LocusSpecificationTest.cpp b/input/tests/LocusSpecificationTest.cpp index c6a03d3..2e8c94c 100644 --- a/input/tests/LocusSpecificationTest.cpp +++ b/input/tests/LocusSpecificationTest.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "region_spec/LocusSpecification.hh" @@ -31,48 +32,48 @@ using namespace ehunter; /* TEST(CreatingRegionSpecs, SingeUnitRepeatSpec_Parsed) { - const string regionId = "region1"; + const string locusId = "region1"; const vector repeatIds; - RegionSpec regionSpec(regionId, repeatIds, Region("chr1:1-10"), "GCC", "AT", "GCC", "TA"); + RegionSpec locusSpec(locusId, repeatIds, Region("chr1:1-10"), "GCC", "AT", "GCC", "TA"); vector expectedComponents = { RegionComponent("LF", "AT", RegionComponentType::kFlank), RegionComponent("Repeat0", "GCC", RegionComponentType::kRepeat), RegionComponent("RF", "TA", RegionComponentType::kFlank) }; - ASSERT_EQ(expectedComponents, regionSpec.components()); + ASSERT_EQ(expectedComponents, locusSpec.components()); } TEST(CreatingRegionSpecs, MultiunitFromatToSpecifySingleUnitRepeat_Parsed) { - const string regionId = "region1"; + const string locusId = "region1"; const vector repeatIds; - RegionSpec regionSpec(regionId, repeatIds, Region("chr1:1-10"), "(AGG)", "AT", "AGG", "TA"); + RegionSpec locusSpec(locusId, repeatIds, Region("chr1:1-10"), "(AGG)", "AT", "AGG", "TA"); vector expectedComponents = { RegionComponent("LF", "AT", RegionComponentType::kFlank), RegionComponent("Repeat0", "AGG", RegionComponentType::kRepeat), RegionComponent("RF", "TA", RegionComponentType::kFlank) }; - ASSERT_EQ(expectedComponents, regionSpec.components()); + ASSERT_EQ(expectedComponents, locusSpec.components()); } TEST(CreatingRegionSpecs, TypicalMultiunitRepeatSpecs_Parsed) { - const string regionId = "region1"; + const string locusId = "region1"; const vector repeatIds; { - RegionSpec regionSpec(regionId, repeatIds, Region("chr1:1-10"), "(AGG)(CG)", "AT", "AGGCG", "TA"); + RegionSpec locusSpec(locusId, repeatIds, Region("chr1:1-10"), "(AGG)(CG)", "AT", "AGGCG", "TA"); vector expectedComponents = { RegionComponent("LF", "AT", RegionComponentType::kFlank), RegionComponent("Repeat0", "AGG", RegionComponentType::kRepeat), RegionComponent("Repeat1", "CG", RegionComponentType::kRepeat), RegionComponent("RF", "TA", RegionComponentType::kFlank) }; - EXPECT_EQ(expectedComponents, regionSpec.components()); + EXPECT_EQ(expectedComponents, locusSpec.components()); } { - RegionSpec regionSpec(regionId, repeatIds, Region("chr1:1-10"), "(AGG)ATG(CG)", "CC", "AGGATGCG", "GG"); + RegionSpec locusSpec(locusId, repeatIds, Region("chr1:1-10"), "(AGG)ATG(CG)", "CC", "AGGATGCG", "GG"); vector expectedComponents = { RegionComponent("LF", "CC", RegionComponentType::kFlank), RegionComponent("Repeat0", "AGG", RegionComponentType::kRepeat), @@ -80,7 +81,7 @@ TEST(CreatingRegionSpecs, TypicalMultiunitRepeatSpecs_Parsed) RegionComponent("Repeat1", "CG", RegionComponentType::kRepeat), RegionComponent("RF", "GG", RegionComponentType::kFlank) }; - EXPECT_EQ(expectedComponents, regionSpec.components()); + EXPECT_EQ(expectedComponents, locusSpec.components()); } } -*/ \ No newline at end of file +*/ diff --git a/input/tests/RegionGraphTest.cpp b/input/tests/RegionGraphTest.cpp index f15d8ca..72e5ddb 100644 --- a/input/tests/RegionGraphTest.cpp +++ b/input/tests/RegionGraphTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "input/RegionGraph.hh" diff --git a/output/BamletWriter.cpp b/output/BamletWriter.cpp index 5d88c13..dacda7d 100644 --- a/output/BamletWriter.cpp +++ b/output/BamletWriter.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Felix Schlesinger , // Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "output/BamletWriter.hh" diff --git a/output/BamletWriter.hh b/output/BamletWriter.hh index e04ec45..cf36bad 100644 --- a/output/BamletWriter.hh +++ b/output/BamletWriter.hh @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Felix Schlesinger , // Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/output/JsonWriter.cpp b/output/JsonWriter.cpp index 13e3c98..95e9180 100644 --- a/output/JsonWriter.cpp +++ b/output/JsonWriter.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "output/JsonWriter.hh" @@ -45,10 +46,8 @@ std::ostream& operator<<(std::ostream& out, JsonWriter& jsonWriter) } JsonWriter::JsonWriter( - const SampleParameters& sampleParams, const ReferenceContigInfo& contigInfo, const RegionCatalog& regionCatalog, - const SampleFindings& sampleFindings) - : sampleParams_(sampleParams) - , contigInfo_(contigInfo) + const ReferenceContigInfo& contigInfo, const RegionCatalog& regionCatalog, const SampleFindings& sampleFindings) + : contigInfo_(contigInfo) , regionCatalog_(regionCatalog) , sampleFindings_(sampleFindings) { @@ -58,18 +57,18 @@ void JsonWriter::write(std::ostream& out) { Json array = Json::array(); - for (const auto& regionIdAndFindings : sampleFindings_) + for (const auto& locusIdAndFindings : sampleFindings_) { - const string& regionId = regionIdAndFindings.first; - const LocusSpecification& regionSpec = regionCatalog_.at(regionId); - const RegionFindings& regionFindings = regionIdAndFindings.second; + const string& locusId = locusIdAndFindings.first; + const LocusSpecification& locusSpec = regionCatalog_.at(locusId); + const LocusFindings& locusFindings = locusIdAndFindings.second; - for (const auto& variantIdAndFindings : regionFindings) + for (const auto& variantIdAndFindings : locusFindings.findingsForEachVariant) { const string& variantId = variantIdAndFindings.first; - const VariantSpecification& variantSpec = regionSpec.getVariantSpecById(variantId); + const VariantSpecification& variantSpec = locusSpec.getVariantSpecById(variantId); - VariantJsonWriter variantWriter(sampleParams_, contigInfo_, regionSpec, variantSpec); + VariantJsonWriter variantWriter(contigInfo_, locusSpec, variantSpec); variantIdAndFindings.second->accept(&variantWriter); array.push_back(variantWriter.record()); } @@ -85,32 +84,6 @@ template static string streamToString(const T& streamableObject) return out.str(); } -static string encodeSupportCounts(const ReadSupportCalculator& readSupportCalculator, int repeatSize) -{ - const string countsOfSpanningReads = to_string(readSupportCalculator.getCountOfConsistentSpanningReads(repeatSize)); - const string countsOfFlankingReads = to_string(readSupportCalculator.getCountOfConsistentFlankingReads(repeatSize)); - return countsOfSpanningReads + "-" + countsOfFlankingReads; -} - -static string encodeRepeatAlleleSupport(const string& repeatUnit, const RepeatFindings& repeatFindings, int readLength) -{ - const int maxUnitsInRead = std::ceil(readLength / static_cast(repeatUnit.length())); - ReadSupportCalculator readSupportCalculator( - maxUnitsInRead, repeatFindings.countsOfSpanningReads(), repeatFindings.countsOfFlankingReads()); - - assert(repeatFindings.optionalGenotype()); - const RepeatGenotype& genotype = *repeatFindings.optionalGenotype(); - - string supportEncoding = encodeSupportCounts(readSupportCalculator, genotype.shortAlleleSizeInUnits()); - - if (genotype.numAlleles() == 2) - { - supportEncoding += "/" + encodeSupportCounts(readSupportCalculator, genotype.longAlleleSizeInUnits()); - } - - return supportEncoding; -} - static string encodeGenotype(const RepeatGenotype& genotype) { string encoding = std::to_string(genotype.shortAlleleSizeInUnits()); @@ -136,36 +109,37 @@ void VariantJsonWriter::visit(const RepeatFindings* repeatFindingsPtr) record_["VariantSubtype"] = streamToString(variantSpec_.classification().subtype); const auto repeatNodeId = variantSpec_.nodes().front(); - const auto& repeatUnit = regionSpec_.regionGraph().nodeSeq(repeatNodeId); + const auto& repeatUnit = locusSpec_.regionGraph().nodeSeq(repeatNodeId); record_["RepeatUnit"] = repeatUnit; record_["CountsOfSpanningReads"] = streamToString(repeatFindings.countsOfSpanningReads()); record_["CountsOfFlankingReads"] = streamToString(repeatFindings.countsOfFlankingReads()); record_["CountsOfInrepeatReads"] = streamToString(repeatFindings.countsOfInrepeatReads()); - if (repeatFindings.optionalGenotype() != boost::none) + if (repeatFindings.optionalGenotype()) { record_["Genotype"] = encodeGenotype(*repeatFindings.optionalGenotype()); record_["GenotypeConfidenceInterval"] = streamToString(*repeatFindings.optionalGenotype()); - record_["GenotypeSupport"] = encodeRepeatAlleleSupport(repeatUnit, repeatFindings, sampleParams_.readLength()); } } void VariantJsonWriter::visit(const SmallVariantFindings* smallVariantFindingsPtr) { - const SmallVariantFindings& indelFindings = *smallVariantFindingsPtr; + const SmallVariantFindings& findings = *smallVariantFindingsPtr; record_.clear(); record_["VariantId"] = variantSpec_.id(); record_["VariantType"] = streamToString(variantSpec_.classification().type); record_["VariantSubtype"] = streamToString(variantSpec_.classification().subtype); - record_["ReferenceRegion"] = streamToString(variantSpec_.referenceLocus()); - record_["CountOfRefReads"] = indelFindings.numRefReads(); - record_["CountOfAltReads"] = indelFindings.numAltReads(); - record_["StatusOfRefAllele"] = streamToString(indelFindings.refAllelePresenceStatus()); - record_["StatusOfAltAllele"] = streamToString(indelFindings.altAllelePresenceStatus()); - if (indelFindings.optionalGenotype() != boost::none) + record_["ReferenceRegion"] = encode(contigInfo_, variantSpec_.referenceLocus()); + record_["CountOfRefReads"] = findings.numRefReads(); + record_["CountOfAltReads"] = findings.numAltReads(); + record_["StatusOfRefAllele"] = streamToString(findings.refAllelePresenceStatus().Status); + record_["LogLikelihoodRefAllelePresent"] = streamToString(findings.refAllelePresenceStatus().LikelihoodRatio); + record_["StatusOfAltAllele"] = streamToString(findings.altAllelePresenceStatus().Status); + record_["LogLikelihoodAltAllelePresent"] = streamToString(findings.altAllelePresenceStatus().LikelihoodRatio); + if (findings.optionalGenotype()) { - record_["Genotype"] = streamToString(*indelFindings.optionalGenotype()); + record_["Genotype"] = streamToString(*findings.optionalGenotype()); } } diff --git a/output/JsonWriter.hh b/output/JsonWriter.hh index 41f2844..a50b38c 100644 --- a/output/JsonWriter.hh +++ b/output/JsonWriter.hh @@ -1,27 +1,28 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once #include "common/Parameters.hh" -#include "region_analysis/VariantFindings.hh" +#include "region_analysis/LocusFindings.hh" #include "region_spec/LocusSpecification.hh" #include "thirdparty/json/json.hpp" @@ -33,13 +34,10 @@ class VariantJsonWriter : public VariantFindingsVisitor { public: VariantJsonWriter( - const SampleParameters& sampleParams, - const ReferenceContigInfo& contigInfo, - const LocusSpecification& regionSpec, + const ReferenceContigInfo& contigInfo, const LocusSpecification& locusSpec, const VariantSpecification& variantSpec) - : sampleParams_(sampleParams) - , contigInfo_(contigInfo) - , regionSpec_(regionSpec) + : contigInfo_(contigInfo) + , locusSpec_(locusSpec) , variantSpec_(variantSpec) { } @@ -50,9 +48,8 @@ public: nlohmann::json record() const { return record_; } private: - const SampleParameters& sampleParams_; const ReferenceContigInfo& contigInfo_; - const LocusSpecification& regionSpec_; + const LocusSpecification& locusSpec_; const VariantSpecification& variantSpec_; nlohmann::json record_; }; @@ -61,15 +58,12 @@ class JsonWriter { public: JsonWriter( - const SampleParameters& sampleParams, - const ReferenceContigInfo& contigInfo, - const RegionCatalog& regionCatalog, + const ReferenceContigInfo& contigInfo, const RegionCatalog& regionCatalog, const SampleFindings& sampleFindings); void write(std::ostream& out); private: - const SampleParameters& sampleParams_; const ReferenceContigInfo& contigInfo_; const RegionCatalog& regionCatalog_; const SampleFindings& sampleFindings_; diff --git a/output/VcfHeader.cpp b/output/VcfHeader.cpp index c9502d9..a4b97f6 100644 --- a/output/VcfHeader.cpp +++ b/output/VcfHeader.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "output/VcfHeader.hh" @@ -28,6 +29,14 @@ using std::string; namespace ehunter { +void FieldDescriptionWriter::addCommonFields() +{ + const string kVaridFieldDescription = "Variant identifier as specified in the variant catalog"; + tryAddingFieldDescription(FieldType::kInfo, "VARID", "1", "String", kVaridFieldDescription); + tryAddingFieldDescription(FieldType::kFormat, "GT", "1", "String", "Genotype"); + tryAddingFieldDescription(FieldType::kFilter, "PASS", "", "", "All filters passed"); +} + void FieldDescriptionWriter::visit(const RepeatFindings* repeatFindingsPtr) { if (!repeatFindingsPtr->optionalGenotype()) @@ -35,15 +44,15 @@ void FieldDescriptionWriter::visit(const RepeatFindings* repeatFindingsPtr) return; } + addCommonFields(); tryAddingFieldDescription(FieldType::kInfo, "SVTYPE", "1", "String", "Type of structural variant"); tryAddingFieldDescription(FieldType::kInfo, "END", "1", "Integer", "End position of the variant"); tryAddingFieldDescription(FieldType::kInfo, "REF", "1", "Integer", "Reference copy number"); tryAddingFieldDescription(FieldType::kInfo, "RL", "1", "Integer", "Reference length in bp"); tryAddingFieldDescription(FieldType::kInfo, "RU", "1", "String", "Repeat unit in the reference orientation"); - const string kRepidFieldDescription = "Repeat identifier from the repeat specification file"; + const string kRepidFieldDescription = "Repeat identifier as specified in the variant catalog"; tryAddingFieldDescription(FieldType::kInfo, "REPID", "1", "String", kRepidFieldDescription); - tryAddingFieldDescription(FieldType::kFormat, "GT", "1", "String", "Genotype"); const string kSoFieldDescription = "Type of reads that support the allele; can be SPANNING, FLANKING, or INREPEAT meaning that the reads span, " @@ -63,10 +72,8 @@ void FieldDescriptionWriter::visit(const RepeatFindings* repeatFindingsPtr) const string kAdirFieldDescription = "Number of in-repeat reads consistent with the allele"; tryAddingFieldDescription(FieldType::kFormat, "ADIR", "1", "String", kAdirFieldDescription); - tryAddingFieldDescription(FieldType::kFilter, "PASS", "", "", "All filters passed"); - const auto repeatNodeId = variantSpec_.nodes().front(); - const string& repeatUnit = regionSpec_.regionGraph().nodeSeq(repeatNodeId); + const string& repeatUnit = locusSpec_.regionGraph().nodeSeq(repeatNodeId); const auto& referenceLocus = variantSpec_.referenceLocus(); const int referenceSize = referenceLocus.length() / repeatUnit.length(); @@ -93,9 +100,19 @@ void FieldDescriptionWriter::visit(const SmallVariantFindings* smallVariantFindi { return; } - - tryAddingFieldDescription(FieldType::kFormat, "GT", "1", "String", "Genotype"); - tryAddingFieldDescription(FieldType::kFilter, "PASS", "", "", "All filters passed"); + addCommonFields(); + tryAddingFieldDescription( + FieldType::kFormat, "AD", ".", "Integer", + "Allelic depths for the ref and alt alleles in the order listed"); + if (variantSpec_.classification().subtype == VariantSubtype::kSMN) + { + tryAddingFieldDescription( + FieldType::kFormat, "RPL", "1", "Float", + "Log-Likelihood ratio for the presence of the ref allele"); + tryAddingFieldDescription( + FieldType::kFormat, "DST", "1", "Character", + "Status ('+' affected, '-' unaffected, '?' uncertain) for the test specified by the DID value"); + } } void FieldDescriptionWriter::tryAddingFieldDescription( @@ -125,24 +142,24 @@ FieldDescription::FieldDescription( { } -void outputVcfHeader(const RegionCatalog& regionCatalog, const SampleFindings& sampleFindings, ostream& out) +void outputVcfHeader(const RegionCatalog& locusCatalog, const SampleFindings& sampleFindings, ostream& out) { out << "##fileformat=VCFv4.1\n"; FieldDescriptionCatalog fieldDescriptionCatalog; - for (const auto& regionIdAndFindings : sampleFindings) + for (const auto& locusIdAndFindings : sampleFindings) { - const string& regionId = regionIdAndFindings.first; - const LocusSpecification& regionSpec = regionCatalog.at(regionId); - const RegionFindings& regionFindings = regionIdAndFindings.second; + const string& locusId = locusIdAndFindings.first; + const LocusSpecification& locusSpec = locusCatalog.at(locusId); + const LocusFindings& locusFindings = locusIdAndFindings.second; - for (const auto& variantIdAndFindings : regionFindings) + for (const auto& variantIdAndFindings : locusFindings.findingsForEachVariant) { const string& variantId = variantIdAndFindings.first; - const VariantSpecification& variantSpec = regionSpec.getVariantSpecById(variantId); + const VariantSpecification& variantSpec = locusSpec.getVariantSpecById(variantId); - FieldDescriptionWriter descriptionWriter(regionSpec, variantSpec); + FieldDescriptionWriter descriptionWriter(locusSpec, variantSpec); variantIdAndFindings.second->accept(&descriptionWriter); descriptionWriter.dumpTo(fieldDescriptionCatalog); } diff --git a/output/VcfHeader.hh b/output/VcfHeader.hh index ce36582..7ea66af 100644 --- a/output/VcfHeader.hh +++ b/output/VcfHeader.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -24,7 +25,7 @@ #include #include -#include "region_analysis/VariantFindings.hh" +#include "region_analysis/LocusFindings.hh" #include "region_spec/LocusSpecification.hh" namespace ehunter @@ -56,8 +57,8 @@ using FieldDescriptionCatalog = std::map // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "output/VcfWriter.hh" @@ -58,15 +59,15 @@ void writeBodyHeader(const string& sampleName, ostream& out) std::ostream& operator<<(std::ostream& out, VcfWriter& vcfWriter) { outputVcfHeader(vcfWriter.regionCatalog_, vcfWriter.sampleFindings_, out); - writeBodyHeader(vcfWriter.sampleParams_.id(), out); + writeBodyHeader(vcfWriter.sampleId_, out); vcfWriter.writeBody(out); return out; } VcfWriter::VcfWriter( - const SampleParameters& sampleParams, Reference& reference, const RegionCatalog& regionCatalog, + std::string sampleId, Reference& reference, const RegionCatalog& regionCatalog, const SampleFindings& sampleFindings) - : sampleParams_(sampleParams) + : sampleId_(sampleId) , reference_(reference) , regionCatalog_(regionCatalog) , sampleFindings_(sampleFindings) @@ -75,44 +76,46 @@ VcfWriter::VcfWriter( void VcfWriter::writeBody(ostream& out) { - const std::vector& ids = VcfWriter::getSortedIdPairs(); + const std::vector& ids = VcfWriter::getSortedIdPairs(); for (const auto& pair : ids) { - const string& regionId = pair.first; - const LocusSpecification& regionSpec = regionCatalog_.at(regionId); - const RegionFindings& regionFindings = sampleFindings_.at(regionId); - + const string& locusId = pair.first; + const LocusSpecification& locusSpec = regionCatalog_.at(locusId); + const LocusFindings& locusFindings = sampleFindings_.at(locusId); + const string& variantId = pair.second; - const VariantSpecification& variantSpec = regionSpec.getVariantSpecById(variantId); - const auto& variantFindings = regionFindings.at(variantId); + const VariantSpecification& variantSpec = locusSpec.getVariantSpecById(variantId); + const auto& variantFindings = locusFindings.findingsForEachVariant.at(variantId); - VariantVcfWriter variantWriter(sampleParams_, reference_, regionSpec, variantSpec, out); + VariantVcfWriter variantWriter(reference_, locusSpec, variantSpec, out); variantFindings->accept(&variantWriter); } } -const std::vector VcfWriter::getSortedIdPairs() +const std::vector VcfWriter::getSortedIdPairs() { - using VariantTuple = std::tuple; + using VariantTuple = std::tuple; std::vector tuples; - for (const auto& regionIdAndFindings : sampleFindings_) + for (const auto& locusIdAndFindings : sampleFindings_) { - const string& regionId = regionIdAndFindings.first; - const LocusSpecification& regionSpec = regionCatalog_.at(regionId); - const RegionFindings& regionFindings = regionIdAndFindings.second; + const string& locusId = locusIdAndFindings.first; + const LocusSpecification& locusSpec = regionCatalog_.at(locusId); + const LocusFindings& locusFindings = locusIdAndFindings.second; - for (const auto& variantIdAndFindings : regionFindings) + for (const auto& variantIdAndFindings : locusFindings.findingsForEachVariant) { const string& variantId = variantIdAndFindings.first; - const VariantSpecification& variantSpec = regionSpec.getVariantSpecById(variantId); - tuples.emplace_back(variantSpec.referenceLocus().contigIndex(), variantSpec.referenceLocus().start(), variantSpec.referenceLocus().end(), RegionIdAndVariantId(regionId, variantId)); + const VariantSpecification& variantSpec = locusSpec.getVariantSpecById(variantId); + tuples.emplace_back( + variantSpec.referenceLocus().contigIndex(), variantSpec.referenceLocus().start(), + variantSpec.referenceLocus().end(), LocusIdAndVariantId(locusId, variantId)); } } std::sort(tuples.begin(), tuples.end()); - std::vector idPairs; + std::vector idPairs; for (const auto& t : tuples) idPairs.emplace_back(std::get<3>(t)); @@ -155,45 +158,44 @@ static string computeInfoFields(const VariantSpecification& variantSpec, const s fields.push_back("REF=" + std::to_string(referenceSizeInUnits)); fields.push_back("RL=" + std::to_string(referenceSizeInUnits)); fields.push_back("RU=" + repeatUnit); + fields.push_back("VARID=" + variantSpec.id()); fields.push_back("REPID=" + variantSpec.id()); return boost::algorithm::join(fields, ";"); } static ReadType -deterimineSupportType(int maxUnitsInRead, CountTable spanningCounts, CountTable flankingCounts, int repeatSize) +deterimineSupportType(const CountTable& spanningCounts, const CountTable& flankingCounts, int repeatSize) { if (spanningCounts.countOf(repeatSize) != 0) { return ReadType::kSpanning; } - else if (flankingCounts.countOf(maxUnitsInRead) != 0) + else if (flankingCounts.countOf(repeatSize) != 0) { - return ReadType::kRepeat; + return ReadType::kFlanking; } - return ReadType::kFlanking; + return ReadType::kRepeat; } static string computeSampleFields( - int readLength, const VariantSpecification& variantSpec, const string& repeatUnit, - const RepeatFindings& repeatFindings) + const VariantSpecification& variantSpec, const string& repeatUnit, const RepeatFindings& repeatFindings) { const auto referenceLocus = variantSpec.referenceLocus(); const int referenceSizeInBp = referenceLocus.length(); const int referenceSizeInUnits = referenceSizeInBp / repeatUnit.length(); const RepeatGenotype& genotype = *repeatFindings.optionalGenotype(); - const int maxUnitsInRead = std::ceil(readLength / static_cast(repeatUnit.length())); ReadSupportCalculator readSupportCalculator( - maxUnitsInRead, repeatFindings.countsOfSpanningReads(), repeatFindings.countsOfFlankingReads()); + repeatFindings.countsOfSpanningReads(), repeatFindings.countsOfFlankingReads(), + repeatFindings.countsOfInrepeatReads()); VcfSampleFields sampleFields(referenceSizeInUnits); const int shortAlleleSize = genotype.shortAlleleSizeInUnits(); ReadType shortAlleleSupportType = deterimineSupportType( - maxUnitsInRead, repeatFindings.countsOfSpanningReads(), repeatFindings.countsOfFlankingReads(), - shortAlleleSize); + repeatFindings.countsOfSpanningReads(), repeatFindings.countsOfFlankingReads(), shortAlleleSize); sampleFields.addAlleleInfo( shortAlleleSize, shortAlleleSupportType, genotype.shortAlleleSizeInUnitsCi(), @@ -205,8 +207,7 @@ static string computeSampleFields( { const int longAlleleSize = genotype.longAlleleSizeInUnits(); ReadType longAlleleSupportType = deterimineSupportType( - maxUnitsInRead, repeatFindings.countsOfSpanningReads(), repeatFindings.countsOfFlankingReads(), - longAlleleSize); + repeatFindings.countsOfSpanningReads(), repeatFindings.countsOfFlankingReads(), longAlleleSize); sampleFields.addAlleleInfo( genotype.longAlleleSizeInUnits(), longAlleleSupportType, genotype.longAlleleSizeInUnitsCi(), @@ -229,14 +230,13 @@ void VariantVcfWriter::visit(const RepeatFindings* repeatFindingsPtr) const auto& referenceLocus = variantSpec_.referenceLocus(); const auto repeatNodeId = variantSpec_.nodes().front(); - const string& repeatUnit = regionSpec_.regionGraph().nodeSeq(repeatNodeId); + const string& repeatUnit = locusSpec_.regionGraph().nodeSeq(repeatNodeId); const int referenceSizeInUnits = referenceLocus.length() / repeatUnit.length(); const string altSymbol = computeAltSymbol(genotype, referenceSizeInUnits); const string infoFields = computeInfoFields(variantSpec_, repeatUnit); - const string sampleFields - = computeSampleFields(sampleParams_.readLength(), variantSpec_, repeatUnit, *repeatFindingsPtr); + const string sampleFields = computeSampleFields(variantSpec_, repeatUnit, *repeatFindingsPtr); const int posPreceedingRepeat1based = referenceLocus.start(); const auto& contigName = reference_.contigInfo().getContigName(referenceLocus.contigIndex()); @@ -269,8 +269,8 @@ void VariantVcfWriter::visit(const SmallVariantFindings* smallVariantFindingsPtr const auto refNodeId = variantSpec_.nodes()[refNodeIndex]; const auto altNodeId = variantSpec_.nodes()[altNodeIndex]; - refSequence = regionSpec_.regionGraph().nodeSeq(refNodeId); - altSequence = regionSpec_.regionGraph().nodeSeq(altNodeId); + refSequence = locusSpec_.regionGraph().nodeSeq(refNodeId); + altSequence = locusSpec_.regionGraph().nodeSeq(altNodeId); // Conversion from 0-based to 1-based coordinates startPosition = referenceLocus.start() + 1; } @@ -280,7 +280,7 @@ void VariantVcfWriter::visit(const SmallVariantFindings* smallVariantFindingsPtr = reference_.getSequence(contigName, referenceLocus.start() - 1, referenceLocus.start()); const int refNodeId = variantSpec_.nodes().front(); - refSequence = refFlankingBase + regionSpec_.regionGraph().nodeSeq(refNodeId); + refSequence = refFlankingBase + locusSpec_.regionGraph().nodeSeq(refNodeId); altSequence = refFlankingBase; // Conversion from 0-based to 1-based coordinates startPosition = referenceLocus.start(); @@ -292,7 +292,7 @@ void VariantVcfWriter::visit(const SmallVariantFindings* smallVariantFindingsPtr const int altNodeId = variantSpec_.nodes().front(); refSequence = refFlankingBase; - altSequence = refFlankingBase + regionSpec_.regionGraph().nodeSeq(altNodeId); + altSequence = refFlankingBase + locusSpec_.regionGraph().nodeSeq(altNodeId); // Conversion from 0-based to 1-based coordinates startPosition = referenceLocus.start(); } @@ -307,32 +307,35 @@ void VariantVcfWriter::visit(const SmallVariantFindings* smallVariantFindingsPtr std::vector sampleFields; std::vector sampleValues; + + sampleFields.push_back("AD"); + std::ostringstream adEncoding; + adEncoding << smallVariantFindingsPtr->numRefReads() << "," << smallVariantFindingsPtr->numAltReads(); + sampleValues.push_back(adEncoding.str()); + if (variantSpec_.classification().subtype == VariantSubtype::kSMN) { - string genotype; - switch (smallVariantFindingsPtr->refAllelePresenceStatus()) + string dst; + switch (smallVariantFindingsPtr->refAllelePresenceStatus().Status) { - case AllelePresenceStatus::kAbsent: - genotype = "1"; + case AlleleStatus::kAbsent: + dst = "+"; break; - case AllelePresenceStatus::kPresent: - genotype = "0"; + case AlleleStatus::kPresent: + dst = "-"; break; - case AllelePresenceStatus::kUncertain: - genotype = "."; + case AlleleStatus::kUncertain: + dst = "?"; break; } - sampleFields.push_back("GT"); - sampleValues.push_back(genotype); - sampleFields.push_back("SMN"); - sampleValues.push_back(streamToString(smallVariantFindingsPtr->refAllelePresenceStatus())); - } - else - { - auto genotype = smallVariantFindingsPtr->optionalGenotype(); - sampleFields.push_back("GT"); - sampleValues.push_back((genotype != boost::none) ? streamToString(*genotype) : "."); + sampleFields.push_back("DST"); + sampleValues.push_back(dst); + sampleFields.push_back("RPL"); + sampleValues.push_back(streamToString(smallVariantFindingsPtr->refAllelePresenceStatus().LikelihoodRatio)); } + auto genotype = smallVariantFindingsPtr->optionalGenotype(); + sampleFields.push_back("GT"); + sampleValues.push_back(genotype ? streamToString(*genotype) : "."); const string sampleField = boost::algorithm::join(sampleFields, ":"); const string sampleValue = boost::algorithm::join(sampleValues, ":"); diff --git a/output/VcfWriter.hh b/output/VcfWriter.hh index 2441bb4..d7f8d94 100644 --- a/output/VcfWriter.hh +++ b/output/VcfWriter.hh @@ -1,33 +1,35 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once #include #include +#include #include #include #include "common/Parameters.hh" #include "common/Reference.hh" -#include "region_analysis/VariantFindings.hh" +#include "region_analysis/LocusFindings.hh" #include "region_spec/LocusSpecification.hh" namespace ehunter @@ -37,11 +39,10 @@ class VariantVcfWriter : public VariantFindingsVisitor { public: VariantVcfWriter( - const SampleParameters& sampleParams, Reference& reference, const LocusSpecification& regionSpec, - const VariantSpecification& variantSpec, std::ostream& out) - : sampleParams_(sampleParams) - , reference_(reference) - , regionSpec_(regionSpec) + Reference& reference, const LocusSpecification& locusSpec, const VariantSpecification& variantSpec, + std::ostream& out) + : reference_(reference) + , locusSpec_(locusSpec) , variantSpec_(variantSpec) , out_(out) { @@ -52,9 +53,8 @@ public: void visit(const SmallVariantFindings* smallVariantFindingsPtr) override; private: - const SampleParameters& sampleParams_; Reference& reference_; - const LocusSpecification& regionSpec_; + const LocusSpecification& locusSpec_; const VariantSpecification& variantSpec_; std::ostream& out_; }; @@ -64,7 +64,7 @@ class VcfWriter { public: VcfWriter( - const SampleParameters& sampleParams, Reference& reference, const RegionCatalog& regionCatalog, + std::string sampleId, Reference& reference, const RegionCatalog& regionCatalog, const SampleFindings& sampleFindings); friend std::ostream& operator<<(std::ostream& out, VcfWriter& vcfWriter); @@ -72,10 +72,10 @@ public: private: void writeHeader(std::ostream& out); void writeBody(std::ostream& out); - using RegionIdAndVariantId = std::pair; - const std::vector getSortedIdPairs(); + using LocusIdAndVariantId = std::pair; + const std::vector getSortedIdPairs(); - const SampleParameters& sampleParams_; + std::string sampleId_; Reference& reference_; const RegionCatalog& regionCatalog_; const SampleFindings& sampleFindings_; diff --git a/output/VcfWriterHelpers.cpp b/output/VcfWriterHelpers.cpp index edc27e0..7abc995 100644 --- a/output/VcfWriterHelpers.cpp +++ b/output/VcfWriterHelpers.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "output/VcfWriterHelpers.hh" diff --git a/output/VcfWriterHelpers.hh b/output/VcfWriterHelpers.hh index 9ffe241..5b92477 100644 --- a/output/VcfWriterHelpers.hh +++ b/output/VcfWriterHelpers.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/reads/Read.cpp b/reads/Read.cpp index f4709ee..e5e40f9 100644 --- a/reads/Read.cpp +++ b/reads/Read.cpp @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "reads/Read.hh" diff --git a/reads/Read.hh b/reads/Read.hh index 6a020f5..57fcc31 100644 --- a/reads/Read.hh +++ b/reads/Read.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -115,6 +116,7 @@ struct LinearAlignmentStats int32_t mapq = -1; int32_t mateChromId = -1; int32_t matePos = -1; + bool isPaired = false; bool isMapped = false; bool isMateMapped = false; }; diff --git a/reads/ReadPairs.cpp b/reads/ReadPairs.cpp index 1fd103e..f4f9c7a 100644 --- a/reads/ReadPairs.cpp +++ b/reads/ReadPairs.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "reads/ReadPairs.hh" @@ -82,7 +83,7 @@ int32_t ReadPairs::NumCompletePairs() const for (const auto& fragmentIdAndReads : readPairs_) { const ReadPair& reads = fragmentIdAndReads.second; - if (reads.firstMate != boost::none && reads.secondMate != boost::none) + if (reads.firstMate && reads.secondMate) { ++numCompletePairs; } diff --git a/reads/ReadPairs.hh b/reads/ReadPairs.hh index 0ffa211..8f71c66 100644 --- a/reads/ReadPairs.hh +++ b/reads/ReadPairs.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/reads/tests/ReadTest.cpp b/reads/tests/ReadTest.cpp index 30ad7ab..2aab24c 100644 --- a/reads/tests/ReadTest.cpp +++ b/reads/tests/ReadTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "reads/Read.hh" diff --git a/region_analysis/Definitions.hh b/region_analysis/Definitions.hh index d5ad93e..f3131ff 100644 --- a/region_analysis/Definitions.hh +++ b/region_analysis/Definitions.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include diff --git a/region_analysis/LocusAnalyzer.cpp b/region_analysis/LocusAnalyzer.cpp new file mode 100644 index 0000000..b8ae987 --- /dev/null +++ b/region_analysis/LocusAnalyzer.cpp @@ -0,0 +1,255 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "region_analysis/LocusAnalyzer.hh" + +#include +#include + +#include "thirdparty/spdlog/spdlog.h" + +#include "graphalign/GraphAlignmentOperations.hh" +#include "graphutils/SequenceOperations.hh" + +#include "alignment/AlignmentFilters.hh" +#include "alignment/AlignmentTweakers.hh" +#include "alignment/GraphAlignmentOperations.hh" +#include "region_analysis/RepeatAnalyzer.hh" +#include "region_analysis/SmallVariantAnalyzer.hh" + +namespace ehunter +{ + +#include + +using boost::optional; +using graphtools::AlignmentWriter; +using graphtools::Operation; +using graphtools::OperationType; +using graphtools::splitStringByDelimiter; +using std::list; +using std::string; +using std::unique_ptr; +using std::vector; + +/* +static const string encodeReadPair(const Read& read, const Read& mate) +{ + std::stringstream encoding; + encoding << read.readId() << ": " << read.sequence() << "\n" << mate.readId() << ": " << read.sequence(); + return encoding.str(); +} +*/ + +LocusAnalyzer::LocusAnalyzer( + const LocusSpecification& locusSpec, HeuristicParameters heuristicParams, + graphtools::AlignmentWriter& alignmentWriter) + : locusSpec_(locusSpec) + , heuristicParams_(heuristicParams) + , alignmentWriter_(alignmentWriter) + , orientationPredictor_(&locusSpec_.regionGraph()) + , graphAligner_( + &locusSpec_.regionGraph(), heuristicParams.alignerType(), heuristicParams_.kmerLenForAlignment(), + heuristicParams_.paddingLength(), heuristicParams_.seedAffixTrimLength()) + , statsCalculator_(locusSpec_.regionGraph()) + , console_(spdlog::get("console") ? spdlog::get("console") : spdlog::stderr_color_mt("console")) + +{ + for (const auto& variantSpec : locusSpec_.variantSpecs()) + { + if (variantSpec.classification().type == VariantType::kRepeat) + { + const auto& graph = locusSpec_.regionGraph(); + const int repeatNodeId = variantSpec.nodes().front(); + const string& repeatUnit = graph.nodeSeq(repeatNodeId); + + weightedPurityCalculators.emplace(std::make_pair(repeatUnit, WeightedPurityCalculator(repeatUnit))); + + if (variantSpec.classification().subtype == VariantSubtype::kRareRepeat) + { + if (optionalUnitOfRareRepeat_) + { + const string errorMessage + = "Region " + locusSpec_.locusId() + " is not permitted to have more than one rare variant"; + throw std::logic_error(errorMessage); + } + optionalUnitOfRareRepeat_ = repeatUnit; + } + + variantAnalyzerPtrs_.emplace_back(new RepeatAnalyzer( + variantSpec.id(), locusSpec.expectedAlleleCount(), locusSpec.regionGraph(), repeatNodeId)); + } + else if (variantSpec.classification().type == VariantType::kSmallVariant) + { + variantAnalyzerPtrs_.emplace_back(new SmallVariantAnalyzer( + variantSpec.id(), variantSpec.classification().subtype, locusSpec.expectedAlleleCount(), + locusSpec.regionGraph(), variantSpec.nodes(), variantSpec.optionalRefNode())); + } + else + { + std::stringstream encoding; + encoding << variantSpec.classification().type << "/" << variantSpec.classification().subtype; + throw std::logic_error("Missing logic to create an analyzer for " + encoding.str()); + } + } +} + +void LocusAnalyzer::processMates(Read read, optional mate, RegionType regionType) +{ + if (regionType == RegionType::kTarget) + { + processOntargetMates(std::move(read), std::move(mate)); + } + else if (mate) + { + processOfftargetMates(std::move(read), std::move(*mate)); + } +} + +void LocusAnalyzer::processOntargetMates(Read read, optional mate) +{ + optional readAlignment = alignRead(read); + optional mateAlignment = mate ? alignRead(*mate) : boost::none; + + int numMatchingBases = read.sequence().length() / 7.5; + numMatchingBases = std::max(numMatchingBases, 10); + LinearAlignmentParameters parameters; + const int kMinNonRepeatAlignmentScore = numMatchingBases * parameters.matchScore; + + if (!checkIfLocallyPlacedReadPair(readAlignment, mateAlignment, kMinNonRepeatAlignmentScore)) + { + console_->debug("Not locally placed read pair\n" + read.fragmentId()); + return; + } + + if (readAlignment) + { + statsCalculator_.inspect(*readAlignment); + } + if (mateAlignment) + { + statsCalculator_.inspect(*mateAlignment); + } + + if (readAlignment && mateAlignment) + { + alignmentWriter_.write( + locusSpec_.locusId(), read.fragmentId(), read.sequence(), read.isFirstMate(), *readAlignment); + alignmentWriter_.write( + locusSpec_.locusId(), mate->fragmentId(), mate->sequence(), mate->isFirstMate(), *mateAlignment); + + for (auto& variantAnalyzerPtr : variantAnalyzerPtrs_) + { + variantAnalyzerPtr->processMates(read, *readAlignment, *mate, *mateAlignment); + } + } + else + { + const string readStatus = readAlignment ? "Able" : "Unable"; + console_->debug("{} to align {} to {}: {}", readStatus, read.readId(), locusSpec_.locusId(), read.sequence()); + if (mate) + { + const string mateStatus = mateAlignment ? "Able" : "Unable"; + console_->debug( + "{} to align {} to {}: {}", mateStatus, mate->readId(), locusSpec_.locusId(), mate->sequence()); + } + } +} + +void LocusAnalyzer::processOfftargetMates(Read read, Read mate) +{ + if (!optionalUnitOfRareRepeat_) + { + const string errorMessage + = "Cannot process offtarget mates for " + locusSpec_.locusId() + " because repeat unit is not set"; + throw std::logic_error(errorMessage); + } + + const string& repeatUnit = *optionalUnitOfRareRepeat_; + + const auto& weightedPurityCalculator = weightedPurityCalculators.at(repeatUnit); + const bool isFirstReadInrepeat = weightedPurityCalculator.score(read.sequence()) >= 0.90; + const bool isSecondReadInrepeat = weightedPurityCalculator.score(mate.sequence()) >= 0.90; + + if (isFirstReadInrepeat && isSecondReadInrepeat) + { + processOntargetMates(std::move(read), std::move(mate)); + } +} + +boost::optional LocusAnalyzer::alignRead(Read& read) const +{ + OrientationPrediction predictedOrientation = orientationPredictor_.predict(read.sequence()); + + if (predictedOrientation == OrientationPrediction::kAlignsInReverseComplementOrientation) + { + read.setSequence(graphtools::reverseComplement(read.sequence())); + } + else if (predictedOrientation == OrientationPrediction::kDoesNotAlign) + { + return boost::optional(); + } + + const list alignments = graphAligner_.align(read.sequence()); + + if (alignments.empty()) + { + return boost::optional(); + } + + return computeCanonicalAlignment(alignments); +} + +LocusFindings LocusAnalyzer::analyze() +{ + LocusFindings locusFindings; + + locusFindings.optionalStats = statsCalculator_.estimate(); + if (locusFindings.optionalStats) + { + for (auto& variantAnalyzerPtr : variantAnalyzerPtrs_) + { + const LocusStats& locusStats = *locusFindings.optionalStats; + std::unique_ptr variantFindingsPtr = variantAnalyzerPtr->analyze(locusStats); + const string& variantId = variantAnalyzerPtr->variantId(); + locusFindings.findingsForEachVariant.emplace(variantId, std::move(variantFindingsPtr)); + } + } + + return locusFindings; +} + +vector> initializeLocusAnalyzers( + const RegionCatalog& RegionCatalog, const HeuristicParameters& heuristicParams, AlignmentWriter& bamletWriter) +{ + vector> locusAnalyzers; + + for (const auto& locusIdAndRegionSpec : RegionCatalog) + { + const LocusSpecification& locusSpec = locusIdAndRegionSpec.second; + + locusAnalyzers.emplace_back(new LocusAnalyzer(locusSpec, heuristicParams, bamletWriter)); + } + + return locusAnalyzers; +} + +} diff --git a/region_analysis/LocusAnalyzer.hh b/region_analysis/LocusAnalyzer.hh new file mode 100644 index 0000000..9e37158 --- /dev/null +++ b/region_analysis/LocusAnalyzer.hh @@ -0,0 +1,109 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#pragma once + +#include +#include +#include +#include + +#include + +#include "thirdparty/spdlog/fmt/ostr.h" +#include "thirdparty/spdlog/spdlog.h" + +#include "graphalign/GappedAligner.hh" +#include "graphalign/KmerIndex.hh" +#include "graphio/AlignmentWriter.hh" + +#include "alignment/SoftclippingAligner.hh" +#include "common/Parameters.hh" +#include "filtering/OrientationPredictor.hh" +#include "reads/Read.hh" +#include "region_analysis/LocusFindings.hh" +#include "region_analysis/VariantAnalyzer.hh" +#include "region_spec/LocusSpecification.hh" +#include "stats/LocusStats.hh" +#include "stats/WeightedPurityCalculator.hh" + +namespace ehunter +{ + +// Regions of the reference genome that can contain reads that originated in a given locus are partitioned into target +// and offtarget regions. Target regions typically consist of the reference region of the locus and possibly other +// highly-similar regions where reads typically misalign. Offtarget regions are regions where certain kinds of +// relevant reads might occasionally misalign and that require special handling (usually for efficiency reasons). +enum class RegionType +{ + kTarget, + kOfftarget +}; + +class LocusAnalyzer +{ +public: + LocusAnalyzer( + const LocusSpecification& locusSpec, HeuristicParameters heuristicParams, + graphtools::AlignmentWriter& alignmentWriter); + + LocusAnalyzer(const LocusAnalyzer&) = delete; + LocusAnalyzer& operator=(const LocusAnalyzer&) = delete; + LocusAnalyzer(LocusAnalyzer&&) = default; + LocusAnalyzer& operator=(LocusAnalyzer&&) = default; + + const std::string& locusId() const { return locusSpec_.locusId(); } + const LocusSpecification& locusSpec() const { return locusSpec_; } + + void processMates(Read read, boost::optional mate, RegionType regionType); + + bool checkIfPassesSequenceFilters(const std::string& sequence) const; + + LocusFindings analyze(); + + bool operator==(const LocusAnalyzer& other) const; + +private: + void processOntargetMates(Read read, boost::optional mate); + void processOfftargetMates(Read read1, Read read2); + boost::optional alignRead(Read& read) const; + + LocusSpecification locusSpec_; + HeuristicParameters heuristicParams_; + + graphtools::AlignmentWriter& alignmentWriter_; + OrientationPredictor orientationPredictor_; + SoftclippingAligner graphAligner_; + + std::unordered_map weightedPurityCalculators; + LocusStatsCalculator statsCalculator_; + + std::vector> variantAnalyzerPtrs_; + boost::optional optionalUnitOfRareRepeat_; + + std::shared_ptr console_; +}; + +std::vector> initializeLocusAnalyzers( + const RegionCatalog& RegionCatalog, const HeuristicParameters& heuristicParams, + graphtools::AlignmentWriter& alignmentWriter); + +} diff --git a/region_analysis/LocusFindings.cpp b/region_analysis/LocusFindings.cpp new file mode 100644 index 0000000..a130747 --- /dev/null +++ b/region_analysis/LocusFindings.cpp @@ -0,0 +1,22 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "region_analysis/LocusFindings.hh" diff --git a/region_analysis/LocusFindings.hh b/region_analysis/LocusFindings.hh new file mode 100644 index 0000000..8a83624 --- /dev/null +++ b/region_analysis/LocusFindings.hh @@ -0,0 +1,46 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#pragma once + +#include +#include +#include + +#include + +#include "region_analysis/VariantFindings.hh" +#include "stats/LocusStats.hh" + +namespace ehunter +{ + +// Container with per-locus analysis results +struct LocusFindings +{ + boost::optional optionalStats; + // VariantFindings is an abstract class from which findings for all variant types are derived + std::unordered_map> findingsForEachVariant; +}; + +using SampleFindings = std::unordered_map; + +} diff --git a/region_analysis/RegionAnalyzer.cpp b/region_analysis/RegionAnalyzer.cpp deleted file mode 100644 index 1ce55f0..0000000 --- a/region_analysis/RegionAnalyzer.cpp +++ /dev/null @@ -1,216 +0,0 @@ -// -// Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. -// -// Author: Egor Dolzhenko -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#include "region_analysis/RegionAnalyzer.hh" - -#include -#include - -#include "thirdparty/spdlog/spdlog.h" - -#include "graphalign/GraphAlignmentOperations.hh" -#include "graphutils/SequenceOperations.hh" - -#include "alignment/AlignmentFilters.hh" -#include "alignment/AlignmentTweakers.hh" -#include "alignment/GraphAlignmentOperations.hh" -#include "region_analysis/RepeatAnalyzer.hh" -#include "region_analysis/SmallVariantAnalyzer.hh" - -namespace ehunter -{ - -#include - -using boost::optional; -using graphtools::AlignmentWriter; -using graphtools::Operation; -using graphtools::OperationType; -using graphtools::splitStringByDelimiter; -using std::list; -using std::string; -using std::vector; - -static const string encodeReadPair(const Read& read, const Read& mate) -{ - std::stringstream encoding; - encoding << read.readId() << ": " << read.sequence() << "\n" << mate.readId() << ": " << read.sequence(); - return encoding.str(); -} - -RegionAnalyzer::RegionAnalyzer( - const LocusSpecification& regionSpec, HeuristicParameters heuristicParams, - graphtools::AlignmentWriter& alignmentWriter) - : regionSpec_(regionSpec) - , heuristicParams_(heuristicParams) - , alignmentWriter_(alignmentWriter) - , orientationPredictor_(®ionSpec_.regionGraph()) - , graphAligner_( - ®ionSpec_.regionGraph(), heuristicParams.alignerType(), heuristicParams_.kmerLenForAlignment(), - heuristicParams_.paddingLength(), heuristicParams_.seedAffixTrimLength()) - , console_(spdlog::get("console") ? spdlog::get("console") : spdlog::stderr_color_mt("console")) - -{ - for (const auto& variantSpec : regionSpec_.variantSpecs()) - { - if (variantSpec.classification().type == VariantType::kRepeat) - { - const auto& graph = regionSpec_.regionGraph(); - const int repeatNodeId = variantSpec.nodes().front(); - const string& repeatUnit = graph.nodeSeq(repeatNodeId); - - weightedPurityCalculators.emplace(std::make_pair(repeatUnit, WeightedPurityCalculator(repeatUnit))); - - if (variantSpec.classification().subtype == VariantSubtype::kRareRepeat) - { - if (optionalUnitOfRareRepeat_) - { - const string errorMessage - = "Region " + regionSpec_.regionId() + " is not permitted to have more than one rare variant"; - throw std::logic_error(errorMessage); - } - optionalUnitOfRareRepeat_ = repeatUnit; - } - - variantAnalyzerPtrs_.emplace_back(new RepeatAnalyzer( - variantSpec.id(), regionSpec.expectedAlleleCount(), regionSpec.regionGraph(), repeatNodeId)); - } - else if (variantSpec.classification().type == VariantType::kSmallVariant) - { - variantAnalyzerPtrs_.emplace_back(new SmallVariantAnalyzer( - variantSpec.id(), variantSpec.classification().subtype, regionSpec.expectedAlleleCount(), - regionSpec.regionGraph(), variantSpec.nodes(), variantSpec.optionalRefNode())); - } - else - { - std::stringstream encoding; - encoding << variantSpec.classification().type << "/" << variantSpec.classification().subtype; - throw std::logic_error("Missing logic to create an analyzer for " + encoding.str()); - } - } -} - -void RegionAnalyzer::processMates(Read read, Read mate) -{ - optional readAlignment = alignRead(read); - optional mateAlignment = alignRead(mate); - - int kMinNonRepeatAlignmentScore = read.sequence().length() / 7.5; - kMinNonRepeatAlignmentScore = std::max(kMinNonRepeatAlignmentScore, 10); - if (!checkIfLocallyPlacedReadPair(readAlignment, mateAlignment, kMinNonRepeatAlignmentScore)) - { - console_->debug("Not locally placed read pair\n" + encodeReadPair(read, mate)); - return; - } - - if (readAlignment && mateAlignment) - { - alignmentWriter_.write( - regionSpec_.regionId(), read.fragmentId(), read.sequence(), read.isFirstMate(), *readAlignment); - alignmentWriter_.write( - regionSpec_.regionId(), mate.fragmentId(), mate.sequence(), mate.isFirstMate(), *mateAlignment); - - for (auto& variantAnalyzerPtr : variantAnalyzerPtrs_) - { - variantAnalyzerPtr->processMates(read, *readAlignment, mate, *mateAlignment); - } - } - else - { - const string readStatus = readAlignment ? "Able" : "Unable"; - const string mateStatus = mateAlignment ? "Able" : "Unable"; - console_->debug("{} to align {}: {}", readStatus, read.readId(), read.sequence()); - console_->debug("{} to align {}: {}", mateStatus, mate.readId(), mate.sequence()); - } -} - -void RegionAnalyzer::processOfftargetMates(Read read1, Read read2) -{ - if (!optionalUnitOfRareRepeat_) - { - const string errorMessage - = "Cannot process offtarget mates for " + regionSpec_.regionId() + " because repeat unit is not set"; - throw std::logic_error(errorMessage); - } - - const string& repeatUnit = *optionalUnitOfRareRepeat_; - - const auto& weightedPurityCalculator = weightedPurityCalculators.at(repeatUnit); - const bool isFirstReadInrepeat = weightedPurityCalculator.score(read1.sequence()) >= 0.90; - const bool isSecondReadInrepeat = weightedPurityCalculator.score(read2.sequence()) >= 0.90; - - if (isFirstReadInrepeat && isSecondReadInrepeat) - { - processMates(std::move(read1), std::move(read2)); - } -} - -boost::optional RegionAnalyzer::alignRead(Read& read) const -{ - OrientationPrediction predictedOrientation = orientationPredictor_.predict(read.sequence()); - - if (predictedOrientation == OrientationPrediction::kAlignsInReverseComplementOrientation) - { - read.setSequence(graphtools::reverseComplement(read.sequence())); - } - else if (predictedOrientation == OrientationPrediction::kDoesNotAlign) - { - return boost::optional(); - } - - const list alignments = graphAligner_.align(read.sequence()); - - if (alignments.empty()) - { - return boost::optional(); - } - - return computeCanonicalAlignment(alignments); -} - -RegionFindings RegionAnalyzer::analyze(const SampleParameters& params) -{ - RegionFindings regionResults; - - for (auto& variantAnalyzerPtr : variantAnalyzerPtrs_) - { - std::unique_ptr variantFindingsPtr = variantAnalyzerPtr->analyze(params); - regionResults.emplace(std::make_pair(variantAnalyzerPtr->variantId(), std::move(variantFindingsPtr))); - } - - return regionResults; -} - -vector> initializeRegionAnalyzers( - const RegionCatalog& RegionCatalog, const HeuristicParameters& heuristicParams, AlignmentWriter& bamletWriter) -{ - vector> regionAnalyzers; - - for (const auto& regionIdAndRegionSpec : RegionCatalog) - { - const LocusSpecification& regionSpec = regionIdAndRegionSpec.second; - - regionAnalyzers.emplace_back(new RegionAnalyzer(regionSpec, heuristicParams, bamletWriter)); - } - - return regionAnalyzers; -} - -} diff --git a/region_analysis/RegionAnalyzer.hh b/region_analysis/RegionAnalyzer.hh deleted file mode 100644 index 225bd71..0000000 --- a/region_analysis/RegionAnalyzer.hh +++ /dev/null @@ -1,94 +0,0 @@ -// -// Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. -// -// Author: Egor Dolzhenko -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#pragma once - -#include -#include -#include -#include - -#include - -#include "thirdparty/spdlog/fmt/ostr.h" -#include "thirdparty/spdlog/spdlog.h" - -#include "graphalign/GappedAligner.hh" -#include "graphalign/KmerIndex.hh" -#include "graphio/AlignmentWriter.hh" - -#include "alignment/SoftclippingAligner.hh" -#include "common/Parameters.hh" -#include "filtering/OrientationPredictor.hh" -#include "reads/Read.hh" -#include "region_analysis/VariantAnalyzer.hh" -#include "region_analysis/VariantFindings.hh" -#include "region_spec/LocusSpecification.hh" -#include "stats/WeightedPurityCalculator.hh" - -namespace ehunter -{ - -class RegionAnalyzer -{ -public: - RegionAnalyzer( - const LocusSpecification& regionSpec, HeuristicParameters heuristicParams, - graphtools::AlignmentWriter& alignmentWriter); - - RegionAnalyzer(const RegionAnalyzer&) = delete; - RegionAnalyzer& operator=(const RegionAnalyzer&) = delete; - RegionAnalyzer(RegionAnalyzer&&) = default; - RegionAnalyzer& operator=(RegionAnalyzer&&) = default; - - const std::string& regionId() const { return regionSpec_.regionId(); } - const LocusSpecification& regionSpec() const { return regionSpec_; } - - void processMates(Read read, Read mate); - void processOfftargetMates(Read read1, Read read2); - bool checkIfPassesSequenceFilters(const std::string& sequence) const; - - RegionFindings analyze(const SampleParameters& params); - - bool operator==(const RegionAnalyzer& other) const; - -private: - boost::optional alignRead(Read& read) const; - - LocusSpecification regionSpec_; - HeuristicParameters heuristicParams_; - - graphtools::AlignmentWriter& alignmentWriter_; - OrientationPredictor orientationPredictor_; - SoftclippingAligner graphAligner_; - - std::unordered_map weightedPurityCalculators; - - std::vector> variantAnalyzerPtrs_; - boost::optional optionalUnitOfRareRepeat_; - - std::shared_ptr console_; -}; - -std::vector> initializeRegionAnalyzers( - const RegionCatalog& RegionCatalog, const HeuristicParameters& heuristicParams, - graphtools::AlignmentWriter& alignmentWriter); - -} diff --git a/region_analysis/RepeatAnalyzer.cpp b/region_analysis/RepeatAnalyzer.cpp index eb94de5..0ed363d 100644 --- a/region_analysis/RepeatAnalyzer.cpp +++ b/region_analysis/RepeatAnalyzer.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "region_analysis/RepeatAnalyzer.hh" @@ -62,7 +63,7 @@ static bool checkIfAlignmentIsConfident( if (alignmentStats.canonicalAlignmentType() == AlignmentType::kSpansRepeat) { - if (!doesReadAlignWellOverRightFlank || !doesReadAlignWellOverRightFlank) + if (!doesReadAlignWellOverLeftFlank || !doesReadAlignWellOverRightFlank) { return false; } @@ -84,31 +85,27 @@ void RepeatAnalyzer::processMates( if (isReadAlignmentConfident) { - // std::cerr << read.readId() << " is " << readAlignmentStats.canonicalAlignmentType() << " for variant " - // << variantId_ << std::endl; + console_->trace( + "{} is {} for variant {}", read.readId(), readAlignmentStats.canonicalAlignmentType(), variantId_); summarizeAlignmentsToReadCounts(readAlignmentStats); } else { - // std::cerr << read.readId() << " could not be confidently aligned " << std::endl; - // std::cerr << prettyPrint(readAlignment, read.sequence()) << std::endl; console_->debug( - "Not a confident alignment for repeat node {}\n{}", repeatNodeId(), + "Could not confidently aligned {} to repeat node {} of {}\n{}", read.readId(), repeatNodeId(), variantId_, prettyPrint(readAlignment, read.sequence())); } if (isMateAlignmentConfident) { - // std::cerr << mate.readId() << " is " << mateAlignmentStats.canonicalAlignmentType() << " for variant " - // << std::endl; + console_->trace( + "{} is {} for variant {}", mate.readId(), mateAlignmentStats.canonicalAlignmentType(), variantId_); summarizeAlignmentsToReadCounts(mateAlignmentStats); } else { - // std::cerr << mate.readId() << " could not be confidently aligned " << std::endl; - // std::cerr << prettyPrint(mateAlignment, mate.sequence()) << std::endl; console_->debug( - "Not a confident alignment for repeat node {}\n{}", repeatNodeId(), + "Could not confidently align {} to repeat node {} of {}\n{}", mate.readId(), repeatNodeId(), variantId_, prettyPrint(mateAlignment, mate.sequence())); } } @@ -139,7 +136,7 @@ void RepeatAnalyzer::summarizeAlignmentsToReadCounts(const RepeatAlignmentStats& } } -std::unique_ptr RepeatAnalyzer::analyze(const SampleParameters& params) const +std::unique_ptr RepeatAnalyzer::analyze(const LocusStats& stats) const { // numRepeatUnitsOverlapped = std::min(numRepeatUnitsOverlapped, maxNumUnitsInRead_); @@ -147,10 +144,12 @@ std::unique_ptr RepeatAnalyzer::analyze(const SampleParameters& const int32_t repeatUnitLength = repeatUnit_.length(); const double propCorrectMolecules = 0.97; - const int maxNumUnitsInRead = std::ceil(params.readLength() / static_cast(repeatUnitLength)); + const int maxNumUnitsInRead = std::ceil(stats.medianReadLength() / static_cast(repeatUnitLength)); + + const double haplotypeDepth = expectedAlleleCount_ == AlleleCount::kTwo ? stats.depth() / 2 : stats.depth(); RepeatGenotyper repeatGenotyper( - params.haplotypeDepth(), expectedAlleleCount_, repeatUnitLength, maxNumUnitsInRead, propCorrectMolecules, + haplotypeDepth, expectedAlleleCount_, repeatUnitLength, maxNumUnitsInRead, propCorrectMolecules, countsOfSpanningReads_, countsOfFlankingReads_, countsOfInrepeatReads_); optional repeatGenotype = repeatGenotyper.genotypeRepeat(candidateAlleleSizes); diff --git a/region_analysis/RepeatAnalyzer.hh b/region_analysis/RepeatAnalyzer.hh index 6301ff0..67c12b1 100644 --- a/region_analysis/RepeatAnalyzer.hh +++ b/region_analysis/RepeatAnalyzer.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -59,7 +60,7 @@ public: const Read& read, const graphtools::GraphAlignment& readAlignment, const Read& mate, const graphtools::GraphAlignment& mateAlignment) override; - std::unique_ptr analyze(const SampleParameters& params) const override; + std::unique_ptr analyze(const LocusStats& stats) const override; private: graphtools::NodeId repeatNodeId() const { return nodeIds_.front(); } diff --git a/region_analysis/SmallVariantAnalyzer.cpp b/region_analysis/SmallVariantAnalyzer.cpp index 26e86f8..28aeb39 100644 --- a/region_analysis/SmallVariantAnalyzer.cpp +++ b/region_analysis/SmallVariantAnalyzer.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "region_analysis/SmallVariantAnalyzer.hh" @@ -58,7 +59,7 @@ int SmallVariantAnalyzer::countReadsSupportingNode(graphtools::NodeId nodeId) co return (numReadsSupportingUpstreamFlank + numReadsSupportingDownstreamFlank) / 2; } -std::unique_ptr SmallVariantAnalyzer::analyze(const SampleParameters& params) const +std::unique_ptr SmallVariantAnalyzer::analyze(const LocusStats& stats) const { NodeId refNode = optionalRefNode_ ? *optionalRefNode_ : ClassifierOfAlignmentsToVariant::kInvalidNodeId; NodeId altNode = ClassifierOfAlignmentsToVariant::kInvalidNodeId; @@ -88,13 +89,13 @@ std::unique_ptr SmallVariantAnalyzer::analyze(const SampleParam const int refNodeSupport = countReadsSupportingNode(refNode); const int altNodeSupport = countReadsSupportingNode(altNode); - SmallVariantGenotyper smallVariantGenotyper(params.haplotypeDepth(), expectedAlleleCount_); + const double haplotypeDepth = expectedAlleleCount_ == AlleleCount::kTwo ? stats.depth() / 2 : stats.depth(); + + SmallVariantGenotyper smallVariantGenotyper(haplotypeDepth, expectedAlleleCount_); auto genotype = smallVariantGenotyper.genotype(refNodeSupport, altNodeSupport); - AllelePresenceStatus refAlleleStatus - = allelePresenceChecker_.check(params.haplotypeDepth(), refNodeSupport, altNodeSupport); - AllelePresenceStatus altAlleleStatus - = allelePresenceChecker_.check(params.haplotypeDepth(), altNodeSupport, refNodeSupport); + auto refAlleleStatus = allelePresenceChecker_.check(haplotypeDepth, refNodeSupport, altNodeSupport); + auto altAlleleStatus = allelePresenceChecker_.check(haplotypeDepth, altNodeSupport, refNodeSupport); return std::unique_ptr( new SmallVariantFindings(refNodeSupport, altNodeSupport, refAlleleStatus, altAlleleStatus, genotype)); diff --git a/region_analysis/SmallVariantAnalyzer.hh b/region_analysis/SmallVariantAnalyzer.hh index 1738cd8..3bf1c31 100644 --- a/region_analysis/SmallVariantAnalyzer.hh +++ b/region_analysis/SmallVariantAnalyzer.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -25,7 +26,7 @@ #include "thirdparty/spdlog/spdlog.h" #include "classification/ClassifierOfAlignmentsToVariant.hh" -#include "genotyping/AllelePresenceChecker.hh" +#include "genotyping/AlleleChecker.hh" #include "genotyping/SmallVariantGenotyper.hh" #include "region_analysis/VariantAnalyzer.hh" #include "region_spec/VariantSpecification.hh" @@ -52,7 +53,7 @@ public: ~SmallVariantAnalyzer() = default; - std::unique_ptr analyze(const SampleParameters& params) const override; + std::unique_ptr analyze(const LocusStats& stats) const override; void processMates( const Read& read, const graphtools::GraphAlignment& readAlignment, const Read& mate, @@ -65,7 +66,7 @@ protected: boost::optional optionalRefNode_; ClassifierOfAlignmentsToVariant alignmentClassifier_; - AllelePresenceChecker allelePresenceChecker_; + AlleleChecker allelePresenceChecker_; std::shared_ptr console_; }; diff --git a/region_analysis/VariantAnalyzer.cpp b/region_analysis/VariantAnalyzer.cpp index fed1109..206b0f8 100644 --- a/region_analysis/VariantAnalyzer.cpp +++ b/region_analysis/VariantAnalyzer.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "region_analysis/VariantAnalyzer.hh" diff --git a/region_analysis/VariantAnalyzer.hh b/region_analysis/VariantAnalyzer.hh index 03ea4cb..faa1c31 100644 --- a/region_analysis/VariantAnalyzer.hh +++ b/region_analysis/VariantAnalyzer.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -31,6 +32,7 @@ #include "common/Parameters.hh" #include "reads/Read.hh" #include "region_analysis/VariantFindings.hh" +#include "stats/LocusStats.hh" namespace ehunter { @@ -54,7 +56,7 @@ public: const graphtools::GraphAlignment& mateAlignment) = 0; - virtual std::unique_ptr analyze(const SampleParameters& params) const = 0; + virtual std::unique_ptr analyze(const LocusStats& stats) const = 0; const std::string& variantId() const { return variantId_; } AlleleCount expectedAlleleCount() const { return expectedAlleleCount_; } diff --git a/region_analysis/VariantFindings.cpp b/region_analysis/VariantFindings.cpp index e497a21..c232ae7 100644 --- a/region_analysis/VariantFindings.cpp +++ b/region_analysis/VariantFindings.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "region_analysis/VariantFindings.hh" diff --git a/region_analysis/VariantFindings.hh b/region_analysis/VariantFindings.hh index 1a94a7e..d66264e 100644 --- a/region_analysis/VariantFindings.hh +++ b/region_analysis/VariantFindings.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -26,7 +27,7 @@ #include #include "common/CountTable.hh" -#include "genotyping/AllelePresenceChecker.hh" +#include "genotyping/AlleleChecker.hh" #include "genotyping/RepeatGenotype.hh" #include "genotyping/SmallVariantGenotype.hh" @@ -50,9 +51,6 @@ public: virtual void accept(VariantFindingsVisitor* visitorPtr) = 0; }; -using RegionFindings = std::unordered_map>; -using SampleFindings = std::unordered_map; - class RepeatFindings : public VariantFindings { public: @@ -93,7 +91,7 @@ class SmallVariantFindings : public VariantFindings public: SmallVariantFindings( int numRefReads, int numAltReads, - AllelePresenceStatus refAlleleStatus, AllelePresenceStatus altAlleleStatus, + AlleleCheckSummary refAlleleStatus, AlleleCheckSummary altAlleleStatus, boost::optional optionalGenotype) : numRefReads_(numRefReads) , numAltReads_(numAltReads) @@ -110,14 +108,14 @@ public: int numAltReads() const { return numAltReads_; } const boost::optional& optionalGenotype() const { return optionalGenotype_; } - AllelePresenceStatus refAllelePresenceStatus() const { return refAlleleStatus_; } - AllelePresenceStatus altAllelePresenceStatus() const { return altAlleleStatus_; } + AlleleCheckSummary refAllelePresenceStatus() const { return refAlleleStatus_; } + AlleleCheckSummary altAllelePresenceStatus() const { return altAlleleStatus_; } private: int numRefReads_; int numAltReads_; - AllelePresenceStatus refAlleleStatus_; - AllelePresenceStatus altAlleleStatus_; + AlleleCheckSummary refAlleleStatus_; + AlleleCheckSummary altAlleleStatus_; boost::optional optionalGenotype_; }; diff --git a/region_analysis/tests/CMakeLists.txt b/region_analysis/tests/CMakeLists.txt index 8335add..7ce6aa7 100644 --- a/region_analysis/tests/CMakeLists.txt +++ b/region_analysis/tests/CMakeLists.txt @@ -2,6 +2,6 @@ add_executable(RepeatAnalyzerTest RepeatAnalyzerTest.cpp) target_link_libraries(RepeatAnalyzerTest region_analysis gtest gmock_main) add_test(NAME RepeatAnalyzerTest COMMAND RepeatAnalyzerTest) -add_executable(RegionAnalyzerTest RegionAnalyzerTest.cpp) -target_link_libraries(RegionAnalyzerTest region_analysis gtest gmock_main) -add_test(NAME RegionAnalyzerTest COMMAND RegionAnalyzerTest) +add_executable(LocusAnalyzerTest LocusAnalyzerTest.cpp) +target_link_libraries(LocusAnalyzerTest region_analysis gtest gmock_main) +add_test(NAME LocusAnalyzerTest COMMAND LocusAnalyzerTest) diff --git a/region_analysis/tests/RegionAnalyzerTest.cpp b/region_analysis/tests/LocusAnalyzerTest.cpp similarity index 55% rename from region_analysis/tests/RegionAnalyzerTest.cpp rename to region_analysis/tests/LocusAnalyzerTest.cpp index 9569f2d..b11b071 100644 --- a/region_analysis/tests/RegionAnalyzerTest.cpp +++ b/region_analysis/tests/LocusAnalyzerTest.cpp @@ -1,24 +1,25 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // -#include "region_analysis/RegionAnalyzer.hh" +#include "region_analysis/LocusAnalyzer.hh" #include "gtest/gtest.h" @@ -43,32 +44,31 @@ TEST_P(AlignerTests, RegionAnalysis_ShortSingleUnitRepeat_Genotyped) vector referenceRegions = { GenomicRegion(1, 1, 2) }; NodeToRegionAssociation dummyAssociation; - LocusSpecification regionSpec("region", referenceRegions, AlleleCount::kTwo, graph, dummyAssociation); + LocusSpecification locusSpec("region", referenceRegions, AlleleCount::kTwo, graph, dummyAssociation); VariantClassification classification(VariantType::kRepeat, VariantSubtype::kCommonRepeat); - regionSpec.addVariantSpecification("repeat", classification, GenomicRegion(1, 1, 2), { 1 }, 1); + locusSpec.addVariantSpecification("repeat", classification, GenomicRegion(1, 1, 2), { 1 }, 1); - SampleParameters sampleParams("dummy_sample", Sex::kFemale, 10, 5.0); HeuristicParameters heuristicParams(1000, 20, true, GetParam(), 4, 1, 5); graphtools::BlankAlignmentWriter blankAlignmentWriter; - RegionAnalyzer regionAnalyzer(regionSpec, heuristicParams, blankAlignmentWriter); + LocusAnalyzer locusAnalyzer(locusSpec, heuristicParams, blankAlignmentWriter); - regionAnalyzer.processMates( + locusAnalyzer.processMates( Read(ReadId("read1", MateNumber::kFirstMate), "CGACCCATGT"), - Read(ReadId("read1", MateNumber::kSecondMate), "GACCCATGTC")); + Read(ReadId("read1", MateNumber::kSecondMate), "GACCCATGTC"), RegionType::kTarget); - regionAnalyzer.processMates( + locusAnalyzer.processMates( Read(ReadId("read2", MateNumber::kFirstMate), "CGACATGT"), - Read(ReadId("read2", MateNumber::kSecondMate), "GACATGTC")); + Read(ReadId("read2", MateNumber::kSecondMate), "GACATGTC"), RegionType::kTarget); - RegionFindings regionFindings = regionAnalyzer.analyze(sampleParams); + LocusFindings locusFindings = locusAnalyzer.analyze(); std::unique_ptr repeatFindingsPtr(new RepeatFindings( CountTable({ { 1, 2 }, { 3, 2 } }), CountTable(), CountTable(), RepeatGenotype(1, { 1, 3 }))); - RegionFindings expectedFindings; - expectedFindings.emplace(std::make_pair("repeat", std::move(repeatFindingsPtr))); + LocusFindings expectedFindings; + expectedFindings.findingsForEachVariant.emplace("repeat", std::move(repeatFindingsPtr)); - ASSERT_EQ(expectedFindings, regionFindings); + ASSERT_EQ(expectedFindings.findingsForEachVariant, locusFindings.findingsForEachVariant); } TEST_P(AlignerTests, RegionAnalysis_ShortMultiUnitRepeat_Genotyped) diff --git a/region_analysis/tests/RepeatAnalyzerTest.cpp b/region_analysis/tests/RepeatAnalyzerTest.cpp index 4ca07e2..ef98501 100644 --- a/region_analysis/tests/RepeatAnalyzerTest.cpp +++ b/region_analysis/tests/RepeatAnalyzerTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "region_analysis/RepeatAnalyzer.hh" diff --git a/region_spec/LocusSpecification.cpp b/region_spec/LocusSpecification.cpp index 9469d9c..0f59a90 100644 --- a/region_spec/LocusSpecification.cpp +++ b/region_spec/LocusSpecification.cpp @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "region_spec/LocusSpecification.hh" @@ -52,9 +53,9 @@ namespace spd = spdlog; namespace ehunter { LocusSpecification::LocusSpecification( - RegionId regionId, std::vector targetReadExtractionRegions, AlleleCount expectedAlleleCount, + RegionId locusId, std::vector targetReadExtractionRegions, AlleleCount expectedAlleleCount, graphtools::Graph regionGraph, NodeToRegionAssociation referenceRegions) - : regionId_(std::move(regionId)) + : locusId_(std::move(locusId)) , targetReadExtractionRegions_(std::move(targetReadExtractionRegions)) , expectedAlleleCount_(expectedAlleleCount) , regionGraph_(std::move(regionGraph)) @@ -79,7 +80,7 @@ const VariantSpecification& LocusSpecification::getVariantSpecById(const std::st } } - throw std::logic_error("There is no variant " + variantSpecId + " in locus " + regionId_); + throw std::logic_error("There is no variant " + variantSpecId + " in locus " + locusId_); } } diff --git a/region_spec/LocusSpecification.hh b/region_spec/LocusSpecification.hh index 190bbe9..e6c901e 100644 --- a/region_spec/LocusSpecification.hh +++ b/region_spec/LocusSpecification.hh @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -48,10 +49,10 @@ class LocusSpecification { public: LocusSpecification( - RegionId regionId, std::vector targetReadExtractionRegions, AlleleCount expectedAlleleCount, + RegionId locusId, std::vector targetReadExtractionRegions, AlleleCount expectedAlleleCount, graphtools::Graph regionGraph, NodeToRegionAssociation referenceRegions); - const RegionId& regionId() const { return regionId_; } + const RegionId& locusId() const { return locusId_; } /* * List of all regions in the reference this graph describes * i.e. where we expect relevant reads to align @@ -79,7 +80,7 @@ public: const NodeToRegionAssociation& referenceProjectionOfNodes() const { return referenceRegions_; } private: - std::string regionId_; + std::string locusId_; std::vector targetReadExtractionRegions_; std::vector offtargetReadExtractionRegions_; AlleleCount expectedAlleleCount_; diff --git a/region_spec/VariantSpecification.cpp b/region_spec/VariantSpecification.cpp index 388b566..163a976 100644 --- a/region_spec/VariantSpecification.cpp +++ b/region_spec/VariantSpecification.cpp @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "region_spec/VariantSpecification.hh" @@ -35,7 +36,7 @@ void VariantSpecification::assertConsistency() const const bool variantIsRepeat = classification_.type == VariantType::kRepeat; const bool variantIsDeletionOrSwap = classification_.type == VariantType::kSmallVariant && (classification_.subtype == VariantSubtype::kDeletion || classification_.subtype == VariantSubtype::kSwap - || classification_.subtype == VariantSubtype::kSMN); + || classification_.subtype == VariantSubtype::kSMN); const bool variantIsInsertion = classification_.type == VariantType::kSmallVariant && classification_.subtype == VariantSubtype::kInsertion; @@ -96,10 +97,9 @@ std::ostream& operator<<(std::ostream& out, VariantSubtype subtype) case VariantSubtype::kSwap: out << "Swap"; break; - case VariantSubtype::kSMN: - out << "SMN"; - break; - + case VariantSubtype::kSMN: + out << "SMN"; + break; } return out; diff --git a/region_spec/VariantSpecification.hh b/region_spec/VariantSpecification.hh index 15f06a1..37105c3 100644 --- a/region_spec/VariantSpecification.hh +++ b/region_spec/VariantSpecification.hh @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/sample_analysis/AnalyzerFinder.cpp b/sample_analysis/AnalyzerFinder.cpp new file mode 100644 index 0000000..868396b --- /dev/null +++ b/sample_analysis/AnalyzerFinder.cpp @@ -0,0 +1,195 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko , +// Felix Schlesinger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "sample_analysis/AnalyzerFinder.hh" + +using boost::optional; +using std::unique_ptr; +using std::unordered_map; +using std::vector; + +namespace ehunter +{ + +namespace +{ + bool areMatesNearby(int32_t readContigId, int64_t readPosition, int32_t mateContigId, int64_t matePosition) + { + const int kMaxMateDistance = 1000; + return ((readContigId == mateContigId) && (std::abs(readPosition - matePosition) < kMaxMateDistance)); + } + + inline RegionType coalesceRegionTypes(RegionType readRegionType, RegionType mateRegionType) + { + if (readRegionType == RegionType::kTarget || mateRegionType == RegionType::kTarget) + { + return RegionType::kTarget; + } + + return RegionType::kOfftarget; + } + + vector + coalesceCommonBundles(const vector& readBundles, const vector& mateBundles) + { + vector commonBundles; + + for (const auto& readBundle : readBundles) + { + for (const auto& mateBundle : mateBundles) + { + if (readBundle.locusAnalyzerPtr == mateBundle.locusAnalyzerPtr) + { + commonBundles.push_back(readBundle); + commonBundles.back().regionType = coalesceRegionTypes(readBundle.regionType, mateBundle.regionType); + } + } + } + + return commonBundles; + } + + // We ignore nearby pairs where one mate is inside and one mate is outside of the offtarget region + vector + coalesceBundlesForNearbyMates(const vector& readBundles, const vector& mateBundles) + { + vector bundles; + + for (const auto& bundle : readBundles) + { + if (bundle.regionType == RegionType::kTarget) + { + bundles.push_back(bundle); + bundles.back().inputType = AnalyzerInputType::kReadOnly; + } + } + + for (const auto& bundle : mateBundles) + { + if (bundle.regionType == RegionType::kTarget) + { + bundles.push_back(bundle); + bundles.back().inputType = AnalyzerInputType::kMateOnly; + } + } + + return bundles; + } + + vector + coalesceBundlesForFarawayMates(const vector& readBundles, const vector& mateBundles) + { + vector bundles; + + for (const auto& bundle : readBundles) + { + bundles.push_back(bundle); + bundles.back().inputType = AnalyzerInputType::kBothReads; + } + + for (const auto& bundle : mateBundles) + { + bundles.push_back(bundle); + bundles.back().inputType = AnalyzerInputType::kBothReads; + } + + return bundles; + } +} + +AnalyzerFinder::AnalyzerFinder(vector>& locusAnalyzers) +{ + using IntervalWithLocusTypeAndAnalyzer = ehunter::Interval; + + unordered_map> contigToIntervals; + for (auto& locusAnalyzer : locusAnalyzers) + { + const LocusSpecification& locusSpec = locusAnalyzer->locusSpec(); + for (const auto& region : locusSpec.targetReadExtractionRegions()) + { + AnalyzerBundle bundle(RegionType::kTarget, locusAnalyzer.get()); + contigToIntervals[region.contigIndex()].emplace_back(region.start(), region.end(), bundle); + } + + for (const auto& region : locusSpec.offtargetReadExtractionRegions()) + { + AnalyzerBundle bundle(RegionType::kOfftarget, locusAnalyzer.get()); + contigToIntervals[region.contigIndex()].emplace_back(region.start(), region.end(), bundle); + } + } + + for (auto& contigAndIntervals : contigToIntervals) + { + int32_t contigIndex = contigAndIntervals.first; + auto intervals = contigAndIntervals.second; + + intervalTrees_.emplace(std::make_pair(contigIndex, AnalyzerIntervalTree(std::move(intervals)))); + } +} + +vector AnalyzerFinder::query(int32_t contigIndex, int64_t start, int64_t end) const +{ + const auto contigTreeIterator = intervalTrees_.find(contigIndex); + if (contigTreeIterator == intervalTrees_.end()) + { + return vector(); + } + + const auto& intervalsWithBundles = contigTreeIterator->second.findOverlapping(start, end); + + vector analyzerBundles; + for (const auto& intervalWithBundle : intervalsWithBundles) + { + const bool isReadContainedInInterval = static_cast(intervalWithBundle.start) <= start + && end <= static_cast(intervalWithBundle.stop); + if (isReadContainedInInterval) + { + analyzerBundles.push_back(intervalWithBundle.value); + } + } + + return analyzerBundles; +} + +vector AnalyzerFinder::query( + int32_t readContigId, int64_t readStart, int64_t readEnd, int32_t mateContigId, int64_t mateStart, + int64_t mateEnd) const +{ + vector readAnalyzerBundles = query(readContigId, readStart, readEnd); + vector mateAnalyzerBundles = query(mateContigId, mateStart, mateEnd); + vector commonBundles = coalesceCommonBundles(readAnalyzerBundles, mateAnalyzerBundles); + + if (!commonBundles.empty()) + { + return commonBundles; + } + else if (areMatesNearby(readContigId, readStart, mateContigId, mateStart)) + { + return coalesceBundlesForNearbyMates(readAnalyzerBundles, mateAnalyzerBundles); + } + else + { + return coalesceBundlesForFarawayMates(readAnalyzerBundles, mateAnalyzerBundles); + } +} + +} diff --git a/sample_analysis/AnalyzerFinder.hh b/sample_analysis/AnalyzerFinder.hh new file mode 100644 index 0000000..0028578 --- /dev/null +++ b/sample_analysis/AnalyzerFinder.hh @@ -0,0 +1,82 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko , +// Felix Schlesinger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#pragma once + +#include +#include +#include + +#include "thirdparty/intervaltree/IntervalTree.h" + +#include "reads/Read.hh" +#include "region_analysis/LocusAnalyzer.hh" +#include "sample_analysis/GenomeMask.hh" + +namespace ehunter +{ + +// Specifies which mates should be processed with a given locus analyzer +enum class AnalyzerInputType +{ + kReadOnly, + kMateOnly, + kBothReads +}; + +// Stores information needed to properly pass reads to the analyzer +struct AnalyzerBundle +{ + AnalyzerBundle(RegionType regionType, LocusAnalyzer* locusAnalyzerPtr) + : regionType(regionType) + , inputType(AnalyzerInputType::kBothReads) + , locusAnalyzerPtr(locusAnalyzerPtr) + { + } + + RegionType regionType; + AnalyzerInputType inputType; + LocusAnalyzer* locusAnalyzerPtr; +}; + +// Enables retrieval of appropriate locus analyzers by genomic coordinates of read alignments +class AnalyzerFinder +{ +public: + AnalyzerFinder(std::vector>& locusAnalyzers); + + // Retrieves analyzers appropriate for the given read pair + std::vector query( + int32_t readContigId, int64_t readStart, int64_t readEnd, int32_t mateContigId, int64_t mateStart, + int64_t mateEnd) const; + + // Retrieves analyzers appropriate for the given read + std::vector query(int32_t readContigId, int64_t readStart, int64_t readEnd) const; + +private: + using AnalyzerIntervalTree = ehunter::IntervalTree; + using AnalyzerIntervalTrees = std::unordered_map; + + AnalyzerIntervalTrees intervalTrees_; +}; + +} diff --git a/sample_analysis/CMakeLists.txt b/sample_analysis/CMakeLists.txt index 182607d..df3ff3d 100644 --- a/sample_analysis/CMakeLists.txt +++ b/sample_analysis/CMakeLists.txt @@ -1,3 +1,4 @@ file(GLOB SOURCES "*.cpp") add_library(sample_analysis ${SOURCES}) target_link_libraries(sample_analysis region_analysis common) +add_subdirectory(tests) diff --git a/sample_analysis/GenomeMask.cpp b/sample_analysis/GenomeMask.cpp new file mode 100644 index 0000000..1630f62 --- /dev/null +++ b/sample_analysis/GenomeMask.cpp @@ -0,0 +1,70 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Felix Schlesinger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "GenomeMask.hh" + +#include + +namespace ehunter +{ + +namespace +{ + inline size_t binPos(int64_t pos) + { + static const int binSizeLog2 = 16; + return pos >> binSizeLog2; + } +} + +bool GenomeMask::query(int32_t contigId, int64_t pos) const +{ + if (contigId >= static_cast(mask_.size())) + { + return false; + } + const contigMask& cmask = mask_[contigId]; + return ((binPos(pos) < cmask.size()) && cmask[binPos(pos)]); +} + +void GenomeMask::addRegion(int32_t contigId, int64_t start, int64_t stop) +{ + assert(start <= stop); + assert(start >= 0); + assert(contigId >= 0); + + if (contigId >= static_cast(mask_.size())) + { + mask_.resize(contigId + 1); + } + contigMask& cmask = mask_[contigId]; + const auto stopBin = binPos(stop); + if (stopBin >= cmask.size()) + { + cmask.resize(stopBin + 1); + } + for (auto bin = binPos(start); bin <= stopBin; ++bin) + { + cmask[bin] = true; + } +} + +} diff --git a/sample_analysis/GenomeMask.hh b/sample_analysis/GenomeMask.hh new file mode 100644 index 0000000..d03fbe6 --- /dev/null +++ b/sample_analysis/GenomeMask.hh @@ -0,0 +1,43 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Felix Schlesinger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#pragma once + +#include +#include + +namespace ehunter +{ + +/// Binned Bit-mask covering the genome +/// Used to mark target regions for fast read screening +class GenomeMask +{ +public: + void addRegion(int32_t contigId, int64_t start, int64_t stop); + bool query(int32_t contigId, int64_t pos) const; + +private: + using contigMask = std::vector; + std::vector mask_; +}; + +} diff --git a/sample_analysis/GenomeQueryCollection.cpp b/sample_analysis/GenomeQueryCollection.cpp new file mode 100644 index 0000000..c2fd706 --- /dev/null +++ b/sample_analysis/GenomeQueryCollection.cpp @@ -0,0 +1,57 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "sample_analysis/GenomeQueryCollection.hh" + +using std::unique_ptr; +using std::vector; + +namespace ehunter +{ + +namespace +{ + void initializeGenomeMask(GenomeMask& genomeMask, vector>& locusAnalyzers) + { + for (auto& locusAnalyzer : locusAnalyzers) + { + const LocusSpecification& locusSpec = locusAnalyzer->locusSpec(); + + for (const auto& region : locusSpec.targetReadExtractionRegions()) + { + genomeMask.addRegion(region.contigIndex(), region.start(), region.end()); + } + + for (const auto& region : locusSpec.offtargetReadExtractionRegions()) + { + genomeMask.addRegion(region.contigIndex(), region.start(), region.end()); + } + } + } +} + +GenomeQueryCollection::GenomeQueryCollection(vector>& locusAnalyzers) + : analyzerFinder(locusAnalyzers) +{ + initializeGenomeMask(targetRegionMask, locusAnalyzers); +} + +} diff --git a/sample_analysis/GenomeQueryCollection.hh b/sample_analysis/GenomeQueryCollection.hh new file mode 100644 index 0000000..37c5528 --- /dev/null +++ b/sample_analysis/GenomeQueryCollection.hh @@ -0,0 +1,39 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#pragma once + +#include "AnalyzerFinder.hh" +#include "GenomeMask.hh" + +namespace ehunter +{ + +// Aggregates various methods for querying genome +struct GenomeQueryCollection +{ + GenomeQueryCollection(std::vector>& locusAnalyzers); + + AnalyzerFinder analyzerFinder; // Analyzers searchable by targeted region + GenomeMask targetRegionMask; // Marks targeted regions to enable fast read screening +}; + +} diff --git a/sample_analysis/HtsFileSeeker.cpp b/sample_analysis/HtsFileSeeker.cpp index 2ea7fbc..c863a58 100644 --- a/sample_analysis/HtsFileSeeker.cpp +++ b/sample_analysis/HtsFileSeeker.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "sample_analysis/HtsFileSeeker.hh" @@ -130,12 +131,8 @@ namespace htshelpers while ((returnCode = sam_itr_next(htsFilePtr_, htsRegionPtr_, htsAlignmentPtr_)) >= 0) { - const bool isPrimaryAlignment = !(htsAlignmentPtr_->core.flag & htshelpers::kIsNotPrimaryLine); - - if (isPrimaryAlignment) - { + if (isPrimaryAlignment(htsAlignmentPtr_)) return true; - } } status_ = Status::kFinishedStreaming; diff --git a/sample_analysis/HtsFileSeeker.hh b/sample_analysis/HtsFileSeeker.hh index e7b5f27..e5604e1 100644 --- a/sample_analysis/HtsFileSeeker.hh +++ b/sample_analysis/HtsFileSeeker.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -81,4 +82,4 @@ namespace htshelpers } -} \ No newline at end of file +} diff --git a/sample_analysis/HtsFileStreamer.cpp b/sample_analysis/HtsFileStreamer.cpp index 830cdb9..00e1190 100644 --- a/sample_analysis/HtsFileStreamer.cpp +++ b/sample_analysis/HtsFileStreamer.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "sample_analysis/HtsFileStreamer.hh" @@ -65,12 +66,8 @@ namespace htshelpers while ((returnCode = sam_read1(htsFilePtr_, htsHeaderPtr_, htsAlignmentPtr_)) >= 0) { - const bool isPrimaryAlignment = !(htsAlignmentPtr_->core.flag & htshelpers::kIsNotPrimaryLine); - - if (isPrimaryAlignment) - { + if (isPrimaryAlignment(htsAlignmentPtr_)) return true; - } } status_ = Status::kFinishedStreaming; @@ -93,7 +90,11 @@ namespace htshelpers return status_ != Status::kFinishedStreaming && currentReadContigId() != -1; } - Read HtsFileStreamer::decodeRead() const { return htshelpers::decodeRead(htsAlignmentPtr_); } + Read HtsFileStreamer::decodeRead(LinearAlignmentStats& alignmentStats) const + { + alignmentStats = decodeAlignmentStats(htsAlignmentPtr_); + return htshelpers::decodeRead(htsAlignmentPtr_); + } HtsFileStreamer::~HtsFileStreamer() { diff --git a/sample_analysis/HtsFileStreamer.hh b/sample_analysis/HtsFileStreamer.hh index 1e74530..d794af3 100644 --- a/sample_analysis/HtsFileStreamer.hh +++ b/sample_analysis/HtsFileStreamer.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -55,12 +56,13 @@ namespace htshelpers int32_t currentReadContigId() const; int32_t currentReadPosition() const; + int32_t currentReadLength() const; int32_t currentMateContigId() const; int32_t currentMatePosition() const; bool isStreamingAlignedReads() const; - Read decodeRead() const; + Read decodeRead(LinearAlignmentStats& alignmentStats) const; private: enum class Status diff --git a/sample_analysis/HtsSeekingSampleAnalysis.cpp b/sample_analysis/HtsSeekingSampleAnalysis.cpp new file mode 100644 index 0000000..62f8eff --- /dev/null +++ b/sample_analysis/HtsSeekingSampleAnalysis.cpp @@ -0,0 +1,273 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "sample_analysis/HtsSeekingSampleAnalysis.hh" + +#include +#include +#include +#include +#include + +#include +#include + +#include "thirdparty/spdlog/spdlog.h" + +#include "reads/ReadPairs.hh" +#include "region_analysis/LocusAnalyzer.hh" +#include "sample_analysis/AnalyzerFinder.hh" +#include "sample_analysis/HtsFileSeeker.hh" +#include "sample_analysis/IndexBasedDepthEstimate.hh" +#include "sample_analysis/MateExtractor.hh" + +namespace ehunter +{ + +using boost::optional; +using graphtools::AlignmentWriter; +using htshelpers::HtsFileSeeker; +using std::ostream; +using std::string; +using std::unique_ptr; +using std::unordered_map; +using std::vector; + +namespace +{ + using AlignmentStatsCatalog = unordered_map>; + + vector + combineRegions(const vector& targetRegions, const vector offtargetRegions) + { + vector combinedRegions(targetRegions); + combinedRegions.insert(combinedRegions.end(), offtargetRegions.begin(), offtargetRegions.end()); + return combinedRegions; + } + + bool checkIfMatesWereMappedNearby(const LinearAlignmentStats& alignmentStats) + { + const int kMaxMateDistance = 1000; + if ((alignmentStats.chromId == alignmentStats.mateChromId) + && (std::abs(alignmentStats.pos - alignmentStats.matePos) < kMaxMateDistance)) + { + return true; + } + return false; + } + + void recoverMates(const string& htsFilePath, AlignmentStatsCatalog& alignmentStatsCatalog, ReadPairs& readPairs) + { + htshelpers::MateExtractor mateExtractor(htsFilePath); + + for (auto& fragmentIdAndReadPair : readPairs) + { + ReadPair& readPair = fragmentIdAndReadPair.second; + + if (readPair.numMatesSet() == 2) + { + continue; + } + + const Read& read = readPair.firstMate ? *readPair.firstMate : *readPair.secondMate; + + const auto alignmentStatsIterator = alignmentStatsCatalog.find(read.readId()); + if (alignmentStatsIterator == alignmentStatsCatalog.end()) + { + throw std::logic_error("Cannot recover mate of uncatalogued read"); + } + const LinearAlignmentStats& alignmentStats = alignmentStatsIterator->second; + + if (!checkIfMatesWereMappedNearby(alignmentStats)) + { + LinearAlignmentStats mateStats; + optional optionalMate = mateExtractor.extractMate(read, alignmentStats, mateStats); + if (optionalMate) + { + const Read& mate = *optionalMate; + alignmentStatsCatalog.emplace(std::make_pair(mate.readId(), alignmentStats)); + readPairs.AddMateToExistingRead(mate); + } + else + { + auto console = spdlog::get("console") ? spdlog::get("console") : spdlog::stderr_color_mt("console"); + console->warn("Could not recover the mate of {}", read.readId()); + } + } + } + } + + ReadPairs collectCandidateReads( + const vector& targetRegions, const vector& offtargetRegions, + AlignmentStatsCatalog& alignmentStatsCatalog, const string& htsFilePath) + { + auto console = spdlog::get("console") ? spdlog::get("console") : spdlog::stderr_color_mt("console"); + + vector regionsWithReads = combineRegions(targetRegions, offtargetRegions); + HtsFileSeeker htsFileSeeker(htsFilePath); + ReadPairs readPairs; + + for (const auto& regionWithReads : regionsWithReads) + { + const int numReadsBeforeCollection = readPairs.NumReads(); + htsFileSeeker.setRegion(regionWithReads); + while (htsFileSeeker.trySeekingToNextPrimaryAlignment()) + { + LinearAlignmentStats alignmentStats; + Read read = htsFileSeeker.decodeRead(alignmentStats); + if (alignmentStats.isPaired) + { + alignmentStatsCatalog.emplace(std::make_pair(read.readId(), alignmentStats)); + readPairs.Add(std::move(read)); + } + else + { + console->warn("Skipping {} because it is unpaired", read.readId()); + } + } + const int numReadsCollected = readPairs.NumReads() - numReadsBeforeCollection; + console->debug("Collected {} reads from {}", numReadsCollected, regionWithReads); + } + + const int numReadsBeforeRecovery = readPairs.NumReads(); + recoverMates(htsFilePath, alignmentStatsCatalog, readPairs); + const int numReadsAfterRecovery = readPairs.NumReads() - numReadsBeforeRecovery; + console->debug("Recovered {} reads", numReadsAfterRecovery); + + return readPairs; + } + + void analyzeReadPair( + AnalyzerFinder& analyzerFinder, const Read& read, const Read& mate, const AlignmentStatsCatalog& alignmentStats) + { + const auto readStatsIter = alignmentStats.find(read.readId()); + const auto mateStatsIter = alignmentStats.find(mate.readId()); + + if (readStatsIter == alignmentStats.end() || mateStatsIter == alignmentStats.end()) + { + throw std::logic_error("Could not to find alignment stats for " + read.fragmentId()); + } + + const LinearAlignmentStats& readStats = readStatsIter->second; + const LinearAlignmentStats& mateStats = mateStatsIter->second; + + const int64_t readEnd = readStats.pos + read.sequence().length(); + const int64_t mateEnd = mateStats.pos + mate.sequence().length(); + vector analyzers = analyzerFinder.query( + readStats.chromId, readStats.pos, readEnd, mateStats.chromId, mateStats.pos, mateEnd); + + if (analyzers.empty()) + { + return; + } + + assert(analyzers.size() == 1); + const AnalyzerBundle& bundle = analyzers.front(); + + if (bundle.inputType == AnalyzerInputType::kBothReads) + { + bundle.locusAnalyzerPtr->processMates(read, mate, bundle.regionType); + } + else if (bundle.inputType == AnalyzerInputType::kReadOnly) + { + bundle.locusAnalyzerPtr->processMates(read, boost::none, bundle.regionType); + } + else if (bundle.inputType == AnalyzerInputType::kMateOnly) + { + bundle.locusAnalyzerPtr->processMates(mate, boost::none, bundle.regionType); + } + } + + void analyzeRead(AnalyzerFinder& analyzerFinder, const Read& read, const AlignmentStatsCatalog& alignmentStats) + { + const auto readStatsIter = alignmentStats.find(read.readId()); + + if (readStatsIter == alignmentStats.end()) + { + throw std::logic_error("Could not to find alignment stats for " + read.fragmentId()); + } + + const LinearAlignmentStats& readStats = readStatsIter->second; + const int64_t readEnd = readStats.pos + read.sequence().length(); + + vector analyzers = analyzerFinder.query(readStats.chromId, readStats.pos, readEnd); + + if (analyzers.empty()) + { + return; + } + + assert(analyzers.size() == 1); + const AnalyzerBundle& bundle = analyzers.front(); + bundle.locusAnalyzerPtr->processMates(read, boost::none, bundle.regionType); + } + + void processReads( + const ReadPairs& candidateReadPairs, const AlignmentStatsCatalog& alignmentStats, + AnalyzerFinder& analyzerFinder) + { + for (const auto& fragmentIdAndReads : candidateReadPairs) + { + const auto& readPair = fragmentIdAndReads.second; + if (readPair.numMatesSet() == 2) + { + analyzeReadPair(analyzerFinder, *readPair.firstMate, *readPair.secondMate, alignmentStats); + } + else + { + const Read& read = readPair.firstMate ? *readPair.firstMate : *readPair.secondMate; + analyzeRead(analyzerFinder, read, alignmentStats); + } + } + } +} + +SampleFindings htsSeekingSampleAnalysis( + const InputPaths& inputPaths, const HeuristicParameters& heuristicParams, const RegionCatalog& regionCatalog, + AlignmentWriter& alignmentWriter) +{ + auto console = spdlog::get("console") ? spdlog::get("console") : spdlog::stderr_color_mt("console"); + + SampleFindings sampleFindings; + for (const auto& locusIdAndRegionSpec : regionCatalog) + { + const string& locusId = locusIdAndRegionSpec.first; + const LocusSpecification& locusSpec = locusIdAndRegionSpec.second; + + vector> locusAnalyzers; + locusAnalyzers.emplace_back(new LocusAnalyzer(locusSpec, heuristicParams, alignmentWriter)); + AnalyzerFinder analyzerFinder(locusAnalyzers); + + AlignmentStatsCatalog alignmentStats; + ReadPairs readPairs = collectCandidateReads( + locusSpec.targetReadExtractionRegions(), locusSpec.offtargetReadExtractionRegions(), alignmentStats, + inputPaths.htsFile()); + + processReads(readPairs, alignmentStats, analyzerFinder); + + auto variantFindings = locusAnalyzers.front()->analyze(); + sampleFindings.emplace(locusId, std::move(variantFindings)); + } + + return sampleFindings; +} + +} diff --git a/sample_analysis/HtsSeekingSampleAnalysis.hh b/sample_analysis/HtsSeekingSampleAnalysis.hh new file mode 100644 index 0000000..0efa612 --- /dev/null +++ b/sample_analysis/HtsSeekingSampleAnalysis.hh @@ -0,0 +1,40 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#pragma once + +#include +#include + +#include "graphio/AlignmentWriter.hh" + +#include "common/Parameters.hh" +#include "region_analysis/LocusFindings.hh" +#include "region_spec/LocusSpecification.hh" + +namespace ehunter +{ + +SampleFindings htsSeekingSampleAnalysis( + const InputPaths& inputPaths, const HeuristicParameters& heuristicParams, const RegionCatalog& regionCatalog, + graphtools::AlignmentWriter& alignmentWriter); + +} diff --git a/sample_analysis/HtsSeekingSampleAnalyzer.cpp b/sample_analysis/HtsSeekingSampleAnalyzer.cpp deleted file mode 100644 index f9689b7..0000000 --- a/sample_analysis/HtsSeekingSampleAnalyzer.cpp +++ /dev/null @@ -1,198 +0,0 @@ -// -// Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. -// -// Author: Egor Dolzhenko -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#include "sample_analysis/HtsSeekingSampleAnalyzer.hh" - -#include -#include -#include -#include - -#include -#include - -#include "thirdparty/spdlog/spdlog.h" - -#include "reads/ReadPairs.hh" -#include "region_analysis/RegionAnalyzer.hh" -#include "sample_analysis/HtsFileSeeker.hh" -#include "sample_analysis/IndexBasedDepthEstimate.hh" -#include "sample_analysis/MateExtractor.hh" - -namespace ehunter -{ - -using boost::optional; -using graphtools::AlignmentWriter; -using htshelpers::HtsFileSeeker; -using std::ostream; -using std::string; -using std::unordered_map; -using std::vector; - -using AlignmentStatsCatalog = unordered_map>; - -static ReadPairs collectReads( - const vector& regions, AlignmentStatsCatalog& alignmentStatsCatalog, HtsFileSeeker& fileHopper) -{ - ReadPairs readPairs; - auto console = spdlog::get("console") ? spdlog::get("console") : spdlog::stderr_color_mt("console"); - - for (const auto& region : regions) - { - int numReadsBeforeCollection = readPairs.NumReads(); - fileHopper.setRegion(region); - while (fileHopper.trySeekingToNextPrimaryAlignment()) - { - LinearAlignmentStats alignmentStats; - Read read = fileHopper.decodeRead(alignmentStats); - alignmentStatsCatalog.emplace(std::make_pair(read.readId(), alignmentStats)); - readPairs.Add(std::move(read)); - } - console->debug("Collected {} reads from {}", readPairs.NumReads() - numReadsBeforeCollection, region); - } - return readPairs; -} - -bool checkIfMatesWereMappedNearby(const LinearAlignmentStats& alignmentStats) -{ - const int maxMateDistance = 1000; - if ((alignmentStats.chromId == alignmentStats.mateChromId) - && (std::abs(alignmentStats.pos - alignmentStats.matePos) < maxMateDistance)) - { - return true; - } - return false; -} - -void recoverMates(const string& htsFilePath, const AlignmentStatsCatalog& alignmentStatsCatalog, ReadPairs& readPairs) -{ - htshelpers::MateExtractor mateExtractor(htsFilePath); - - for (auto& fragmentIdAndReadPair : readPairs) - { - ReadPair& readPair = fragmentIdAndReadPair.second; - - if (readPair.numMatesSet() == 2) - { - continue; - } - - const Read& read = readPair.firstMate != boost::none ? *readPair.firstMate : *readPair.secondMate; - - const auto alignmentStatsIterator = alignmentStatsCatalog.find(read.readId()); - if (alignmentStatsIterator == alignmentStatsCatalog.end()) - { - throw std::logic_error("Cannot recover mate of uncatalogued read"); - } - const LinearAlignmentStats& alignmentStats = alignmentStatsIterator->second; - - if (!checkIfMatesWereMappedNearby(alignmentStats)) - { - optional optionalMate = mateExtractor.extractMate(read, alignmentStats); - if (optionalMate != boost::none) - { - readPairs.AddMateToExistingRead(*optionalMate); - } - else - { - auto console = spdlog::get("console") ? spdlog::get("console") : spdlog::stderr_color_mt("console"); - console->warn("Could not recover the mate of {}", read.readId()); - } - } - } -} - -static RegionFindings analyzeRegion( - const ReadPairs& readPairs, const ReadPairs& offtargetReadPairs, const LocusSpecification& regionSpec, - const SampleParameters& sampleParams, const HeuristicParameters& heuristicParams, AlignmentWriter& alignmentWriter) -{ - RegionAnalyzer regionAnalyzer(regionSpec, heuristicParams, alignmentWriter); - - for (const auto fragmentIdAndReads : readPairs) - { - const auto& readPair = fragmentIdAndReads.second; - if (readPair.numMatesSet() == 2) - { - regionAnalyzer.processMates(*readPair.firstMate, *readPair.secondMate); - } - } - - for (const auto fragmentIdAndReads : offtargetReadPairs) - { - const auto& readPair = fragmentIdAndReads.second; - if (readPair.numMatesSet() == 2) - { - regionAnalyzer.processOfftargetMates(*readPair.firstMate, *readPair.secondMate); - } - } - - return regionAnalyzer.analyze(sampleParams); -} - -SampleFindings htsSeekingSampleAnalysis( - const InputPaths& inputPaths, SampleParameters& sampleParams, const HeuristicParameters& heuristicParams, - const RegionCatalog& regionCatalog, AlignmentWriter& alignmentWriter) -{ - auto console = spdlog::get("console") ? spdlog::get("console") : spdlog::stderr_color_mt("console"); - - if (!sampleParams.isHaplotypeDepthSet()) - { - const double depth = estimateDepthFromHtsIndex(inputPaths.htsFile(), sampleParams.readLength()); - - const double kMinDepthAllowed = 10.0; - if (depth < kMinDepthAllowed) - { - throw std::invalid_argument("Read depth must be at least " + std::to_string(kMinDepthAllowed)); - } - - sampleParams.setHaplotypeDepth(depth / 2); - console->info("Depth is set to {}", depth); - } - - HtsFileSeeker htsFileSeeker(inputPaths.htsFile()); - - SampleFindings sampleFindings; - for (const auto& regionIdAndRegionSpec : regionCatalog) - { - const string& regionId = regionIdAndRegionSpec.first; - const LocusSpecification& regionSpec = regionIdAndRegionSpec.second; - - AlignmentStatsCatalog readAlignmentStats; - ReadPairs targetReadPairs - = collectReads(regionSpec.targetReadExtractionRegions(), readAlignmentStats, htsFileSeeker); - recoverMates(inputPaths.htsFile(), readAlignmentStats, targetReadPairs); - console->debug("Collected {} read pairs from target regions", targetReadPairs.NumCompletePairs()); - - AlignmentStatsCatalog offtargetReadAlignmentStatsCatalog; - ReadPairs offtargetReadPairs = collectReads( - regionSpec.offtargetReadExtractionRegions(), offtargetReadAlignmentStatsCatalog, htsFileSeeker); - recoverMates(inputPaths.htsFile(), offtargetReadAlignmentStatsCatalog, offtargetReadPairs); - console->debug("Collected {} read pairs from offtarget regions", offtargetReadPairs.NumCompletePairs()); - - auto regionFindings = analyzeRegion( - targetReadPairs, offtargetReadPairs, regionSpec, sampleParams, heuristicParams, alignmentWriter); - sampleFindings.emplace(std::make_pair(regionId, std::move(regionFindings))); - } - - return sampleFindings; -} - -} diff --git a/sample_analysis/HtsSeekingSampleAnalyzer.hh b/sample_analysis/HtsSeekingSampleAnalyzer.hh deleted file mode 100644 index d50e5e6..0000000 --- a/sample_analysis/HtsSeekingSampleAnalyzer.hh +++ /dev/null @@ -1,39 +0,0 @@ -// -// Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. -// -// Author: Egor Dolzhenko -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#pragma once - -#include -#include - -#include "graphio/AlignmentWriter.hh" - -#include "common/Parameters.hh" -#include "region_analysis/VariantFindings.hh" -#include "region_spec/LocusSpecification.hh" - -namespace ehunter -{ - -SampleFindings htsSeekingSampleAnalysis( - const InputPaths& inputPaths, SampleParameters& sampleParams, const HeuristicParameters& heuristicParams, - const RegionCatalog& regionCatalog, graphtools::AlignmentWriter& alignmentWriter); - -} diff --git a/sample_analysis/HtsStreamingSampleAnalysis.cpp b/sample_analysis/HtsStreamingSampleAnalysis.cpp new file mode 100644 index 0000000..fa388da --- /dev/null +++ b/sample_analysis/HtsStreamingSampleAnalysis.cpp @@ -0,0 +1,116 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "sample_analysis/HtsStreamingSampleAnalysis.hh" + +#include +#include + +#include "common/HtsHelpers.hh" +#include "region_analysis/LocusAnalyzer.hh" +#include "sample_analysis/GenomeQueryCollection.hh" +#include "sample_analysis/HtsFileStreamer.hh" + +using graphtools::AlignmentWriter; +using std::map; +using std::string; +using std::unordered_map; +using std::vector; + +namespace ehunter +{ + +SampleFindings htsStreamingSampleAnalysis( + const InputPaths& inputPaths, const HeuristicParameters& heuristicParams, const RegionCatalog& regionCatalog, + AlignmentWriter& bamletWriter) +{ + vector> locusAnalyzers + = initializeLocusAnalyzers(regionCatalog, heuristicParams, bamletWriter); + GenomeQueryCollection genomeQuery(locusAnalyzers); + + using ReadCatalog = std::unordered_map; + ReadCatalog unpairedReads; + + htshelpers::HtsFileStreamer readStreamer(inputPaths.htsFile()); + while (readStreamer.trySeekingToNextPrimaryAlignment() && readStreamer.isStreamingAlignedReads()) + { + const bool isReadNearTargetRegion = genomeQuery.targetRegionMask.query( + readStreamer.currentReadContigId(), readStreamer.currentReadPosition()); + const bool isMateNearTargetRegion = genomeQuery.targetRegionMask.query( + readStreamer.currentMateContigId(), readStreamer.currentMatePosition()); + if (!isReadNearTargetRegion && !isMateNearTargetRegion) + { + continue; + } + + LinearAlignmentStats alignmentStats; + Read read = readStreamer.decodeRead(alignmentStats); + if (!alignmentStats.isPaired) + { + continue; + } + + const auto mateIterator = unpairedReads.find(read.fragmentId()); + if (mateIterator == unpairedReads.end()) + { + unpairedReads.emplace(std::make_pair(read.fragmentId(), std::move(read))); + continue; + } + Read mate = std::move(mateIterator->second); + unpairedReads.erase(mateIterator); + + const int64_t readEnd = readStreamer.currentReadPosition() + read.sequence().length(); + const int64_t mateEnd = readStreamer.currentMatePosition() + mate.sequence().length(); + + vector analyzerBundles = genomeQuery.analyzerFinder.query( + readStreamer.currentReadContigId(), readStreamer.currentReadPosition(), readEnd, + readStreamer.currentMateContigId(), readStreamer.currentMatePosition(), mateEnd); + + for (auto& analyzerBundle : analyzerBundles) + { + const auto analyzerPtr = analyzerBundle.locusAnalyzerPtr; + + switch (analyzerBundle.inputType) + { + case AnalyzerInputType::kBothReads: + analyzerPtr->processMates(std::move(read), std::move(mate), analyzerBundle.regionType); + break; + case AnalyzerInputType::kReadOnly: + analyzerPtr->processMates(std::move(read), boost::none, analyzerBundle.regionType); + break; + case AnalyzerInputType::kMateOnly: + analyzerPtr->processMates(std::move(mate), boost::none, analyzerBundle.regionType); + break; + } + } + } + + SampleFindings sampleFindings; + for (auto& locusAnalyzer : locusAnalyzers) + { + auto locusFindings = locusAnalyzer->analyze(); + sampleFindings.emplace(std::make_pair(locusAnalyzer->locusId(), std::move(locusFindings))); + } + + return sampleFindings; +} + +} diff --git a/sample_analysis/HtsStreamingSampleAnalysis.hh b/sample_analysis/HtsStreamingSampleAnalysis.hh new file mode 100644 index 0000000..15e5a74 --- /dev/null +++ b/sample_analysis/HtsStreamingSampleAnalysis.hh @@ -0,0 +1,41 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#pragma once + +#include +#include +#include + +#include "graphio/AlignmentWriter.hh" + +#include "common/Parameters.hh" +#include "region_analysis/LocusFindings.hh" +#include "region_spec/LocusSpecification.hh" + +namespace ehunter +{ + +SampleFindings htsStreamingSampleAnalysis( + const InputPaths& inputPaths, const HeuristicParameters& heuristicParams, const RegionCatalog& regionCatalog, + graphtools::AlignmentWriter& alignmentWriter); + +} diff --git a/sample_analysis/HtsStreamingSampleAnalyzer.cpp b/sample_analysis/HtsStreamingSampleAnalyzer.cpp deleted file mode 100644 index a8e49b9..0000000 --- a/sample_analysis/HtsStreamingSampleAnalyzer.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// -// Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. -// -// Author: Egor Dolzhenko -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#include "sample_analysis/HtsStreamingSampleAnalyzer.hh" - -#include -#include - -#include "common/HtsHelpers.hh" -#include "region_analysis/RegionAnalyzer.hh" -#include "sample_analysis/HtsFileStreamer.hh" -#include "sample_analysis/LocationBasedDispatcher.hh" - -using graphtools::AlignmentWriter; -using std::map; -using std::string; -using std::unordered_map; -using std::vector; - -namespace ehunter -{ - -SampleFindings htslibStreamingSampleAnalyzer( - const InputPaths& inputPaths, const SampleParameters& sampleParams, const HeuristicParameters& heuristicParams, - const RegionCatalog& regionCatalog, AlignmentWriter& bamletWriter) -{ - vector> locusAnalyzers - = initializeRegionAnalyzers(regionCatalog, heuristicParams, bamletWriter); - LocationBasedDispatcher locationBasedDispatcher(locusAnalyzers); - - htshelpers::HtsFileStreamer readStreamer(inputPaths.htsFile()); - while (readStreamer.trySeekingToNextPrimaryAlignment() && readStreamer.isStreamingAlignedReads()) - { - locationBasedDispatcher.dispatch( - readStreamer.currentReadContigId(), readStreamer.currentReadPosition(), readStreamer.currentMateContigId(), - readStreamer.currentMatePosition(), readStreamer.decodeRead()); - } - - SampleFindings sampleFindings; - for (auto& locusAnalyzer : locusAnalyzers) - { - auto locusFindings = locusAnalyzer->analyze(sampleParams); - sampleFindings.emplace(std::make_pair(locusAnalyzer->regionId(), std::move(locusFindings))); - } - - return sampleFindings; -} - -} diff --git a/sample_analysis/HtsStreamingSampleAnalyzer.hh b/sample_analysis/HtsStreamingSampleAnalyzer.hh deleted file mode 100644 index 3ada359..0000000 --- a/sample_analysis/HtsStreamingSampleAnalyzer.hh +++ /dev/null @@ -1,40 +0,0 @@ -// -// Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. -// -// Author: Egor Dolzhenko -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#pragma once - -#include -#include -#include - -#include "graphio/AlignmentWriter.hh" - -#include "common/Parameters.hh" -#include "region_analysis/VariantFindings.hh" -#include "region_spec/LocusSpecification.hh" - -namespace ehunter -{ - -SampleFindings htslibStreamingSampleAnalyzer( - const InputPaths& inputPaths, const SampleParameters& sampleParams, const HeuristicParameters& heuristicParams, - const RegionCatalog& regionCatalog, graphtools::AlignmentWriter& alignmentWriter); - -} diff --git a/sample_analysis/IndexBasedDepthEstimate.cpp b/sample_analysis/IndexBasedDepthEstimate.cpp index eabe0e7..b0b1943 100644 --- a/sample_analysis/IndexBasedDepthEstimate.cpp +++ b/sample_analysis/IndexBasedDepthEstimate.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "sample_analysis/IndexBasedDepthEstimate.hh" diff --git a/sample_analysis/IndexBasedDepthEstimate.hh b/sample_analysis/IndexBasedDepthEstimate.hh index 54115cf..94b6de1 100644 --- a/sample_analysis/IndexBasedDepthEstimate.hh +++ b/sample_analysis/IndexBasedDepthEstimate.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/sample_analysis/LocationBasedAnalyzerFinder.cpp b/sample_analysis/LocationBasedAnalyzerFinder.cpp deleted file mode 100644 index 921f95d..0000000 --- a/sample_analysis/LocationBasedAnalyzerFinder.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// -// Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. -// -// Author: Egor Dolzhenko -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#include "sample_analysis/LocationBasedAnalyzerFinder.hh" - -#include -#include - -using boost::optional; -using std::map; -using std::string; -using std::unordered_map; -using std::vector; - -namespace ehunter -{ - -LocationBasedAnalyzerFinder::LocationBasedAnalyzerFinder(vector>& locusAnalyzers) -{ - unordered_map> contigToIntervals; - for (auto& locusAnalyzer : locusAnalyzers) - { - const LocusSpecification& locusSpec = locusAnalyzer->regionSpec(); - for (auto& refRegion : locusSpec.targetReadExtractionRegions()) - { - LocusTypeAndAnalyzer payload(LocusType::kTargetLocus, locusAnalyzer.get()); - contigToIntervals[refRegion.contigIndex()].emplace_back(refRegion.start(), refRegion.end(), payload); - } - for (const auto& offtargetLocus : locusSpec.offtargetReadExtractionRegions()) - { - LocusTypeAndAnalyzer payload(LocusType::kOfftargetLocus, locusAnalyzer.get()); - contigToIntervals[offtargetLocus.contigIndex()].emplace_back( - offtargetLocus.start(), offtargetLocus.end(), payload); - } - } - - for (auto& contigAndIntervals : contigToIntervals) - { - int32_t contigIndex = contigAndIntervals.first; - auto intervals = contigAndIntervals.second; - intervalTrees_.emplace(std::make_pair(contigIndex, AnalyzerIntervalTree(std::move(intervals)))); - } -} - -optional LocationBasedAnalyzerFinder::query( - int32_t readContigId, int64_t readPosition, int32_t mateContigId, int64_t matePosition) -{ - auto optionalReadLocusTypeAndAnalyzer = tryGettingLocusAnalyzer(readContigId, readPosition); - auto optionalMateLocusTypeAndAnalyzer = tryGettingLocusAnalyzer(mateContigId, matePosition); - - if (optionalReadLocusTypeAndAnalyzer && optionalReadLocusTypeAndAnalyzer->locusType == LocusType::kTargetLocus) - { - return optionalReadLocusTypeAndAnalyzer; - } - - if (optionalMateLocusTypeAndAnalyzer && optionalMateLocusTypeAndAnalyzer->locusType == LocusType::kTargetLocus) - { - return optionalMateLocusTypeAndAnalyzer; - } - - if (optionalReadLocusTypeAndAnalyzer) - { - return optionalReadLocusTypeAndAnalyzer; - } - - if (optionalMateLocusTypeAndAnalyzer) - { - return optionalMateLocusTypeAndAnalyzer; - } - - return optional(); -} - -optional -LocationBasedAnalyzerFinder::tryGettingLocusAnalyzer(int32_t contigIndex, int64_t position) const -{ - const auto contigTreeIterator = intervalTrees_.find(contigIndex); - - if (contigTreeIterator == intervalTrees_.end()) - { - return optional(); - } - - const vector& relevantRegionAnalyzers - = contigTreeIterator->second.findOverlapping(position, position + 1); - - if (relevantRegionAnalyzers.size() > 1) - { - throw std::logic_error("Repeat catalog must contain non-overlapping regions"); - } - - if (!relevantRegionAnalyzers.empty()) - { - return relevantRegionAnalyzers.front().value; - } - else - { - return optional(); - } -} - -} diff --git a/sample_analysis/LocationBasedAnalyzerFinder.hh b/sample_analysis/LocationBasedAnalyzerFinder.hh deleted file mode 100644 index 186df00..0000000 --- a/sample_analysis/LocationBasedAnalyzerFinder.hh +++ /dev/null @@ -1,71 +0,0 @@ -// -// Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. -// -// Author: Egor Dolzhenko -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#pragma once - -#include -#include -#include - -#include - -#include "thirdparty/intervaltree/IntervalTree.h" - -#include "reads/Read.hh" -#include "region_analysis/RegionAnalyzer.hh" - -namespace ehunter -{ - -enum class LocusType -{ - kOfftargetLocus, - kTargetLocus -}; - -struct LocusTypeAndAnalyzer -{ - LocusTypeAndAnalyzer(LocusType locusType, RegionAnalyzer* locusAnalyzerPtr) - : locusType(locusType) - , locusAnalyzerPtr(locusAnalyzerPtr) - { - } - LocusType locusType; - RegionAnalyzer* locusAnalyzerPtr; -}; - -using IntervalWithLocusTypeAndAnalyzer = ehunter::Interval; -using AnalyzerIntervalTree = ehunter::IntervalTree; -using AnalyzerIntervalTrees = std::unordered_map; - -class LocationBasedAnalyzerFinder -{ -public: - LocationBasedAnalyzerFinder(std::vector>& locusAnalyzers); - boost::optional - query(int32_t readContigId, int64_t readPosition, int32_t mateContigId, int64_t matePosition); - -private: - boost::optional tryGettingLocusAnalyzer(int32_t contigIndex, int64_t position) const; - - AnalyzerIntervalTrees intervalTrees_; -}; - -} diff --git a/sample_analysis/LocationBasedDispatcher.cpp b/sample_analysis/LocationBasedDispatcher.cpp deleted file mode 100644 index 0ef02dd..0000000 --- a/sample_analysis/LocationBasedDispatcher.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// -// Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. -// -// Author: Egor Dolzhenko -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#include "sample_analysis/LocationBasedDispatcher.hh" - -using std::string; -using std::vector; - -namespace ehunter -{ - -LocationBasedDispatcher::LocationBasedDispatcher(std::vector>& locusAnalyzers) - : locationBasedAnalyzerFinder_(locusAnalyzers) -{ -} - -void LocationBasedDispatcher::dispatch( - int32_t readContigId, int64_t readPosition, int32_t mateContigId, int64_t matePosition, Read read) -{ - // Check if the read is in the hash and act accordingly - const auto mateIterator = unpairedReads_.find(read.fragmentId()); - if (mateIterator == unpairedReads_.end()) - { - unpairedReads_.emplace(std::make_pair(read.fragmentId(), std::move(read))); - return; - } - - Read& mate = mateIterator->second; - auto optionalRegionTypeAndAnalyzer - = locationBasedAnalyzerFinder_.query(readContigId, readPosition, mateContigId, matePosition); - - if (optionalRegionTypeAndAnalyzer) - { - RegionAnalyzer& regionAnalyzer = *optionalRegionTypeAndAnalyzer->locusAnalyzerPtr; - string fragmentId = mate.fragmentId(); - if (optionalRegionTypeAndAnalyzer->locusType == LocusType::kTargetLocus) - { - regionAnalyzer.processMates(std::move(read), std::move(mate)); - } - else - { - regionAnalyzer.processOfftargetMates(std::move(read), std::move(mate)); - } - unpairedReads_.erase(fragmentId); - } - else - { - unpairedReads_.erase(mate.fragmentId()); - } -} - -} diff --git a/sample_analysis/LocationBasedDispatcher.hh b/sample_analysis/LocationBasedDispatcher.hh deleted file mode 100644 index 52564ed..0000000 --- a/sample_analysis/LocationBasedDispatcher.hh +++ /dev/null @@ -1,46 +0,0 @@ -// -// Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. -// -// Author: Egor Dolzhenko -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#pragma once - -#include -#include - -#include "reads/Read.hh" -#include "region_analysis/RegionAnalyzer.hh" -#include "sample_analysis/LocationBasedAnalyzerFinder.hh" - -namespace ehunter -{ - -class LocationBasedDispatcher -{ -public: - LocationBasedDispatcher(std::vector>& locusAnalyzers); - void dispatch(int32_t readContigId, int64_t readPosition, int32_t mateContigId, int64_t matePosition, Read read); - -private: - LocationBasedAnalyzerFinder locationBasedAnalyzerFinder_; - - using ReadCatalog = std::unordered_map; - ReadCatalog unpairedReads_; -}; - -} diff --git a/sample_analysis/MateExtractor.cpp b/sample_analysis/MateExtractor.cpp index 42c4439..4457155 100644 --- a/sample_analysis/MateExtractor.cpp +++ b/sample_analysis/MateExtractor.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "sample_analysis/MateExtractor.hh" @@ -89,7 +90,8 @@ namespace htshelpers } } - optional MateExtractor::extractMate(const Read& read, const LinearAlignmentStats& alignmentStats) + optional MateExtractor::extractMate( + const Read& read, const LinearAlignmentStats& alignmentStats, LinearAlignmentStats& mateStats) { const int32_t searchRegionContigIndex = alignmentStats.isMateMapped ? alignmentStats.mateChromId : alignmentStats.chromId; @@ -117,6 +119,7 @@ namespace htshelpers const bool formProperPair = read.mateNumber() != putativeMate.mateNumber(); if (belongToSameFragment && formProperPair) { + mateStats = decodeAlignmentStats(htsAlignmentPtr_); hts_itr_destroy(htsRegionPtr_); return putativeMate; } diff --git a/sample_analysis/MateExtractor.hh b/sample_analysis/MateExtractor.hh index ccf3881..32776b3 100644 --- a/sample_analysis/MateExtractor.hh +++ b/sample_analysis/MateExtractor.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -45,7 +46,8 @@ namespace htshelpers MateExtractor(const std::string& htsFilePath); ~MateExtractor(); - boost::optional extractMate(const Read& read, const LinearAlignmentStats& alignmentStats); + boost::optional + extractMate(const Read& read, const LinearAlignmentStats& alignmentStats, LinearAlignmentStats& mateStats); private: void openFile(); diff --git a/sample_analysis/tests/CMakeLists.txt b/sample_analysis/tests/CMakeLists.txt new file mode 100644 index 0000000..fb7050b --- /dev/null +++ b/sample_analysis/tests/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(GenomeMaskTest GenomeMaskTest.cpp) +target_link_libraries(GenomeMaskTest sample_analysis gtest gmock_main) +add_test(NAME GenomeMaskTest COMMAND GenomeMaskTest) diff --git a/sample_analysis/tests/GenomeMaskTest.cpp b/sample_analysis/tests/GenomeMaskTest.cpp new file mode 100644 index 0000000..284bb2b --- /dev/null +++ b/sample_analysis/tests/GenomeMaskTest.cpp @@ -0,0 +1,65 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Felix Schlesinger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "sample_analysis/GenomeMask.hh" + +#include "gtest/gtest.h" + +using namespace ehunter; + +TEST(GenomeMaskTest, covered) +{ + const int binSize = 1 << 16; + GenomeMask mask; + mask.addRegion(1, 10 * binSize + 1000, 11 * binSize + 10); + mask.addRegion(1, 10 * binSize, 10 * binSize + 100); + + ASSERT_TRUE(mask.query(1, 10 * binSize)); + ASSERT_TRUE(mask.query(1, 10 * binSize + 50)); + ASSERT_TRUE(mask.query(1, 11 * binSize + 10)); + ASSERT_FALSE(mask.query(1, 12 * binSize)); + ASSERT_FALSE(mask.query(1, 10 * binSize - 1)); +} + +TEST(GenomeMaskTest, notCovered) +{ + const int binSize = 1 << 16; + GenomeMask mask; + mask.addRegion(0, 10 * binSize, 10 * binSize + 100); + mask.addRegion(2, 10 * binSize + 1000, 11 * binSize + 10); + + ASSERT_FALSE(mask.query(1, 10 * binSize)); + ASSERT_FALSE(mask.query(3, 10 * binSize)); + ASSERT_FALSE(mask.query(2, 12 * binSize)); + ASSERT_FALSE(mask.query(2, 100 * binSize)); + ASSERT_TRUE(mask.query(0, 10 * binSize + 50)); +} + +TEST(GenomeMaskTest, outOfBounds) +{ + const int binSize = 1 << 16; + GenomeMask mask; + mask.addRegion(0, 10 * binSize, 10 * binSize + 100); + mask.addRegion(2, 10 * binSize + 1000, 11 * binSize + 10); + + ASSERT_FALSE(mask.query(100, 10)); + ASSERT_FALSE(mask.query(1, 0)); +} diff --git a/src/ExpansionHunter.cpp b/src/ExpansionHunter.cpp index 8c66ad2..5dec671 100644 --- a/src/ExpansionHunter.cpp +++ b/src/ExpansionHunter.cpp @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include @@ -40,8 +41,8 @@ #include "output/JsonWriter.hh" #include "output/VcfWriter.hh" #include "region_analysis/VariantFindings.hh" -#include "sample_analysis/HtsSeekingSampleAnalyzer.hh" -#include "sample_analysis/HtsStreamingSampleAnalyzer.hh" +#include "sample_analysis/HtsSeekingSampleAnalysis.hh" +#include "sample_analysis/HtsStreamingSampleAnalysis.hh" #include "src/Version.hh" namespace spd = spdlog; @@ -65,6 +66,9 @@ void setLogLevel(LogLevel logLevel) { switch (logLevel) { + case LogLevel::kTrace: + spdlog::set_level(spdlog::level::trace); + break; case LogLevel::kDebug: spdlog::set_level(spdlog::level::debug); break; @@ -101,7 +105,6 @@ int main(int argc, char** argv) SampleParameters& sampleParams = params.sample(); console->info("Analyzing sample {}", sampleParams.id()); - console->info("Read length is set to {}", sampleParams.readLength()); const InputPaths& inputPaths = params.inputPaths(); @@ -113,28 +116,27 @@ int main(int argc, char** argv) const RegionCatalog regionCatalog = loadLocusCatalogFromDisk(inputPaths.catalog(), sampleParams.sex(), heuristicParams, reference); - console->info("Running sample analysis"); const OutputPaths& outputPaths = params.outputPaths(); BamletWriter bamletWriter(outputPaths.bamlet(), reference.contigInfo(), regionCatalog); SampleFindings sampleFindings; - if (isBamFile(inputPaths.htsFile())) + if (params.analysisMode() == AnalysisMode::kSeeking) { - sampleFindings - = htsSeekingSampleAnalysis(inputPaths, sampleParams, heuristicParams, regionCatalog, bamletWriter); + console->info("Running sample analysis in seeking mode"); + sampleFindings = htsSeekingSampleAnalysis(inputPaths, heuristicParams, regionCatalog, bamletWriter); } else { - sampleFindings - = htslibStreamingSampleAnalyzer(inputPaths, sampleParams, heuristicParams, regionCatalog, bamletWriter); + console->info("Running sample analysis in streaming mode"); + sampleFindings = htsStreamingSampleAnalysis(inputPaths, heuristicParams, regionCatalog, bamletWriter); } console->info("Writing output to disk"); - VcfWriter vcfWriter(sampleParams, reference, regionCatalog, sampleFindings); + VcfWriter vcfWriter(sampleParams.id(), reference, regionCatalog, sampleFindings); writeToFile(outputPaths.vcf(), vcfWriter); - JsonWriter jsonWriter(sampleParams, reference.contigInfo(), regionCatalog, sampleFindings); + JsonWriter jsonWriter(reference.contigInfo(), regionCatalog, sampleFindings); writeToFile(outputPaths.json(), jsonWriter); } catch (const std::exception& e) diff --git a/src/Version.hh b/src/Version.hh index b4bb8ae..55a1c6a 100644 --- a/src/Version.hh +++ b/src/Version.hh @@ -1,23 +1,24 @@ // // Expansion Hunter -// Copyright (c) 2016 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Mitch Bekritsky , Richard Shaw // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -27,6 +28,6 @@ namespace ehunter { -const std::string kProgramVersion = "Expansion Hunter v3.0.0-rc2"; +const std::string kProgramVersion = "Expansion Hunter v3.0.0-rc3"; } diff --git a/stats/CMakeLists.txt b/stats/CMakeLists.txt index ae5f116..a9ce16c 100644 --- a/stats/CMakeLists.txt +++ b/stats/CMakeLists.txt @@ -1,4 +1,4 @@ file(GLOB SOURCES "*.cpp") add_library(stats ${SOURCES}) -target_link_libraries(stats common) +target_link_libraries(stats common graphtools) add_subdirectory(tests) diff --git a/stats/LocusStats.cpp b/stats/LocusStats.cpp new file mode 100644 index 0000000..ce3fb29 --- /dev/null +++ b/stats/LocusStats.cpp @@ -0,0 +1,75 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "stats/LocusStats.hh" + +#include +#include + +namespace ehunter +{ + +using boost::optional; + +bool LocusStats::operator==(const LocusStats& other) const { return medianReadLength_ == other.medianReadLength_; } + +std::ostream& operator<<(std::ostream& out, const LocusStats& stats) +{ + out << "LocusStats(medianReadLength=" << stats.medianReadLength() << ", depth=" << stats.depth() << ")"; + return out; +} + +LocusStatsCalculator::LocusStatsCalculator(const graphtools::Graph& graph) + : readCount_(0) +{ + // As elsewhere in the program, assuming that the fist and last node are flanks + leftFlankId_ = 0; + rightFlankId_ = graph.numNodes() - 1; + + leftFlankLength_ = graph.nodeSeq(leftFlankId_).length(); + rightFlankLength_ = graph.nodeSeq(rightFlankId_).length(); +} + +void LocusStatsCalculator::inspect(const graphtools::GraphAlignment& alignment) +{ + const graphtools::NodeId firstNode = alignment.path().getNodeIdByIndex(0); + if (firstNode == leftFlankId_ || firstNode == rightFlankId_) + { + readLengthAccumulator_(alignment.queryLength()); + ++readCount_; + } +} + +optional LocusStatsCalculator::estimate() const +{ + if (boost::accumulators::count(readLengthAccumulator_) == 0 || readCount_ == 0) + { + return optional(); + } + + const int meanReadLength = boost::accumulators::mean(readLengthAccumulator_); + const int numberOfStartPositions = leftFlankLength_ + rightFlankLength_ - meanReadLength; + const double depth = meanReadLength * (static_cast(readCount_) / numberOfStartPositions); + const int medianReadLength = boost::accumulators::median(readLengthAccumulator_); + return LocusStats(medianReadLength, depth); +} + +} diff --git a/stats/LocusStats.hh b/stats/LocusStats.hh new file mode 100644 index 0000000..dc4c6d2 --- /dev/null +++ b/stats/LocusStats.hh @@ -0,0 +1,84 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#pragma once + +#include +#include +#include + +#include +#include +#include + +#include "graphalign/GraphAlignment.hh" +#include "graphcore/Graph.hh" + +#include "common/Common.hh" + +namespace ehunter +{ + +class LocusStats +{ +public: + LocusStats(int medianReadLength, double depth) + : medianReadLength_(medianReadLength) + , depth_(depth) + { + } + + int medianReadLength() const { return medianReadLength_; } + double depth() const { return depth_; } + + bool operator==(const LocusStats& other) const; + +private: + int medianReadLength_; + double depth_; +}; + +std::ostream& operator<<(std::ostream& out, const LocusStats& stats); + +// Computes read and coverage statistics for each locus from reads aligning to the flanks +class LocusStatsCalculator +{ +public: + LocusStatsCalculator(const graphtools::Graph& graph); + + void inspect(const graphtools::GraphAlignment& alignment); + + boost::optional estimate() const; + +private: + using AccumulatorStats = boost::accumulators::features< + boost::accumulators::tag::count, boost::accumulators::tag::mean, boost::accumulators::tag::median>; + using Accumulator = boost::accumulators::accumulator_set; + + Accumulator readLengthAccumulator_; + graphtools::NodeId leftFlankId_; + graphtools::NodeId rightFlankId_; + int leftFlankLength_; + int rightFlankLength_; + int readCount_; +}; + +} diff --git a/stats/ReadSupportCalculator.cpp b/stats/ReadSupportCalculator.cpp index 21835b8..bda6aef 100644 --- a/stats/ReadSupportCalculator.cpp +++ b/stats/ReadSupportCalculator.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "stats/ReadSupportCalculator.hh" @@ -26,32 +27,40 @@ namespace ehunter { -int ReadSupportCalculator::getCountOfConsistentSpanningReads(int haplotypeSize) const +namespace { - return spanningReadCounts_.countOf(haplotypeSize); -} + int countConsistentReads(const CountTable& table, int alleleSize) + { + int readCount = 0; -int ReadSupportCalculator::getCountOfConsistentFlankingReads(int haplotypeSize) const -{ - const int cappedHaplotypeSize = std::min(haplotypeSize, maxUnitsInRead_ - 1); + for (const auto& sizeAndCount : table) + { + const int size = sizeAndCount.first; + const int count = sizeAndCount.second; - int readCount = 0; - for (int size = cappedHaplotypeSize; size != -1; --size) - { - readCount += flankingReadCounts_.countOf(size); + if (size <= alleleSize) + { + readCount += count; + } + } + + return readCount; } +} - return readCount; +int ReadSupportCalculator::getCountOfConsistentSpanningReads(int alleleSize) const +{ + return spanningReadCounts_.countOf(alleleSize); } -int ReadSupportCalculator::getCountOfConsistentRepeatReads(int haplotypeSize) const +int ReadSupportCalculator::getCountOfConsistentFlankingReads(int alleleSize) const { - if (haplotypeSize == maxUnitsInRead_) - { - return flankingReadCounts_.countOf(haplotypeSize); - } + return countConsistentReads(flankingReadCounts_, alleleSize); +} - return 0; +int ReadSupportCalculator::getCountOfConsistentRepeatReads(int alleleSize) const +{ + return countConsistentReads(inrepeatReadCounts_, alleleSize); } } diff --git a/stats/ReadSupportCalculator.hh b/stats/ReadSupportCalculator.hh index 94adff4..4c6050d 100644 --- a/stats/ReadSupportCalculator.hh +++ b/stats/ReadSupportCalculator.hh @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once @@ -33,13 +34,13 @@ class ReadSupportCalculator { public: ReadSupportCalculator( - int maxUnitsInRead, const CountTable& spanningReadCounts, const CountTable& flankingReadCounts) - : maxUnitsInRead_(maxUnitsInRead) - , spanningReadCounts_(spanningReadCounts) + const CountTable& spanningReadCounts, const CountTable& flankingReadCounts, + const CountTable& inrepeatReadCounts) + : spanningReadCounts_(spanningReadCounts) , flankingReadCounts_(flankingReadCounts) + , inrepeatReadCounts_(inrepeatReadCounts) { - assert(maxUnitsInRead_ > 0); } // A spanning read is consistent with the given repeat allele if it spans same number of repeat units @@ -50,9 +51,9 @@ public: int getCountOfConsistentRepeatReads(int haplotypeSize) const; private: - const int maxUnitsInRead_; const CountTable& spanningReadCounts_; const CountTable& flankingReadCounts_; + const CountTable& inrepeatReadCounts_; }; } diff --git a/stats/WeightedPurityCalculator.cpp b/stats/WeightedPurityCalculator.cpp index 636a015..619813b 100644 --- a/stats/WeightedPurityCalculator.cpp +++ b/stats/WeightedPurityCalculator.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "stats/WeightedPurityCalculator.hh" diff --git a/stats/WeightedPurityCalculator.hh b/stats/WeightedPurityCalculator.hh index 4f38389..ed752a4 100644 --- a/stats/WeightedPurityCalculator.hh +++ b/stats/WeightedPurityCalculator.hh @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #pragma once diff --git a/stats/tests/CMakeLists.txt b/stats/tests/CMakeLists.txt index cc3a828..631e963 100644 --- a/stats/tests/CMakeLists.txt +++ b/stats/tests/CMakeLists.txt @@ -5,3 +5,7 @@ add_test(NAME ReadSupportCalculatorTest COMMAND ReadSupportCalculatorTest) add_executable(WeightedPurityCalculatorTest WeightedPurityCalculatorTest.cpp) target_link_libraries(WeightedPurityCalculatorTest stats gtest gmock_main) add_test(NAME WeightedPurityCalculatorTest COMMAND WeightedPurityCalculatorTest) + +add_executable(LocusStatsTest LocusStatsTest.cpp) +target_link_libraries(LocusStatsTest stats gtest gmock_main) +add_test(NAME LocusStatsTest COMMAND LocusStatsTest) diff --git a/stats/tests/LocusStatsTest.cpp b/stats/tests/LocusStatsTest.cpp new file mode 100644 index 0000000..c5aa5a9 --- /dev/null +++ b/stats/tests/LocusStatsTest.cpp @@ -0,0 +1,68 @@ +// +// Expansion Hunter +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. +// +// Author: Egor Dolzhenko +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// + +#include "stats/LocusStats.hh" + +#include "gtest/gtest.h" + +#include "graphalign/GraphAlignmentOperations.hh" +#include "graphcore/GraphBuilders.hh" + +using namespace ehunter; +using boost::optional; +using graphtools::decodeGraphAlignment; +using graphtools::GraphAlignment; + +TEST(LocusStatsCalculator, NoDataGiven_StatsNotCalculated) +{ + graphtools::Graph graph = graphtools::makeStrGraph("TAATG", "CCG", "CCTTATTA"); + + LocusStatsCalculator statsCalculator(graph); + + GraphAlignment alignmentStartingOnLeftFlank = decodeGraphAlignment(3, "0[2M]1[2M]", &graph); + GraphAlignment alignmentStartingInsideRepeat = decodeGraphAlignment(0, "1[3M]", &graph); + GraphAlignment alignmentStartingOnRightFlank = decodeGraphAlignment(0, "2[4M]", &graph); + + ASSERT_EQ(optional(), statsCalculator.estimate()); +} + +TEST(LocusStatsCalculator, TypicalReadLengths_StatsCalculated) +{ + graphtools::Graph graph = graphtools::makeStrGraph("TAATG", "CCG", "CCTTATTA"); + + LocusStatsCalculator statsCalculator(graph); + + GraphAlignment alignmentStartingOnLeftFlank = decodeGraphAlignment(3, "0[2M]1[2M]", &graph); + GraphAlignment alignmentStartingInsideRepeat = decodeGraphAlignment(0, "1[3M]", &graph); + GraphAlignment alignmentStartingOnRightFlank = decodeGraphAlignment(0, "2[3M]", &graph); + + for (int index = 0; index != 29; ++index) + { + statsCalculator.inspect(alignmentStartingOnLeftFlank); + statsCalculator.inspect(alignmentStartingInsideRepeat); + statsCalculator.inspect(alignmentStartingOnRightFlank); + } + statsCalculator.inspect(alignmentStartingOnRightFlank); + statsCalculator.inspect(alignmentStartingOnRightFlank); + + ASSERT_NE(boost::none, statsCalculator.estimate()); + ASSERT_EQ(LocusStats(3, 18), *statsCalculator.estimate()); +} diff --git a/stats/tests/ReadSupportCalculatorTest.cpp b/stats/tests/ReadSupportCalculatorTest.cpp index 88bfaf7..7d84763 100644 --- a/stats/tests/ReadSupportCalculatorTest.cpp +++ b/stats/tests/ReadSupportCalculatorTest.cpp @@ -1,22 +1,23 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko , // Concept: Michael Eberle // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "stats/ReadSupportCalculator.hh" @@ -27,13 +28,13 @@ using namespace ehunter; -TEST(CalculatingCountsOfReadsConsistentWithHaplotype, TypicalCountTables_SupportCalculated) +TEST(DISABLED_CalculatingCountsOfReadsConsistentWithHaplotype, TypicalCountTables_SupportCalculated) { - int maxUnitsInRead = 12; CountTable spanningReadCounts({ { 3, 2 }, { 5, 10 } }); CountTable flankingReadCounts({ { 2, 5 }, { 7, 3 }, { 12, 15 } }); + CountTable inrepeatReadCounts; - ReadSupportCalculator readSupportCalculator(maxUnitsInRead, spanningReadCounts, flankingReadCounts); + ReadSupportCalculator readSupportCalculator(spanningReadCounts, flankingReadCounts, inrepeatReadCounts); EXPECT_EQ(0, readSupportCalculator.getCountOfConsistentSpanningReads(2)); EXPECT_EQ(2, readSupportCalculator.getCountOfConsistentSpanningReads(3)); diff --git a/stats/tests/WeightedPurityCalculatorTest.cpp b/stats/tests/WeightedPurityCalculatorTest.cpp index 6df80ed..8c2735e 100644 --- a/stats/tests/WeightedPurityCalculatorTest.cpp +++ b/stats/tests/WeightedPurityCalculatorTest.cpp @@ -1,21 +1,22 @@ // // Expansion Hunter -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2016-2019 Illumina, Inc. +// All rights reserved. // // Author: Egor Dolzhenko // -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . // #include "stats/WeightedPurityCalculator.hh" diff --git a/thirdparty/graph-tools-master/LICENSE.txt b/thirdparty/graph-tools-master/LICENSE.txt new file mode 100755 index 0000000..d645695 --- /dev/null +++ b/thirdparty/graph-tools-master/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/thirdparty/graph-tools-master/include/graphalign/DagAlignerAffine.hh b/thirdparty/graph-tools-master/include/graphalign/DagAlignerAffine.hh index c109abe..09584cf 100755 --- a/thirdparty/graph-tools-master/include/graphalign/DagAlignerAffine.hh +++ b/thirdparty/graph-tools-master/include/graphalign/DagAlignerAffine.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Roman Petrovski // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/GaplessAligner.hh b/thirdparty/graph-tools-master/include/graphalign/GaplessAligner.hh index adfedc9..5946d2c 100755 --- a/thirdparty/graph-tools-master/include/graphalign/GaplessAligner.hh +++ b/thirdparty/graph-tools-master/include/graphalign/GaplessAligner.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/GappedAligner.hh b/thirdparty/graph-tools-master/include/graphalign/GappedAligner.hh index e56e0e6..98a4286 100755 --- a/thirdparty/graph-tools-master/include/graphalign/GappedAligner.hh +++ b/thirdparty/graph-tools-master/include/graphalign/GappedAligner.hh @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Roman Petrovski // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once @@ -34,6 +26,8 @@ #include #include +#include + #include "graphalign/GaplessAligner.hh" #include "graphalign/GraphAligner.hh" #include "graphalign/GraphAlignment.hh" @@ -88,15 +82,15 @@ public: std::list align(const std::string& query) const override; /** - * Extends a path matching a kmer in the query sequence to full-length alignments + * Extends a seed path corresponding to a perfect match to the query sequence to full-length alignments * - * @param kmer_path: Kmer match path + * @param seed_path: Seed path * @param query: Query sequence - * @param kmer_start_on_query: Position of the left-most base of the kmer on the query sequence - * @return List of top-scoring graph alignments going through the kmer match path + * @param seed_start_on_query: Position of the left-most base of the seed on the query sequence + * @return List of top-scoring graph alignments going through the seed path */ std::list - extendKmerMatchToFullAlignments(Path kmer_path, const std::string& query, size_t kmer_start_on_query) const; + extendSeedToFullAlignments(Path seed_path, const std::string& query, size_t seed_start_on_query) const; /** * Aligns query suffix to all suffix-extensions of a given path @@ -126,6 +120,21 @@ private: const int32_t seed_affix_trim_len_; const KmerIndex kmer_index_; + // An alignment seed is a path whose sequence is a perfect match to the query starting from a given position + struct AlignmentSeed + { + AlignmentSeed(Path path, int start_on_query) + : path(std::move(path)) + , start_on_query(start_on_query) + { + } + Path path; + int start_on_query = -1; + }; + + // Performs a search for an alignment seed + boost::optional searchForAlignmentSeed(const std::string& query) const; + class AlignerSelector { std::shared_ptr ptrPathAligner_; diff --git a/thirdparty/graph-tools-master/include/graphalign/GraphAligner.hh b/thirdparty/graph-tools-master/include/graphalign/GraphAligner.hh index 98b00bf..7e2cb24 100755 --- a/thirdparty/graph-tools-master/include/graphalign/GraphAligner.hh +++ b/thirdparty/graph-tools-master/include/graphalign/GraphAligner.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once @@ -44,4 +36,4 @@ public: virtual ~GraphAligner(){}; virtual std::list align(const std::string& query) const = 0; }; -} \ No newline at end of file +} diff --git a/thirdparty/graph-tools-master/include/graphalign/GraphAlignment.hh b/thirdparty/graph-tools-master/include/graphalign/GraphAlignment.hh index bcb3492..2d6ca36 100755 --- a/thirdparty/graph-tools-master/include/graphalign/GraphAlignment.hh +++ b/thirdparty/graph-tools-master/include/graphalign/GraphAlignment.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/GraphAlignmentOperations.hh b/thirdparty/graph-tools-master/include/graphalign/GraphAlignmentOperations.hh index c8b4eaa..099c038 100755 --- a/thirdparty/graph-tools-master/include/graphalign/GraphAlignmentOperations.hh +++ b/thirdparty/graph-tools-master/include/graphalign/GraphAlignmentOperations.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/KmerIndex.hh b/thirdparty/graph-tools-master/include/graphalign/KmerIndex.hh index 564e978..5a8c8a2 100755 --- a/thirdparty/graph-tools-master/include/graphalign/KmerIndex.hh +++ b/thirdparty/graph-tools-master/include/graphalign/KmerIndex.hh @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/KmerIndexOperations.hh b/thirdparty/graph-tools-master/include/graphalign/KmerIndexOperations.hh index ad5edac..dc9e518 100755 --- a/thirdparty/graph-tools-master/include/graphalign/KmerIndexOperations.hh +++ b/thirdparty/graph-tools-master/include/graphalign/KmerIndexOperations.hh @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Peter Krusche , // Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/LinearAlignment.hh b/thirdparty/graph-tools-master/include/graphalign/LinearAlignment.hh index e200860..5b945f3 100755 --- a/thirdparty/graph-tools-master/include/graphalign/LinearAlignment.hh +++ b/thirdparty/graph-tools-master/include/graphalign/LinearAlignment.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/LinearAlignmentOperations.hh b/thirdparty/graph-tools-master/include/graphalign/LinearAlignmentOperations.hh index 2d03728..21558c3 100755 --- a/thirdparty/graph-tools-master/include/graphalign/LinearAlignmentOperations.hh +++ b/thirdparty/graph-tools-master/include/graphalign/LinearAlignmentOperations.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/LinearAlignmentParameters.hh b/thirdparty/graph-tools-master/include/graphalign/LinearAlignmentParameters.hh index 76c38f8..1529eec 100755 --- a/thirdparty/graph-tools-master/include/graphalign/LinearAlignmentParameters.hh +++ b/thirdparty/graph-tools-master/include/graphalign/LinearAlignmentParameters.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/Operation.hh b/thirdparty/graph-tools-master/include/graphalign/Operation.hh index 8823cce..861b7ff 100755 --- a/thirdparty/graph-tools-master/include/graphalign/Operation.hh +++ b/thirdparty/graph-tools-master/include/graphalign/Operation.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/OperationOperations.hh b/thirdparty/graph-tools-master/include/graphalign/OperationOperations.hh index be0e328..764504e 100755 --- a/thirdparty/graph-tools-master/include/graphalign/OperationOperations.hh +++ b/thirdparty/graph-tools-master/include/graphalign/OperationOperations.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/Operation.hh" @@ -47,4 +39,4 @@ using OperationPair = std::pair; * @return A pair of operations produced by the split */ OperationPair splitByReferenceLength(const Operation& operation, uint32_t prefix_reference_length); -} \ No newline at end of file +} diff --git a/thirdparty/graph-tools-master/include/graphalign/PinnedAligner.hh b/thirdparty/graph-tools-master/include/graphalign/PinnedAligner.hh index c2d45f9..d94faa8 100755 --- a/thirdparty/graph-tools-master/include/graphalign/PinnedAligner.hh +++ b/thirdparty/graph-tools-master/include/graphalign/PinnedAligner.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/PinnedDagAligner.hh b/thirdparty/graph-tools-master/include/graphalign/PinnedDagAligner.hh index d950e25..22ce556 100755 --- a/thirdparty/graph-tools-master/include/graphalign/PinnedDagAligner.hh +++ b/thirdparty/graph-tools-master/include/graphalign/PinnedDagAligner.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Roman Petrovski // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once @@ -78,6 +70,7 @@ class PinnedDagAligner { typedef std::pair Edge; typedef std::vector Edges; + typedef graphalign::dagAligner::Cigar Cigar; BaseMatchingDagAligner aligner_; static void appendOperation(OperationType type, uint32_t length, std::list& operations) diff --git a/thirdparty/graph-tools-master/include/graphalign/PinnedPathAligner.hh b/thirdparty/graph-tools-master/include/graphalign/PinnedPathAligner.hh index 441f0e2..c4ddd80 100755 --- a/thirdparty/graph-tools-master/include/graphalign/PinnedPathAligner.hh +++ b/thirdparty/graph-tools-master/include/graphalign/PinnedPathAligner.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/TracebackMatrix.hh b/thirdparty/graph-tools-master/include/graphalign/TracebackMatrix.hh index 3377f83..f692855 100755 --- a/thirdparty/graph-tools-master/include/graphalign/TracebackMatrix.hh +++ b/thirdparty/graph-tools-master/include/graphalign/TracebackMatrix.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/TracebackRunner.hh b/thirdparty/graph-tools-master/include/graphalign/TracebackRunner.hh index 1f291cf..f383b25 100755 --- a/thirdparty/graph-tools-master/include/graphalign/TracebackRunner.hh +++ b/thirdparty/graph-tools-master/include/graphalign/TracebackRunner.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/dagAligner/AffineAlignMatrix.hh b/thirdparty/graph-tools-master/include/graphalign/dagAligner/AffineAlignMatrix.hh index 11fbacf..0cb5d98 100755 --- a/thirdparty/graph-tools-master/include/graphalign/dagAligner/AffineAlignMatrix.hh +++ b/thirdparty/graph-tools-master/include/graphalign/dagAligner/AffineAlignMatrix.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Roman Petrovski // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/dagAligner/AffineAlignMatrixVectorized.hh b/thirdparty/graph-tools-master/include/graphalign/dagAligner/AffineAlignMatrixVectorized.hh index 7309910..d7ef305 100755 --- a/thirdparty/graph-tools-master/include/graphalign/dagAligner/AffineAlignMatrixVectorized.hh +++ b/thirdparty/graph-tools-master/include/graphalign/dagAligner/AffineAlignMatrixVectorized.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Roman Petrovski // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/dagAligner/BaseMatchingPenaltyMatrix.hh b/thirdparty/graph-tools-master/include/graphalign/dagAligner/BaseMatchingPenaltyMatrix.hh index a9a7eac..d71ce6e 100755 --- a/thirdparty/graph-tools-master/include/graphalign/dagAligner/BaseMatchingPenaltyMatrix.hh +++ b/thirdparty/graph-tools-master/include/graphalign/dagAligner/BaseMatchingPenaltyMatrix.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Roman Petrovski // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/dagAligner/Details.hh b/thirdparty/graph-tools-master/include/graphalign/dagAligner/Details.hh index 3183985..e4f00f5 100755 --- a/thirdparty/graph-tools-master/include/graphalign/dagAligner/Details.hh +++ b/thirdparty/graph-tools-master/include/graphalign/dagAligner/Details.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Roman Petrovski // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphalign/dagAligner/PenaltyMatrix.hh b/thirdparty/graph-tools-master/include/graphalign/dagAligner/PenaltyMatrix.hh index 2eeda76..07bdef9 100755 --- a/thirdparty/graph-tools-master/include/graphalign/dagAligner/PenaltyMatrix.hh +++ b/thirdparty/graph-tools-master/include/graphalign/dagAligner/PenaltyMatrix.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Roman Petrovski // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphcore/Graph.hh b/thirdparty/graph-tools-master/include/graphcore/Graph.hh index ec8c156..24fad95 100755 --- a/thirdparty/graph-tools-master/include/graphcore/Graph.hh +++ b/thirdparty/graph-tools-master/include/graphcore/Graph.hh @@ -1,32 +1,24 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Peter Krusche , // Felix Schlesinger -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphcore/GraphBuilders.hh b/thirdparty/graph-tools-master/include/graphcore/GraphBuilders.hh index 5dc1abf..54cefb3 100755 --- a/thirdparty/graph-tools-master/include/graphcore/GraphBuilders.hh +++ b/thirdparty/graph-tools-master/include/graphcore/GraphBuilders.hh @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Peter Krusche -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphcore/GraphCoordinates.hh b/thirdparty/graph-tools-master/include/graphcore/GraphCoordinates.hh index edc2879..7768312 100755 --- a/thirdparty/graph-tools-master/include/graphcore/GraphCoordinates.hh +++ b/thirdparty/graph-tools-master/include/graphcore/GraphCoordinates.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Peter Krusche -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphcore/GraphOperations.hh b/thirdparty/graph-tools-master/include/graphcore/GraphOperations.hh index 984d14c..6fbe3ad 100755 --- a/thirdparty/graph-tools-master/include/graphcore/GraphOperations.hh +++ b/thirdparty/graph-tools-master/include/graphcore/GraphOperations.hh @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Peter Krusche -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphcore/GraphReferenceMapping.hh b/thirdparty/graph-tools-master/include/graphcore/GraphReferenceMapping.hh index f045bcc..e477d60 100755 --- a/thirdparty/graph-tools-master/include/graphcore/GraphReferenceMapping.hh +++ b/thirdparty/graph-tools-master/include/graphcore/GraphReferenceMapping.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphcore/Path.hh b/thirdparty/graph-tools-master/include/graphcore/Path.hh index 6887cd9..a653fa1 100755 --- a/thirdparty/graph-tools-master/include/graphcore/Path.hh +++ b/thirdparty/graph-tools-master/include/graphcore/Path.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphcore/PathFamily.hh b/thirdparty/graph-tools-master/include/graphcore/PathFamily.hh index 29beb07..e53fc10 100755 --- a/thirdparty/graph-tools-master/include/graphcore/PathFamily.hh +++ b/thirdparty/graph-tools-master/include/graphcore/PathFamily.hh @@ -1,34 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger , // Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphcore/PathFamilyOperations.hh b/thirdparty/graph-tools-master/include/graphcore/PathFamilyOperations.hh index 53de601..e67dfbe 100755 --- a/thirdparty/graph-tools-master/include/graphcore/PathFamilyOperations.hh +++ b/thirdparty/graph-tools-master/include/graphcore/PathFamilyOperations.hh @@ -1,32 +1,24 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger , // Peter Krusche , // Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphcore/PathOperations.hh b/thirdparty/graph-tools-master/include/graphcore/PathOperations.hh index 565ca32..d3dc4c0 100755 --- a/thirdparty/graph-tools-master/include/graphcore/PathOperations.hh +++ b/thirdparty/graph-tools-master/include/graphcore/PathOperations.hh @@ -1,34 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphio/AlignmentWriter.hh b/thirdparty/graph-tools-master/include/graphio/AlignmentWriter.hh index 66ba502..5047cf7 100755 --- a/thirdparty/graph-tools-master/include/graphio/AlignmentWriter.hh +++ b/thirdparty/graph-tools-master/include/graphio/AlignmentWriter.hh @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger , // Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at // -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. +// http://www.apache.org/licenses/LICENSE-2.0 // -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #pragma once diff --git a/thirdparty/graph-tools-master/include/graphio/GraphJson.hh b/thirdparty/graph-tools-master/include/graphio/GraphJson.hh index f28a3cc..8ad6c63 100755 --- a/thirdparty/graph-tools-master/include/graphio/GraphJson.hh +++ b/thirdparty/graph-tools-master/include/graphio/GraphJson.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphutils/BaseMatching.hh b/thirdparty/graph-tools-master/include/graphutils/BaseMatching.hh index df9e9b7..dafcbaf 100755 --- a/thirdparty/graph-tools-master/include/graphutils/BaseMatching.hh +++ b/thirdparty/graph-tools-master/include/graphutils/BaseMatching.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphutils/DepthTest.hh b/thirdparty/graph-tools-master/include/graphutils/DepthTest.hh index d3cc37a..d1debc7 100755 --- a/thirdparty/graph-tools-master/include/graphutils/DepthTest.hh +++ b/thirdparty/graph-tools-master/include/graphutils/DepthTest.hh @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Sai Chen , // Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphutils/IntervalBuffer.hh b/thirdparty/graph-tools-master/include/graphutils/IntervalBuffer.hh index 7c9fbe7..382b270 100755 --- a/thirdparty/graph-tools-master/include/graphutils/IntervalBuffer.hh +++ b/thirdparty/graph-tools-master/include/graphutils/IntervalBuffer.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once diff --git a/thirdparty/graph-tools-master/include/graphutils/IntervalList.hh b/thirdparty/graph-tools-master/include/graphutils/IntervalList.hh index fa41902..b394042 100755 --- a/thirdparty/graph-tools-master/include/graphutils/IntervalList.hh +++ b/thirdparty/graph-tools-master/include/graphutils/IntervalList.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// /** * \brief Store a list of non-intersecting intervals diff --git a/thirdparty/graph-tools-master/include/graphutils/PairHashing.hh b/thirdparty/graph-tools-master/include/graphutils/PairHashing.hh index 7ca38aa..49651a2 100755 --- a/thirdparty/graph-tools-master/include/graphutils/PairHashing.hh +++ b/thirdparty/graph-tools-master/include/graphutils/PairHashing.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once @@ -54,4 +46,4 @@ template struct hash> return result; } }; -} \ No newline at end of file +} diff --git a/thirdparty/graph-tools-master/include/graphutils/SequenceOperations.hh b/thirdparty/graph-tools-master/include/graphutils/SequenceOperations.hh index 33695e0..36f2e60 100755 --- a/thirdparty/graph-tools-master/include/graphutils/SequenceOperations.hh +++ b/thirdparty/graph-tools-master/include/graphutils/SequenceOperations.hh @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #pragma once @@ -87,4 +79,4 @@ std::string const& expandReferenceSymbol(char reference_symbol); * @return All nucleotide sequences matching the input sequence */ void expandReferenceSequence(const std::string& sequence, std::vector& target); -} \ No newline at end of file +} diff --git a/thirdparty/graph-tools-master/src/graphalign/GaplessAligner.cpp b/thirdparty/graph-tools-master/src/graphalign/GaplessAligner.cpp index d0c7ad4..38e72bd 100755 --- a/thirdparty/graph-tools-master/src/graphalign/GaplessAligner.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/GaplessAligner.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/GaplessAligner.hh" diff --git a/thirdparty/graph-tools-master/src/graphalign/GappedAligner.cpp b/thirdparty/graph-tools-master/src/graphalign/GappedAligner.cpp index e77d0ee..d2aea04 100755 --- a/thirdparty/graph-tools-master/src/graphalign/GappedAligner.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/GappedAligner.cpp @@ -1,38 +1,34 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Roman Petrovski // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/GappedAligner.hh" +#include +#include + #include "graphalign/GraphAlignmentOperations.hh" #include "graphalign/LinearAlignmentOperations.hh" #include "graphcore/PathOperations.hh" +using boost::optional; using std::list; using std::make_pair; using std::string; @@ -42,96 +38,129 @@ namespace graphtools { /** - * Remove prefix of a path if it overlaps multiple nodes + * Trim prefix of a path if it is close to node edge * - * @param prefixLength: length of the prefix of the path to evaluate + * @param requested_trim_len: length of the prefix to attempt to trim by + * @param min_path_len: minimal length of the trimmed path * @param[in|out] path: any path - * @return: the length by which the path's beginning was trimmed + * @return: actual trim length */ -static int32_t removePrefixThatOverlapsMultipleNodes(int32_t prefixLength, Path& path) +static int32_t trimPrefixNearNodeEdge(int32_t requested_trim_len, int32_t min_path_len, Path& path) { - if (path.numNodes() == 1) + if (path.numNodes() == 1 || static_cast(path.length()) <= min_path_len) { return 0; } - const int32_t overlapLengthWithFirstNode = path.getNodeOverlapLengthByIndex(0); - - if (overlapLengthWithFirstNode <= prefixLength) + const int32_t overlap_len_with_first_node = path.getNodeOverlapLengthByIndex(0); + if (overlap_len_with_first_node > requested_trim_len) { - if ((int32_t)path.length() >= prefixLength) - { - path.shrinkStartBy(prefixLength); - return prefixLength; - } + return 0; } - return 0; + const bool can_be_fully_trimmed = static_cast(path.length()) >= requested_trim_len + min_path_len; + const int32_t actual_trim_len = can_be_fully_trimmed ? requested_trim_len : path.length() - min_path_len; + + path.shrinkStartBy(actual_trim_len); + return actual_trim_len; } /** - * Remove suffix of a path if it overlaps multiple nodes + * Trim suffix of a path if it is close to node edge * - * @param suffixLength: length of the suffix of the path to evaluate + * @param requested_trim_len: length of the suffix to attempt to trim by + * @param min_path_len: minimal length of the shrank path * @param[in|out] path: any path * @return: the length by which the path's end was trimmed */ -static int32_t removeSuffixThatOverlapsMultipleNodes(int32_t suffixLength, Path& path) +static int32_t trimSuffixNearNodeEdge(int32_t requested_trim_len, int32_t min_path_len, Path& path) { - if (path.numNodes() == 1) + if (path.numNodes() == 1 || static_cast(path.length()) <= min_path_len) { return 0; } - const int32_t overlapLengthWithLastNode = path.getNodeOverlapLengthByIndex(path.numNodes() - 1); - - if (overlapLengthWithLastNode <= suffixLength) + const int32_t overlap_len_with_last_node = path.getNodeOverlapLengthByIndex(path.numNodes() - 1); + if (overlap_len_with_last_node > requested_trim_len) { - if ((int32_t)path.length() >= suffixLength) - { - path.shrinkEndBy(suffixLength); - return suffixLength; - } + return 0; } - return 0; + const bool can_be_fully_trimmed = static_cast(path.length()) >= requested_trim_len + min_path_len; + const int32_t actual_trim_len = can_be_fully_trimmed ? requested_trim_len : path.length() - min_path_len; + + path.shrinkEndBy(actual_trim_len); + return actual_trim_len; } list GappedGraphAligner::align(const string& query) const { - const list kmers = extractKmersFromAllPositions(query, kmer_len_); + optional optional_seed = searchForAlignmentSeed(query); + + if (optional_seed) + { + Path& seed_path = optional_seed->path; + int seed_start_on_query = optional_seed->start_on_query; + + const int kMinPathLength = 2; + trimSuffixNearNodeEdge(seed_affix_trim_len_, kMinPathLength, seed_path); + const int trimmed_prefix_len = trimPrefixNearNodeEdge(seed_affix_trim_len_, kMinPathLength, seed_path); + return extendSeedToFullAlignments(seed_path, query, seed_start_on_query + trimmed_prefix_len); + } + else + { + return {}; + } +} + +optional GappedGraphAligner::searchForAlignmentSeed(const string& query) const +{ + string upperQuery = query; + boost::to_upper(upperQuery); + + optional optional_seed; - size_t kmer_start_on_query = 0; - for (const string& kmer : kmers) + size_t kmer_start_position = 0; + while (kmer_start_position + kmer_len_ <= upperQuery.length()) { - // Initiate alignment from a unique kmer. + const string kmer = upperQuery.substr(kmer_start_position, static_cast(kmer_len_)); + + // Initiate seed construction from a unique kmer if (kmer_index_.numPaths(kmer) == 1) { Path kmer_path = kmer_index_.getPaths(kmer).front(); - removeSuffixThatOverlapsMultipleNodes(seed_affix_trim_len_, kmer_path); - const int32_t num_prefix_bases_trimmed - = removePrefixThatOverlapsMultipleNodes(seed_affix_trim_len_, kmer_path); - return extendKmerMatchToFullAlignments(kmer_path, query, kmer_start_on_query + num_prefix_bases_trimmed); + // This call updates kmer_start_position to the start of the extended path + Path extended_path = extendPathMatching(kmer_path, upperQuery, kmer_start_position); + + if (!optional_seed || extended_path.length() > optional_seed->path.length()) + { + optional_seed = AlignmentSeed(extended_path, kmer_start_position); + } + + kmer_start_position += extended_path.length(); + } + else + { + ++kmer_start_position; } - ++kmer_start_on_query; } - return {}; + return optional_seed; } -list GappedGraphAligner::extendKmerMatchToFullAlignments( - Path kmer_path, const string& query, size_t kmer_start_on_query) const +list +GappedGraphAligner::extendSeedToFullAlignments(Path seed_path, const string& query, size_t seed_start_on_query) const { - assert(kmer_path.length() > 1); + assert(seed_path.length() > 1); // Generate prefix extensions list prefix_extensions; - size_t query_prefix_len = kmer_start_on_query; + size_t query_prefix_len = seed_start_on_query; if (query_prefix_len != 0) { const string query_prefix = query.substr(0, query_prefix_len); - Path prefix_seed_path = kmer_path; - prefix_seed_path.shrinkEndBy(kmer_path.length()); + Path prefix_seed_path = seed_path; + prefix_seed_path.shrinkEndBy(seed_path.length()); prefix_extensions = extendAlignmentPrefix(prefix_seed_path, query_prefix, query_prefix_len + padding_len_); } else @@ -139,30 +168,30 @@ list GappedGraphAligner::extendKmerMatchToFullAlignments( // Because (a) empty alignments are currently disallowed and (b) we don't want to deal with an empty list of // prefix_extensions we create a 1bp prefix artificially. query_prefix_len = 1; - Path prefix_path = kmer_path; + Path prefix_path = seed_path; prefix_path.shrinkEndBy(prefix_path.length() - 1); prefix_extensions = { make_pair(prefix_path, Alignment(0, "1M")) }; - kmer_path.shrinkStartBy(1); + seed_path.shrinkStartBy(1); } // Generate suffix extensions list suffix_extensions; - size_t query_suffix_len = query.length() - kmer_path.length() - query_prefix_len; + size_t query_suffix_len = query.length() - seed_path.length() - query_prefix_len; if (query_suffix_len != 0) { - const string query_suffix = query.substr(query_prefix_len + kmer_path.length(), query_suffix_len); - Path suffix_seed_path = kmer_path; - suffix_seed_path.shrinkStartBy(kmer_path.length()); + const string query_suffix = query.substr(query_prefix_len + seed_path.length(), query_suffix_len); + Path suffix_seed_path = seed_path; + suffix_seed_path.shrinkStartBy(seed_path.length()); suffix_extensions = extendAlignmentSuffix(suffix_seed_path, query_suffix, query_suffix_len + padding_len_); } else { // Because (a) empty alignments are currently disallowed and (b) we don't want to deal with an empty list of // suffix_extensions we create a 1bp suffix artificially. - Path suffix_path = kmer_path; + Path suffix_path = seed_path; suffix_path.shrinkStartBy(suffix_path.length() - 1); suffix_extensions = { make_pair(suffix_path, Alignment(0, "1M")) }; - kmer_path.shrinkEndBy(1); + seed_path.shrinkEndBy(1); } // Merge alignments together @@ -170,19 +199,19 @@ list GappedGraphAligner::extendKmerMatchToFullAlignments( for (PathAndAlignment& prefix_path_and_alignment : prefix_extensions) { Path& prefix_path = prefix_path_and_alignment.first; - Path prefix_plus_kmer_path = concatenatePaths(prefix_path, kmer_path); + Path prefix_plus_seed_path = concatenatePaths(prefix_path, seed_path); Alignment& prefix_alignment = prefix_path_and_alignment.second; - Alignment kmer_alignment(prefix_alignment.referenceLength(), to_string(kmer_path.length()) + "M"); + Alignment kmer_alignment(prefix_alignment.referenceLength(), to_string(seed_path.length()) + "M"); Alignment prefix_plus_kmer_alignment = mergeAlignments(prefix_alignment, kmer_alignment); for (PathAndAlignment& suffix_path_and_alignment : suffix_extensions) { Path& suffix_path = suffix_path_and_alignment.first; Alignment& suffix_alignment = suffix_path_and_alignment.second; - Path full_path = concatenatePaths(prefix_plus_kmer_path, suffix_path); + Path full_path = concatenatePaths(prefix_plus_seed_path, suffix_path); - suffix_alignment.setReferenceStart(prefix_plus_kmer_path.length()); + suffix_alignment.setReferenceStart(prefix_plus_seed_path.length()); Alignment full_alignment = mergeAlignments(prefix_plus_kmer_alignment, suffix_alignment); top_paths_and_alignments.push_back(make_pair(full_path, full_alignment)); } diff --git a/thirdparty/graph-tools-master/src/graphalign/GraphAlignment.cpp b/thirdparty/graph-tools-master/src/graphalign/GraphAlignment.cpp index bee7e5d..5f0573e 100755 --- a/thirdparty/graph-tools-master/src/graphalign/GraphAlignment.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/GraphAlignment.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include #include diff --git a/thirdparty/graph-tools-master/src/graphalign/GraphAlignmentOperations.cpp b/thirdparty/graph-tools-master/src/graphalign/GraphAlignmentOperations.cpp index 7c77086..8625d34 100755 --- a/thirdparty/graph-tools-master/src/graphalign/GraphAlignmentOperations.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/GraphAlignmentOperations.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/GraphAlignmentOperations.hh" diff --git a/thirdparty/graph-tools-master/src/graphalign/KmerIndex.cpp b/thirdparty/graph-tools-master/src/graphalign/KmerIndex.cpp index d714b6f..5165084 100755 --- a/thirdparty/graph-tools-master/src/graphalign/KmerIndex.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/KmerIndex.cpp @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/KmerIndex.hh" diff --git a/thirdparty/graph-tools-master/src/graphalign/KmerIndexOperations.cpp b/thirdparty/graph-tools-master/src/graphalign/KmerIndexOperations.cpp index 56ab379..bfbccac 100755 --- a/thirdparty/graph-tools-master/src/graphalign/KmerIndexOperations.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/KmerIndexOperations.cpp @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/KmerIndexOperations.hh" diff --git a/thirdparty/graph-tools-master/src/graphalign/LinearAlignment.cpp b/thirdparty/graph-tools-master/src/graphalign/LinearAlignment.cpp index 85ac107..29ae693 100755 --- a/thirdparty/graph-tools-master/src/graphalign/LinearAlignment.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/LinearAlignment.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/LinearAlignment.hh" diff --git a/thirdparty/graph-tools-master/src/graphalign/LinearAlignmentOperations.cpp b/thirdparty/graph-tools-master/src/graphalign/LinearAlignmentOperations.cpp index 268ca0a..5f69c8c 100755 --- a/thirdparty/graph-tools-master/src/graphalign/LinearAlignmentOperations.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/LinearAlignmentOperations.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/LinearAlignmentOperations.hh" diff --git a/thirdparty/graph-tools-master/src/graphalign/Operation.cpp b/thirdparty/graph-tools-master/src/graphalign/Operation.cpp index dc79728..dca6205 100755 --- a/thirdparty/graph-tools-master/src/graphalign/Operation.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/Operation.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/Operation.hh" diff --git a/thirdparty/graph-tools-master/src/graphalign/OperationOperations.cpp b/thirdparty/graph-tools-master/src/graphalign/OperationOperations.cpp index e8c057b..f552742 100755 --- a/thirdparty/graph-tools-master/src/graphalign/OperationOperations.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/OperationOperations.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/OperationOperations.hh" @@ -120,4 +112,4 @@ OperationPair splitByReferenceLength(const Operation& operation, uint32_t prefix return std::make_pair(prefix_operation, suffix_operation); } -} \ No newline at end of file +} diff --git a/thirdparty/graph-tools-master/src/graphalign/PinnedAligner.cpp b/thirdparty/graph-tools-master/src/graphalign/PinnedAligner.cpp index 2b5912a..aa6e01c 100755 --- a/thirdparty/graph-tools-master/src/graphalign/PinnedAligner.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/PinnedAligner.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/PinnedAligner.hh" diff --git a/thirdparty/graph-tools-master/src/graphalign/TracebackMatrix.cpp b/thirdparty/graph-tools-master/src/graphalign/TracebackMatrix.cpp index 902a4bc..de8b6f7 100755 --- a/thirdparty/graph-tools-master/src/graphalign/TracebackMatrix.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/TracebackMatrix.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/TracebackMatrix.hh" diff --git a/thirdparty/graph-tools-master/src/graphalign/TracebackRunner.cpp b/thirdparty/graph-tools-master/src/graphalign/TracebackRunner.cpp index 72608d9..369fb48 100755 --- a/thirdparty/graph-tools-master/src/graphalign/TracebackRunner.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/TracebackRunner.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/TracebackRunner.hh" diff --git a/thirdparty/graph-tools-master/src/graphalign/dagAligner/PenaltyMatrix.cpp b/thirdparty/graph-tools-master/src/graphalign/dagAligner/PenaltyMatrix.cpp index b4f7387..d1c7bba 100755 --- a/thirdparty/graph-tools-master/src/graphalign/dagAligner/PenaltyMatrix.cpp +++ b/thirdparty/graph-tools-master/src/graphalign/dagAligner/PenaltyMatrix.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Roman Petrovski // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/dagAligner/PenaltyMatrix.hh" diff --git a/thirdparty/graph-tools-master/src/graphcore/Graph.cpp b/thirdparty/graph-tools-master/src/graphcore/Graph.cpp index be420bc..46c2826 100755 --- a/thirdparty/graph-tools-master/src/graphcore/Graph.cpp +++ b/thirdparty/graph-tools-master/src/graphcore/Graph.cpp @@ -1,32 +1,24 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Peter Krusche , // Felix Schlesinger // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/Graph.hh" diff --git a/thirdparty/graph-tools-master/src/graphcore/GraphBuilders.cpp b/thirdparty/graph-tools-master/src/graphcore/GraphBuilders.cpp index fc57c9f..dd31318 100755 --- a/thirdparty/graph-tools-master/src/graphcore/GraphBuilders.cpp +++ b/thirdparty/graph-tools-master/src/graphcore/GraphBuilders.cpp @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/GraphBuilders.hh" diff --git a/thirdparty/graph-tools-master/src/graphcore/GraphCoordinates.cpp b/thirdparty/graph-tools-master/src/graphcore/GraphCoordinates.cpp index 1be6684..2550eda 100755 --- a/thirdparty/graph-tools-master/src/graphcore/GraphCoordinates.cpp +++ b/thirdparty/graph-tools-master/src/graphcore/GraphCoordinates.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// this software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are -// disclaimed. in no event shall the copyright holder or contributors be liable -// for any direct, indirect, incidental, special, exemplary, or consequential -// damages (including, but not limited to, procurement of substitute goods or -// services; loss of use, data, or profits; or business interruption) however -// caused and on any theory of liability, whether in contract, strict liability, -// or tort including negligence or otherwise) arising in any way out of the use -// of this software, even if advised of the possibility of such damage. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/GraphCoordinates.hh" #include "graphutils/PairHashing.hh" @@ -234,4 +226,4 @@ NodeId GraphCoordinates::nodeId(const std::string& node_name) const * @return the graph for these coordinates */ Graph const& GraphCoordinates::getGraph() const { return *(_impl->graph); } -} \ No newline at end of file +} diff --git a/thirdparty/graph-tools-master/src/graphcore/GraphOperations.cpp b/thirdparty/graph-tools-master/src/graphcore/GraphOperations.cpp index 290945d..9504c0a 100755 --- a/thirdparty/graph-tools-master/src/graphcore/GraphOperations.cpp +++ b/thirdparty/graph-tools-master/src/graphcore/GraphOperations.cpp @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/GraphOperations.hh" diff --git a/thirdparty/graph-tools-master/src/graphcore/GraphReferenceMapping.cpp b/thirdparty/graph-tools-master/src/graphcore/GraphReferenceMapping.cpp index 3a739b4..6b4f2fa 100755 --- a/thirdparty/graph-tools-master/src/graphcore/GraphReferenceMapping.cpp +++ b/thirdparty/graph-tools-master/src/graphcore/GraphReferenceMapping.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/GraphReferenceMapping.hh" diff --git a/thirdparty/graph-tools-master/src/graphcore/Path.cpp b/thirdparty/graph-tools-master/src/graphcore/Path.cpp index a5fb9cd..ede694a 100755 --- a/thirdparty/graph-tools-master/src/graphcore/Path.cpp +++ b/thirdparty/graph-tools-master/src/graphcore/Path.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/Path.hh" diff --git a/thirdparty/graph-tools-master/src/graphcore/PathFamily.cpp b/thirdparty/graph-tools-master/src/graphcore/PathFamily.cpp index fac6c7b..a3a8bfd 100755 --- a/thirdparty/graph-tools-master/src/graphcore/PathFamily.cpp +++ b/thirdparty/graph-tools-master/src/graphcore/PathFamily.cpp @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger , // Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/PathFamily.hh" diff --git a/thirdparty/graph-tools-master/src/graphcore/PathFamilyOperations.cpp b/thirdparty/graph-tools-master/src/graphcore/PathFamilyOperations.cpp index f738079..f3a75af 100755 --- a/thirdparty/graph-tools-master/src/graphcore/PathFamilyOperations.cpp +++ b/thirdparty/graph-tools-master/src/graphcore/PathFamilyOperations.cpp @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger , // Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/Path.hh" #include "graphcore/PathFamily.hh" diff --git a/thirdparty/graph-tools-master/src/graphcore/PathOperations.cpp b/thirdparty/graph-tools-master/src/graphcore/PathOperations.cpp index 75f7ab4..29a6e53 100755 --- a/thirdparty/graph-tools-master/src/graphcore/PathOperations.cpp +++ b/thirdparty/graph-tools-master/src/graphcore/PathOperations.cpp @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/PathOperations.hh" @@ -36,6 +28,8 @@ #include #include +#include "graphutils/BaseMatching.hh" + using std::list; using std::set; using std::string; @@ -134,7 +128,7 @@ Path extendPathEndMatching(Path path, const std::string& query, size_t qpos) const std::string& node_sequence = graph.nodeSeq(node_in_graph); while (pos_in_query < query.size() && pos_in_node < node_sequence.size() - && query.at(pos_in_query) == node_sequence.at(pos_in_node)) + && checkIfReferenceBaseMatchesQueryBase(node_sequence.at(pos_in_node), query.at(pos_in_query))) { moved = true; ++pos_in_node; @@ -160,7 +154,8 @@ Path extendPathEndMatching(Path path, const std::string& query, size_t qpos) size_t pos_in_successor = 0; const std::string& successor_sequence = graph.nodeSeq(successor); while (pos_in_successor < successor_min_size && pos_in_query + pos_in_successor < query.size() - && successor_sequence.at(pos_in_successor) == query[pos_in_query + pos_in_successor]) + && checkIfReferenceBaseMatchesQueryBase( + successor_sequence.at(pos_in_successor), query[pos_in_query + pos_in_successor])) { ++pos_in_successor; } @@ -207,7 +202,8 @@ Path extendPathStartMatching(Path path, const std::string& query, size_t& pos_in const std::string& node_sequence = graph.nodeSeq(node_in_graph); - while (pos_in_query > 0 && pos_in_node > 0 && query.at(pos_in_query - 1) == node_sequence.at(pos_in_node - 1)) + while (pos_in_query > 0 && pos_in_node > 0 + && checkIfReferenceBaseMatchesQueryBase(node_sequence.at(pos_in_node - 1), query.at(pos_in_query - 1))) { moved = true; --pos_in_node; @@ -234,7 +230,8 @@ Path extendPathStartMatching(Path path, const std::string& query, size_t& pos_in size_t match_length = 0; while (pos_in_predecessor > (predecessor_sequence.size() - predecessor_min_size) && pos_in_query - match_length > 0 - && predecessor_sequence.at(pos_in_predecessor - 1) == query[pos_in_query - match_length - 1]) + && checkIfReferenceBaseMatchesQueryBase( + predecessor_sequence.at(pos_in_predecessor - 1), query[pos_in_query - match_length - 1])) { --pos_in_predecessor; ++match_length; diff --git a/thirdparty/graph-tools-master/src/graphio/AlignmentWriter.cpp b/thirdparty/graph-tools-master/src/graphio/AlignmentWriter.cpp index 70331c9..7980aa1 100755 --- a/thirdparty/graph-tools-master/src/graphio/AlignmentWriter.cpp +++ b/thirdparty/graph-tools-master/src/graphio/AlignmentWriter.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphio/AlignmentWriter.hh" diff --git a/thirdparty/graph-tools-master/src/graphio/GraphJson.cpp b/thirdparty/graph-tools-master/src/graphio/GraphJson.cpp index c4b0aa5..4a5208f 100755 --- a/thirdparty/graph-tools-master/src/graphio/GraphJson.cpp +++ b/thirdparty/graph-tools-master/src/graphio/GraphJson.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphio/GraphJson.hh" @@ -154,4 +146,4 @@ GraphReferenceMapping parseReferenceMapping(Json const& jRefmap, Graph const& gr } return refmap; } -} \ No newline at end of file +} diff --git a/thirdparty/graph-tools-master/src/graphutils/DepthTest.cpp b/thirdparty/graph-tools-master/src/graphutils/DepthTest.cpp index 4d232a0..dd17882 100755 --- a/thirdparty/graph-tools-master/src/graphutils/DepthTest.cpp +++ b/thirdparty/graph-tools-master/src/graphutils/DepthTest.cpp @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Sai Chen , // Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphutils/DepthTest.hh" diff --git a/thirdparty/graph-tools-master/src/graphutils/IntervalBuffer.cpp b/thirdparty/graph-tools-master/src/graphutils/IntervalBuffer.cpp index d2b9b94..250cbd6 100755 --- a/thirdparty/graph-tools-master/src/graphutils/IntervalBuffer.cpp +++ b/thirdparty/graph-tools-master/src/graphutils/IntervalBuffer.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphutils/IntervalBuffer.hh" #include "graphutils/IntervalList.hh" diff --git a/thirdparty/graph-tools-master/src/graphutils/SequenceOperations.cpp b/thirdparty/graph-tools-master/src/graphutils/SequenceOperations.cpp index 136369a..04608b7 100755 --- a/thirdparty/graph-tools-master/src/graphutils/SequenceOperations.cpp +++ b/thirdparty/graph-tools-master/src/graphutils/SequenceOperations.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphutils/SequenceOperations.hh" diff --git a/thirdparty/graph-tools-master/tests/BaseMatchingTest.cpp b/thirdparty/graph-tools-master/tests/BaseMatchingTest.cpp index 4806dee..066dc16 100755 --- a/thirdparty/graph-tools-master/tests/BaseMatchingTest.cpp +++ b/thirdparty/graph-tools-master/tests/BaseMatchingTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphutils/BaseMatching.hh" diff --git a/thirdparty/graph-tools-master/tests/DagAlignerTest.cpp b/thirdparty/graph-tools-master/tests/DagAlignerTest.cpp index 199a731..d23223b 100755 --- a/thirdparty/graph-tools-master/tests/DagAlignerTest.cpp +++ b/thirdparty/graph-tools-master/tests/DagAlignerTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Roman Petrovski // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/DagAlignerAffine.hh" diff --git a/thirdparty/graph-tools-master/tests/DepthTestTest.cpp b/thirdparty/graph-tools-master/tests/DepthTestTest.cpp index 932682d..add5680 100755 --- a/thirdparty/graph-tools-master/tests/DepthTestTest.cpp +++ b/thirdparty/graph-tools-master/tests/DepthTestTest.cpp @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Sai Chen , // Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphutils/DepthTest.hh" diff --git a/thirdparty/graph-tools-master/tests/GaplessAlignerTest.cpp b/thirdparty/graph-tools-master/tests/GaplessAlignerTest.cpp index 9fa4e09..129a90f 100755 --- a/thirdparty/graph-tools-master/tests/GaplessAlignerTest.cpp +++ b/thirdparty/graph-tools-master/tests/GaplessAlignerTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/GaplessAligner.hh" #include "graphalign/GraphAlignmentOperations.hh" diff --git a/thirdparty/graph-tools-master/tests/GappedAlignerTest.cpp b/thirdparty/graph-tools-master/tests/GappedAlignerTest.cpp index 9b82b4f..048e51c 100755 --- a/thirdparty/graph-tools-master/tests/GappedAlignerTest.cpp +++ b/thirdparty/graph-tools-master/tests/GappedAlignerTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/GappedAligner.hh" diff --git a/thirdparty/graph-tools-master/tests/GraphAlignmentOperationsTest.cpp b/thirdparty/graph-tools-master/tests/GraphAlignmentOperationsTest.cpp index 8f23161..7f10150 100755 --- a/thirdparty/graph-tools-master/tests/GraphAlignmentOperationsTest.cpp +++ b/thirdparty/graph-tools-master/tests/GraphAlignmentOperationsTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/GraphAlignmentOperations.hh" diff --git a/thirdparty/graph-tools-master/tests/GraphAlignmentTest.cpp b/thirdparty/graph-tools-master/tests/GraphAlignmentTest.cpp index a5771c9..14aa897 100755 --- a/thirdparty/graph-tools-master/tests/GraphAlignmentTest.cpp +++ b/thirdparty/graph-tools-master/tests/GraphAlignmentTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/GraphAlignment.hh" diff --git a/thirdparty/graph-tools-master/tests/GraphBuildersTest.cpp b/thirdparty/graph-tools-master/tests/GraphBuildersTest.cpp index 7312898..36c1eab 100755 --- a/thirdparty/graph-tools-master/tests/GraphBuildersTest.cpp +++ b/thirdparty/graph-tools-master/tests/GraphBuildersTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/GraphBuilders.hh" diff --git a/thirdparty/graph-tools-master/tests/GraphCoordinatesTest.cpp b/thirdparty/graph-tools-master/tests/GraphCoordinatesTest.cpp index 4e703d2..d1cb592 100755 --- a/thirdparty/graph-tools-master/tests/GraphCoordinatesTest.cpp +++ b/thirdparty/graph-tools-master/tests/GraphCoordinatesTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/GraphCoordinates.hh" diff --git a/thirdparty/graph-tools-master/tests/GraphJsonTest.cpp b/thirdparty/graph-tools-master/tests/GraphJsonTest.cpp index 6348160..387d3da 100755 --- a/thirdparty/graph-tools-master/tests/GraphJsonTest.cpp +++ b/thirdparty/graph-tools-master/tests/GraphJsonTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include diff --git a/thirdparty/graph-tools-master/tests/GraphOperationsTest.cpp b/thirdparty/graph-tools-master/tests/GraphOperationsTest.cpp index d709e98..c8cec14 100755 --- a/thirdparty/graph-tools-master/tests/GraphOperationsTest.cpp +++ b/thirdparty/graph-tools-master/tests/GraphOperationsTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/GraphOperations.hh" #include "graphcore/Graph.hh" diff --git a/thirdparty/graph-tools-master/tests/GraphReferenceMappingTest.cpp b/thirdparty/graph-tools-master/tests/GraphReferenceMappingTest.cpp index 76ac801..9cd113e 100755 --- a/thirdparty/graph-tools-master/tests/GraphReferenceMappingTest.cpp +++ b/thirdparty/graph-tools-master/tests/GraphReferenceMappingTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/GraphReferenceMapping.hh" #include "graphcore/GraphBuilders.hh" diff --git a/thirdparty/graph-tools-master/tests/GraphTest.cpp b/thirdparty/graph-tools-master/tests/GraphTest.cpp index c293c91..680dc01 100755 --- a/thirdparty/graph-tools-master/tests/GraphTest.cpp +++ b/thirdparty/graph-tools-master/tests/GraphTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/Graph.hh" diff --git a/thirdparty/graph-tools-master/tests/IntervalBufferTest.cpp b/thirdparty/graph-tools-master/tests/IntervalBufferTest.cpp index 98242fe..62f9026 100755 --- a/thirdparty/graph-tools-master/tests/IntervalBufferTest.cpp +++ b/thirdparty/graph-tools-master/tests/IntervalBufferTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphutils/IntervalBuffer.hh" #include "gtest/gtest.h" diff --git a/thirdparty/graph-tools-master/tests/IntervalListTest.cpp b/thirdparty/graph-tools-master/tests/IntervalListTest.cpp index 921e85a..30e7d6e 100755 --- a/thirdparty/graph-tools-master/tests/IntervalListTest.cpp +++ b/thirdparty/graph-tools-master/tests/IntervalListTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphutils/IntervalList.hh" #include "gtest/gtest.h" diff --git a/thirdparty/graph-tools-master/tests/KmerIndexOperationsTest.cpp b/thirdparty/graph-tools-master/tests/KmerIndexOperationsTest.cpp index 4bcbfae..3380192 100755 --- a/thirdparty/graph-tools-master/tests/KmerIndexOperationsTest.cpp +++ b/thirdparty/graph-tools-master/tests/KmerIndexOperationsTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/KmerIndexOperations.hh" diff --git a/thirdparty/graph-tools-master/tests/KmerIndexTest.cpp b/thirdparty/graph-tools-master/tests/KmerIndexTest.cpp index 2f24920..c978619 100755 --- a/thirdparty/graph-tools-master/tests/KmerIndexTest.cpp +++ b/thirdparty/graph-tools-master/tests/KmerIndexTest.cpp @@ -1,31 +1,23 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko , // Peter Krusche // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/KmerIndex.hh" diff --git a/thirdparty/graph-tools-master/tests/LinearAlignmentOperationsTest.cpp b/thirdparty/graph-tools-master/tests/LinearAlignmentOperationsTest.cpp index 5deef1e..c1d71c4 100755 --- a/thirdparty/graph-tools-master/tests/LinearAlignmentOperationsTest.cpp +++ b/thirdparty/graph-tools-master/tests/LinearAlignmentOperationsTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/LinearAlignmentOperations.hh" diff --git a/thirdparty/graph-tools-master/tests/LinearAlignmentTest.cpp b/thirdparty/graph-tools-master/tests/LinearAlignmentTest.cpp index 1c17060..f576efc 100755 --- a/thirdparty/graph-tools-master/tests/LinearAlignmentTest.cpp +++ b/thirdparty/graph-tools-master/tests/LinearAlignmentTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/LinearAlignment.hh" diff --git a/thirdparty/graph-tools-master/tests/OperationOperationsTest.cpp b/thirdparty/graph-tools-master/tests/OperationOperationsTest.cpp index 894cc61..e84bc7d 100755 --- a/thirdparty/graph-tools-master/tests/OperationOperationsTest.cpp +++ b/thirdparty/graph-tools-master/tests/OperationOperationsTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/OperationOperations.hh" diff --git a/thirdparty/graph-tools-master/tests/OperationTest.cpp b/thirdparty/graph-tools-master/tests/OperationTest.cpp index 40c346e..0e7c58e 100755 --- a/thirdparty/graph-tools-master/tests/OperationTest.cpp +++ b/thirdparty/graph-tools-master/tests/OperationTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/Operation.hh" diff --git a/thirdparty/graph-tools-master/tests/PathFamilyOperationsTest.cpp b/thirdparty/graph-tools-master/tests/PathFamilyOperationsTest.cpp index d7ff7f4..d6c5d87 100755 --- a/thirdparty/graph-tools-master/tests/PathFamilyOperationsTest.cpp +++ b/thirdparty/graph-tools-master/tests/PathFamilyOperationsTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "gtest/gtest.h" diff --git a/thirdparty/graph-tools-master/tests/PathFamilyTest.cpp b/thirdparty/graph-tools-master/tests/PathFamilyTest.cpp index 90a7ffd..00019ce 100755 --- a/thirdparty/graph-tools-master/tests/PathFamilyTest.cpp +++ b/thirdparty/graph-tools-master/tests/PathFamilyTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Felix Schlesinger // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "gtest/gtest.h" @@ -139,4 +131,4 @@ TEST(Compare, AddingEdges_Includes) fam1.addEdge(0, 2); ASSERT_TRUE(fam1.includes(fam2)); ASSERT_FALSE(fam2.includes(fam1)); -} \ No newline at end of file +} diff --git a/thirdparty/graph-tools-master/tests/PathOperationsTest.cpp b/thirdparty/graph-tools-master/tests/PathOperationsTest.cpp index 52387df..9e81801 100755 --- a/thirdparty/graph-tools-master/tests/PathOperationsTest.cpp +++ b/thirdparty/graph-tools-master/tests/PathOperationsTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/PathOperations.hh" diff --git a/thirdparty/graph-tools-master/tests/PathTest.cpp b/thirdparty/graph-tools-master/tests/PathTest.cpp index 7f4c2b0..dd5e667 100755 --- a/thirdparty/graph-tools-master/tests/PathTest.cpp +++ b/thirdparty/graph-tools-master/tests/PathTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphcore/Path.hh" diff --git a/thirdparty/graph-tools-master/tests/PinnedAlignerTest.cpp b/thirdparty/graph-tools-master/tests/PinnedAlignerTest.cpp index e501bc5..d02fd51 100755 --- a/thirdparty/graph-tools-master/tests/PinnedAlignerTest.cpp +++ b/thirdparty/graph-tools-master/tests/PinnedAlignerTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/PinnedAligner.hh" diff --git a/thirdparty/graph-tools-master/tests/PinnedDagAlignerTest.cpp b/thirdparty/graph-tools-master/tests/PinnedDagAlignerTest.cpp index 1ea7c05..ef7699f 100755 --- a/thirdparty/graph-tools-master/tests/PinnedDagAlignerTest.cpp +++ b/thirdparty/graph-tools-master/tests/PinnedDagAlignerTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Roman Petrovski // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include #include diff --git a/thirdparty/graph-tools-master/tests/SequenceOperationsTest.cpp b/thirdparty/graph-tools-master/tests/SequenceOperationsTest.cpp index 71d86ea..af76f1f 100755 --- a/thirdparty/graph-tools-master/tests/SequenceOperationsTest.cpp +++ b/thirdparty/graph-tools-master/tests/SequenceOperationsTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphutils/SequenceOperations.hh" diff --git a/thirdparty/graph-tools-master/tests/TracebackMatrixTest.cpp b/thirdparty/graph-tools-master/tests/TracebackMatrixTest.cpp index 8d2876c..440a050 100755 --- a/thirdparty/graph-tools-master/tests/TracebackMatrixTest.cpp +++ b/thirdparty/graph-tools-master/tests/TracebackMatrixTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/TracebackMatrix.hh" diff --git a/thirdparty/graph-tools-master/tests/TracebackRunnerTest.cpp b/thirdparty/graph-tools-master/tests/TracebackRunnerTest.cpp index 68bb089..cd1d8e3 100755 --- a/thirdparty/graph-tools-master/tests/TracebackRunnerTest.cpp +++ b/thirdparty/graph-tools-master/tests/TracebackRunnerTest.cpp @@ -1,30 +1,22 @@ // // GraphTools library -// Copyright (c) 2018 Illumina, Inc. +// Copyright 2017-2019 Illumina, Inc. // All rights reserved. // // Author: Egor Dolzhenko // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: - -// 1. Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. - -// 2. Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. - -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// #include "graphalign/TracebackRunner.hh" diff --git a/variant_catalog/variant_catalog_grch37.json b/variant_catalog/variant_catalog_grch37.json index 015fe70..2d20125 100755 --- a/variant_catalog/variant_catalog_grch37.json +++ b/variant_catalog/variant_catalog_grch37.json @@ -50,8 +50,19 @@ { "VariantType": "Repeat", "LocusId": "ATXN7", - "LocusStructure": "(GCA)*", - "ReferenceRegion": "3:63898360-63898390" + "LocusStructure": "(GCA)*(GCC)+", + "ReferenceRegion": [ + "3:63898360-63898390", + "3:63898390-63898402" + ], + "VariantType": [ + "Repeat", + "Repeat" + ], + "VariantId": [ + "ATXN7", + "ATXN7_GCC" + ] }, { "LocusId": "ATXN8OS", @@ -63,6 +74,10 @@ "VariantType": [ "Repeat", "Repeat" + ], + "VariantId": [ + "ATXN8OS_CTA", + "ATXN8OS" ] }, { @@ -71,36 +86,36 @@ "LocusStructure": "(GGCCCC)*", "ReferenceRegion": "9:27573526-27573544", "OfftargetRegions": [ - "1:150552238-150552273", - "11:910821-910969", - "11:2905960-2906190", - "11:44748502-44748739", - "12:54476278-54476439", - "12:128751638-128751649", - "13:107569867-107570000", - "16:819162-819226", - "16:49526377-49526380", - "18:74203223-74203243", - "19:878803-878954", - "19:39897404-39897410", - "2:240659782-240660010", - "20:388475-388656", - "20:60640211-60640346", - "22:51066608-51066626", - "3:49591993-49592173", - "3:50161662-50161732", - "5:10761494-10761495", - "5:176797951-176798133", - "6:33601522-33601525", - "6:109804703-109804748", - "9:132331488-132331496", - "9:132428311-132428437", - "X:9754276-9754424", - "X:49644488-49644585", - "X:53652706-53652891", - "X:153569931-153569996", - "X:153618748-153618918" - ] + "1:150552238-150552273", + "11:910821-910969", + "11:2905960-2906190", + "11:44748502-44748739", + "12:54476278-54476439", + "12:128751638-128751649", + "13:107569867-107570000", + "16:819162-819226", + "16:49526377-49526380", + "18:74203223-74203243", + "19:878803-878954", + "19:39897404-39897410", + "2:240659782-240660010", + "20:388475-388656", + "20:60640211-60640346", + "22:51066608-51066626", + "3:49591993-49592173", + "3:50161662-50161732", + "5:10761494-10761495", + "5:176797951-176798133", + "6:33601522-33601525", + "6:109804703-109804748", + "9:132331488-132331496", + "9:132428311-132428437", + "X:9754276-9754424", + "X:49644488-49644585", + "X:53652706-53652891", + "X:153569931-153569996", + "X:153618748-153618918" + ] }, { "VariantType": "Repeat", @@ -126,6 +141,11 @@ "Repeat", "Repeat", "Repeat" + ], + "VariantId": [ + "CNBP", + "CNBP_CAGA", + "CNBP_CA" ] }, { @@ -184,6 +204,10 @@ "VariantType": [ "Repeat", "Repeat" + ], + "VariantId": [ + "FXN_A", + "FXN" ] }, { @@ -196,6 +220,10 @@ "VariantType": [ "Repeat", "Repeat" + ], + "VariantId": [ + "HTT", + "HTT_CCG" ] }, { @@ -205,10 +233,20 @@ "ReferenceRegion": "16:87637893-87637935" }, { - "VariantType": "Repeat", "LocusId": "NOP56", - "LocusStructure": "(GGCCTG)*", - "ReferenceRegion": "20:2633379-2633403" + "LocusStructure": "(GGCCTG)*(CGCCTG)*", + "ReferenceRegion": [ + "20:2633379-2633403", + "20:2633403-2633421" + ], + "VariantType": [ + "Repeat", + "Repeat" + ], + "VariantId": [ + "NOP56", + "NOP56_CGCCTG" + ] }, { "VariantType": "Repeat", @@ -228,4 +266,4 @@ "LocusStructure": "(CAG)*", "ReferenceRegion": "18:53253386-53253458" } -] +] \ No newline at end of file diff --git a/variant_catalog/variant_catalog_grch38.json b/variant_catalog/variant_catalog_grch38.json index 1dcc263..3870fc4 100644 --- a/variant_catalog/variant_catalog_grch38.json +++ b/variant_catalog/variant_catalog_grch38.json @@ -49,9 +49,19 @@ }, { "LocusId": "ATXN7", - "LocusStructure": "(GCA)*", - "ReferenceRegion": "3:63912684-63912714", - "VariantType": "Repeat" + "LocusStructure": "(GCA)*(GCC)+", + "ReferenceRegion": [ + "3:63912684-63912714", + "3:63912714-63912726" + ], + "VariantId": [ + "ATXN7", + "ATXN7_GCC" + ], + "VariantType": [ + "Repeat", + "Repeat" + ] }, { "LocusId": "ATXN8OS", @@ -60,6 +70,10 @@ "13:70139353-70139383", "13:70139383-70139428" ], + "VariantId": [ + "ATXN8OS_CTA", + "ATXN8OS" + ], "VariantType": [ "Repeat", "Repeat" @@ -168,6 +182,11 @@ "3:129172656-129172696", "3:129172696-129172732" ], + "VariantId": [ + "CNBP", + "CNBP_CAGA", + "CNBP_CA" + ], "VariantType": [ "Repeat", "Repeat", @@ -421,6 +440,10 @@ "9:69037261-69037286", "9:69037286-69037304" ], + "VariantId": [ + "FXN_A", + "FXN" + ], "VariantType": [ "Repeat", "Repeat" @@ -433,6 +456,10 @@ "4:3074876-3074933", "4:3074939-3074966" ], + "VariantId": [ + "HTT", + "HTT_CCG" + ], "VariantType": [ "Repeat", "Repeat" @@ -446,9 +473,19 @@ }, { "LocusId": "NOP56", - "LocusStructure": "(GGCCTG)*", - "ReferenceRegion": "20:2652733-2652757", - "VariantType": "Repeat" + "LocusStructure": "(GGCCTG)*(CGCCTG)*", + "ReferenceRegion": [ + "20:2652733-2652757", + "20:2652757-2652775" + ], + "VariantId": [ + "NOP56", + "NOP56_CGCCTG" + ], + "VariantType": [ + "Repeat", + "Repeat" + ] }, { "LocusId": "PPP2R2B", diff --git a/variant_catalog/variant_catalog_hg19.json b/variant_catalog/variant_catalog_hg19.json index fc63975..439c8f5 100755 --- a/variant_catalog/variant_catalog_hg19.json +++ b/variant_catalog/variant_catalog_hg19.json @@ -50,8 +50,19 @@ { "VariantType": "Repeat", "LocusId": "ATXN7", - "LocusStructure": "(GCA)*", - "ReferenceRegion": "chr3:63898360-63898390" + "LocusStructure": "(GCA)*(GCC)+", + "ReferenceRegion": [ + "chr3:63898360-63898390", + "chr3:63898390-63898402" + ], + "VariantType": [ + "Repeat", + "Repeat" + ], + "VariantId": [ + "ATXN7", + "ATXN7_GCC" + ] }, { "LocusId": "ATXN8OS", @@ -63,6 +74,10 @@ "VariantType": [ "Repeat", "Repeat" + ], + "VariantId": [ + "ATXN8OS_CTA", + "ATXN8OS" ] }, { @@ -71,36 +86,36 @@ "LocusStructure": "(GGCCCC)*", "ReferenceRegion": "chr9:27573526-27573544", "OfftargetRegions": [ - "chr1:150552238-150552273", - "chr11:910821-910969", - "chr11:2905960-2906190", - "chr11:44748502-44748739", - "chr12:54476278-54476439", - "chr12:128751638-128751649", - "chr13:107569867-107570000", - "chr16:819162-819226", - "chr16:49526377-49526380", - "chr18:74203223-74203243", - "chr19:878803-878954", - "chr19:39897404-39897410", - "chr2:240659782-240660010", - "chr20:388475-388656", - "chr20:60640211-60640346", - "chr22:51066608-51066626", - "chr3:49591993-49592173", - "chr3:50161662-50161732", - "chr5:10761494-10761495", - "chr5:176797951-176798133", - "chr6:33601522-33601525", - "chr6:109804703-109804748", - "chr9:132331488-132331496", - "chr9:132428311-132428437", - "chrX:9754276-9754424", - "chrX:49644488-49644585", - "chrX:53652706-53652891", - "chrX:153569931-153569996", - "chrX:153618748-153618918" - ] + "chr1:150552238-150552273", + "chr11:910821-910969", + "chr11:2905960-2906190", + "chr11:44748502-44748739", + "chr12:54476278-54476439", + "chr12:128751638-128751649", + "chr13:107569867-107570000", + "chr16:819162-819226", + "chr16:49526377-49526380", + "chr18:74203223-74203243", + "chr19:878803-878954", + "chr19:39897404-39897410", + "chr2:240659782-240660010", + "chr20:388475-388656", + "chr20:60640211-60640346", + "chr22:51066608-51066626", + "chr3:49591993-49592173", + "chr3:50161662-50161732", + "chr5:10761494-10761495", + "chr5:176797951-176798133", + "chr6:33601522-33601525", + "chr6:109804703-109804748", + "chr9:132331488-132331496", + "chr9:132428311-132428437", + "chrX:9754276-9754424", + "chrX:49644488-49644585", + "chrX:53652706-53652891", + "chrX:153569931-153569996", + "chrX:153618748-153618918" + ] }, { "VariantType": "Repeat", @@ -126,6 +141,11 @@ "Repeat", "Repeat", "Repeat" + ], + "VariantId": [ + "CNBP", + "CNBP_CAGA", + "CNBP_CA" ] }, { @@ -184,6 +204,10 @@ "VariantType": [ "Repeat", "Repeat" + ], + "VariantId": [ + "FXN_A", + "FXN" ] }, { @@ -196,6 +220,10 @@ "VariantType": [ "Repeat", "Repeat" + ], + "VariantId": [ + "HTT", + "HTT_CCG" ] }, { @@ -205,10 +233,20 @@ "ReferenceRegion": "chr16:87637893-87637935" }, { - "VariantType": "Repeat", "LocusId": "NOP56", - "LocusStructure": "(GGCCTG)*", - "ReferenceRegion": "chr20:2633379-2633403" + "LocusStructure": "(GGCCTG)*(CGCCTG)*", + "ReferenceRegion": [ + "chr20:2633379-2633403", + "chr20:2633403-2633421" + ], + "VariantType": [ + "Repeat", + "Repeat" + ], + "VariantId": [ + "NOP56", + "NOP56_CGCCTG" + ] }, { "VariantType": "Repeat", @@ -228,4 +266,4 @@ "LocusStructure": "(CAG)*", "ReferenceRegion": "chr18:53253386-53253458" } -] +] \ No newline at end of file diff --git a/variant_catalog/variant_catalog_hg38.json b/variant_catalog/variant_catalog_hg38.json index 65032cf..05a5cbe 100644 --- a/variant_catalog/variant_catalog_hg38.json +++ b/variant_catalog/variant_catalog_hg38.json @@ -49,9 +49,19 @@ }, { "LocusId": "ATXN7", - "LocusStructure": "(GCA)*", - "ReferenceRegion": "chr3:63912684-63912714", - "VariantType": "Repeat" + "LocusStructure": "(GCA)*(GCC)+", + "ReferenceRegion": [ + "chr3:63912684-63912714", + "chr3:63912714-63912726" + ], + "VariantId": [ + "ATXN7", + "ATXN7_GCC" + ], + "VariantType": [ + "Repeat", + "Repeat" + ] }, { "LocusId": "ATXN8OS", @@ -60,6 +70,10 @@ "chr13:70139353-70139383", "chr13:70139383-70139428" ], + "VariantId": [ + "ATXN8OS_CTA", + "ATXN8OS" + ], "VariantType": [ "Repeat", "Repeat" @@ -168,6 +182,11 @@ "chr3:129172656-129172696", "chr3:129172696-129172732" ], + "VariantId": [ + "CNBP", + "CNBP_CAGA", + "CNBP_CA" + ], "VariantType": [ "Repeat", "Repeat", @@ -421,6 +440,10 @@ "chr9:69037261-69037286", "chr9:69037286-69037304" ], + "VariantId": [ + "FXN_A", + "FXN" + ], "VariantType": [ "Repeat", "Repeat" @@ -433,6 +456,10 @@ "chr4:3074876-3074933", "chr4:3074939-3074966" ], + "VariantId": [ + "HTT", + "HTT_CCG" + ], "VariantType": [ "Repeat", "Repeat" @@ -446,9 +473,19 @@ }, { "LocusId": "NOP56", - "LocusStructure": "(GGCCTG)*", - "ReferenceRegion": "chr20:2652733-2652757", - "VariantType": "Repeat" + "LocusStructure": "(GGCCTG)*(CGCCTG)*", + "ReferenceRegion": [ + "chr20:2652733-2652757", + "chr20:2652757-2652775" + ], + "VariantId": [ + "NOP56", + "NOP56_CGCCTG" + ], + "VariantType": [ + "Repeat", + "Repeat" + ] }, { "LocusId": "PPP2R2B",