SciCodePile/SciCode-Domain-Code
DATA1: Domain-Specific Code Dataset Dataset Overview DATA1 is a large-scale domain-specific code dataset focusing on code samples from interdisciplinary fields such as biology, chemistry, materials science, and related areas. The dataset is collected and organized from GitHub repositories, covering 178 different domain topics with over 1.1 billion lines of code. Dataset Statistics Total Datasets: 178 CSV files Total Data Size: ~115 GB Total Lines… See the full description on the dataset page: https://huggingface.co/datasets/SciCodePile/SciCode-Domain-Code.
42.4k
1"keyword","repo_name","file_path","file_extension","file_size","line_count","content","language"
2"In Silico","GGFHF/ddRADseqTools","CHANGELOG.md",".md","1482","43","CURRENT VERSION: 0.453 4********************************************************************************5 6Changes of v 0.44 to v 0.45 (February 2018)7 8* Review of parameter values when the mutation function is called in rsitesearch.py.9 10* Processing of verbose and trace options of simcasavaids.py.11 12********************************************************************************13 14Changes of v 0.43 to v 0.44 (January 2018)15 16* Enzymes with ambiguous restriction sites can be used.17 18* Parameters enzyme1 and enzyme2 can be equal in rsiteseach.py (in this case,19 it simulates a digestion with only one enzyme).20 21* simcasavaids.py is a new tool which fixes sequence identifiers of a FASTQ read22 file generated by ddRADseqTools to compatible format with CASAVA.23 24* Several minor improvements.25 26********************************************************************************27 28Changes of v 0.42 to v 0.43 (October 2017)29 30* Parameters enzyme1 and enzyme2 can be an identifier or a restriction site31 sequence, independently of each other.32 33********************************************************************************34 35Changes of v 0.40 to v 0.42 (July 2017)36 37* Fixed a bug in the algorithm to mutate sequences that occurs when there is38 more than one SNP or indel.39 40* Added new options in the programs to control the printing of verbose and41 development info, and the making of statistical graphics.42 43We thank to the professor Alex Buerkle his comments to improve ddRADseqTools.44","Markdown"
45"In Silico","GGFHF/ddRADseqTools","LICENSE.md",".md","35142","675"," GNU GENERAL PUBLIC LICENSE46 Version 3, 29 June 200747 48 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>49 Everyone is permitted to copy and distribute verbatim copies50 of this license document, but changing it is not allowed.51 52 Preamble 53 54 The GNU General Public License is a free, copyleft license for55software and other kinds of works.56 57 The licenses for most software and other practical works are designed58to take away your freedom to share and change the works. By contrast,59the GNU General Public License is intended to guarantee your freedom to60share and change all versions of a program--to make sure it remains free61software for all its users. We, the Free Software Foundation, use the62GNU General Public License for most of our software; it applies also to63any other work released this way by its authors. You can apply it to64your programs, too.65 66 When we speak of free software, we are referring to freedom, not67price. Our General Public Licenses are designed to make sure that you68have the freedom to distribute copies of free software (and charge for69them if you wish), that you receive source code or can get it if you70want it, that you can change the software or use pieces of it in new71free programs, and that you know you can do these things.72 73 To protect your rights, we need to prevent others from denying you74these rights or asking you to surrender the rights. Therefore, you have75certain responsibilities if you distribute copies of the software, or if76you modify it: responsibilities to respect the freedom of others.77 78 For example, if you distribute copies of such a program, whether79gratis or for a fee, you must pass on to the recipients the same80freedoms that you received. You must make sure that they, too, receive81or can get the source code. And you must show them these terms so they82know their rights.83 84 Developers that use the GNU GPL protect your rights with two steps:85(1) assert copyright on the software, and (2) offer you this License86giving you legal permission to copy, distribute and/or modify it.87 88 For the developers' and authors' protection, the GPL clearly explains89that there is no warranty for this free software. For both users' and90authors' sake, the GPL requires that modified versions be marked as91changed, so that their problems will not be attributed erroneously to92authors of previous versions.93 94 Some devices are designed to deny users access to install or run95modified versions of the software inside them, although the manufacturer96can do so. This is fundamentally incompatible with the aim of97protecting users' freedom to change the software. The systematic98pattern of such abuse occurs in the area of products for individuals to99use, which is precisely where it is most unacceptable. Therefore, we100have designed this version of the GPL to prohibit the practice for those101products. If such problems arise substantially in other domains, we102stand ready to extend this provision to those domains in future versions103of the GPL, as needed to protect the freedom of users.104 105 Finally, every program is threatened constantly by software patents.106States should not allow patents to restrict development and use of107software on general-purpose computers, but in those that do, we wish to108avoid the special danger that patents applied to a free program could109make it effectively proprietary. To prevent this, the GPL assures that110patents cannot be used to render the program non-free.111 112 The precise terms and conditions for copying, distribution and113modification follow.114 115 TERMS AND CONDITIONS116 117 0. Definitions.118 119 ""This License"" refers to version 3 of the GNU General Public License.120 121 ""Copyright"" also means copyright-like laws that apply to other kinds of122works, such as semiconductor masks.123 124 ""The Program"" refers to any copyrightable work licensed under this125License. Each licensee is addressed as ""you"". ""Licensees"" and126""recipients"" may be individuals or organizations.127 128 To ""modify"" a work means to copy from or adapt all or part of the work129in a fashion requiring copyright permission, other than the making of an130exact copy. The resulting work is called a ""modified version"" of the131earlier work or a work ""based on"" the earlier work.132 133 A ""covered work"" means either the unmodified Program or a work based134on the Program.135 136 To ""propagate"" a work means to do anything with it that, without137permission, would make you directly or secondarily liable for138infringement under applicable copyright law, except executing it on a139computer or modifying a private copy. Propagation includes copying,140distribution (with or without modification), making available to the141public, and in some countries other activities as well.142 143 To ""convey"" a work means any kind of propagation that enables other144parties to make or receive copies. Mere interaction with a user through145a computer network, with no transfer of a copy, is not conveying.146 147 An interactive user interface displays ""Appropriate Legal Notices""148to the extent that it includes a convenient and prominently visible149feature that (1) displays an appropriate copyright notice, and (2)150tells the user that there is no warranty for the work (except to the151extent that warranties are provided), that licensees may convey the152work under this License, and how to view a copy of this License. If153the interface presents a list of user commands or options, such as a154menu, a prominent item in the list meets this criterion.155 156 1. Source Code.157 158 The ""source code"" for a work means the preferred form of the work159for making modifications to it. ""Object code"" means any non-source160form of a work.161 162 A ""Standard Interface"" means an interface that either is an official163standard defined by a recognized standards body, or, in the case of164interfaces specified for a particular programming language, one that165is widely used among developers working in that language.166 167 The ""System Libraries"" of an executable work include anything, other168than the work as a whole, that (a) is included in the normal form of169packaging a Major Component, but which is not part of that Major170Component, and (b) serves only to enable use of the work with that171Major Component, or to implement a Standard Interface for which an172implementation is available to the public in source code form. A173""Major Component"", in this context, means a major essential component174(kernel, window system, and so on) of the specific operating system175(if any) on which the executable work runs, or a compiler used to176produce the work, or an object code interpreter used to run it.177 178 The ""Corresponding Source"" for a work in object code form means all179the source code needed to generate, install, and (for an executable180work) run the object code and to modify the work, including scripts to181control those activities. However, it does not include the work's182System Libraries, or general-purpose tools or generally available free183programs which are used unmodified in performing those activities but184which are not part of the work. For example, Corresponding Source185includes interface definition files associated with source files for186the work, and the source code for shared libraries and dynamically187linked subprograms that the work is specifically designed to require,188such as by intimate data communication or control flow between those189subprograms and other parts of the work.190 191 The Corresponding Source need not include anything that users192can regenerate automatically from other parts of the Corresponding193Source.194 195 The Corresponding Source for a work in source code form is that196same work.197 198 2. Basic Permissions.199 200 All rights granted under this License are granted for the term of201copyright on the Program, and are irrevocable provided the stated202conditions are met. This License explicitly affirms your unlimited203permission to run the unmodified Program. The output from running a204covered work is covered by this License only if the output, given its205content, constitutes a covered work. This License acknowledges your206rights of fair use or other equivalent, as provided by copyright law.207 208 You may make, run and propagate covered works that you do not209convey, without conditions so long as your license otherwise remains210in force. You may convey covered works to others for the sole purpose211of having them make modifications exclusively for you, or provide you212with facilities for running those works, provided that you comply with213the terms of this License in conveying all material for which you do214not control copyright. Those thus making or running the covered works215for you must do so exclusively on your behalf, under your direction216and control, on terms that prohibit them from making any copies of217your copyrighted material outside their relationship with you.218 219 Conveying under any other circumstances is permitted solely under220the conditions stated below. Sublicensing is not allowed; section 10221makes it unnecessary.222 223 3. Protecting Users' Legal Rights From Anti-Circumvention Law.224 225 No covered work shall be deemed part of an effective technological226measure under any applicable law fulfilling obligations under article22711 of the WIPO copyright treaty adopted on 20 December 1996, or228similar laws prohibiting or restricting circumvention of such229measures.230 231 When you convey a covered work, you waive any legal power to forbid232circumvention of technological measures to the extent such circumvention233is effected by exercising rights under this License with respect to234the covered work, and you disclaim any intention to limit operation or235modification of the work as a means of enforcing, against the work's236users, your or third parties' legal rights to forbid circumvention of237technological measures.238 239 4. Conveying Verbatim Copies.240 241 You may convey verbatim copies of the Program's source code as you242receive it, in any medium, provided that you conspicuously and243appropriately publish on each copy an appropriate copyright notice;244keep intact all notices stating that this License and any245non-permissive terms added in accord with section 7 apply to the code;246keep intact all notices of the absence of any warranty; and give all247recipients a copy of this License along with the Program.248 249 You may charge any price or no price for each copy that you convey,250and you may offer support or warranty protection for a fee.251 252 5. Conveying Modified Source Versions.253 254 You may convey a work based on the Program, or the modifications to255produce it from the Program, in the form of source code under the256terms of section 4, provided that you also meet all of these conditions:257 258 a) The work must carry prominent notices stating that you modified259 it, and giving a relevant date.260 261 b) The work must carry prominent notices stating that it is262 released under this License and any conditions added under section263 7. This requirement modifies the requirement in section 4 to264 ""keep intact all notices"".265 266 c) You must license the entire work, as a whole, under this267 License to anyone who comes into possession of a copy. This268 License will therefore apply, along with any applicable section 7269 additional terms, to the whole of the work, and all its parts,270 regardless of how they are packaged. This License gives no271 permission to license the work in any other way, but it does not272 invalidate such permission if you have separately received it.273 274 d) If the work has interactive user interfaces, each must display275 Appropriate Legal Notices; however, if the Program has interactive276 interfaces that do not display Appropriate Legal Notices, your277 work need not make them do so.278 279 A compilation of a covered work with other separate and independent280works, which are not by their nature extensions of the covered work,281and which are not combined with it such as to form a larger program,282in or on a volume of a storage or distribution medium, is called an283""aggregate"" if the compilation and its resulting copyright are not284used to limit the access or legal rights of the compilation's users285beyond what the individual works permit. Inclusion of a covered work286in an aggregate does not cause this License to apply to the other287parts of the aggregate.288 289 6. Conveying Non-Source Forms.290 291 You may convey a covered work in object code form under the terms292of sections 4 and 5, provided that you also convey the293machine-readable Corresponding Source under the terms of this License,294in one of these ways:295 296 a) Convey the object code in, or embodied in, a physical product297 (including a physical distribution medium), accompanied by the298 Corresponding Source fixed on a durable physical medium299 customarily used for software interchange.300 301 b) Convey the object code in, or embodied in, a physical product302 (including a physical distribution medium), accompanied by a303 written offer, valid for at least three years and valid for as304 long as you offer spare parts or customer support for that product305 model, to give anyone who possesses the object code either (1) a306 copy of the Corresponding Source for all the software in the307 product that is covered by this License, on a durable physical308 medium customarily used for software interchange, for a price no309 more than your reasonable cost of physically performing this310 conveying of source, or (2) access to copy the311 Corresponding Source from a network server at no charge.312 313 c) Convey individual copies of the object code with a copy of the314 written offer to provide the Corresponding Source. This315 alternative is allowed only occasionally and noncommercially, and316 only if you received the object code with such an offer, in accord317 with subsection 6b.318 319 d) Convey the object code by offering access from a designated320 place (gratis or for a charge), and offer equivalent access to the321 Corresponding Source in the same way through the same place at no322 further charge. You need not require recipients to copy the323 Corresponding Source along with the object code. If the place to324 copy the object code is a network server, the Corresponding Source325 may be on a different server (operated by you or a third party)326 that supports equivalent copying facilities, provided you maintain327 clear directions next to the object code saying where to find the328 Corresponding Source. Regardless of what server hosts the329 Corresponding Source, you remain obligated to ensure that it is330 available for as long as needed to satisfy these requirements.331 332 e) Convey the object code using peer-to-peer transmission, provided333 you inform other peers where the object code and Corresponding334 Source of the work are being offered to the general public at no335 charge under subsection 6d.336 337 A separable portion of the object code, whose source code is excluded338from the Corresponding Source as a System Library, need not be339included in conveying the object code work.340 341 A ""User Product"" is either (1) a ""consumer product"", which means any342tangible personal property which is normally used for personal, family,343or household purposes, or (2) anything designed or sold for incorporation344into a dwelling. In determining whether a product is a consumer product,345doubtful cases shall be resolved in favor of coverage. For a particular346product received by a particular user, ""normally used"" refers to a347typical or common use of that class of product, regardless of the status348of the particular user or of the way in which the particular user349actually uses, or expects or is expected to use, the product. A product350is a consumer product regardless of whether the product has substantial351commercial, industrial or non-consumer uses, unless such uses represent352the only significant mode of use of the product.353 354 ""Installation Information"" for a User Product means any methods,355procedures, authorization keys, or other information required to install356and execute modified versions of a covered work in that User Product from357a modified version of its Corresponding Source. The information must358suffice to ensure that the continued functioning of the modified object359code is in no case prevented or interfered with solely because360modification has been made.361 362 If you convey an object code work under this section in, or with, or363specifically for use in, a User Product, and the conveying occurs as364part of a transaction in which the right of possession and use of the365User Product is transferred to the recipient in perpetuity or for a366fixed term (regardless of how the transaction is characterized), the367Corresponding Source conveyed under this section must be accompanied368by the Installation Information. But this requirement does not apply369if neither you nor any third party retains the ability to install370modified object code on the User Product (for example, the work has371been installed in ROM).372 373 The requirement to provide Installation Information does not include a374requirement to continue to provide support service, warranty, or updates375for a work that has been modified or installed by the recipient, or for376the User Product in which it has been modified or installed. Access to a377network may be denied when the modification itself materially and378adversely affects the operation of the network or violates the rules and379protocols for communication across the network.380 381 Corresponding Source conveyed, and Installation Information provided,382in accord with this section must be in a format that is publicly383documented (and with an implementation available to the public in384source code form), and must require no special password or key for385unpacking, reading or copying.386 387 7. Additional Terms.388 389 ""Additional permissions"" are terms that supplement the terms of this390License by making exceptions from one or more of its conditions.391Additional permissions that are applicable to the entire Program shall392be treated as though they were included in this License, to the extent393that they are valid under applicable law. If additional permissions394apply only to part of the Program, that part may be used separately395under those permissions, but the entire Program remains governed by396this License without regard to the additional permissions.397 398 When you convey a copy of a covered work, you may at your option399remove any additional permissions from that copy, or from any part of400it. (Additional permissions may be written to require their own401removal in certain cases when you modify the work.) You may place402additional permissions on material, added by you to a covered work,403for which you have or can give appropriate copyright permission.404 405 Notwithstanding any other provision of this License, for material you406add to a covered work, you may (if authorized by the copyright holders of407that material) supplement the terms of this License with terms:408 409 a) Disclaiming warranty or limiting liability differently from the410 terms of sections 15 and 16 of this License; or411 412 b) Requiring preservation of specified reasonable legal notices or413 author attributions in that material or in the Appropriate Legal414 Notices displayed by works containing it; or415 416 c) Prohibiting misrepresentation of the origin of that material, or417 requiring that modified versions of such material be marked in418 reasonable ways as different from the original version; or419 420 d) Limiting the use for publicity purposes of names of licensors or421 authors of the material; or422 423 e) Declining to grant rights under trademark law for use of some424 trade names, trademarks, or service marks; or425 426 f) Requiring indemnification of licensors and authors of that427 material by anyone who conveys the material (or modified versions of428 it) with contractual assumptions of liability to the recipient, for429 any liability that these contractual assumptions directly impose on430 those licensors and authors.431 432 All other non-permissive additional terms are considered ""further433restrictions"" within the meaning of section 10. If the Program as you434received it, or any part of it, contains a notice stating that it is435governed by this License along with a term that is a further436restriction, you may remove that term. If a license document contains437a further restriction but permits relicensing or conveying under this438License, you may add to a covered work material governed by the terms439of that license document, provided that the further restriction does440not survive such relicensing or conveying.441 442 If you add terms to a covered work in accord with this section, you443must place, in the relevant source files, a statement of the444additional terms that apply to those files, or a notice indicating445where to find the applicable terms.446 447 Additional terms, permissive or non-permissive, may be stated in the448form of a separately written license, or stated as exceptions;449the above requirements apply either way.450 451 8. Termination.452 453 You may not propagate or modify a covered work except as expressly454provided under this License. Any attempt otherwise to propagate or455modify it is void, and will automatically terminate your rights under456this License (including any patent licenses granted under the third457paragraph of section 11).458 459 However, if you cease all violation of this License, then your460license from a particular copyright holder is reinstated (a)461provisionally, unless and until the copyright holder explicitly and462finally terminates your license, and (b) permanently, if the copyright463holder fails to notify you of the violation by some reasonable means464prior to 60 days after the cessation.465 466 Moreover, your license from a particular copyright holder is467reinstated permanently if the copyright holder notifies you of the468violation by some reasonable means, this is the first time you have469received notice of violation of this License (for any work) from that470copyright holder, and you cure the violation prior to 30 days after471your receipt of the notice.472 473 Termination of your rights under this section does not terminate the474licenses of parties who have received copies or rights from you under475this License. If your rights have been terminated and not permanently476reinstated, you do not qualify to receive new licenses for the same477material under section 10.478 479 9. Acceptance Not Required for Having Copies.480 481 You are not required to accept this License in order to receive or482run a copy of the Program. Ancillary propagation of a covered work483occurring solely as a consequence of using peer-to-peer transmission484to receive a copy likewise does not require acceptance. However,485nothing other than this License grants you permission to propagate or486modify any covered work. These actions infringe copyright if you do487not accept this License. Therefore, by modifying or propagating a488covered work, you indicate your acceptance of this License to do so.489 490 10. Automatic Licensing of Downstream Recipients.491 492 Each time you convey a covered work, the recipient automatically493receives a license from the original licensors, to run, modify and494propagate that work, subject to this License. You are not responsible495for enforcing compliance by third parties with this License.496 497 An ""entity transaction"" is a transaction transferring control of an498organization, or substantially all assets of one, or subdividing an499organization, or merging organizations. If propagation of a covered500work results from an entity transaction, each party to that501transaction who receives a copy of the work also receives whatever502licenses to the work the party's predecessor in interest had or could503give under the previous paragraph, plus a right to possession of the504Corresponding Source of the work from the predecessor in interest, if505the predecessor has it or can get it with reasonable efforts.506 507 You may not impose any further restrictions on the exercise of the508rights granted or affirmed under this License. For example, you may509not impose a license fee, royalty, or other charge for exercise of510rights granted under this License, and you may not initiate litigation511(including a cross-claim or counterclaim in a lawsuit) alleging that512any patent claim is infringed by making, using, selling, offering for513sale, or importing the Program or any portion of it.514 515 11. Patents.516 517 A ""contributor"" is a copyright holder who authorizes use under this518License of the Program or a work on which the Program is based. The519work thus licensed is called the contributor's ""contributor version"".520 521 A contributor's ""essential patent claims"" are all patent claims522owned or controlled by the contributor, whether already acquired or523hereafter acquired, that would be infringed by some manner, permitted524by this License, of making, using, or selling its contributor version,525but do not include claims that would be infringed only as a526consequence of further modification of the contributor version. For527purposes of this definition, ""control"" includes the right to grant528patent sublicenses in a manner consistent with the requirements of529this License.530 531 Each contributor grants you a non-exclusive, worldwide, royalty-free532patent license under the contributor's essential patent claims, to533make, use, sell, offer for sale, import and otherwise run, modify and534propagate the contents of its contributor version.535 536 In the following three paragraphs, a ""patent license"" is any express537agreement or commitment, however denominated, not to enforce a patent538(such as an express permission to practice a patent or covenant not to539sue for patent infringement). To ""grant"" such a patent license to a540party means to make such an agreement or commitment not to enforce a541patent against the party.542 543 If you convey a covered work, knowingly relying on a patent license,544and the Corresponding Source of the work is not available for anyone545to copy, free of charge and under the terms of this License, through a546publicly available network server or other readily accessible means,547then you must either (1) cause the Corresponding Source to be so548available, or (2) arrange to deprive yourself of the benefit of the549patent license for this particular work, or (3) arrange, in a manner550consistent with the requirements of this License, to extend the patent551license to downstream recipients. ""Knowingly relying"" means you have552actual knowledge that, but for the patent license, your conveying the553covered work in a country, or your recipient's use of the covered work554in a country, would infringe one or more identifiable patents in that555country that you have reason to believe are valid.556 557 If, pursuant to or in connection with a single transaction or558arrangement, you convey, or propagate by procuring conveyance of, a559covered work, and grant a patent license to some of the parties560receiving the covered work authorizing them to use, propagate, modify561or convey a specific copy of the covered work, then the patent license562you grant is automatically extended to all recipients of the covered563work and works based on it.564 565 A patent license is ""discriminatory"" if it does not include within566the scope of its coverage, prohibits the exercise of, or is567conditioned on the non-exercise of one or more of the rights that are568specifically granted under this License. You may not convey a covered569work if you are a party to an arrangement with a third party that is570in the business of distributing software, under which you make payment571to the third party based on the extent of your activity of conveying572the work, and under which the third party grants, to any of the573parties who would receive the covered work from you, a discriminatory574patent license (a) in connection with copies of the covered work575conveyed by you (or copies made from those copies), or (b) primarily576for and in connection with specific products or compilations that577contain the covered work, unless you entered into that arrangement,578or that patent license was granted, prior to 28 March 2007.579 580 Nothing in this License shall be construed as excluding or limiting581any implied license or other defenses to infringement that may582otherwise be available to you under applicable patent law.583 584 12. No Surrender of Others' Freedom.585 586 If conditions are imposed on you (whether by court order, agreement or587otherwise) that contradict the conditions of this License, they do not588excuse you from the conditions of this License. If you cannot convey a589covered work so as to satisfy simultaneously your obligations under this590License and any other pertinent obligations, then as a consequence you may591not convey it at all. For example, if you agree to terms that obligate you592to collect a royalty for further conveying from those to whom you convey593the Program, the only way you could satisfy both those terms and this594License would be to refrain entirely from conveying the Program.595 596 13. Use with the GNU Affero General Public License.597 598 Notwithstanding any other provision of this License, you have599permission to link or combine any covered work with a work licensed600under version 3 of the GNU Affero General Public License into a single601combined work, and to convey the resulting work. The terms of this602License will continue to apply to the part which is the covered work,603but the special requirements of the GNU Affero General Public License,604section 13, concerning interaction through a network will apply to the605combination as such.606 607 14. Revised Versions of this License.608 609 The Free Software Foundation may publish revised and/or new versions of610the GNU General Public License from time to time. Such new versions will611be similar in spirit to the present version, but may differ in detail to612address new problems or concerns.613 614 Each version is given a distinguishing version number. If the615Program specifies that a certain numbered version of the GNU General616Public License ""or any later version"" applies to it, you have the617option of following the terms and conditions either of that numbered618version or of any later version published by the Free Software619Foundation. If the Program does not specify a version number of the620GNU General Public License, you may choose any version ever published621by the Free Software Foundation.622 623 If the Program specifies that a proxy can decide which future624versions of the GNU General Public License can be used, that proxy's625public statement of acceptance of a version permanently authorizes you626to choose that version for the Program.627 628 Later license versions may give you additional or different629permissions. However, no additional obligations are imposed on any630author or copyright holder as a result of your choosing to follow a631later version.632 633 15. Disclaimer of Warranty.634 635 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY636APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT637HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ""AS IS"" WITHOUT WARRANTY638OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,639THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR640PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM641IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF642ALL NECESSARY SERVICING, REPAIR OR CORRECTION.643 644 16. Limitation of Liability.645 646 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING647WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS648THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY649GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE650USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF651DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD652PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),653EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF654SUCH DAMAGES.655 656 17. Interpretation of Sections 15 and 16.657 658 If the disclaimer of warranty and limitation of liability provided659above cannot be given local legal effect according to their terms,660reviewing courts shall apply local law that most closely approximates661an absolute waiver of all civil liability in connection with the662Program, unless a warranty or assumption of liability accompanies a663copy of the Program in return for a fee.664 665 END OF TERMS AND CONDITIONS666 667 How to Apply These Terms to Your New Programs668 669 If you develop a new program, and you want it to be of the greatest670possible use to the public, the best way to achieve this is to make it671free software which everyone can redistribute and change under these terms.672 673 To do so, attach the following notices to the program. It is safest674to attach them to the start of each source file to most effectively675state the exclusion of warranty; and each file should have at least676the ""copyright"" line and a pointer to where the full notice is found.677 678 {one line to give the program's name and a brief idea of what it does.}679 Copyright (C) {year} {name of author}680 681 This program is free software: you can redistribute it and/or modify682 it under the terms of the GNU General Public License as published by683 the Free Software Foundation, either version 3 of the License, or684 (at your option) any later version.685 686 This program is distributed in the hope that it will be useful,687 but WITHOUT ANY WARRANTY; without even the implied warranty of688 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the689 GNU General Public License for more details.690 691 You should have received a copy of the GNU General Public License692 along with this program. If not, see <http://www.gnu.org/licenses/>.693 694Also add information on how to contact you by electronic and paper mail.695 696 If the program does terminal interaction, make it output a short697notice like this when it starts in an interactive mode:698 699 {project} Copyright (C) {year} {fullname}700 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.701 This is free software, and you are welcome to redistribute it702 under certain conditions; type `show c' for details.703 704The hypothetical commands `show w' and `show c' should show the appropriate705parts of the General Public License. Of course, your program's commands706might be different; for a GUI interface, you would use an ""about box"".707 708 You should also get your employer (if you work as a programmer) or school,709if any, to sign a ""copyright disclaimer"" for the program, if necessary.710For more information on this, and how to apply and follow the GNU GPL, see711<http://www.gnu.org/licenses/>.712 713 The GNU General Public License does not permit incorporating your program714into proprietary programs. If your program is a subroutine library, you715may consider it more useful to permit linking proprietary applications with716the library. If this is what you want to do, use the GNU Lesser General717Public License instead of this License. But first, please read718<http://www.gnu.org/philosophy/why-not-lgpl.html>.719","Markdown"
720"In Silico","GGFHF/ddRADseqTools","Package/seqlocation.py",".py","9429","257","#!/usr/bin/env python3721# -*- coding: utf-8 -*-722 723#-------------------------------------------------------------------------------724 725'''This software has been developed by:726 727 GI Genética, Fisiología e Historia Forestal728 Dpto. Sistemas y Recursos Naturales729 ETSI Montes, Forestal y del Medio Natural730 Universidad Politécnica de Madrid731 https://github.com/ggfhf/732 733 Licence: GNU General Public Licence Version 3734'''735 736#-------------------------------------------------------------------------------737 738'''This source contains the program of the ddRADseqTools software package that739 locates a sequence into the genome.740'''741#-------------------------------------------------------------------------------742 743import gzip744import re745import sys746 747from genlib import *748 749#-------------------------------------------------------------------------------750 751def main(argv):752 '''Main line of the program.'''753 754 # build the options dictionary755 options_dict = build_options()756 757 # it has been requested the help or to build a new config file758 for param in argv:759 # show the help and exit OK760 if param.startswith('--help'):761 print_help(options_dict)762 sys.exit(0)763 # build the config file and exit OK764 elif param.startswith('--config'):765 build_config(options_dict)766 sys.exit(0)767 768 # get the config file769 config_file = get_config_file(__file__)770 771 # get options from the config file and the input parameters772 options_dict = get_options(options_dict, config_file, argv)773 774 # locate sequence775 locate_seq(options_dict)776 777#-------------------------------------------------------------------------------778 779def locate_seq(options_dict):780 '''Locate a sequence into the genome.'''781 782 genfile = options_dict['genfile']['value']783 seq = options_dict['seq']['value']784 verbose = options_dict['verbose']['value']785 trace = options_dict['trace']['value']786 787 # set the verbose and trace status788 if verbose.upper() == 'YES':789 Message.set_verbose_status(True)790 else:791 Message.set_verbose_status(False)792 if trace.upper() == 'YES':793 Message.set_trace_status(True)794 else:795 Message.set_trace_status(False)796 797 # ...798 Message.print('info', 'seq to be locate: {0}'.format(seq))799 Message.print('info', 'reverse compl. : {0}'.format(get_reverse_complementary_sequence(seq)))800 801 # open the genome file802 try:803 if genfile.endswith('.gz'):804 genfile_id = gzip.open(genfile, mode='rt', encoding='iso-8859-1')805 else:806 genfile_id = open(genfile, mode='r', encoding='iso-8859-1')807 except:808 raise ProgramError('F002', genfile)809 810 # set the pattern of the head records (>locus_info)811 pattern = r'^>(.*)$'812 813 # initialize the found site count814 found_site_count = 0815 816 # read the first record817 record = genfile_id.readline()818 819 # while there are records820 while record != '':821 822 # process the head record 823 if record.startswith('>'):824 825 # extract the data 826 mo = re.search(pattern, record)827 locus_info = mo.group(1)828 829 # initialize the locus sequence of Watson strand830 watson_locus_seq = ''831 832 # read the next record833 record = genfile_id.readline()834 835 else:836 837 # control the FASTA format838 raise ProgramError('F003', genfile, 'FASTA')839 840 # while there are records and they are sequence841 while record != '' and not record.startswith('>'):842 843 # concatenate the record to the locus sequence of Watson strand844 watson_locus_seq += record.strip().upper()845 846 # read the next record847 record = genfile_id.readline()848 849 # find the first location in Watson locus sequence850 start = watson_locus_seq.find(seq.upper())851 852 # while the sequence is found in the Watson strand853 while start >= 0:854 855 # print the location data856 Message.print('info', 'Locus info: {0} | strand: + | start position: {1} | end position: {2}'.format(locus_info, (start + 1), (start + len(seq))))857 858 # add 1 to found site count859 found_site_count += 1860 861 # find the next location862 start = watson_locus_seq.find(seq.upper(), (start + len(seq)))863 864 # get the sequence of the Crick strand865 crick_locus_seq = get_reverse_complementary_sequence(watson_locus_seq)866 867 # find the first location in Crick locus sequence868 start = crick_locus_seq.find(seq.upper())869 870 # while the sequence is the Crick strand871 while start >= 0:872 873 # print the loation data874 Message.print('info', 'Locus info: {0} | strand: - | start position: {1} | end position: {2}'.format(locus_info, (len(crick_locus_seq) - start), (len(crick_locus_seq) - start - len(seq) + 1)))875 876 # add 1 to found site count877 found_site_count += 1878 879 # find the next location880 start = crick_locus_seq.find(seq.upper(), (start + len(seq)))881 882 # close genfile883 genfile_id.close()884 885 # show the found site count886 if found_site_count == 0:887 Message.print('info', 'The sequence is not found')888 else:889 Message.print('info', 'The sequence is found in {0} sites'.format(found_site_count))890 891#-------------------------------------------------------------------------------892 893def build_options():894 '''Build a dictionary with the program options.'''895 896 # get all options dictionary897 all_options_dict = get_all_options_dict()898 899 # define the options dictionary900 options_dict = {901 'genfile': all_options_dict['genfile'],902 'seq': all_options_dict['seq'],903 'verbose': all_options_dict['verbose'],904 'trace': all_options_dict['trace']905 }906 907 # return the options dictionary908 return options_dict909 910#-------------------------------------------------------------------------------911 912def print_help(options_dict):913 '''Print the program help.'''914 915 # get general data916 project_name = get_project_name()917 project_version = get_project_version()918 program_file = get_file_name(__file__)919 config_file = get_config_file(__file__)920 921 # print the helpplot_graphic(intervals)922 Message.print('info', '')923 Message.print('info', '{0} version {1}'.format(project_name, project_version))924 Message.print('info', '')925 Message.print('info', '{0} locates a sequence into the genome.'.format(program_file))926 Message.print('info', '')927 Message.print('info', 'Usage: {0} --help'.format(program_file))928 Message.print('info', '')929 Message.print('info', ' Show the help of {0}.'.format(program_file))930 Message.print('info', '')931 Message.print('info', ' or: {0} --config'.format(program_file))932 Message.print('info', '')933 Message.print('info', ' Create the config file {0} with the default value of the options.'.format(config_file))934 Message.print('info', ' The default value of the options can be modified.'.format(config_file))935 Message.print('info', '')936 Message.print('info', ' or: {0} [--option=<value> [--option=<value>, ...]]'.format(program_file))937 Message.print('info', '')938 Message.print('info', ' The options values are read from the config file {0}, but they can be modified'.format(config_file))939 Message.print('info', ' in command line. The options are:')940 Message.print('info', '')941 Message.print('info', ' {0:9} {1}'.format('option', 'value'))942 Message.print('info', ' {0:9} {1}'.format('=' * 9, '=' * 44))943 Message.print('info', ' {0:9} {1}'.format('--genfile', options_dict['genfile']['comment']))944 Message.print('info', ' {0:9} {1}'.format('--seq', options_dict['seq']['comment']))945 Message.print('info', ' {0:9} {1}'.format('--verbose', options_dict['verbose']['comment']))946 Message.print('info', ' {0:9} {1}'.format('--trace', options_dict['trace']['comment']))947 948#-------------------------------------------------------------------------------949 950def build_config(options_dict):951 '''Build the file with the options by default.'''952 953 # get the config file954 config_file = get_config_file(__file__)955 956 # create the config file and write the default options957 try:958 with open(config_file, mode='w', encoding='iso-8859-1') as config_file_id:959 config_file_id.write('{0:33} # {1}\n'.format('genfile' + '=' + options_dict['genfile']['default'], options_dict['genfile']['comment']))960 config_file_id.write('{0:33} # {1}\n'.format('seq' + '=' + options_dict['seq']['default'], options_dict['seq']['comment']))961 config_file_id.write('{0:33} # {1}\n'.format('verbose' + '=' + options_dict['verbose']['default'], options_dict['verbose']['comment']))962 config_file_id.write('{0:33} # {1}\n'.format('trace' + '=' + options_dict['trace']['default'], options_dict['trace']['comment']))963 except:964 raise ProgramError('F001', config_file)965 966 # show OK message 967 Message.print('info', 'The configuration file {0} is created.'.format(get_file_name(config_file)))968 969#-------------------------------------------------------------------------------970 971if __name__ == '__main__':972 main(sys.argv[1:])973 sys.exit(0)974 975#-------------------------------------------------------------------------------976","Python"
977"In Silico","GGFHF/ddRADseqTools","Package/pcrdupremoval.py",".py","36786","914","#!/usr/bin/env python3978# -*- coding: utf-8 -*-979 980#-------------------------------------------------------------------------------981 982'''This software has been developed by:983 984 GI Genética, Fisiología e Historia Forestal985 Dpto. Sistemas y Recursos Naturales986 ETSI Montes, Forestal y del Medio Natural987 Universidad Politécnica de Madrid988 https://github.com/ggfhf/989 990 Licence: GNU General Public Licence Version 3991'''992 993#-------------------------------------------------------------------------------994 995'''This source contains the program of the ddRADseqTools software package that996 quantifies the PCR duplicates and removes them from a file(s) in FASTQ/FASTA997 format with sequences of a double digest RADseq.998'''999#-------------------------------------------------------------------------------1000 1001import os.path1002import re1003import subprocess1004import sys1005 1006from genlib import *1007 1008#-------------------------------------------------------------------------------1009 1010def main(argv):1011 '''Main line of the program.'''1012 1013 # build the options dictionary1014 options_dict = build_options()1015 1016 # it has been requested the help or to build a new config file1017 for param in argv:1018 # show the help and exit OK1019 if param.startswith('--help'):1020 print_help(options_dict)1021 sys.exit(0)1022 # build the config file and exit OK1023 elif param.startswith('--config'):1024 build_config(options_dict)1025 sys.exit(0)1026 1027 # get the config file1028 config_file = get_config_file(__file__)1029 1030 # get options from the config file and the input parameters1031 options_dict = get_options(options_dict, config_file, argv)1032 1033 # process PCR duplicates of a double digest RADseq1034 process_pcr_duplicates(options_dict)1035 1036#-------------------------------------------------------------------------------1037 1038def process_pcr_duplicates(options_dict):1039 '''Process PCR duplicates of a double digest RADseq.'''1040 1041 format = options_dict['format']['value']1042 readtype = options_dict['readtype']['value']1043 readsfile1 = options_dict['readsfile1']['value']1044 readsfile2 = options_dict['readsfile2']['value']1045 clearfile = options_dict['clearfile']['value']1046 dupstfile = options_dict['dupstfile']['value']1047 plot = options_dict['plot']['value']1048 verbose = options_dict['verbose']['value']1049 trace = options_dict['trace']['value']1050 1051 # set the verbose and trace status1052 if verbose.upper() == 'YES':1053 Message.set_verbose_status(True)1054 else:1055 Message.set_verbose_status(False)1056 if trace.upper() == 'YES':1057 Message.set_trace_status(True)1058 else:1059 Message.set_trace_status(False)1060 1061 # initialize the statistics1062 stats_dict = {}1063 1064 # asign the temporal file name with records unified by read1065 unified_reads_file = readsfile1 + '.unified'1066 1067 # build temporal file unifing records by read1068 unify_records(format, readtype, readsfile1, readsfile2, unified_reads_file)1069 1070 # asign the temporal file name with sorted records unified by read1071 sorted_reads_file = unified_reads_file + '.sorted'1072 1073 # sort the temporal file with records unified by read1074 sort_records(unified_reads_file, sorted_reads_file)1075 1076 # delete temporal file with records unified by read1077 os.remove(unified_reads_file)1078 Message.print('info', 'The temporal file {0} is deleted.'.format(get_file_name(unified_reads_file)))1079 1080 # asign the purged temporal file(s) name1081 purged_reads_file = sorted_reads_file + '.purged'1082 1083 # quantify and remove the PCR duplicates1084 stats_dict = purge_records(format, readtype, sorted_reads_file, purged_reads_file)1085 1086 # delete temporal file with sorted records unified by read1087 os.remove(sorted_reads_file)1088 Message.print('info', 'The temporal file {0} is deleted.'.format(get_file_name(sorted_reads_file)))1089 1090 # assign the output file(s) name1091 extention = '.fastq' if format == 'FASTQ' else '.fasta'1092 if readtype == 'SE':1093 clearfile1 = clearfile + extention1094 clearfile2 = None1095 elif readtype == 'PE':1096 clearfile1 = clearfile + '-1' + extention1097 clearfile2 = clearfile + '-2' + extention1098 1099 # restore the original file(s) format1100 restore_format(format, readtype, purged_reads_file, clearfile1, clearfile2)1101 1102 # delete temporal file without PCR duplicates1103 os.remove(purged_reads_file)1104 Message.print('info', 'The temporal file {0} is deleted.'.format(get_file_name(purged_reads_file)))1105 1106 # write the PCR duplicates statistics1107 write_pcrdup_stats(dupstfile, stats_dict)1108 1109 # plot the PCR duplicates graphics1110 if plot.upper() == 'YES':1111 plot_pcrdup_graphics(dupstfile, stats_dict)1112 1113 # plot the graphic of the individuals without data per locus1114 if plot.upper() == 'YES':1115 plot_individuals_withoutdata_graphic(dupstfile, stats_dict)1116 1117 # plot the graphic of the loci without data per individual1118 if plot.upper() == 'YES':1119 plot_loci_withoutdata_graphic(dupstfile, stats_dict)1120 1121#-------------------------------------------------------------------------------1122 1123def unify_records(format, readtype, readsfile1, readsfile2, unified_reads_file):1124 '''Build file(s) unifing records by read.'''1125 1126 # open the reads file(s)1127 try:1128 readsfile1_id = open(readsfile1, mode='r', encoding='iso-8859-1')1129 except:1130 raise ProgramError('F002', readsfile1)1131 if readtype == 'PE':1132 try:1133 readsfile2_id = open(readsfile2, mode='r', encoding='iso-8859-1')1134 except:1135 raise ProgramError('F002', readsfile2)1136 1137 # open the file unifing records by read1138 try:1139 unified_reads_file_id = open(unified_reads_file, mode='w', encoding='iso-8859-1')1140 except:1141 raise ProgramError('F002', unified_reads_file)1142 1143 # initialize the count of reads1144 reads_count = 01145 1146 # if the format is FASTA1147 if format == 'FASTA':1148 1149 # set the pattern of the head records (>read_info)1150 pattern = r'^>(.*)$'1151 1152 # if readtype is SE1153 if readtype == 'SE':1154 1155 # read the first record of readsfile(s)1156 record1 = readsfile1_id.readline()1157 1158 # while there are records in readsfile11159 while record1 != '':1160 1161 # process the head record 1162 if record1.startswith('>'):1163 1164 # extract the data 1165 mo = re.search(pattern, record1)1166 info1 = mo.group(1).strip()1167 1168 # initialize the sequence1169 seq1 = ''1170 1171 # read the next record of readsfile11172 record1 = readsfile1_id.readline()1173 1174 else:1175 1176 # control the FASTA format1177 raise ProgramError('F003', readsfile1, 'FASTA')1178 1179 # while there are records in readsfile1 and they are sequence1180 while record1 != '' and not record1.startswith('>'):1181 1182 # add the record to the sequence1183 seq1 += record1.strip()1184 1185 # read the next record of readsfile11186 record1 = readsfile1_id.readline()1187 1188 # write record in unifile1189 unified_reads_file_id.write('{0}|||{1}\n'.format(seq1, info1))1190 1191 # notify the reads have been processed1192 reads_count += 11193 Message.print('verbose', '\rProcessed reads: {0:9d}'.format(reads_count))1194 1195 # if the readtype is PE1196 elif readtype == 'PE':1197 1198 # read the first record of readsfile1 and readfile21199 record1 = readsfile1_id.readline()1200 record2 = readsfile2_id.readline()