├── DESCRIPTION ├── LICENSE ├── MegaR_1.0.tar.gz ├── NAMESPACE ├── R ├── getGoodfeature.R ├── getLevelData.R ├── getconfuMat.R ├── gettrainingdoneglm.R ├── gettrainingdonerf.R ├── gettrainingdonesvm.R ├── getunknpredict.R ├── megaRshiny.R ├── plotimptfeatures.R ├── readmetadata.R ├── savePlot.R └── validation.R ├── README.md ├── data ├── 16S │ ├── Antibiotic │ │ ├── Antibiotics_metadata.tsv │ │ └── otu_table.filtered.2Maaslin.txt │ ├── T1D │ │ ├── diabimmune_t1d_16s_otu_table.biom.txt │ │ └── metadata.tsv │ └── Three_country │ │ ├── merged_three_Countrymetadata.tsv │ │ └── qiime_three.txt └── WGS │ ├── Antibiotic │ ├── Antibiotics_metadata.tsv │ └── merged_metaphlan_antibiotic.txt │ ├── T1D.zip │ ├── T1D │ ├── merged_metaphlan_t1d.txt │ └── metadata.tsv │ └── Three_country │ ├── merged_three_Countrymetadata.tsv │ └── merged_three_country.txt ├── man ├── getGoodfeature.Rd ├── getLevelData.Rd ├── getconfuMat.Rd ├── gettrainingdoneglm.Rd ├── gettrainingdonerf.Rd ├── gettrainingdonesvm.Rd ├── getunknpredict.Rd ├── megaR.Rd ├── plotimptfeatures.Rd ├── readmetadata.Rd ├── readmydata.Rd ├── savePlot.Rd └── validation.Rd ├── screenshot ├── AUC.PNG ├── Data_input_table.png ├── Datainput.gif ├── Interface.png ├── ModelBuilding1.gif ├── ModelBuilding2.gif ├── Prediction-02.png ├── Prediction_CustomModel.png ├── Prediction_CustomModel2.png ├── Prediction_CustomModel3.png ├── Prediction_table.png ├── Preprocess_genus.png ├── Preprocessing_species.png ├── Preprocessing_table.png ├── Train_stats.png ├── Validation.PNG ├── accuracy.PNG ├── accuracy_rf_plot.png ├── data_input.png ├── download.PNG ├── features.PNG ├── input.gif ├── prediction.PNG ├── preprocessing.gif ├── rf_train_plot.png ├── test_error_db.png ├── test_error_stats_rf_db.png ├── testerror.PNG ├── teststats.PNG ├── topimptfeature.png ├── trainerror.PNG └── trainstats.PNG └── scripts └── README /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: MegaR 2 | Type: Package 3 | Title: An interactive R package for Metagenomic Data Analysis for Disease 4 | Prediction 5 | Version: 1.0 6 | Depends: R (>= 3.4) 7 | Authors@R: c(person("Eliza", "Dhungel", role = c("aut", "cre"), 8 | email = "eliza.dhungel@slu.edu"), 9 | person("Ted", "Ahn", 10 | email="ted.ahn@slu.edu" ,role = "aut") 11 | ) 12 | Maintainer: Eliza Dhungel 13 | Description: MegaR helps in building predictive models to classify metagenomic 14 | samples. 15 | models and check the training and testing accuracy of the model and Built 16 | models can also be validated and used for predicting unknown samples. 17 | License: file LICENSE 18 | Encoding: UTF-8 19 | LazyData: true 20 | biocViews: 21 | Imports: 22 | shiny, 23 | shinythemes, 24 | shinydashboard, 25 | randomForest, 26 | stringr, 27 | plyr, 28 | ggplot2, 29 | RColorBrewer, 30 | caret, 31 | DT, 32 | graphics, 33 | MLeval, 34 | edgeR, 35 | biomaRt, 36 | kernlab, 37 | e1071 38 | RoxygenNote: 7.0.0 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /MegaR_1.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/MegaR_1.0.tar.gz -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(MegaR) 4 | export(getGoodfeature) 5 | export(getLevelData) 6 | export(getconfuMat) 7 | export(gettrainingdonesvm) 8 | export(getunknpredict) 9 | export(plotimptfeatures) 10 | export(readmetadata) 11 | export(readmydata) 12 | export(validation) 13 | import(RColorBrewer) 14 | import(ggplot2) 15 | importFrom(DT,dataTableOutput) 16 | importFrom(DT,datatable) 17 | importFrom(DT,renderDataTable) 18 | importFrom(grDevices,dev.off) 19 | importFrom(grDevices,png) 20 | importFrom(graphics,legend) 21 | importFrom(graphics,matplot) 22 | importFrom(graphics,par) 23 | importFrom(shiny,downloadButton) 24 | importFrom(shiny,downloadHandler) 25 | importFrom(shiny,fileInput) 26 | importFrom(shiny,mainPanel) 27 | importFrom(shiny,navbarPage) 28 | importFrom(shiny,observeEvent) 29 | importFrom(shiny,plotOutput) 30 | importFrom(shiny,radioButtons) 31 | importFrom(shiny,reactiveValues) 32 | importFrom(shiny,renderPlot) 33 | importFrom(shiny,renderUI) 34 | importFrom(shiny,selectInput) 35 | importFrom(shiny,shinyApp) 36 | importFrom(shiny,shinyUI) 37 | importFrom(shiny,sidebarLayout) 38 | importFrom(shiny,sidebarPanel) 39 | importFrom(shiny,sliderInput) 40 | importFrom(shiny,stopApp) 41 | importFrom(shiny,tabPanel) 42 | importFrom(shiny,tags) 43 | importFrom(shiny,textInput) 44 | importFrom(shiny,uiOutput) 45 | importFrom(shiny,updateRadioButtons) 46 | importFrom(utils,write.csv) 47 | importFrom(utils,write.table) 48 | importFrom(MLeval, evalm) 49 | importFrom(edgeR, DGEList) 50 | importFrom(edgeR, calcNormFactors) 51 | importFrom(edgeR, cpm) 52 | -------------------------------------------------------------------------------- /R/getGoodfeature.R: -------------------------------------------------------------------------------- 1 | #'MegaR getGoodfeature 2 | #' 3 | #' This is an internal function used to collect good features 4 | #' 5 | #' @param alltable2 table containing all the features analyzed 6 | #' @param threshold threshold of the value of feature that should 7 | #' be across the sample 8 | #' @param samplePercent percentage of sample that should contain 9 | #' the threshold amount of value in its feature 10 | #' @param normval wheather cumulative sum normalization(default), Trimmed mean-median normalization, quantile normalization or no normalization should be used 11 | #' @export 12 | quantile_normalisation <- function(df){ 13 | df_rank <- apply(df,2,rank,ties.method="min") 14 | df_sorted <- data.frame(apply(df, 2, sort)) 15 | df_mean <- apply(df_sorted, 1, mean) 16 | 17 | index_to_mean <- function(my_index, my_mean){ 18 | return(my_mean[my_index]) 19 | } 20 | 21 | df_final <- apply(df_rank, 2, index_to_mean, my_mean=df_mean) 22 | rownames(df_final) <- rownames(df) 23 | return(df_final) 24 | } 25 | 26 | getGoodfeature <- function(alltable2, threshold, samplePercent, normval){ 27 | row2keep <- c() 28 | 29 | cutoff <- ceiling( (samplePercent/100) * ncol(alltable2) ) 30 | #updateProgress(detail = "Calculating processing-value") 31 | for ( i in 1:nrow(alltable2)) { 32 | row_nonzero <- length( which( alltable2[ i , ] > threshold ) ) 33 | if ( row_nonzero > cutoff ) { 34 | row2keep <- c( row2keep , i) 35 | } 36 | } 37 | #updateProgress(detail = "doing normalization") 38 | a <- alltable2[ row2keep , , drop=F ] 39 | newmatrix <- matrix(1:length(a), nrow = nrow(a), ncol = ncol(a)) 40 | if (normval=="none"){ 41 | # rownames(a) <- str_remove(rownames(a), "[.*__g]") 42 | return(a) 43 | } 44 | else if (normval=="quantile") 45 | { 46 | return(quantile_normalisation(a)) 47 | } 48 | else if (normval == "TMM"){ 49 | dg <- edgeR::DGEList(a) 50 | dfm <- edgeR::calcNormFactors(dg, method = "TMM") 51 | newmatrix <- edgeR::cpm(dfm, log=FALSE) 52 | return(newmatrix) 53 | } 54 | else{ 55 | normdata <- sweep(a, 2, colSums(a) , '/')*100 56 | #rownames(normdata) <- str_remove(rownames(normdata), "[.*__g]") 57 | return(normdata) 58 | } 59 | #updateProgress(detail = "Displaying the result") 60 | } 61 | -------------------------------------------------------------------------------- /R/getLevelData.R: -------------------------------------------------------------------------------- 1 | #' MegaR getLevelData 2 | #' 3 | #' This is an internal function used to extract either the species or genus 4 | #' level of information 5 | #' @param alltable the taxonomic table 6 | #' @param leveld the taxonomic level at which to select the feature 7 | #' @export 8 | 9 | getLevelData <- function(alltable, leveld){ 10 | if (leveld == "All Level") { 11 | if(all(grepl("s__", rownames(alltable))) == TRUE){ #biom file 12 | genus <- stringr::str_remove(rownames(alltable), ".[0-9]+$") 13 | alltable$all <- stringr::str_remove( 14 | genus, 15 | ".s__$|.g__.s__$|.g__.s__$|.f__.g__.s__$|.o__.f__.g__.s__$") 16 | x <- stats::aggregate( . ~ all, alltable, sum ) 17 | rownames(x) <- x$all 18 | x <- x[-1] 19 | return(x) 20 | } 21 | else{ 22 | tble <- NULL 23 | ##unclassified family## all classified 24 | x <- grep("g__.*" , rownames(alltable),invert = T, value = T) 25 | y <- grep("f__.*" , x, value = TRUE) 26 | new_count_table <- alltable[match(y, rownames(alltable)),] 27 | family_unclass <-grep("unclass", rownames(new_count_table),value=T) 28 | if (length(family_unclass) != 0){ 29 | fmily <- alltable[match(family_unclass, rownames(alltable)), ] 30 | tble <- rbind(fmily) 31 | } 32 | 33 | x <- grep("s__.*" , rownames(alltable),invert = T, value = T) 34 | y <- grep("g__.*" , x, value = TRUE) 35 | new_count_table <- alltable[match(y, rownames(alltable)),] 36 | genus_unclass<- grep("unclass", rownames(new_count_table),value = T) 37 | 38 | if(length(genus_unclass)!= 0){ 39 | genus <- alltable[match(genus_unclass, rownames(alltable)), ] 40 | tble <- rbind(genus, tble) 41 | } 42 | 43 | x <- grep("t__.*" , rownames(alltable),invert = T, value = T) 44 | y <- grep("s__.*" , x, value = TRUE) 45 | new_count_table <- alltable[match(y, rownames(alltable)),] 46 | speci_unclass<-grep("unclass", rownames(new_count_table), value = T) 47 | if(length(speci_unclass)!=0){ 48 | species <- alltable[match(speci_unclass, rownames(alltable)), ] 49 | tble <- rbind(tble, species)} 50 | 51 | #x <- grep("t__.*" , rownames(alltable),invert = T, value = T) 52 | y <- grep("t__" , rownames(alltable), value = TRUE) 53 | alltype <- alltable[match(y, rownames(alltable)),] 54 | 55 | tble <- rbind(tble, alltype) 56 | } 57 | } 58 | else{ 59 | #if data is biomfile 60 | if(all(grepl("s__", rownames(alltable))) == TRUE){ 61 | if (leveld == "Species Level"){ 62 | alltable$species <- stringr::str_remove(rownames(alltable), 63 | ".[0-9]+$") 64 | x <- stats::aggregate( . ~ species, alltable, sum) 65 | rownames(x) <- x$species 66 | x <- x[grep ("s__[a-z]", ignore.case = TRUE, rownames(x)),] 67 | x <- x[-1] 68 | return(x) 69 | } 70 | else{ 71 | alltable$genus <- stringr::str_remove(rownames(alltable), 72 | "s__.*") 73 | x <- stats::aggregate( . ~ genus, alltable, sum) 74 | rownames(x) <- x$genus 75 | x <-x[grep ("g__[a-z]", ignore.case = T, rownames(x)),] 76 | x<- x[-1] 77 | return(x) 78 | } 79 | } 80 | else if (any(grepl("t__", rownames(alltable))) == TRUE){ 81 | if (leveld == "Genus Level"){ 82 | x <- grep("s__.*" , rownames(alltable),invert = T, value = T) 83 | y <- grep("g__.*" , x, value = TRUE) 84 | } 85 | else{ 86 | x <- grep("t__.*" , rownames(alltable),invert = T, value = T) 87 | y <- grep("s__.*" , x, value = TRUE) 88 | } 89 | new_count_table <- alltable[match(y, rownames(alltable)),] 90 | return(new_count_table) 91 | } 92 | else{ 93 | if (leveld == "Genus Level"){ 94 | x <- grep("s__.*" , rownames(alltable),invert = T, value = T) 95 | y <- grep("g__.*" , x, value = TRUE) 96 | new_count_table <- alltable[match(y, rownames(alltable)),] 97 | new_count_table<-new_count_table[grep("g__unclassified", 98 | rownames(new_count_table), 99 | invert = TRUE),] 100 | } 101 | else{ 102 | x <- grep("[0-9]+$" , rownames(alltable),invert = T, value =T) 103 | y <- grep("s__.*" , x, value = TRUE) 104 | new_count_table <- alltable[match(y, rownames(alltable)),] 105 | new_count_table<-new_count_table[grep("s__unclassified", 106 | rownames(new_count_table), 107 | invert = TRUE),] 108 | } 109 | return(new_count_table) 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /R/getconfuMat.R: -------------------------------------------------------------------------------- 1 | #' MegaR analysis 2 | #' 3 | #' This is an internal function used to plot the confusion Matrix 4 | #' 5 | #' @param testdata testdata 6 | #' @param rfmodel the model on which classification is done 7 | 8 | #' @import ggplot2 9 | #' @import RColorBrewer 10 | #' @export 11 | 12 | #library(ggplot2) 13 | #library(RColorBrewer) 14 | getconfuMat <- function(testdata, rfmodel){ 15 | tpre <- stats::predict(rfmodel, testdata[,-ncol(testdata)]) 16 | #tpre 17 | confu_mat <- caret::confusionMatrix(tpre,as.factor(testdata$country)) 18 | jBluesFun <- grDevices::colorRampPalette(brewer.pal(n = 6, "Blues")) 19 | paletteSize <- 256 20 | jBluesPalette <- jBluesFun(paletteSize) 21 | ggplotConfusionMatrix <- function(m){ 22 | p <-with(m,{ 23 | ggplot(data = as.data.frame(m$table) , 24 | aes(x = Prediction, y =Reference)) + 25 | geom_tile(aes(fill = Freq), colour = "White") + 26 | scale_fill_gradient2( 27 | low = jBluesPalette[1], 28 | mid = jBluesPalette[paletteSize/2], 29 | high = jBluesPalette[paletteSize], 30 | midpoint = (max(data.frame(m$table)$Freq) + 31 | min(data.frame(m$table)$Freq)) / 2, 32 | name = "") + 33 | theme(axis.text.x = element_text(face = "bold", color = "black"))+ 34 | theme(axis.text.y = element_text(face = "bold", color = "black"))+ 35 | geom_text(aes(x = Prediction, y = Reference, label = Freq)) + 36 | scale_x_discrete( name = element_text("Prediction", face = "bold"))+ 37 | scale_y_discrete( name = "True Label" )+ 38 | ggtitle("Confusion Matrix")+ 39 | theme(legend.key.height = unit(2.4, "cm"), 40 | plot.title = element_text(hjust = 0.5))+ 41 | theme(panel.border = element_rect(linetype = "solid", fill = NA))}) 42 | return(p) 43 | } 44 | return (list(ggplotConfusionMatrix(confu_mat), confu_mat)) 45 | } 46 | -------------------------------------------------------------------------------- /R/gettrainingdoneglm.R: -------------------------------------------------------------------------------- 1 | #' MegaR analysis 2 | #' @param mytable3 processed input file with features 3 | #' @param classid the column number in metadata file in which the class of 4 | #' input data is stored 5 | #' @param ruleout the class which is to be removed from classification model 6 | #' @param sampleid the column number of metadata file which contain sample ids 7 | #' that match with input data 8 | #' @param psd the percentage of data to be split into training set 9 | #' @param metadat the metadata path 10 | #' 11 | #' @export 12 | gettrainingdoneglm <- function(mytable3,classid,sampleid,ruleout,psd,metadat){ 13 | otu_table_scaled <- mytable3 14 | otu_table_scaled_state <- data.frame(t(otu_table_scaled)) 15 | otu_table_scaled_state$country <- metadat[,classid][match( 16 | rownames(otu_table_scaled_state), metadat[,sampleid])] 17 | otu_table_scaled_state <- stats::na.omit(otu_table_scaled_state) 18 | otu_table_scaled_state <- otu_table_scaled_state[ 19 | otu_table_scaled_state$country != ruleout,] 20 | otu_table_scaled_state1 <-droplevels( otu_table_scaled_state) 21 | 22 | set.seed(60) 23 | smp_size <- floor((psd/100) * nrow(otu_table_scaled_state1)) 24 | train_ind <- sample(seq_len(nrow(otu_table_scaled_state1)), size = smp_size) 25 | train <- otu_table_scaled_state1[train_ind, ] 26 | train<-droplevels(train) 27 | test <- otu_table_scaled_state1[-train_ind,] 28 | RF_state_classify <- caret::train(as.factor(country)~. , data =train, 29 | method = "glm", maxit=10000, trControl = caret::trainControl(savePredictions = T, classProbs = T, verboseIter = T)) 30 | return(list(train, test, RF_state_classify)) 31 | } 32 | -------------------------------------------------------------------------------- /R/gettrainingdonerf.R: -------------------------------------------------------------------------------- 1 | #' MegaR gettrainingdonerf 2 | #' @param mytable3 processed input file with features 3 | #' @param classid the column number in metadata file in which the class of 4 | #' input data is stored 5 | #' @param ruleout the class which is to be removed from classification model 6 | #' @param sampleid the column number of metadata file which contain sample ids 7 | #' that match with input data 8 | #' @param psd the percentage of data to be split into training set 9 | #' @param metadat the metadata path 10 | #' 11 | #' @export 12 | gettrainingdonerf <- function(mytable3, classid, sampleid,ruleout,psd,metadat,mrange){ 13 | otu_table_scaled <- mytable3 14 | otu_table_scaled_state <- data.frame(t(otu_table_scaled)) 15 | otu_table_scaled_state$country <- metadat[,classid][match( 16 | stringr::str_remove(rownames(otu_table_scaled_state), "_.*"), 17 | metadat[,sampleid])] 18 | otu_table_scaled_state <- stats::na.omit(otu_table_scaled_state) 19 | otu_table_scaled_state$country <- factor(otu_table_scaled_state$country, levels = ruleout) # add this lin 20 | otu_table_scaled_state1 <- stats::na.omit(droplevels(otu_table_scaled_state)) 21 | set.seed(60) 22 | smp_size <- floor((psd/100) * nrow(otu_table_scaled_state1)) 23 | train_ind <- sample(seq_len(nrow(otu_table_scaled_state1)), size = smp_size) 24 | train <- otu_table_scaled_state1[train_ind, ] 25 | train<-droplevels(train) 26 | test <- otu_table_scaled_state1[-train_ind,] 27 | tunegrid <- expand.grid(.mtry=c(mrange[[1]]:mrange[[2]])) 28 | rf_gridsearch <- caret::train(as.factor(country)~., data=train, method="rf", 29 | tuneGrid=tunegrid, trControl = caret::trainControl(savePredictions = T, classProbs = T, verboseIter = T)) 30 | 31 | return(list(train, test, rf_gridsearch)) 32 | } -------------------------------------------------------------------------------- /R/gettrainingdonesvm.R: -------------------------------------------------------------------------------- 1 | #' MegaR gettrainingdonesvm 2 | #' 3 | #' This is the function to get class information for the input data from the 4 | #' metadata file and build the support vector machines as predictive models. 5 | #' @param mytable3 processed input file with features 6 | #' @param classid the column number in metadata file in which the class of 7 | #' input data is stored 8 | #' @param ruleout the class which is to be removed from classification model 9 | #' @param sampleid the column number of metadata file which contain sample ids 10 | #' that match with input data 11 | #' @param psd the percentage of data to be split into training set 12 | #' @param metadat the metadata path 13 | #' @param svmmethod one of the many svm method available in caret 14 | #' @export 15 | 16 | gettrainingdonesvm <- function(mytable3, classid, sampleid, ruleout, psd, 17 | metadat,svmmethod, mrange){ 18 | otu_table_scaled <- mytable3 19 | otu_table_scaled_state <- data.frame(t(otu_table_scaled)) 20 | otu_table_scaled_state$country <- metadat[,classid][match( 21 | rownames(otu_table_scaled_state), metadat[,sampleid])] 22 | otu_table_scaled_state <- stats::na.omit(otu_table_scaled_state) 23 | otu_table_scaled_state$country <- factor(otu_table_scaled_state$country, levels = ruleout) 24 | otu_table_scaled_state1 <- stats::na.omit(droplevels( otu_table_scaled_state)) 25 | tunegrid <- expand.grid(.C = seq(mrange[[1]],mrange[[2]], 0.01)) 26 | 27 | set.seed(60) 28 | smp_size <- floor((psd/100) * nrow(otu_table_scaled_state1)) 29 | train_ind <- sample(seq_len(nrow(otu_table_scaled_state1)), size = smp_size) 30 | train <- otu_table_scaled_state1[train_ind, ] 31 | train<-droplevels(train) 32 | test <- otu_table_scaled_state1[-train_ind,] 33 | RF_state_classify <- caret::train(as.factor(country)~. , 34 | data =train,method = "svmLinear", tuneGrid = tunegrid,trControl = caret::trainControl(savePredictions = T, classProbs = T, verboseIter = T)) 35 | return(list(train, test, RF_state_classify)) 36 | } 37 | -------------------------------------------------------------------------------- /R/getunknpredict.R: -------------------------------------------------------------------------------- 1 | #' MegaR analysis 2 | #' 3 | #' This is an internal function used to predict the given dataset. 4 | #' 5 | #' @param unknormdata unknown dataset 6 | #' @param a model list with elements ****** 7 | #' @export 8 | getunknpredict <- function(unknormdata, a){ 9 | rownames(unknormdata)<- gsub("|", ".", rownames(unknormdata), fixed = TRUE) 10 | new_leveled_ukn.s1 <- unknormdata[match(colnames(a[[1]]), 11 | rownames(unknormdata)),] 12 | rownames(new_leveled_ukn.s1) <- colnames(a[[1]]) 13 | new_leveled_ukn.s1[is.na(new_leveled_ukn.s1)] <- 0 14 | #prediction of unknown data 15 | RF.predict <- stats::predict(a[[3]] , t(new_leveled_ukn.s1)) 16 | tablemy <- data.frame( rownames(t(new_leveled_ukn.s1)), RF.predict) 17 | return(tablemy) 18 | } 19 | -------------------------------------------------------------------------------- /R/megaRshiny.R: -------------------------------------------------------------------------------- 1 | #' MegaR megaRshiny 2 | #' Use MegaR through shiny interface 3 | #' 4 | #' This function allows the user to input data files and alter the input 5 | #' variables to make sure the formatting is correct. 6 | #' They can then run the MegaR package which will output the results and plots 7 | #' in the browser and allow the user to download results as needed. 8 | #' 9 | #' @importFrom shiny shinyUI 10 | #' @importFrom shiny tabPanel 11 | #' @importFrom shiny sidebarLayout 12 | #' @importFrom shiny sidebarPanel 13 | #' @importFrom shiny selectInput 14 | #' @importFrom shiny uiOutput 15 | #' @importFrom shiny fileInput 16 | #' @importFrom shiny radioButtons 17 | #' @importFrom shiny mainPanel 18 | #' @importFrom shiny downloadButton 19 | #' @importFrom shiny sliderInput 20 | #' @importFrom shiny plotOutput 21 | #' @importFrom shiny renderUI 22 | #' @importFrom shiny observeEvent 23 | #' @importFrom shiny reactiveValues 24 | #' @importFrom shiny tags 25 | #' @importFrom shiny renderPlot 26 | #' @importFrom shiny downloadHandler 27 | #' @importFrom shiny shinyApp 28 | #' @importFrom shiny updateRadioButtons 29 | #' @importFrom shiny stopApp 30 | #' @importFrom shiny textInput 31 | #' @importFrom shiny navbarPage 32 | #' @importFrom biomaRt listDatasets 33 | #' @importFrom biomaRt useMart 34 | #' @importFrom biomaRt listAttributes 35 | #' @importFrom biomaRt listFilters 36 | #' @importFrom DT renderDataTable 37 | #' @importFrom DT dataTableOutput 38 | #' @importFrom DT datatable 39 | #' @importFrom grDevices dev.off 40 | #' @importFrom grDevices png 41 | #' @importFrom graphics legend 42 | #' @importFrom graphics matplot 43 | #' @importFrom graphics par 44 | #' @importFrom utils write.csv 45 | #' @importFrom utils write.table 46 | #' @examples 47 | #' if(interactive()) {MegaR()} 48 | #' @export 49 | #' 50 | MegaR <- function(){ 51 | 52 | 53 | ##check prediction 54 | #library(shiny) 55 | ##library(shinythemes) 56 | 57 | #library(randomForest) 58 | #library(stringr) 59 | #library(plyr) 60 | #library(ggplot2) 61 | #library(RColorBrewer) 62 | #library(biomformat) 63 | #library(caret) 64 | options(warn=-1) 65 | #source("glm.R") 66 | #source("getgoodfea.R") 67 | #source("getleveldata.R") 68 | #source("training.R") 69 | #source("plotconfumat.R") 70 | #source("readdata.R") 71 | #source("prediction.R") 72 | #source("plottopimptfeat.R") 73 | #source("svmmodeltrain.R") 74 | #source("validation.R") 75 | options(shiny.maxRequestSize=30*1024^2) 76 | 77 | 78 | 79 | ui <- shiny::fluidPage(theme=shinythemes::shinytheme("flatly"), 80 | shiny::navbarPage("MegaR",id= "inTabsetm", 81 | shiny::tabPanel("Data Input", 82 | shiny::fluidRow(shiny::sidebarLayout( 83 | shiny::sidebarPanel(shiny::fileInput( 84 | inputId = "file1otutable", 85 | label = "COUNT TABLE", 86 | multiple = FALSE) 87 | ), 88 | shiny::mainPanel(type = "tab",shiny::tabsetPanel( 89 | shiny::tabPanel("Data", 90 | DT::dataTableOutput("mdataTbl", width = 800)) 91 | #tabPanel("G_Heatmap", 92 | #plotOutput("mgenus")), 93 | #tabPanel("S_Heatmap", 94 | #plotOutput("mspecies")) 95 | )) 96 | )) 97 | ), 98 | shiny::tabPanel("Preprocessing", 99 | shiny::fluidRow( 100 | shiny::sidebarLayout( 101 | shiny::sidebarPanel( 102 | shiny:: radioButtons("level", 103 | "Criteria for feature selection", 104 | choices = c("Genus Level", 105 | "Species Level", 106 | "All Level"), 107 | selected = "Genus"), 108 | shiny:: numericInput( 109 | "threshold", "Threshold",min= 0, 110 | max = 100, step = 0.001, 111 | value = 0.003), 112 | shiny::sliderInput( 113 | "samplePercent", "Percentage of Sample", min = 0 , max = 100,step = 1, value=5), 114 | shiny:: helpText( 115 | "OTU that have less than the threshold value in given percentage of sample are 116 | removed."), 117 | shiny:: radioButtons('norm' ,"Normalization",choices = c(TMM="TMM", Quantile = "quantile", CSS = "CSS", NO="none"), 118 | selected = "")), 119 | shiny::mainPanel(shiny::tabsetPanel(shiny::tabPanel("Data",DT::dataTableOutput( 120 | "mGoodTbl", width = 800))))))), 121 | shiny::navbarMenu("Model building", 122 | shiny::tabPanel("GLM", 123 | shiny::sidebarLayout(shiny::sidebarPanel( 124 | shiny::fileInput( 125 | inputId = "gmyresponseVector", 126 | label ="Please upload a metadata file",multiple = FALSE), 127 | shiny::numericInput("gclassid",label ="Column number for class ID", 128 | min = 1, max = 100, value =7), 129 | shiny::numericInput("gsampleid",label= "Column number for sample ID", 130 | min = 1, max = 100, value =53), 131 | shiny::numericInput("gpsd","Percentage of data in training", 132 | min = 60, max = 100, value = 90), 133 | shiny::uiOutput("gselectclass"),#shiny::textInput("gruleout",label = "Remove class", value = "EST"), 134 | shiny::actionButton("runglm","Run") 135 | ), 136 | shiny:: mainPanel(shiny::tabsetPanel(shiny:: tabPanel("Train Error", 137 | shiny::verbatimTextOutput("gAOC")), 138 | shiny::tabPanel("Test Error",shiny::uiOutput("gmyconfusionMatrix"), 139 | shiny:: actionButton("gaplot2", "Plot test error"), 140 | shiny:: uiOutput("gdownload2") , 141 | shiny:: actionButton("gastats2", "Stats of the test error")), 142 | shiny::tabPanel("AUC", shiny::imageOutput('aucglm'), shiny::uiOutput("AUCdownloadglm")), 143 | shiny::tabPanel("Download",shiny::downloadButton('downloadmodelglm',"Download Model")) 144 | )))), 145 | 146 | shiny:: tabPanel("Random Forest", shiny::sidebarLayout( 147 | shiny::sidebarPanel(shiny::fileInput( 148 | inputId = "myresponseVector",label="Please upload a metadata file", 149 | multiple = FALSE), 150 | shiny::numericInput("classid",label ="Column number for class ID", 151 | min = 1, max = 100, value =7), 152 | shiny:: numericInput("sampleid", label = "Column number for sample ID", 153 | min = 1, max = 100, value =2), 154 | shiny::numericInput("psd", "Percentage of data in training", 155 | min = 60, max = 100, value = 90), 156 | shiny::uiOutput("selectclass"),#shiny::textInput("ruleout", label = "Remove class", value = "EST"), 157 | shiny::sliderInput("range", "Number of variable at split", 158 | min = 1, max = 1000, value = c(1,101), round = T, step = 5), 159 | shiny::actionButton("runrf","Run") 160 | ), 161 | shiny::mainPanel(shiny::tabsetPanel(shiny::tabPanel("Train Error", 162 | shiny::uiOutput("AOC"), 163 | shiny::actionButton("aplot1", 164 | "Plot train error"), 165 | shiny::uiOutput("trainerrordl"), 166 | shiny::actionButton("astats1", "Stats of the train error")), 167 | shiny:: tabPanel("Test Error", shiny::uiOutput("myconfusionMatrix"), 168 | shiny::uiOutput("download2"), shiny::actionButton("aplot2", "Plot test error"), 169 | shiny::actionButton("astats2", "Stats of the test error")), 170 | shiny:: tabPanel("Important feature", shiny::imageOutput("imptFeature"), 171 | shiny:: uiOutput("download3")), 172 | shiny::tabPanel("Accuracy", shiny::imageOutput("accuracy"),shiny::uiOutput("download1")), 173 | shiny::tabPanel("AUC", shiny::imageOutput('auc'), shiny::uiOutput("AUCdownload")), 174 | shiny::tabPanel("Download", shiny::downloadButton('downloadmodel', "Download Model"))))) 175 | ), 176 | shiny:: tabPanel("SVM",shiny::sidebarLayout(shiny::sidebarPanel( 177 | shiny::fileInput(inputId = "smyresponseVector", 178 | label = "Please upload a metadata file", multiple = FALSE), 179 | shiny::numericInput("sclassid", label = "Column number for class ID", 180 | min = 1, max = 100, value =8), 181 | shiny::numericInput("ssampleid", label = "Column number for sample ID", 182 | min = 1, max = 100, value =53), 183 | shiny::numericInput("spsd", "percentage of data in training", 184 | min = 60, max = 100, value = 90), 185 | shiny::uiOutput("sselectclass"),#shiny:: textInput("sruleout", label = "Remove class", value = "EST"), 186 | shiny::sliderInput("srange", "Cost for non-linearity", 187 | min = 0, max = 5, value = c(0.02,0.8), step = 0.01), 188 | shiny::textInput("svmtd", label = "SVM Method", value = "svmLinear"), 189 | shiny::actionButton("runsvm","Run") 190 | ), 191 | shiny::mainPanel(shiny::tabsetPanel( 192 | shiny::tabPanel("Train Error", shiny::verbatimTextOutput("sAOC")), 193 | shiny::tabPanel("Test Error", shiny::uiOutput("smyconfusionMatrix"), 194 | shiny::actionButton("saplot2", "Plot test error"), 195 | shiny::uiOutput("sdownload2"), 196 | shiny::actionButton("sastats2", "Stats of the test error")), 197 | shiny::tabPanel("Accuracy", shiny::imageOutput("saccuracy"), shiny::uiOutput('saccuracydl')), 198 | shiny::tabPanel("AUC", shiny::imageOutput('aucsvm'), shiny::uiOutput("AUCdownloadsvm")), 199 | shiny::tabPanel("Download",shiny::downloadButton('downloadmodelsvm',"Download Model")) 200 | ))) 201 | 202 | )), 203 | shiny::tabPanel("Validate", 204 | shiny:: sidebarLayout(shiny::sidebarPanel( 205 | #shiny::radioButtons("choicemdl", label = "Choose model", 206 | #choices = c(RandomForest = "rfmodel" , 207 | #SVM = "svmmodel", GLM = "glmmodel"), 208 | #selected = ""), 209 | shiny:: numericInput("ntimes", "number of validation set",min= 1, max = 10, 210 | step = 1, value = 3), 211 | shiny::actionButton("val","Validate")), 212 | shiny:: mainPanel(shiny::tabsetPanel(shiny::tabPanel("Accuracy", 213 | shiny::verbatimTextOutput("validationAcc"))) 214 | )) 215 | ), 216 | shiny:: navbarMenu("Prediction",shiny::tabPanel( 217 | "Use most recent model", 218 | shiny::sidebarLayout(shiny::sidebarPanel( 219 | shiny:: fileInput(inputId = "unknw", 220 | label= "Please input your unknown dataset", 221 | multiple= FALSE)), 222 | shiny:: mainPanel(shiny::tabsetPanel(shiny::tabPanel("Prediction", 223 | DT::dataTableOutput("Preresult", width = 800)) 224 | )))), 225 | shiny:: tabPanel("Use custom model", 226 | shiny::sidebarLayout(shiny::sidebarPanel( 227 | shiny::fileInput(inputId = 'unknw2', 228 | label = 'Please input your unknown dataset', 229 | multiple = FALSE), 230 | shiny::fileInput(inputId = 'upmodel', 231 | label = "Please input your custom model", 232 | multiple = FALSE)), 233 | shiny::mainPanel(shiny::tabsetPanel(shiny::tabPanel("Prediction", 234 | DT::dataTableOutput("Preresult2", width = 800)) 235 | )))) 236 | 237 | ) 238 | ) 239 | ) 240 | 241 | 242 | server <- function(input, output, session){ 243 | ############## function to generate specific taxon level data ############# 244 | myreaddata <- shiny::reactive({ 245 | return(readmydata(input$file1otutable$datapath)) 246 | }) 247 | 248 | myLevelData <- shiny::reactive({ 249 | return(getLevelData(myreaddata(), input$level)) 250 | }) 251 | 252 | myGoodfeature <- shiny::reactive({ 253 | return(getGoodfeature(myLevelData(),input$threshold,input$samplePercent, 254 | input$norm)) 255 | }) 256 | #progressbarrf <- shiny::observeEvent(input$runrf,{ 257 | #progress <- shiny::Progress$new(style = 'notification') 258 | #progress$set(message = "Ready to plot", value = 100) 259 | #Sys.sleep(3) 260 | #on.exit(progress$close()) 261 | #}) 262 | #progressbarglm <- shiny::observeEvent(input$runglm,{ 263 | # progress <- shiny::Progress$new(style = 'notification') 264 | # progress$set(message = "Ready to plot", value = 100) 265 | # Sys.sleep(3) 266 | # on.exit(progress$close()) 267 | #}) 268 | #progressbarsvm <- shiny::observeEvent(input$runsvm,{ 269 | #progress <- shiny::Progress$new(style = 'notification') 270 | #progress$set(message = "Ready to plot", value = 100) 271 | #Sys.sleep(3) 272 | #on.exit(progress$close()) 273 | #}) 274 | myrfmodel <- shiny::eventReactive(input$runrf, { 275 | progress <- shiny::Progress$new(style = 'notification') 276 | progress$set(message = "Working...",value = 100) 277 | on.exit(progress$close()) 278 | a <-gettrainingdonerf(myGoodfeature(), input$classid, input$sampleid, 279 | input$ruleout, input$psd,readmetadata( 280 | input$myresponseVector$datapath),input$range) 281 | selectedmodel<<-'RF' 282 | out<-list(a,'RF',input$level, input$threshold, input$samplePercent, input$norm) 283 | return(out) 284 | }) 285 | smyrfmodel <-shiny:: eventReactive(input$runsvm, { 286 | progress <- shiny::Progress$new(style = 'notification') 287 | progress$set(message = "Working...",value = 100) 288 | on.exit(progress$close()) 289 | a <- gettrainingdonesvm(myGoodfeature(), input$sclassid,input$ssampleid, 290 | input$sruleout, input$spsd,readmetadata( 291 | input$smyresponseVector$datapath),input$svmtd, input$srange) 292 | selectedmodel<<-'svmmodel' 293 | out<-list(a,'svmmodel',input$level, input$threshold, input$samplePercent, input$norm) 294 | return(out) 295 | }) 296 | gmyrfmodel <-shiny:: eventReactive(input$runglm, { 297 | progress <- shiny::Progress$new(style = 'notification') 298 | progress$set(message = "Working...",value = 100) 299 | on.exit(progress$close()) 300 | a<-gettrainingdoneglm(myGoodfeature(), input$gclassid, 301 | input$gsampleid, input$gruleout, input$gpsd, 302 | readmetadata(input$gmyresponseVector$datapath)) 303 | selectedmodel<<-'glmmodel' 304 | out<-list(a,'glmmodel',input$level, input$threshold, input$samplePercent, input$norm) 305 | return(out) 306 | }) 307 | output$mdataTbl <- DT::renderDataTable({ 308 | shiny::req(input$file1otutable$datapath) 309 | DT::datatable(myreaddata() ,options = list(scrollX = TRUE)) 310 | }) 311 | 312 | output$mGoodTbl <- DT::renderDataTable({ 313 | shiny::req(input$norm) 314 | DT::datatable(myGoodfeature(),options = list(scrollX = TRUE)) 315 | }) 316 | 317 | v1 <- shiny::reactiveValues(data = NULL) 318 | v2 <- shiny::reactiveValues(data = NULL) 319 | 320 | output$AOC <- shiny::renderUI({ 321 | shiny::req(v1$data) 322 | if(v1$data == 1){ 323 | shiny::plotOutput("plottrainerror") 324 | }else{ 325 | shiny::verbatimTextOutput("Statstrain") 326 | } 327 | }) 328 | 329 | shiny:: observeEvent(input$aplot1,{ v1$data <- 1 }) 330 | shiny::observeEvent(input$astats1,{v1$data <- 2 }) 331 | 332 | output$plottrainerror <- shiny::renderPlot({ 333 | shiny::req(input$myresponseVector$datapath) 334 | graphics::plot(myrfmodel()[[1]][[3]]$finalModel, 335 | main="Train Error during training model") 336 | }) 337 | 338 | output$Statstrain <- shiny::renderPrint({ 339 | shiny::req(input$myresponseVector$datapath) 340 | myrfmodel()[[1]][[3]]$finalModel 341 | }) 342 | 343 | output$myconfusionMatrix <- shiny::renderUI({ 344 | shiny::req(v2$data) 345 | if(v2$data == 1){ 346 | plotOutput("plotconfumat") 347 | } else{ 348 | shiny::verbatimTextOutput("Statsconfu") 349 | } 350 | }) 351 | 352 | shiny::observeEvent(input$aplot2,{ v2$data <- 1 }) 353 | shiny::observeEvent(input$astats2,{v2$data <- 2 }) 354 | 355 | output$plotconfumat <- shiny::renderPlot({ 356 | getconfuMat(myrfmodel()[[1]][[2]], myrfmodel()[[1]][[3]])[v2$data] 357 | }) 358 | 359 | output$Statsconfu <- shiny::renderPrint({ 360 | shiny::req(myrfmodel()[[1]]) 361 | getconfuMat(myrfmodel()[[1]][[2]], myrfmodel()[[1]][[3]])[v2$data] 362 | }) 363 | 364 | output$imptFeature <-shiny:: renderPlot({ 365 | shiny::req(myrfmodel) 366 | plotimptfeatures(myrfmodel()[[1]][[3]], 10) 367 | }) 368 | output$auc <- shiny::renderPlot({shiny::req(myrfmodel) 369 | rfauc <<- MLeval::evalm(myrfmodel()[[1]][[3]]) 370 | rfauc$roc 371 | }) 372 | output$aucsvm <- shiny::renderPlot({shiny::req(smyrfmodel) 373 | svmauc <<- MLeval::evalm(smyrfmodel()[[1]][[3]]) 374 | svmauc$roc 375 | }) 376 | output$aucglm <- shiny::renderPlot({shiny::req(gmyrfmodel) 377 | glmauc <<- MLeval::evalm(gmyrfmodel()[[1]][[3]]) 378 | glmauc$roc 379 | }) 380 | output$accuracy <- shiny::renderPlot({ 381 | shiny::req(myrfmodel) 382 | plot(myrfmodel()[[1]][[3]]) 383 | }) 384 | output$saccuracy <- shiny::renderPlot({ 385 | shiny::req(smyrfmodel) 386 | plot(smyrfmodel()[[1]][[3]]) 387 | }) 388 | 389 | output$validationAcc <-shiny:: renderPrint({ 390 | shiny::req(input$val) 391 | if(selectedmodel== 'RF'){ 392 | validation(input$ntimes, myrfmodel()[[2]],myGoodfeature(),input$classid, 393 | input$sampleid,input$ruleout, input$psd, 394 | readmetadata(input$myresponseVector$datapath), 395 | myrfmodel()[[1]][[3]]$finalModel$mtry)} 396 | 397 | else if (selectedmodel=='svmmodel'){ 398 | validation(input$ntimes, smyrfmodel()[[2]],myGoodfeature(), input$sclassid, 399 | input$ssampleid,input$sruleout, input$spsd, 400 | readmetadata(input$smyresponseVector$datapath), 401 | smyrfmodel()[[1]]$results$C[which(smyrfmodel()[[1]]$results$Accuracy==max(smyrfmodel()[[1]]$results$Accuracy))])} 402 | 403 | else{ 404 | validation(input$ntimes, gmyrfmodel()[[2]],myGoodfeature(), input$gclassid, 405 | input$gsampleid,input$gruleout, input$gpsd, 406 | readmetadata(input$gmyresponseVector$datapath), gmyrfmodel()[[1]])} 407 | 408 | }) 409 | 410 | output$Preresult <- DT::renderDataTable({ 411 | shiny::req(input$unknw$datapath) 412 | a <- getGoodfeature(getLevelData(readmydata(input$unknw$datapath), 413 | input$level),input$threshold, 414 | input$samplePercent, input$norm) 415 | if(selectedmodel=='RF'){ 416 | DT::datatable(getunknpredict(a,myrfmodel()[[1]]),options = list(scrollX = TRUE )) 417 | } 418 | else if(selectedmodel=='svmmodel'){ 419 | DT::datatable(getunknpredict(a,smyrfmodel()[[1]]),options = list(scrollX = TRUE)) 420 | } 421 | else { 422 | DT::datatable(getunknpredict(a,gmyrfmodel()[[1]]), options = list(scrollX = TRUE)) 423 | } 424 | }) 425 | 426 | output$Preresult2 <- DT::renderDataTable({ 427 | shiny::req(input$unknw2$datapath) 428 | shiny::req(input$upmodel$datapath) 429 | b <- readRDS(input$upmodel$datapath) 430 | a <- getGoodfeature(getLevelData(readmydata(input$unknw2$datapath), 431 | b[[3]]),b[[4]], 432 | b[[5]], b[[6]]) 433 | 434 | DT::datatable(getunknpredict(a,b[[1]]),options = list(scrollX = TRUE )) 435 | }) 436 | 437 | ####################################################################### 438 | ##### metaphlan svm ############# 439 | 440 | sv1 <- shiny::reactiveValues(data = NULL) 441 | sv2 <- shiny::reactiveValues(data = NULL) 442 | shiny::observeEvent(input$saplot2,{ sv2$data <- 1 }) 443 | shiny::observeEvent(input$sastats2,{ sv2$data <- 2 }) 444 | 445 | output$sAOC <-shiny:: renderPrint({ 446 | shiny::req(input$smyresponseVector$datapath) 447 | smyrfmodel()[[1]][[3]] 448 | }) 449 | 450 | output$smyconfusionMatrix <-shiny:: renderUI({ 451 | shiny::req(sv2$data) 452 | if(sv2$data == 1){ 453 | shiny::plotOutput("splotconfumat") 454 | } else{ 455 | shiny::verbatimTextOutput("sStatsconfu") 456 | } 457 | }) 458 | output$splotconfumat <- shiny::renderPlot({ 459 | getconfuMat(smyrfmodel()[[1]][[2]], smyrfmodel()[[1]][[3]])[1] 460 | }) 461 | output$sStatsconfu <- shiny::renderPrint({ 462 | shiny::req(smyrfmodel) 463 | getconfuMat(smyrfmodel()[[1]][[2]],smyrfmodel()[[1]][[3]])[2] 464 | }) 465 | 466 | ######################################################################## 467 | 468 | output$gAOC <- shiny::renderPrint({ 469 | shiny::req(input$gmyresponseVector$datapath) 470 | gmyrfmodel()[[1]][[3]] #, smyrfmodel[[1]]) 471 | }) 472 | 473 | gv1 <- shiny::reactiveValues(data = NULL) 474 | gv2 <- shiny::reactiveValues(data = NULL) 475 | 476 | 477 | shiny::observeEvent(input$gaplot1,{ gv1$data <- 1}) 478 | shiny::observeEvent(input$gastats1,{gv1$data <- 2}) 479 | 480 | 481 | output$gmyconfusionMatrix <- shiny::renderUI({ 482 | shiny::req(gv2$data) 483 | if(gv2$data == 1){ 484 | shiny::plotOutput("gplotconfumat") 485 | }else{ 486 | shiny::verbatimTextOutput("gStatsconfu") 487 | } 488 | }) 489 | 490 | shiny::observeEvent(input$gaplot2,{ gv2$data <- 1 }) 491 | shiny::observeEvent(input$gastats2,{ gv2$data <- 2}) 492 | 493 | output$gplotconfumat <- shiny::renderPlot({ 494 | getconfuMat(gmyrfmodel()[[1]][[2]], gmyrfmodel()[[1]][[3]])[gv2$data] 495 | }) 496 | 497 | output$gStatsconfu <- shiny::renderPrint({ 498 | shiny::req(gmyrfmodel) 499 | getconfuMat(gmyrfmodel()[[1]][[2]],gmyrfmodel()[[1]][[3]])[gv2$data] 500 | }) 501 | rf2 <- shiny::reactiveValues() 502 | observe({ 503 | if(!is.null(myrfmodel())) 504 | isolate( 505 | rf2<<-myrfmodel() 506 | ) 507 | }) 508 | output$downloadmodel <- shiny::downloadHandler( 509 | filename <- function(){ 510 | paste("Model.rds") 511 | }, 512 | content=function(file){ 513 | saveRDS(rf2,file=file) 514 | } 515 | ) 516 | rf3 <- shiny::reactiveValues() 517 | observe({ 518 | if(!is.null(smyrfmodel())) 519 | isolate( 520 | rf3<<-smyrfmodel() 521 | ) 522 | }) 523 | output$downloadmodelsvm <- shiny::downloadHandler( 524 | filename <- function(){ 525 | paste("Model.rds") 526 | }, 527 | content=function(file){ 528 | saveRDS(rf3,file=file) 529 | } 530 | ) 531 | rf4 <- shiny::reactiveValues() 532 | observe({ 533 | if(!is.null(gmyrfmodel()[[1]][[3]])) 534 | isolate( 535 | rf4<<-gmyrfmodel() 536 | ) 537 | }) 538 | output$downloadmodelglm <- shiny::downloadHandler( 539 | filename <- function(){ 540 | paste("Model.rds") 541 | }, 542 | content=function(file){ 543 | saveRDS(rf4,file=file) 544 | } 545 | ) 546 | output$trainerrordl<- shiny::renderUI({ 547 | if(!is.null(myrfmodel)){ 548 | downloadButton('tedl','Download Output File') 549 | } 550 | }) 551 | output$download1 <- shiny::renderUI({ 552 | #shiny::req(v1$data) 553 | #if(v1$data == 1) { 554 | if(!is.null(myrfmodel)){ 555 | downloadButton('down', 'Download Output File') 556 | } 557 | }) 558 | output$download2 <- shiny::renderUI({ 559 | shiny::req(v2$data) 560 | if(v2$data == 1){ 561 | downloadButton('confudown', 'Download Output File') 562 | } 563 | }) 564 | output$sdownload2 <- shiny::renderUI({ 565 | #shiny::req(sv2$data) 566 | #if(sv2$data == 1){ 567 | if(!is.null(smyrfmodel)){ 568 | downloadButton('sconfudown', 'Download Output File') 569 | } 570 | }) 571 | output$gdownload2 <- shiny::renderUI({ 572 | shiny::req(gv2$data) 573 | if(gv2$data == 1){ 574 | downloadButton('gconfudown', 'Download Output File') 575 | } 576 | }) 577 | output$download3 <- shiny::renderUI({ 578 | if(!is.null(myrfmodel)) { 579 | downloadButton('imptfeat', 'Download Output File') 580 | } 581 | }) 582 | output$saccuracydl <- shiny::renderUI({ 583 | if(!is.null(smyrfmodel)){ 584 | downloadButton("saccdl", "Download Output File") 585 | } 586 | }) 587 | output$AUCdownload <- shiny::renderUI({ 588 | if(!is.null(myrfmodel)) { 589 | downloadButton("AUCdl", 'Download AUC Graph') 590 | } 591 | }) 592 | output$AUCdownloadsvm <- shiny::renderUI({ 593 | if(!is.null(myrfmodel)) { 594 | downloadButton("AUCdlsvm", 'Download AUC Graph') 595 | } 596 | }) 597 | output$AUCdownloadglm <- shiny::renderUI({ 598 | if(!is.null(myrfmodel)) { 599 | downloadButton("AUCdlglm", 'Download AUC Graph') 600 | } 601 | }) 602 | output$down <- shiny::downloadHandler( 603 | filename = "stats_plot.pdf", 604 | content = function(file){ 605 | grDevices::pdf(file) # open the pdf device 606 | print(graphics::plot(myrfmodel()[[1]][[3]])) 607 | dev.off() 608 | } 609 | ) 610 | output$confudown <- shiny::downloadHandler( 611 | filename = "confusion_matrix.pdf", 612 | content = function(file) { 613 | grDevices::pdf(file) # open the pdf device 614 | print( getconfuMat(myrfmodel()[[1]][[2]], myrfmodel()[[1]][[3]])) 615 | dev.off() 616 | } 617 | ) 618 | output$sconfudown <- shiny::downloadHandler( 619 | filename = "confusion_matrix.pdf", 620 | content = function(file) { 621 | grDevices::pdf(file) # open the pdf device 622 | print( getconfuMat(smyrfmodel()[[1]][[2]], smyrfmodel()[[1]][[3]])) 623 | dev.off() 624 | } 625 | ) 626 | output$gconfudown <- shiny::downloadHandler( 627 | filename = "confusion_matrix.pdf", 628 | content = function(file) { 629 | grDevices::pdf(file) # open the pdf device 630 | print( getconfuMat(gmyrfmodel()[[1]][[2]], gmyrfmodel()[[1]][[3]])) 631 | dev.off() 632 | } 633 | ) 634 | output$imptfeat <- shiny::downloadHandler( 635 | filename = "important_features.pdf", 636 | content = function(file) { 637 | grDevices::pdf(file) # open the pdf device 638 | print(plotimptfeatures(myrfmodel()[[1]][[3]], 10)) 639 | dev.off() 640 | } 641 | ) 642 | output$AUCdl <- shiny::downloadHandler( 643 | filename = "AUC.pdf", 644 | content = function(file) { 645 | grDevices::pdf(file) 646 | print(rfauc$roc) 647 | dev.off() 648 | } 649 | ) 650 | output$AUCdlsvm <- shiny::downloadHandler( 651 | filename = "AUC.pdf", 652 | content = function(file) { 653 | grDevices::pdf(file) 654 | print(svmauc$roc) 655 | dev.off() 656 | } 657 | ) 658 | output$AUCdlglm <- shiny::downloadHandler( 659 | filename = "AUC.pdf", 660 | content = function(file) { 661 | grDevices::pdf(file) 662 | print(glmauc$roc) 663 | dev.off() 664 | } 665 | ) 666 | output$saccdl <- shiny::downloadHandler( 667 | filename = "Accuracy.pdf", 668 | content = function(file) { 669 | grDevices::pdf(file) 670 | print(plot(smyrfmodel()[[1]][[3]])) 671 | dev.off() 672 | } 673 | ) 674 | output$tedl <- shiny::downloadHandler( 675 | filename = "Train_error.pdf", 676 | content = function(file) { 677 | grDevices::pdf(file) 678 | print(graphics::plot(myrfmodel()[[1]][[3]]$finalModel, 679 | main="Train Error during training model")) 680 | dev.off() 681 | } 682 | ) 683 | output$selectclass <- renderUI({ 684 | req(input$myresponseVector$datapath) 685 | selectInput("ruleout", "Select classification labels", 686 | choices = levels(as.factor(readmetadata( 687 | input$myresponseVector$datapath)[,input$classid])) , 688 | multiple = TRUE) 689 | }) 690 | output$sselectclass <- renderUI({ 691 | req(input$smyresponseVector$datapath) 692 | selectInput("sruleout", "Select classification labels", 693 | choices = levels(as.factor(readmetadata( 694 | input$smyresponseVector$datapath)[,input$sclassid])) , 695 | multiple = TRUE) 696 | }) 697 | output$gselectclass <- renderUI({ 698 | req(input$gmyresponseVector$datapath) 699 | selectInput("gruleout", "Select classification labels", 700 | choices = levels(as.factor(readmetadata( 701 | input$gmyresponseVector$datapath)[,input$gclassid])) , 702 | multiple = TRUE) 703 | }) 704 | } 705 | shiny::runApp(shiny::shinyApp(ui, server), quiet=FALSE, launch.browser=TRUE) 706 | #shinyApp(ui, server) 707 | } 708 | 709 | -------------------------------------------------------------------------------- /R/plotimptfeatures.R: -------------------------------------------------------------------------------- 1 | #' MegaR analysis 2 | #' This function plots the top 10 important features for random forest 3 | #' classification. 4 | #' 5 | #' @param RF_state_classify the random forest model 6 | #' @param noOffeature no. of feature =10 7 | #' @export 8 | #' 9 | plotimptfeatures <- function(RF_state_classify, noOffeature){ 10 | lk<- varImp(RF_state_classify) 11 | tablelk<-lk$importance 12 | tablelk$first <- rownames(tablelk) 13 | new <-tablelk[order(tablelk$Overall, decreasing = TRUE),] 14 | fc <- grDevices::colorRampPalette(rev(RColorBrewer::brewer.pal(n = 9, 15 | "Blues"))) 16 | a <- graphics::barplot(new[1:10,]$Overall,names.arg= substr(stringr::str_remove 17 | (new[1:10,]$first, ".*s__" ),1,20), 18 | cex.axis = .75, cex.names = .75, col = fc(10)) 19 | return(a) 20 | } 21 | -------------------------------------------------------------------------------- /R/readmetadata.R: -------------------------------------------------------------------------------- 1 | #' MegaR analysis 2 | #' This is internal function to read data 3 | 4 | #' @param x the path to the file 5 | 6 | #' @export 7 | readmetadata <- function(x){ 8 | mymetaData<- utils::read.table(x, 9 | header = TRUE, sep = "\t", stringsAsFactors = FALSE) 10 | return(mymetaData) 11 | } 12 | 13 | #' MegaR analysis 14 | #' @param x the path to the file 15 | #' @export 16 | readmydata <- function(x){ 17 | success <- try(otufromqiime <- biomformat::read_biom(x), silent = TRUE) 18 | is.error <- function(x) inherits(x, "try-error") 19 | 20 | if (is.error(success)==TRUE){ 21 | qiimedatamatrix <- utils::read.table(x,header = TRUE, sep= "\t", 22 | row.names = 1, 23 | quote = "", stringsAsFactors = FALSE) 24 | colnames(qiimedatamatrix) <- stringr::str_remove(colnames( 25 | qiimedatamatrix), "X") 26 | } 27 | else if(is.error(success)==FALSE){ 28 | qiimedata <- biomformat::read_biom(x) 29 | qiimedatamatrix <- as.data.frame(as.matrix(biomformat::biom_data( 30 | qiimedata))) 31 | rownames(qiimedatamatrix) <- make.names( 32 | gsub(" ", "", apply(biomformat::observation_metadata(qiimedata), 1, 33 | function(x) 34 | {paste(x, collapse="|")}), fixed = TRUE), 35 | unique = TRUE) 36 | } 37 | return(qiimedatamatrix) 38 | } 39 | 40 | 41 | -------------------------------------------------------------------------------- /R/savePlot.R: -------------------------------------------------------------------------------- 1 | #' MegaR savePlot 2 | #' 3 | #' This is a internal function. This function allows the program to 4 | #' save the plot generated in the program. 5 | 6 | #' @param file name of the file where data is to be stored 7 | #' @param plotIn the plot which is stored 8 | #' import ggsave from ggplot2** 9 | savePlot <- function(file, plotIn) { 10 | ggplot2::ggsave( 11 | device = "pdf", 12 | plot = plotIn, 13 | width = 5, 14 | height = 5, 15 | units = "in", 16 | dpi = 200 17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /R/validation.R: -------------------------------------------------------------------------------- 1 | #' MegaR validation 2 | #' 3 | #' This function conducts 10 fold cross validation on N set of data 4 | #' @param Num No. of sets to run for validation 5 | #' @param modelclas one of the model, randomforest, supportvector machine or 6 | #' generalized linear model 7 | #' @param mytable3 processed input file with features 8 | #' @param classid the column number in metadata file in which the class of 9 | #' input data is stored 10 | #' @param ruleout the class which is to be removed from classification model 11 | #' @param sampleid the column number of metadata file which contain sample ids 12 | #' that match with input data 13 | #' @param psd the percentage of data to be split into training set 14 | #' @param metadat the metadata path 15 | #' 16 | #' @export 17 | 18 | validation<-function(Num,modelclas,mytable3,classid,sampleid,ruleout,psd, 19 | metadat, optparam){ 20 | otu_table_scaled <- mytable3 21 | otu_table_scaled_state <- data.frame(t(otu_table_scaled)) 22 | otu_table_scaled_state$country <- metadat[,classid][match( 23 | rownames (otu_table_scaled_state), 24 | metadat[,sampleid])] 25 | otu_table_scaled_state <- stats::na.omit(otu_table_scaled_state) 26 | otu_table_scaled_state$country <- factor(otu_table_scaled_state$country, levels = ruleout) # add this lin 27 | otu_table_scaled_state1 <- stats::na.omit(droplevels( otu_table_scaled_state)) 28 | fit_control <- caret::trainControl(method = "LOOCV") 29 | progress <- shiny::Progress$new(style = 'notification') 30 | progress$set(message = "Working...",value = 0) 31 | Acc3<- NULL 32 | Kpp3 <- NULL 33 | for (i in 1:Num) { 34 | smp_size <- floor((psd/100) * nrow(otu_table_scaled_state1)) 35 | train_ind <- sample(seq_len(nrow(otu_table_scaled_state1)), 36 | size = smp_size) 37 | mtrain <- otu_table_scaled_state1[train_ind, ] 38 | #mtrain<-droplevels(mtrain) 39 | test <- otu_table_scaled_state1[-train_ind,] 40 | if(modelclas == "RF"){ 41 | #RF_state_classify <- randomForest::randomForest( 42 | # as.factor(country)~. ,data =train,importance = T,proximities=T) 43 | RF_state_classify_loocv <- caret::train( 44 | as.factor(country)~. , data = mtrain,method="rf",ntree= 501, 45 | .mtry = optparam, trControl=fit_control) 46 | Acc3[i] <- RF_state_classify_loocv$results$Accuracy 47 | Kpp3[i] <- RF_state_classify_loocv$results$Kappa 48 | #optparam 49 | } 50 | else if(modelclas == "svmmodel"){ 51 | RF_state_classify_loocv <- caret::train(as.factor(country)~. , 52 | data =mtrain , method="svmLinear", 53 | trControl=fit_control, .C=optparam) 54 | Acc3[i] <- RF_state_classify_loocv$results$Accuracy 55 | Kpp3[i] <- RF_state_classify_loocv$results$Kappa 56 | } 57 | else { 58 | RF_state_classify_loocv <- caret::train(as.factor(country)~. , 59 | data =mtrain , method="glm" , 60 | trControl=fit_control) 61 | Acc3[i] <- RF_state_classify_loocv$results$Accuracy 62 | Kpp3[i] <- RF_state_classify_loocv$results$Kappa 63 | } 64 | progress$inc(i/Num, detail=paste("Validation set", i+1)) 65 | } 66 | on.exit(progress$close()) 67 | sprintf("The 10 fold cross validated obtained from the average of %i 68 | independent run is %f. ", Num , sum(Acc3)/Num ) 69 | } 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MegaR: A user-friendly interactive machine learning interface for metagenomic analysis to identify and predict disease sample accurately. 2 | 3 | ### Cite this article 4 | Dhungel, E., Mreyoud, Y., Gwak, HJ. et al. MegaR: an interactive R package for rapid sample classification and phenotype prediction using metagenome profiles and machine learning. BMC Bioinformatics 22, 25 (2021). [https://doi.org/10.1186/s12859-020-03933-4](https://doi.org/10.1186/s12859-020-03933-4) 5 | 6 | ### Summary 7 | 8 | Machine learning has been utilized in many applications from biomedical imaging to business analytics. Machine learning is stipulated to be a strong method for diagnostics and even for determining therapeutics in future as we move to personalized medicine. MegaR provides an unprecedented opportunity to develop machine learning models from metagenomic data available publicly as well as to perform classification of data samples based on the optimal model we developed. 9 | 10 | The description below walks you through the analysis of the WGS of T1D cohort from DIABIMMUNE project (https://pubs.broadinstitute.org/diabimmune) where the goal of this cohort is to compare microbiome in infants who have developed type 1 diabetes (T1D) or serum autoantibodies (markers predicting the onset of T1D) with healthy controls in the same area. 11 | 12 | The general workflow is described in below. 13 | 14 | If you would like to preview MegaR without downloading the package, you can visit https://megar.shinyapps.io/preview 15 | *Note:* You will still need to download the data set locally. That can be done [here](https://github.com/BioHPC/MegaR/tree/master/data/WGS/T1D.zip). 16 | 17 | 18 | ### Pre-requisites: 19 | 20 | * R version 21 | * Download R (>3.6.0) version from CRAN. 22 | * Windows: https://cran.r-project.org/bin/windows/base/ 23 | * Mac OS X: https://cran.r-project.org/bin/macosx/ 24 | * Linux: https://cran.r-project.org/bin/linux/ 25 | 26 | ## Installing MegaR: 27 | 28 | There are two ways to install MegaR. The first is using devtools, and the second is using the MegaR.tar.gz file. 29 | 30 | #### [1] Devtools installation: 31 | 32 | * Libraries: 33 | * devtools 34 | 35 | To install devtools, use below command: 36 | ``` 37 | > install.packages("devtools") 38 | ``` 39 | *Note*: MegaR also uses shiny, shinythemes; randomForest; stringr; caret, plyr; ggplot2; RColorBrewer, DT. However, those packages will be automatically installed if using install_github from below. 40 | 41 | 42 | Using an R interface, type: 43 | ``` 44 | > devtools::install_github("BioHPC/MegaR") 45 | ``` 46 | 47 | #### [2] MegaR.tar.gz installation: 48 | 49 | Download the MegaR.tar.gz file from [here](https://github.com/BioHPC/MegaR/blob/master/MegaR_1.0.tar.gz) 50 | 51 | In the R console, type: 52 | ``` 53 | >setwdir("/path/") 54 | ``` 55 | Where path is the location of the downloaded MegaR.tar.gz file. 56 | 57 | Once in the correct location, type: 58 | ``` 59 | >install.packages(MegaR.tar.gz) 60 | ``` 61 | Alternatively, you may install the package using the R interface by going to: 62 | ``` 63 | Tools > Installpackages... > Package Archive File > Browse... > MegaR.tar.gz 64 | ``` 65 | 66 | ## Getting Started 67 | 68 | In RStudio, use following command: 69 | 70 | ``` 71 | > library(MegaR) 72 | > MegaR() 73 | ``` 74 | 75 | ### Data Input ### 76 | 77 | MegaR can take both OTU table and BIOM file from popular metagenomic profiling tools, [metaphlan](https://www.nature.com/articles/nmeth.2066) and [qiime](https://www.nature.com/articles/nmeth.f.303). 78 | MegaR provides sample data from the DIABIMMUNE project. If you clone or download the full MegaR package, the data files are located in data folder. Otherwise, the data set used for this example is the T1D dataset that can be downloaded from [here](https://github.com/BioHPC/MegaR/tree/master/data/WGS/T1D.zip). 79 | 80 | * Clicking the browse tab, user can upload the input file from anywhere in the computer path. 81 | * For T1D experiment, upload **merged_metaphlan_t1d.txt** file. 82 | * After the data is uploaded, the contents of the data are displayed as an interactive table under the **Data** tab. 83 | 84 | ![](https://github.com/BioHPC/MegaR/blob/master/screenshot/input.gif) 85 | 86 | ### Data Preprocessing ### 87 | After the data is loaded, it can be preprocessed to allow efficient machine leaning. Click preprocess tab and select the appropriate taxonomic level information to use for machine learning. 88 | 89 | #### Criteria for feature selection #### 90 | **Genus Level** and **Species Level** tabs return genus and species level from the dataset as the feature. **All Level** tab tracks back the taxon level for unclassified higher order. For the T1D experiment, 91 | 92 | * Clicking **Species Level** for feature selection. 93 | 94 | #### Threshold #### 95 | This field is getting a floating number to remove profiles and their abundances below the threshold value. Default value is **0.003**. 96 | 97 | * For the T1D experiment, just leave the the deafult value (0.03). 98 | 99 | #### Percentage of Sample #### 100 | The **Percentage of Sample** slider bar can be adjusted to select the percentage of sample that should include the threshold amount of abundance present in the data. Default value is **5%**. 101 | 102 | * For the T1D experiment, just leave the the deafult value (5%). 103 | 104 | #### Normalization #### 105 | There is a choice for normalizing the data. MegaR provides fours choices for data normalization: **Cumulative Sum Scaling (CSS)**, **Quantile**, **Trimmed Mean of M-values (TMM)**, and **NO**. After choosing the desired normalization, the processed data that is ready for building machine learning models is seen under the data tab. 106 | 107 | * For the T1D experiment, select **NO**. 108 | 109 | ![](https://github.com/BioHPC/MegaR/blob/master/screenshot/preprocessing.gif) 110 | 111 | ### Model Development ### 112 | 113 | There are three machine learning models available for classification. **Generalized Linear Model (GLM)**, **Random Forest Model**, and **Support Vector Machines**. If a user click the **Model building** tabl, the user can select the appropriate machine learning model. 114 | 115 | * For the T1D experiment, select **Random Forest**. 116 | 117 | #### Upload a metadata file #### 118 | Upload a metadata file containing information about the sample dataset. The metadata should be tab-separated file with rows containing sample ids and columns containing the other information like class that each sample belongs to. The sample ID in the metadata **must match** exactly to sample ID in the initial metaphlan/qiime file. 119 | 120 | * For the T1D experiment, upload **metadata.tsv** file in the T1D dataset. 121 | 122 | #### Column number for class info #### 123 | Provide a column number for class info. For the T1D expeirment, column 7 (T1D_Diagnosed) has the class values (t, f) where t is True and f is False. 124 | 125 | * For the T1D experiment, provide **7** for this field. 126 | 127 | #### Column number for sample ID #### 128 | Provide a column number for sample IDs. For the T1D expeirment, column 2 (Gid_shotgun) has the sample IDs. 129 | 130 | * For the T1D experiment, provide **2** for this field. 131 | 132 | #### Percentage of data in training #### 133 | Then select the percentage of data that you want to use to train a model. One can use as much as 100% of the data but then there will be no test set to generate confusion matrix. 134 | 135 | * For the T1D experiment, provide **80** for this field. 136 | 137 | #### Select classification labels #### 138 | Provide lables of the classification. For example, the T1D metadata column 2 has the class values (t, f) where t is True and f is False. MegaR automatically pulls the class labels from the provided column number for the class info. 139 | 140 | * For the T1D experiment, select **f** and **t** in this field. 141 | 142 | #### Number of variable at split #### 143 | This field is the number of variable that is randomly collected to be sampled at each split time. **Accuracy** results will show the results by this randomly selected predictors. The default value is from **1** to **101**. 144 | 145 | * For the T1D experiment, select **41** and **81** in this field. 146 | 147 | ### Model Results ### 148 | 149 | #### Train Error #### 150 | The error rate of prediction during training a model is given by the plot under error rate. 151 | 152 | ![](https://github.com/BioHPC/MegaR/blob/master/screenshot/trainerror.PNG) 153 | 154 | #### Test Error #### 155 | The error rate of prediction on test set is a better estimate of model accuracy and it can be estimated using confusion matrix generated under confusion Matrix tab. The Statistics of how well the model performs can also be obtained using the statistics tab. 156 | 157 | ![](https://github.com/BioHPC/MegaR/blob/master/screenshot/testerror.PNG) 158 | ![](https://github.com/BioHPC/MegaR/blob/master/screenshot/teststats.PNG) 159 | 160 | #### Important feature #### 161 | From a practical perspective, it is important to identify features that are important in identifying the class of metagenomic sample. The top ten important species or genus crucial in identifying the class of sample along with their variable importance is shown under the **Important Feature** tab. 162 | 163 | ![](https://github.com/BioHPC/MegaR/blob/master/screenshot/features.PNG) 164 | 165 | #### Accuracy #### 166 | For the random forest model, a user can select the number of predictors to be used during each split. Similarly, users can also select the range of cost to be applied to support vector machines. A plot for the accuracy of the model based on selected parameter can be seen in accuracy tab. MegaR selects the best accuracies from among the selected parameter for model building. An additional feature of tool that can improve accuracy is the **Select level to classify** tab. When more than two classes are present, only the classes that are examined for classification can be selected. This also allows the removal of control and other less important classes from the model, thus increasing the model accuracy. 167 | 168 | ![](https://github.com/BioHPC/MegaR/blob/master/screenshot/accuracy.PNG) 169 | 170 | #### AUC #### 171 | AUC - ROC curve is a performance measurement for classification problem at various thresholds settings. MegaR visualize the AUC-ROC plot. 172 | 173 | ![](https://github.com/BioHPC/MegaR/blob/master/screenshot/AUC.PNG) 174 | 175 | #### Download #### 176 | Finally, MegaR provides the option to download the trained model for later use in Prediction. If a user clicks **Download Model**, the RDS model file is generated and downloaded. A user can load this model for the fast prediction of unknown samples without training the model again. 177 | 178 | ![](https://github.com/BioHPC/MegaR/blob/master/screenshot/download.PNG) 179 | 180 | ### Validation ### 181 | Cross-validation is a manner to access, judge, and review the performance of machine learning models. First and foremost, cross validation is essential to validate the model accuracy and model bias. This implies that the developed model should not be overfitted and not having bias. 182 | To make a better model, all data set is not usually used for the training purpose, but split into training and validating/testing sets. For example, in k-fold cross validation, the dataset is shuffled and divided into k sub samples. The k-1 samples are used as a training dataset and the single partition is used for validation. This process is repeated k times to represent the model performance. MegaR provides cross validation options allowing for an accurate prediction measure. The variance in fitting the model tends to be higher if it is fitted to a small dataset, therefore k-fold cross validation can have a high variance. MegaR provides users to select N independent runs of the 10-fold cross validation to minimize such a high variance. 183 | 184 | * For the T1D experiment, provide **3** for this field. 185 | 186 | ![](https://github.com/BioHPC/MegaR/blob/master/screenshot/Validation.PNG) 187 | 188 | ### Prediction ### 189 | Finally, we can upload unknown test set and get the prediction on which category they fall into as a list. Unknown set must be biom file if model is developed from qiime data and merged metaphlan table if model is developed from the metaphlan data. 190 | 191 | ![](https://github.com/BioHPC/MegaR/blob/master/screenshot/prediction.PNG) 192 | 193 | It is also possible to upload a previously trained model for prediction using the **Use custom model** tab under **Prediction**. If a user click the **Prediction** and select **Use cumstome model**, then a user can upload the downloaded RDS model (trained model) along with the unknown dataset to predict the phenotype fast without training the model again. 194 | 195 | ![](https://github.com/BioHPC/MegaR/blob/master/screenshot/Prediction_CustomModel3.png) 196 | -------------------------------------------------------------------------------- /data/16S/Antibiotic/Antibiotics_metadata.tsv: -------------------------------------------------------------------------------- 1 | "subject" "Year of birth" "Country" "Gender" "Delivery type" "Gestational age" "Antibiotcs_treated" 2 | "E000823" "2008" "Finland" "Male" "Vaginal delivery" "39+4" FALSE 3 | "E001958" "2008" "Finland" "Female" "Vaginal delivery" "40+1" FALSE 4 | "E003188" "2008" "Finland" "Female" "Vaginal delivery" "38+6" TRUE 5 | "E003953" "2008" "Finland" "Female" "Vaginal delivery" "39+5" TRUE 6 | "E004628" "2008" "Finland" "Male" "Ceasarean section" "40+3" TRUE 7 | "E004709" "2008" "Finland" "Male" "Vaginal delivery" "40+2" FALSE 8 | "E004898" "2008" "Finland" "Male" "Vaginal delivery" "41+1" TRUE 9 | "E005786" "2008" "Finland" "Female" "Vaginal delivery" "38+3" TRUE 10 | "E006091" "2008" "Finland" "Female" "Vaginal delivery" "40+2" TRUE 11 | "E006493" "2009" "Finland" "Female" "Vaginal delivery" "40+0" FALSE 12 | "E006781" "2009" "Finland" "Female" "Vaginal delivery" "39+4" TRUE 13 | "E007944" "2009" "Finland" "Female" "Vaginal delivery" "40+2" FALSE 14 | "E010481" "2009" "Finland" "Male" "Vaginal delivery" "40+5" TRUE 15 | "E010581" "2009" "Finland" "Male" "Vaginal delivery" "37+3" FALSE 16 | "E010682" "2009" "Finland" "Female" "Vaginal delivery" "42+0" TRUE 17 | "E011878" "2009" "Finland" "Male" "Vaginal delivery" "41+0" TRUE 18 | "E012854" "2009" "Finland" "Male" "Vaginal delivery" "40+4" TRUE 19 | "E013094" "2009" "Finland" "Male" "Vaginal delivery" "41+0" FALSE 20 | "E013505" "2009" "Finland" "Male" "Vaginal delivery" "35+3" TRUE 21 | "E014086" "2009" "Finland" "Female" "Vaginal delivery" "41+1" FALSE 22 | "E014403" "2009" "Finland" "Male" "Vaginal delivery" "41+4" TRUE 23 | "E016063" "2009" "Finland" "Female" "Ceasarean section" "39+1" FALSE 24 | "E016273" "2009" "Finland" "Male" "Vaginal delivery" "41+2" FALSE 25 | "E016426" "2009" "Finland" "Male" "Vaginal delivery" "37+5" TRUE 26 | "E017497" "2009" "Finland" "Male" "Vaginal delivery" "40+0" FALSE 27 | "E018286" "2009" "Finland" "Female" "Ceasarean section" "39+1" FALSE 28 | "E018754" "2009" "Finland" "Female" "Vaginal delivery" "39+1" FALSE 29 | "E019092" "2009" "Finland" "Male" "Ceasarean section" "35+1" FALSE 30 | "E019763" "2009" "Finland" "Female" "Vaginal delivery" "38+5" FALSE 31 | "E020570" "2009" "Finland" "Female" "Vaginal delivery" "39+1" FALSE 32 | "E020924" "2009" "Finland" "Female" "Vaginal delivery" "38+1" TRUE 33 | "E021032" "2009" "Finland" "Male" "Vaginal delivery" "42+4" FALSE 34 | "E021235" "2009" "Finland" "Male" "Vaginal delivery" "35+3" TRUE 35 | "E021822" "2009" "Finland" "Male" "Vaginal delivery" "39+4" TRUE 36 | "E021940" "2009" "Finland" "Male" "Vaginal delivery" "40+0" TRUE 37 | "E022497" "2009" "Finland" "Male" "Vaginal delivery" "38+2" FALSE 38 | "E023445" "2009" "Finland" "Male" "Vaginal delivery" "40+0" TRUE 39 | "E024907" "2009" "Finland" "Female" "Vaginal delivery" "40+4" TRUE 40 | "E035134" "2010" "Finland" "Male" "Vaginal delivery" "41+0" FALSE 41 | -------------------------------------------------------------------------------- /data/WGS/Antibiotic/Antibiotics_metadata.tsv: -------------------------------------------------------------------------------- 1 | "subject" "Year of birth" "Country" "Gender" "Delivery type" "Gestational age" "Antibiotcs_treated" 2 | "E000823" "2008" "Finland" "Male" "Vaginal delivery" "39+4" FALSE 3 | "E001958" "2008" "Finland" "Female" "Vaginal delivery" "40+1" FALSE 4 | "E003188" "2008" "Finland" "Female" "Vaginal delivery" "38+6" TRUE 5 | "E003953" "2008" "Finland" "Female" "Vaginal delivery" "39+5" TRUE 6 | "E004628" "2008" "Finland" "Male" "Ceasarean section" "40+3" TRUE 7 | "E004709" "2008" "Finland" "Male" "Vaginal delivery" "40+2" FALSE 8 | "E004898" "2008" "Finland" "Male" "Vaginal delivery" "41+1" TRUE 9 | "E005786" "2008" "Finland" "Female" "Vaginal delivery" "38+3" TRUE 10 | "E006091" "2008" "Finland" "Female" "Vaginal delivery" "40+2" TRUE 11 | "E006493" "2009" "Finland" "Female" "Vaginal delivery" "40+0" FALSE 12 | "E006781" "2009" "Finland" "Female" "Vaginal delivery" "39+4" TRUE 13 | "E007944" "2009" "Finland" "Female" "Vaginal delivery" "40+2" FALSE 14 | "E010481" "2009" "Finland" "Male" "Vaginal delivery" "40+5" TRUE 15 | "E010581" "2009" "Finland" "Male" "Vaginal delivery" "37+3" FALSE 16 | "E010682" "2009" "Finland" "Female" "Vaginal delivery" "42+0" TRUE 17 | "E011878" "2009" "Finland" "Male" "Vaginal delivery" "41+0" TRUE 18 | "E012854" "2009" "Finland" "Male" "Vaginal delivery" "40+4" TRUE 19 | "E013094" "2009" "Finland" "Male" "Vaginal delivery" "41+0" FALSE 20 | "E013505" "2009" "Finland" "Male" "Vaginal delivery" "35+3" TRUE 21 | "E014086" "2009" "Finland" "Female" "Vaginal delivery" "41+1" FALSE 22 | "E014403" "2009" "Finland" "Male" "Vaginal delivery" "41+4" TRUE 23 | "E016063" "2009" "Finland" "Female" "Ceasarean section" "39+1" FALSE 24 | "E016273" "2009" "Finland" "Male" "Vaginal delivery" "41+2" FALSE 25 | "E016426" "2009" "Finland" "Male" "Vaginal delivery" "37+5" TRUE 26 | "E017497" "2009" "Finland" "Male" "Vaginal delivery" "40+0" FALSE 27 | "E018286" "2009" "Finland" "Female" "Ceasarean section" "39+1" FALSE 28 | "E018754" "2009" "Finland" "Female" "Vaginal delivery" "39+1" FALSE 29 | "E019092" "2009" "Finland" "Male" "Ceasarean section" "35+1" FALSE 30 | "E019763" "2009" "Finland" "Female" "Vaginal delivery" "38+5" FALSE 31 | "E020570" "2009" "Finland" "Female" "Vaginal delivery" "39+1" FALSE 32 | "E020924" "2009" "Finland" "Female" "Vaginal delivery" "38+1" TRUE 33 | "E021032" "2009" "Finland" "Male" "Vaginal delivery" "42+4" FALSE 34 | "E021235" "2009" "Finland" "Male" "Vaginal delivery" "35+3" TRUE 35 | "E021822" "2009" "Finland" "Male" "Vaginal delivery" "39+4" TRUE 36 | "E021940" "2009" "Finland" "Male" "Vaginal delivery" "40+0" TRUE 37 | "E022497" "2009" "Finland" "Male" "Vaginal delivery" "38+2" FALSE 38 | "E023445" "2009" "Finland" "Male" "Vaginal delivery" "40+0" TRUE 39 | "E024907" "2009" "Finland" "Female" "Vaginal delivery" "40+4" TRUE 40 | "E035134" "2010" "Finland" "Male" "Vaginal delivery" "41+0" FALSE 41 | -------------------------------------------------------------------------------- /data/WGS/T1D.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/data/WGS/T1D.zip -------------------------------------------------------------------------------- /data/WGS/T1D/metadata.tsv: -------------------------------------------------------------------------------- 1 | Gid_16S Gid_shotgun Subject_ID Case_Control Gender Delivery_Route T1D_Diagnosed Post_T1D_Diag HLA_Risk_Class AAB_positive AAB_Post_LastNeg AAB_Post_FistPos AbxExposureAbsolute PostAbxExposure AbxAtCollection AbxPreCollection IllnessAtCollection IAA_Level GADA_Level IA2A_Level ZNT8A_Level ICA_Level IAA_Positive GADA_Positive IA2A_Positive ZNT8A_Positive ICA_Positive Flowcell Total_Reads Read_Depth_Class DNA_Concentration DNA_Yield_Class Age_at_Collection Container_1 Container_2 Tech_rep_exists Country Collection_Location Exclusive_BF BF Infant_Formula Fruits_Berries Corn Rice Wheat Oat Barley Rye Buckwheat_Millet Cereal Root_Veg Veg Eggs Soy_Prod Milk_Prod Meat Fish Solid_Food IAA_Level_Bin GADA_Level_Bin IA2A_Level_Bin ZNT8A_Level_Bin ICA_Level_Bin BF_Exclusive_Duration BF_Exclusive_Positive BF_Long_Term T1D_Status 2 | G36451 G45078 E001463 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0.627 0 0.001 0.072 0 FALSE FALSE FALSE FALSE FALSE A3L91 57296 1 66.21192932 2 303 CO-6610452 CO-6556462 FALSE Finland Jorvi FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 123 TRUE TRUE control 3 | G36025 G45069 E001463 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0.196 0 0.055 0.064 0 FALSE FALSE FALSE FALSE FALSE A3RE3 20428 0 18.35483932 1 457 CO-6572385 CO-6560957 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 123 TRUE TRUE control 4 | G36836 G45119 E001463 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0 0 0.16 0.095 0 FALSE FALSE FALSE FALSE FALSE A3MD2 75469 1 9.359108925 1 638 CO-6616307 CO-6571127 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE zero zero neg neg zero 123 TRUE TRUE control 5 | G36847 G45120 E001463 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0 0.93 0.1 0.05 0 FALSE FALSE FALSE FALSE FALSE A3MD2 91870 1 3.308204889 1 853 CO-6616307 CO-3700195 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE zero neg neg neg zero 123 TRUE TRUE control 6 | G36829 G45118 E001463 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin and clavulanic acid no_illness 0 0.93 0.1 0.05 0 FALSE FALSE FALSE FALSE FALSE A3MD2 57933 1 5.451251507 1 943 CO-6616307 CO-6571127 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE zero neg neg neg zero 123 TRUE TRUE control 7 | G36812 G45117 E001463 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin and clavulanic acid no_illness 0 0.93 0.1 0.05 0 FALSE FALSE FALSE FALSE FALSE A3MD2 53347 1 12.57366848 1 1062 CO-6616307 CO-6571127 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE zero neg neg neg zero 123 TRUE TRUE control 8 | G36554 G45107 E003251 case female vaginal t FALSE 3 TRUE TRUE FALSE TRUE FALSE no_abx no_abx no_illness 0.448 0 0.164 0.078 0 FALSE FALSE FALSE FALSE FALSE A3L91 34701 1 4.267730713 1 208 CO-6599077 CO-6599077 FALSE Finland Jorvi FALSE TRUE TRUE TRUE TRUE FALSE FALSE TRUE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE neg zero neg neg zero 0 FALSE TRUE T1D 9 | G36547 G45105 E003251 case female vaginal t FALSE 3 TRUE TRUE FALSE TRUE FALSE no_abx no_abx no_illness 0.448 0 0.164 0.078 0 FALSE FALSE FALSE FALSE FALSE A3L91 27401 0 5.595866203 1 249 CO-6599077 CO-6599077 FALSE Finland Jorvi FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE neg zero neg neg zero 0 FALSE TRUE T1D 10 | G36553 G45106 E003251 case female vaginal t FALSE 3 TRUE TRUE FALSE TRUE FALSE no_abx no_abx no_illness 0.448 0 0.164 0.078 0 FALSE FALSE FALSE FALSE FALSE A3L91 175557 2 22.38706589 2 355 CO-6599077 CO-6599077 FALSE Finland Jorvi FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE FALSE TRUE neg zero neg neg zero 0 FALSE TRUE T1D 11 | G36546 G45104 E003251 case female vaginal t FALSE 3 TRUE TRUE TRUE TRUE FALSE no_abx no_abx no_illness 14.083 21.754 0.076 0.296 0 TRUE TRUE FALSE FALSE FALSE A3L91 94833 1 18.04670143 1 474 CO-6599077 CO-6599077 FALSE Finland Jorvi FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos neg neg zero 0 FALSE TRUE T1D 12 | G36875 G45108 E003251 case female vaginal t FALSE 3 TRUE TRUE TRUE TRUE FALSE no_abx no_abx no_illness 14.083 21.754 0.076 0.296 0 TRUE TRUE FALSE FALSE FALSE A3MD2 246414 2 33.23430252 2 508 CO-6599077 CO-3700195 FALSE Finland Jorvi FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos neg neg zero 0 FALSE TRUE T1D 13 | G36543 G45231 E003989 case male vaginal f FALSE 3 TRUE TRUE FALSE TRUE FALSE no_abx no_abx no_illness 0 0 0.152 0.062 0 FALSE FALSE FALSE FALSE FALSE A3L91 6327 0 5.413952827 1 208 CO-6599077 CO-6599077 FALSE Finland Jorvi FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE zero zero neg neg zero 0 FALSE FALSE seroconverted 14 | G36548 G45265 E003989 case male vaginal f FALSE 3 TRUE TRUE FALSE TRUE TRUE Cefalexin Cefalexin otitis media 0 0 0.152 0.062 0 FALSE FALSE FALSE FALSE FALSE A3L91 37047 1 5.209465504 1 303 CO-6599077 CO-6599077 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE zero zero neg neg zero 0 FALSE FALSE seroconverted 15 | G36870 G45271 E003989 case male vaginal f FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Cefalexin no_illness 13.462 0 0.146 0.021 0 TRUE FALSE FALSE FALSE FALSE A3MD2 90405 1 16.0486908 1 474 CO-6599077 CO-3700195 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE pos zero neg neg zero 0 FALSE FALSE seroconverted 16 | G36868 G45270 E003989 case male vaginal f FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Cefalexin no_illness 13.462 0 0.146 0.021 0 TRUE FALSE FALSE FALSE FALSE A3MD2 157883 2 7.754646301 1 531 CO-6599077 CO-3700195 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE pos zero neg neg zero 0 FALSE FALSE seroconverted 17 | G36866 G45269 E003989 case male vaginal f FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 12.75 3.46 0.07 0.1 6 TRUE FALSE FALSE FALSE TRUE A3MD2 116143 2 45.44193268 2 659 CO-6599077 CO-3700195 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE pos neg neg neg pos 0 FALSE FALSE seroconverted 18 | G36863 G45268 E003989 case male vaginal f FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 7.28 22.16 0.11 0.15 0 TRUE TRUE FALSE FALSE FALSE A3MD2 169142 2 21.91771889 2 750 CO-6599077 CO-3700195 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE pos pos neg neg zero 0 FALSE FALSE seroconverted 19 | G36858 G45267 E003989 case male vaginal f FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 7.28 22.16 0.11 0.15 0 TRUE TRUE FALSE FALSE FALSE A3MD2 229444 2 52.06442261 2 1028 CO-6599077 CO-3700195 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE pos pos neg neg zero 0 FALSE FALSE seroconverted 20 | G36540 G45103 E006547 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0.059 0 0.097 0.05 0 FALSE FALSE FALSE FALSE FALSE A3L91 34205 1 4.634126186 1 369 CO-6599077 CO-6599077 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 117 TRUE TRUE control 21 | G36534 G45101 E006547 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin no_illness 0.731 0.169 0.085 0.089 0 FALSE FALSE FALSE FALSE FALSE A3L91 101875 2 19.21497917 1 465 CO-6599077 CO-6599077 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 117 TRUE TRUE control 22 | G36536 G45102 E006547 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin no_illness 0 4.2 0.23 0.08 0 FALSE FALSE FALSE FALSE FALSE A3L91 216876 2 14.5496254 1 600 CO-6599077 CO-6599077 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE zero neg neg neg zero 117 TRUE TRUE control 23 | G36525 G45100 E006547 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin no_illness 0 0.47 0.07 0.19 0 FALSE FALSE FALSE FALSE FALSE A3L91 64135 1 18.26745224 1 785 CO-6599077 CO-6599077 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE zero neg neg neg zero 117 TRUE TRUE control 24 | G36524 G45099 E006547 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin no_illness 0 0.47 0.07 0.19 0 FALSE FALSE FALSE FALSE FALSE A3L91 304608 2 13.17752266 1 1040 CO-6599077 CO-6599077 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE zero neg neg neg zero 117 TRUE TRUE control 25 | G36294 G45088 E006574 case male vaginal t FALSE 3 TRUE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0.422 0 0.075 0.03 0 FALSE FALSE FALSE FALSE FALSE A2RDP 49626 1 6.162345886 1 237 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE TRUE FALSE TRUE neg zero neg neg zero 177 TRUE TRUE T1D 26 | G36305 G45093 E006574 case male vaginal t FALSE 3 TRUE TRUE FALSE TRUE TRUE no_abx Azithromycin no_illness 0.701 0.073 0.097 0.05 0 FALSE FALSE FALSE FALSE FALSE A2RDP 37795 1 8.953804016 1 366 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 177 TRUE TRUE T1D 27 | G36310 G45095 E006574 case male vaginal t FALSE 3 TRUE TRUE FALSE TRUE TRUE no_abx Azithromycin no_illness 0.701 0.073 0.097 0.05 0 FALSE FALSE FALSE FALSE FALSE A2RDP 38567 1 10.18546104 1 430 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 177 TRUE TRUE T1D 28 | G36297 G45090 E006574 case male vaginal t FALSE 3 TRUE TRUE FALSE TRUE TRUE no_abx Amoxicillin no_illness 0.701 0.073 0.097 0.05 0 FALSE FALSE FALSE FALSE FALSE A2RDP 30182 1 9.279737473 1 520 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 177 TRUE TRUE T1D 29 | G36309 G45094 E006574 case male vaginal t FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 8.93 0.71 0.08 0.14 6 TRUE FALSE FALSE FALSE TRUE A2RDP 24234 0 41.53508759 2 562 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos neg neg neg pos 177 TRUE TRUE T1D 30 | G36296 G45089 E006574 case male vaginal t FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 8.93 0.71 0.08 0.14 6 TRUE FALSE FALSE FALSE TRUE A2RDP 28906 0 7.870550632 1 616 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos neg neg neg pos 177 TRUE TRUE T1D 31 | G36480 G45098 E006574 case male vaginal t FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 8.93 0.71 0.08 0.14 6 TRUE FALSE FALSE FALSE TRUE A3L91 25922 0 7.588328838 1 683 CO-6595439 CO-6556462 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos neg neg neg pos 177 TRUE TRUE T1D 32 | G36479 G45097 E006574 case male vaginal t FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Azithromycin no_illness 8.93 0.71 0.08 0.14 6 TRUE FALSE FALSE FALSE TRUE A3L91 53131 1 12.01099873 1 788 CO-6595439 CO-6556462 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos neg neg neg pos 177 TRUE TRUE T1D 33 | G36312 G45096 E006574 case male vaginal t FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Azithromycin no_illness 8.93 0.71 0.08 0.14 6 TRUE FALSE FALSE FALSE TRUE A2RDP 32373 1 13.20820045 1 844 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos neg neg neg pos 177 TRUE TRUE T1D 34 | G36299 G45091 E006574 case male vaginal t FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Azithromycin no_illness 8.93 0.71 0.08 0.14 6 TRUE FALSE FALSE FALSE TRUE A2RDP 60627 1 35.4598732 2 918 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos neg neg neg pos 177 TRUE TRUE T1D 35 | G36304 G45092 E006574 case male vaginal t FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Azithromycin no_illness 30.08 195.49 1013.95 13.67 1024 TRUE TRUE TRUE TRUE TRUE A2RDP 97380 1 27.84149742 2 1049 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos pos pos pos 177 TRUE TRUE T1D 36 | G36004 G45064 E006673 control female vaginal f FALSE 4 FALSE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0 0 0.134 0.031 0 FALSE FALSE FALSE FALSE FALSE A3RE3 19078 0 46.03257751 2 207 CO-6572385 CO-6560957 FALSE Finland Jorvi FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE zero zero neg neg zero 119 TRUE FALSE control 37 | G36008 G45065 E006673 control female vaginal f FALSE 4 FALSE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0 0 0.134 0.031 0 FALSE FALSE FALSE FALSE FALSE A3RE3 116365 2 52.00554657 2 339 CO-6572385 CO-6560957 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE zero zero neg neg zero 119 TRUE FALSE control 38 | G36013 G45066 E006673 control female vaginal f FALSE 4 FALSE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0.387 0 0.179 0.108 0 FALSE FALSE FALSE FALSE FALSE A3RE3 63978 1 17.26343918 1 431 CO-6572385 CO-6560957 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 119 TRUE FALSE control 39 | G36018 G45067 E006673 control female vaginal f FALSE 4 FALSE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0.387 0 0.179 0.108 0 FALSE FALSE FALSE FALSE FALSE A3RE3 280212 2 119.3671722 2 536 CO-6572385 CO-6560957 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 119 TRUE FALSE control 40 | G36022 G45068 E006673 control female vaginal f FALSE 4 FALSE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0.37 2.7 0.08 0.08 0 FALSE FALSE FALSE FALSE FALSE A3RE3 139276 2 35.27873611 2 705 CO-6572385 CO-6560957 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 119 TRUE FALSE control 41 | G36459 G45079 E010590 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0.163 0 0.081 0.044 0 FALSE FALSE FALSE FALSE FALSE A3L91 6770 0 31.86118698 2 227 CO-6610452 CO-6556462 FALSE Finland Jorvi FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE neg zero neg neg zero 131 TRUE TRUE control 42 | G36464 G45083 E010590 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0.163 0 0.081 0.044 0 FALSE FALSE FALSE FALSE FALSE A3L91 43345 1 29.17752838 2 322 CO-6610452 CO-6556462 FALSE Finland Jorvi FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE neg zero neg neg zero 131 TRUE TRUE control 43 | G36463 G45082 E010590 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Cefalexin no_illness 0 0 0.12 0.03 0 FALSE FALSE FALSE FALSE FALSE A49HE 217138 3 53.22422028 2 423 CO-6610452 CO-6610452 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE zero zero neg neg zero 131 TRUE TRUE control 44 | G36474 G45086 E010590 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Cefalexin no_illness 0 0 0.12 0.03 0 FALSE FALSE FALSE FALSE FALSE A3L91 132512 2 76.46139526 2 525 CO-6610452 CO-6556462 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE zero zero neg neg zero 131 TRUE TRUE control 45 | G36462 G45081 E010590 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE Amoxicillin Amoxicillin otitis media 0 0 0.12 0.05 0 FALSE FALSE FALSE FALSE FALSE A3L91 74274 1 32.16959 2 576 CO-6610452 CO-6556462 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE zero zero neg neg zero 131 TRUE TRUE control 46 | G36473 G45085 E010590 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Azithromycin no_illness 0 0 0.12 0.05 0 FALSE FALSE FALSE FALSE FALSE A3L91 77843 1 57.03216553 2 626 CO-6610452 CO-6556462 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE zero zero neg neg zero 131 TRUE TRUE control 47 | G36461 G45080 E010590 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin no_illness 0 0 0.12 0.05 0 FALSE FALSE FALSE FALSE FALSE A3L91 47823 1 39.05141449 2 709 CO-6610452 CO-6556462 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE zero zero neg neg zero 131 TRUE TRUE control 48 | G36472 G45084 E010590 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin no_illness 0.41 0.02 0.08 0.1 0 FALSE FALSE FALSE FALSE FALSE A3L91 73476 1 62.64514923 2 804 CO-6610452 CO-6556462 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE neg neg neg neg zero 131 TRUE TRUE control 49 | G36440 G45072 E010590 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin no_illness 0.41 0.02 0.08 0.1 0 FALSE FALSE FALSE FALSE FALSE A3L91 53229 1 17.93720436 1 919 CO-6610452 CO-6556462 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE neg neg neg neg zero 131 TRUE TRUE control 50 | G36438 G45071 E010590 control male vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin no_illness 0.41 0.02 0.08 0.1 0 FALSE FALSE FALSE FALSE FALSE A3L91 50693 1 9.263421059 1 1045 CO-6610452 CO-6556462 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE neg neg neg neg zero 131 TRUE TRUE control 51 | G36302 G45264 E010629 case male vaginal f FALSE 3 TRUE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0 0 0.073 0.046 0 FALSE FALSE FALSE FALSE FALSE A2RDP 20348 0 6.548281193 1 164 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE zero zero neg neg zero 110 TRUE FALSE seroconverted 52 | G35983 G45249 E010629 case male vaginal f FALSE 3 TRUE TRUE FALSE TRUE TRUE no_abx Amoxicillin and clavulanic acid no_illness 2.35 0 0.1 0.04 0 FALSE FALSE FALSE FALSE FALSE A3RE3 62411 1 8.095162392 1 389 CO-6569853 CO-6560957 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 110 TRUE FALSE seroconverted 53 | G35984 G45250 E010629 case male vaginal f FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 5.13 7.46 0.12 1.37 256 TRUE TRUE FALSE TRUE TRUE A3RE3 117070 2 19.81173515 1 1089 CO-6569853 CO-6560957 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos neg pos pos 110 TRUE FALSE seroconverted 54 | G35972 G45062 E010937 case female vaginal t FALSE 4 TRUE FALSE FALSE TRUE TRUE no_abx Trimetoprime and sulfadiazine no_illness 0.219 0 0.071 0.063 0 FALSE FALSE FALSE FALSE FALSE A3RE3 49791 1 83.17263031 2 237 CO-6569853 CO-6560957 FALSE Finland Jorvi FALSE TRUE FALSE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE FALSE TRUE FALSE TRUE neg zero neg neg zero 129 TRUE TRUE T1D 55 | G35976 G45063 E010937 case female vaginal t FALSE 4 TRUE FALSE FALSE TRUE TRUE no_abx Azithromycin no_illness 0.09 1.1 0.099 0.03 0 FALSE FALSE FALSE FALSE FALSE A3RE3 44806 1 8.221935272 1 385 CO-6569853 CO-6560957 FALSE Finland Jorvi FALSE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 129 TRUE TRUE T1D 56 | G35961 G45058 E010937 case female vaginal t FALSE 4 TRUE FALSE FALSE TRUE TRUE no_abx Trimetoprime and sulfadiazine no_illness 0.09 1.1 0.099 0.03 0 FALSE FALSE FALSE FALSE FALSE A3RE3 72275 1 13.3336544 1 509 CO-6572385 CO-6560957 FALSE Finland Jorvi FALSE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 129 TRUE TRUE T1D 57 | G35965 G45059 E010937 case female vaginal t FALSE 4 TRUE TRUE FALSE TRUE TRUE no_abx Trimetoprime and sulfadiazine no_illness 2.42 0 0.17 0.07 0 FALSE FALSE FALSE FALSE FALSE A3RE3 16443 0 26.93038559 2 630 CO-6569853 CO-6560957 FALSE Finland Jorvi FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 129 TRUE TRUE T1D 58 | G35966 G45060 E010937 case female vaginal t FALSE 4 TRUE TRUE FALSE TRUE TRUE no_abx Trimetoprime and sulfadiazine no_illness 2.42 0 0.17 0.07 0 FALSE FALSE FALSE FALSE FALSE A3RE3 48866 1 18.99253845 1 661 CO-6569853 CO-6560957 FALSE Finland Jorvi FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 129 TRUE TRUE T1D 59 | G35967 G45061 E010937 case female vaginal t FALSE 4 TRUE TRUE FALSE TRUE TRUE no_abx Trimetoprime and sulfadiazine no_illness 2.42 0 0.17 0.07 0 FALSE FALSE FALSE FALSE FALSE A3RE3 51659 1 35.23153687 2 692 CO-6569853 CO-6560957 FALSE Finland Jorvi FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 129 TRUE TRUE T1D 60 | G35951 G45055 E010937 case female vaginal t FALSE 4 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 7.83 0.37 456.5 3.48 256 TRUE FALSE TRUE TRUE TRUE A3RE3 51456 1 14.95007229 1 938 CO-6572385 CO-6489811 FALSE Finland Jorvi FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos neg pos pos pos 129 TRUE TRUE T1D 61 | G35952 G45056 E010937 case female vaginal t TRUE 4 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 7.83 0.37 456.5 3.48 256 TRUE FALSE TRUE TRUE TRUE A3RE3 49195 1 53.28865814 2 964 CO-6572385 CO-6489811 FALSE Finland Jorvi FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos neg pos pos pos 129 TRUE TRUE T1D 62 | G35954 G45057 E010937 case female vaginal t TRUE 4 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 7.83 0.37 456.5 3.48 256 TRUE FALSE TRUE TRUE TRUE A3RE3 44989 1 25.2662735 2 1027 CO-6572385 CO-6489811 FALSE Finland Jorvi FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos neg pos pos pos 129 TRUE TRUE T1D 63 | G36556 G45266 E016924 control female vaginal f FALSE 2 TRUE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0.69 2.78 0.11 0.06 0 FALSE FALSE FALSE FALSE FALSE A3L91 58459 1 12.68700409 1 164 CO-6599077 CO-6599077 FALSE Finland Jorvi FALSE FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE TRUE neg neg neg neg zero 0 FALSE FALSE control 64 | G36886 G45233 E016924 control female vaginal f FALSE 2 TRUE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0.95 0 0.03 0.16 0 FALSE FALSE FALSE FALSE FALSE A3MD2 130107 2 21.05899239 2 290 CO-6610452 CO-3700195 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 0 FALSE FALSE control 65 | G36886 G45110 E016924 control female vaginal f FALSE 2 TRUE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0.95 0 0.03 0.16 0 FALSE FALSE FALSE FALSE FALSE A3MD2 130107 2 21.05899239 2 290 CO-6610452 CO-3700195 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 0 FALSE FALSE control 66 | G36896 G45234 E016924 control female vaginal f FALSE 2 TRUE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0.79 0 0.03 0.14 0 FALSE FALSE FALSE FALSE FALSE A3MD2 186098 2 81.34389496 2 505 CO-6610452 CO-3700195 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 0 FALSE FALSE control 67 | G36896 G45111 E016924 control female vaginal f FALSE 2 TRUE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0.79 0 0.03 0.14 0 FALSE FALSE FALSE FALSE FALSE A3MD2 186098 2 81.34389496 2 505 CO-6610452 CO-3700195 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 0 FALSE FALSE control 68 | G36882 G45109 E016924 control female vaginal f FALSE 2 TRUE TRUE FALSE FALSE FALSE no_abx no_abx no_illness 0.9 0 0.09 0.06 0 FALSE FALSE FALSE FALSE FALSE A3MD2 156852 2 46.49960709 2 769 CO-6610452 CO-3700195 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE neg zero neg neg zero 0 FALSE FALSE control 69 | G36882 G45232 E016924 control female vaginal f FALSE 2 TRUE TRUE FALSE FALSE FALSE no_abx no_abx no_illness 0.9 0 0.09 0.06 0 FALSE FALSE FALSE FALSE FALSE A3MD2 156852 2 46.49960709 2 769 CO-6610452 CO-3700195 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE neg zero neg neg zero 0 FALSE FALSE control 70 | G35384 G45224 E016924 control female vaginal f FALSE 2 TRUE TRUE FALSE FALSE FALSE no_abx no_abx no_illness 0.9 0 0.09 0.06 0 FALSE FALSE FALSE FALSE FALSE A2G7T 6466 0 7.680489063 1 911 CO-6489812 CO-4402727 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE neg zero neg neg zero 0 FALSE FALSE control 71 | G35384 G45125 E016924 control female vaginal f FALSE 2 TRUE TRUE FALSE FALSE FALSE no_abx no_abx no_illness 0.9 0 0.09 0.06 0 FALSE FALSE FALSE FALSE FALSE A2G7T 6466 0 7.680489063 1 911 CO-6489812 CO-4402727 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE neg zero neg neg zero 0 FALSE FALSE control 72 | G35412 G45227 E016924 control female vaginal f FALSE 2 TRUE TRUE FALSE FALSE FALSE no_abx no_abx no_illness 0.9 0 0.09 0.06 0 FALSE FALSE FALSE FALSE FALSE A2G7T 183911 2 12.99573708 1 1131 CO-6560957 CO-5193197 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE neg zero neg neg zero 0 FALSE FALSE control 73 | G35942 G45247 E017751 case female vaginal f FALSE 2 TRUE TRUE FALSE TRUE FALSE no_abx no_abx no_illness 0 0.89 0.12 0.05 0 FALSE FALSE FALSE FALSE FALSE A3RE3 80198 1 5.975747585 1 179 CO-6572385 CO-6489811 FALSE Finland Jorvi FALSE TRUE TRUE TRUE TRUE FALSE FALSE TRUE FALSE FALSE FALSE TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE zero neg neg neg zero 119 TRUE TRUE seroconverted 74 | G35992 G45251 E017751 case female vaginal f FALSE 2 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 10.34 0 0.06 0.06 0 TRUE FALSE FALSE FALSE FALSE A3RE3 38293 1 7.617115021 1 333 CO-6572385 CO-6560957 FALSE Finland Jorvi FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos zero neg neg zero 119 TRUE TRUE seroconverted 75 | G35948 G45248 E017751 case female vaginal f FALSE 2 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 19.56 0 0.11 0.13 0 TRUE FALSE FALSE FALSE FALSE A3RE3 80418 1 30.30607605 2 502 CO-6572385 CO-6489811 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos zero neg neg zero 119 TRUE TRUE seroconverted 76 | G35936 G45230 E017751 case female vaginal f FALSE 2 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 6.81 0 0.08 0.09 0 TRUE FALSE FALSE FALSE FALSE A3RE3 100338 2 10.97129345 1 692 CO-6569853 CO-6489811 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos zero neg neg zero 119 TRUE TRUE seroconverted 77 | G35940 G45245 E017751 case female vaginal f FALSE 2 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 6.81 0 0.08 0.09 0 TRUE FALSE FALSE FALSE FALSE A3RE3 132816 2 24.80822945 2 722 CO-6572385 CO-6489811 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos zero neg neg zero 119 TRUE TRUE seroconverted 78 | G35941 G45246 E017751 case female vaginal f FALSE 2 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 15.8 0 0.17 0.1 4 TRUE FALSE FALSE FALSE TRUE A3RE3 45183 1 16.12187958 1 778 CO-6572385 CO-6489811 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos zero neg neg pos 119 TRUE TRUE seroconverted 79 | G36751 G45235 E017751 case female vaginal f FALSE 2 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 15.8 0 0.17 0.1 4 TRUE FALSE FALSE FALSE TRUE A3MD2 223078 2 33.16787338 2 998 CO-6613160 CO-6571127 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos zero neg neg pos 119 TRUE TRUE seroconverted 80 | G36260 G45259 E018113 case female vaginal f FALSE 3 TRUE FALSE FALSE TRUE TRUE no_abx Trimetoprime and sulfadiazine no_illness 0.49 0 0.05 0.14 0 FALSE FALSE FALSE FALSE FALSE A2RDP 41112 1 4.874362469 1 337 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 150 TRUE TRUE seroconverted 81 | G36263 G45260 E018113 case female vaginal f FALSE 3 TRUE TRUE FALSE TRUE TRUE no_abx Trimetoprime and sulfadiazine no_illness 2.3 1.32 0.1 0.15 0 FALSE FALSE FALSE FALSE FALSE A2RDP 48439 1 11.25704956 1 434 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 150 TRUE TRUE seroconverted 82 | G36266 G45261 E018113 case female vaginal f FALSE 3 TRUE TRUE FALSE TRUE TRUE no_abx Trimetoprime and sulfadiazine no_illness 2.3 1.32 0.1 0.15 0 FALSE FALSE FALSE FALSE FALSE A2RDP 100583 2 12.3214922 1 527 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 150 TRUE TRUE seroconverted 83 | G36267 G45262 E018113 case female vaginal f FALSE 3 TRUE TRUE FALSE TRUE TRUE no_abx Azithromycin no_illness 2.3 1.32 0.1 0.15 0 FALSE FALSE FALSE FALSE FALSE A2RDP 77440 1 9.017858505 1 558 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 150 TRUE TRUE seroconverted 84 | G36268 G45263 E018113 case female vaginal f FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Cefaclor no_illness 16.14 9.73 0.2 0.15 23 TRUE TRUE FALSE FALSE TRUE A2RDP 41544 1 9.426724434 1 584 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos neg neg pos 150 TRUE TRUE seroconverted 85 | G36248 G45256 E018113 case female vaginal f FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Cefaclor no_illness 16.14 9.73 0.2 0.15 23 TRUE TRUE FALSE FALSE TRUE A2RDP 76658 1 48.3687706 2 687 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos neg neg pos 150 TRUE TRUE seroconverted 86 | G36249 G45257 E018113 case female vaginal f FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 16.14 9.73 0.2 0.15 23 TRUE TRUE FALSE FALSE TRUE A2RDP 59264 1 21.4753418 2 747 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos neg neg pos 150 TRUE TRUE seroconverted 87 | G36251 G45258 E018113 case female vaginal f FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 11.98 103.29 17.41 6.04 64 TRUE TRUE TRUE TRUE TRUE A2RDP 66823 1 72.85266876 2 804 CO-6595439 CO-6595439 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos pos pos pos 150 TRUE TRUE seroconverted 88 | G36224 G45255 E018113 case female vaginal f FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 11.98 103.29 17.41 6.04 64 TRUE TRUE TRUE TRUE TRUE A2RDP 95327 1 18.4685154 1 1053 CO-6593410 CO-6593410 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos pos pos pos 150 TRUE TRUE seroconverted 89 | G36165 G45087 E018268 control female vaginal f FALSE 3 FALSE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0 0 0.09 0.19 0 FALSE FALSE FALSE FALSE FALSE A2RDP 79361 1 118.4821625 2 352 CO-6593410 CO-6593410 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE zero zero neg neg zero 119 TRUE FALSE control 90 | G36906 G45122 E018268 control female vaginal f FALSE 3 FALSE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0 0.92 0.04 0.09 0 FALSE FALSE FALSE FALSE FALSE A2G30 71877 1 12.72323322 1 504 CO-6616307 CO-1694630 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE zero neg neg neg zero 119 TRUE FALSE control 91 | G35465 G45051 E018268 control female vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin and clavulanic acid no_illness 0.27 0 0.07 0.05 0 FALSE FALSE FALSE FALSE FALSE A49HE 380934 2 26.71079063 2 606 CO-6560957 CO-5193197 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 119 TRUE FALSE control 92 | G36922 G45124 E018268 control female vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin and clavulanic acid no_illness 0.27 0 0.07 0.05 0 FALSE FALSE FALSE FALSE FALSE A2G30 36220 1 49.75075531 2 747 CO-6616307 CO-1694630 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 119 TRUE FALSE control 93 | G35893 G45049 E018268 control female vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin and clavulanic acid no_illness 0.35 0 0.12 0.11 0 FALSE FALSE FALSE FALSE FALSE A3RE3 57298 1 81.62340546 2 910 CO-6569853 CO-6489811 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 119 TRUE FALSE control 94 | G36904 G45121 E018268 control female vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin and clavulanic acid no_illness 0.35 0 0.12 0.11 0 FALSE FALSE FALSE FALSE FALSE A2G30 133129 2 37.67655945 2 1017 CO-6616307 CO-1694630 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 119 TRUE FALSE control 95 | G36920 G45123 E018268 control female vaginal f FALSE 3 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin and clavulanic acid no_illness 0.34 0 0.1 0.14 0 FALSE FALSE FALSE FALSE FALSE A2G30 41111 1 22.20563126 2 1233 CO-6616307 CO-1694630 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 119 TRUE FALSE control 96 | G36813 G45236 E022137 case male vaginal f FALSE 3 TRUE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0.26 0 0.1 0.05 0 FALSE FALSE FALSE FALSE FALSE A3MD2 98011 1 20.44647789 2 281 CO-6616307 CO-6571127 TRUE Finland Jorvi FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE FALSE TRUE neg zero neg neg zero 151 TRUE TRUE seroconverted 97 | G35898 G45228 E022137 case male vaginal f FALSE 3 TRUE TRUE FALSE FALSE FALSE no_abx no_abx no_illness 2.51 2.49 0.17 0.33 0 FALSE FALSE FALSE FALSE FALSE A3RE3 98208 1 11.83599472 1 397 CO-6569853 CO-6489811 TRUE Finland Jorvi FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE neg neg neg neg zero 151 TRUE TRUE seroconverted 98 | G36154 G45252 E022137 case male vaginal f FALSE 3 TRUE TRUE TRUE FALSE FALSE no_abx no_abx no_illness 3.29 4.42 0.1 0.13 0 TRUE FALSE FALSE FALSE FALSE A2RDP 143675 2 22.04771423 2 612 CO-6593410 CO-6593410 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE pos neg neg neg zero 151 TRUE TRUE seroconverted 99 | G35473 G45229 E022137 case male vaginal f FALSE 3 TRUE TRUE TRUE FALSE FALSE no_abx no_abx no_illness 11.15 13.73 0.33 0.19 0 TRUE TRUE FALSE FALSE FALSE A2G7T 303132 2 76.11322021 2 767 CO-6560957 CO-5193197 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE pos pos neg neg zero 151 TRUE TRUE seroconverted 100 | G36843 G45237 E022137 case male vaginal f FALSE 3 TRUE TRUE TRUE FALSE FALSE no_abx no_abx no_illness 11.15 13.73 0.33 0.19 0 TRUE TRUE FALSE FALSE FALSE A3MD2 133548 2 9.952746391 1 899 CO-6616307 CO-6571127 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE pos pos neg neg zero 151 TRUE TRUE seroconverted 101 | G36754 G45113 E022852 control male cesarian f FALSE 3 FALSE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0.06 0 0.07 0.08 0 FALSE FALSE FALSE FALSE FALSE A3MD2 117011 2 13.45043373 1 362 CO-6613160 CO-6571127 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 0 FALSE FALSE control 102 | G36752 G45112 E022852 control male cesarian f FALSE 3 FALSE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 1.08 0 0.09 0.046 0 FALSE FALSE FALSE FALSE FALSE A3MD2 143689 2 40.76960754 2 518 CO-6613160 CO-6571127 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 0 FALSE FALSE control 103 | G36765 G45114 E022852 control male cesarian f FALSE 3 FALSE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 1.55 0.26 0.08 0.1 0 FALSE FALSE FALSE FALSE FALSE A3MD2 61972 1 48.9513855 2 681 CO-6613160 CO-6571127 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 0 FALSE FALSE control 104 | G35906 G45054 E022852 control male cesarian f FALSE 3 FALSE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 1.08 0.47 0.08 0.09 0 FALSE FALSE FALSE FALSE FALSE A49HE 229654 1 71.61921692 2 973 CO-6569853 CO-6489811 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 0 FALSE FALSE control 105 | G36159 G45253 E026079 case male vaginal f FALSE 3 TRUE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 1.36 0 0.07 0.07 0 FALSE FALSE FALSE FALSE FALSE A2RDP 51071 1 8.111056328 1 227 CO-6593410 CO-6593410 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE FALSE TRUE TRUE TRUE neg zero neg neg zero 15 TRUE FALSE seroconverted 106 | G36179 G45254 E026079 case male vaginal f FALSE 3 TRUE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 1.36 0 0.07 0.07 0 FALSE FALSE FALSE FALSE FALSE A2RDP 42401 1 118.6239014 2 369 CO-6593410 CO-6593410 FALSE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 15 TRUE FALSE seroconverted 107 | G36952 G45238 E026079 case male vaginal f FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 12.28 11.57 0.11 0.1 4 TRUE TRUE FALSE FALSE TRUE A2G30 74976 1 40.7195282 2 582 CO-6616550 CO-1694630 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos neg neg pos 15 TRUE FALSE seroconverted 108 | G35391 G45226 E026079 case male vaginal f FALSE 3 TRUE TRUE TRUE TRUE TRUE no_abx Amoxicillin no_illness 12.28 11.57 0.11 0.1 4 TRUE TRUE FALSE FALSE TRUE A2G7T 130381 2 17.98520851 1 760 CO-6489812 CO-4402727 TRUE Finland Jorvi FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos neg neg pos 15 TRUE FALSE seroconverted 109 | G35390 G45225 T013815 case female vaginal f FALSE 2 TRUE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0 0 0.127 0.146 0 FALSE FALSE FALSE FALSE FALSE A2G7T 99260 1 26.20007133 2 42 CO-6489812 CO-5193197 TRUE Estonia Tarto TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE zero zero neg neg zero 150 TRUE TRUE seroconverted 110 | G36958 G45239 T013815 case female vaginal f FALSE 2 TRUE FALSE FALSE FALSE FALSE no_abx no_abx no_illness 0 0 0.127 0.146 0 FALSE FALSE FALSE FALSE FALSE A2G30 31105 1 3.810671091 1 155 CO-6616550 CO-1694630 TRUE Estonia Tarto FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE zero zero neg neg zero 150 TRUE TRUE seroconverted 111 | G36964 G45242 T013815 case female vaginal f FALSE 2 TRUE TRUE TRUE FALSE FALSE no_abx no_abx no_illness 21.78 18.46 0.07 0.09 0 TRUE TRUE FALSE FALSE FALSE A2G30 40621 1 5.410312176 1 421 CO-6616550 CO-1694630 TRUE Estonia Tarto FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos neg neg zero 150 TRUE TRUE seroconverted 112 | G36962 G45241 T013815 case female vaginal f FALSE 2 TRUE TRUE TRUE FALSE FALSE no_abx no_abx no_illness 21.78 18.46 0.07 0.09 0 TRUE TRUE FALSE FALSE FALSE A2G30 43161 1 26.36745453 2 481 CO-6616550 CO-1694630 TRUE Estonia Tarto FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos neg neg zero 150 TRUE TRUE seroconverted 113 | G36959 G45240 T013815 case female vaginal f FALSE 2 TRUE TRUE TRUE FALSE FALSE no_abx no_abx no_illness 21.78 18.46 0.07 0.09 0 TRUE TRUE FALSE FALSE FALSE A2G30 35223 1 12.81294441 1 485 CO-6616550 CO-1694630 FALSE Estonia Tarto FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos neg neg zero 150 TRUE TRUE seroconverted 114 | G36976 G45244 T013815 case female vaginal f FALSE 2 TRUE TRUE TRUE FALSE FALSE no_abx no_abx no_illness 34.01 1.94 0.08 0.12 0 TRUE FALSE FALSE FALSE FALSE A2G30 49986 1 18.79042625 1 587 CO-6616550 CO-1694630 FALSE Estonia Tarto FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos neg neg neg zero 150 TRUE TRUE seroconverted 115 | G35360 G45223 T013815 case female vaginal f FALSE 2 TRUE TRUE TRUE FALSE FALSE no_abx no_abx no_illness 34.01 1.94 0.08 0.12 0 TRUE FALSE FALSE FALSE FALSE A2G7T 17607 0 27.12285805 2 643 CO-6489812 CO-4402727 TRUE Estonia Tarto FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos neg neg neg zero 150 TRUE TRUE seroconverted 116 | G36972 G45243 T013815 case female vaginal f FALSE 2 TRUE TRUE TRUE FALSE FALSE no_abx no_abx no_illness 34.01 1.94 0.08 0.12 0 TRUE FALSE FALSE FALSE FALSE A2G30 49474 1 30.37803841 2 727 CO-6616550 CO-1694630 TRUE Estonia Tarto FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos neg neg neg zero 150 TRUE TRUE seroconverted 117 | G35464 G45050 T014292 control female vaginal f FALSE 2 FALSE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0.17 0.09 0.08 0.09 0 FALSE FALSE FALSE FALSE FALSE A2G7T 97285 1 8.007688522 1 249 CO-6560957 CO-5193197 TRUE Estonia Tarto FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE neg neg neg neg zero 0 FALSE TRUE control 118 | G36788 G45115 T014292 control female vaginal f FALSE 2 FALSE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0.17 0.09 0.08 0.09 0 FALSE FALSE FALSE FALSE FALSE A3MD2 65212 1 24.88734436 2 310 CO-6616307 CO-6571127 TRUE Estonia Tarto FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 0 FALSE TRUE control 119 | G35488 G45053 T014292 control female vaginal f FALSE 2 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin no_illness 0.56 0.21 0.13 0.07 0 FALSE FALSE FALSE FALSE FALSE A2G7T 30731 1 22.57471085 2 471 CO-6560957 CO-4402727 TRUE Estonia Tarto FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 0 FALSE TRUE control 120 | G35474 G45052 T014292 control female vaginal f FALSE 2 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin no_illness 0.56 0.21 0.13 0.07 0 FALSE FALSE FALSE FALSE FALSE A2G7T 14514 0 28.87458038 2 562 CO-6560957 CO-4402727 TRUE Estonia Tarto FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 0 FALSE TRUE control 121 | G36802 G45116 T014292 control female vaginal f FALSE 2 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin no_illness 0.39 0 0.08 0.12 0 FALSE FALSE FALSE FALSE FALSE A3MD2 121066 2 19.76346397 1 652 CO-6616307 CO-6571127 TRUE Estonia Tarto FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 0 FALSE TRUE control 122 | G35451 G45048 T014292 control female vaginal f FALSE 2 FALSE FALSE FALSE TRUE TRUE no_abx Amoxicillin no_illness 0.39 0 0.08 0.12 0 FALSE FALSE FALSE FALSE FALSE A2G7T 37832 1 28.05429459 2 736 CO-6559738 CO-4402727 TRUE Estonia Tarto FALSE FALSE FALSE TRUE FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg zero neg neg zero 0 FALSE TRUE control 123 | G36444 G45074 T025418 case female vaginal t FALSE 3 TRUE FALSE FALSE TRUE FALSE no_abx no_abx no_illness 0.07 0 0.1 0.081 0 FALSE FALSE FALSE FALSE FALSE A3L91 25148 0 9.735329628 1 264 CO-6610452 CO-6556462 FALSE Estonia Tarto FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE neg zero neg neg zero 0 FALSE TRUE T1D 124 | G36443 G45073 T025418 case female vaginal t FALSE 3 TRUE TRUE FALSE TRUE FALSE no_abx no_abx no_illness 0.98 3.95 0.09 0.11 0 FALSE FALSE FALSE FALSE FALSE A3L91 25630 0 4.321252823 1 399 CO-6610452 CO-6556462 FALSE Estonia Tarto FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 0 FALSE TRUE T1D 125 | G35421 G45047 T025418 case female vaginal t FALSE 3 TRUE TRUE FALSE TRUE FALSE no_abx no_abx no_illness 0.98 3.95 0.09 0.11 0 FALSE FALSE FALSE FALSE FALSE A2G7T 113064 2 56.93887329 2 477 CO-6560957 CO-5193197 TRUE Estonia Tarto FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg neg neg neg zero 0 FALSE TRUE T1D 126 | G36446 G45076 T025418 case female vaginal t FALSE 3 TRUE TRUE TRUE TRUE FALSE no_abx no_abx no_illness 0.54 131.68 0.19 0.17 0 FALSE TRUE FALSE FALSE FALSE A3L91 41159 1 5.445137024 1 527 CO-6610452 CO-6556462 FALSE Estonia Tarto FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg pos neg neg zero 0 FALSE TRUE T1D 127 | G36032 G45070 T025418 case female vaginal t FALSE 3 TRUE TRUE TRUE TRUE FALSE no_abx no_abx no_illness 0.54 131.68 0.19 0.17 0 FALSE TRUE FALSE FALSE FALSE A3RE3 75530 1 19.7820034 1 568 CO-6572385 CO-6560957 FALSE Estonia Tarto FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg pos neg neg zero 0 FALSE TRUE T1D 128 | G36448 G45077 T025418 case female vaginal t FALSE 3 TRUE TRUE TRUE TRUE FALSE no_abx no_abx no_illness 0.54 131.68 0.19 0.17 0 FALSE TRUE FALSE FALSE FALSE A3L91 96858 1 20.69583893 2 629 CO-6610452 CO-6556462 FALSE Estonia Tarto FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE neg pos neg neg zero 0 FALSE TRUE T1D 129 | G36445 G45075 T025418 case female vaginal t TRUE 3 TRUE TRUE TRUE TRUE TRUE no_abx Penicillin V no_illness 8.59 189.7 0.39 0.13 512 TRUE TRUE FALSE FALSE TRUE A3L91 38733 1 9.429825783 1 1025 CO-6610452 CO-6556462 FALSE Estonia Tarto FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE pos pos neg neg pos 0 FALSE TRUE T1D 130 | -------------------------------------------------------------------------------- /man/getGoodfeature.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/getGoodfeature.R 3 | \name{getGoodfeature} 4 | \alias{getGoodfeature} 5 | \title{MegaR getGoodfeature} 6 | \usage{ 7 | getGoodfeature(alltable2, threshold, samplePercent, normval) 8 | } 9 | \arguments{ 10 | \item{alltable2}{table containing all the features analyzed} 11 | 12 | \item{threshold}{threshold of the value of feature that should 13 | be across the sample} 14 | 15 | \item{samplePercent}{percentage of sample that should contain 16 | the threshold amount of value in its feature} 17 | 18 | \item{normval}{wheather cumulative sum normalization is to be used or not} 19 | } 20 | \description{ 21 | This is an internal function used to collect good features 22 | } 23 | -------------------------------------------------------------------------------- /man/getLevelData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/getLevelData.R 3 | \name{getLevelData} 4 | \alias{getLevelData} 5 | \title{MegaR getLevelData} 6 | \usage{ 7 | getLevelData(alltable, leveld) 8 | } 9 | \arguments{ 10 | \item{alltable}{the taxonomic table} 11 | 12 | \item{leveld}{the taxonomic level at which to select the feature} 13 | } 14 | \description{ 15 | This is an internal function used to extract either the species or genus 16 | level of information 17 | } 18 | -------------------------------------------------------------------------------- /man/getconfuMat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/getconfuMat.R 3 | \name{getconfuMat} 4 | \alias{getconfuMat} 5 | \title{MegaR analysis} 6 | \usage{ 7 | getconfuMat(testdata, rfmodel) 8 | } 9 | \arguments{ 10 | \item{testdata}{testdata} 11 | 12 | \item{rfmodel}{the model on which classification is done} 13 | } 14 | \description{ 15 | This is an internal function used to plot the confusion Matrix 16 | } 17 | -------------------------------------------------------------------------------- /man/gettrainingdoneglm.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gettrainingdoneglm.R 3 | \name{gettrainingdoneglm} 4 | \alias{gettrainingdoneglm} 5 | \title{MegaR analysis} 6 | \usage{ 7 | gettrainingdoneglm(mytable3, classid, sampleid, ruleout, psd, metadat) 8 | } 9 | \arguments{ 10 | \item{mytable3}{processed input file with features} 11 | 12 | \item{classid}{the column number in metadata file in which the class of 13 | input data is stored} 14 | 15 | \item{sampleid}{the column number of metadata file which contain sample ids 16 | that match with input data} 17 | 18 | \item{ruleout}{the class which is to be removed from classification model} 19 | 20 | \item{psd}{the percentage of data to be split into training set} 21 | 22 | \item{metadat}{the metadata path 23 | 24 | @export} 25 | } 26 | \description{ 27 | MegaR analysis 28 | } 29 | -------------------------------------------------------------------------------- /man/gettrainingdonerf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gettrainingdonerf.R 3 | \name{gettrainingdonerf} 4 | \alias{gettrainingdonerf} 5 | \title{MegaR gettrainingdonerf} 6 | \usage{ 7 | gettrainingdonerf(mytable3, classid, sampleid, ruleout, psd, metadat) 8 | } 9 | \arguments{ 10 | \item{mytable3}{processed input file with features} 11 | 12 | \item{classid}{the column number in metadata file in which the class of 13 | input data is stored} 14 | 15 | \item{sampleid}{the column number of metadata file which contain sample ids 16 | that match with input data} 17 | 18 | \item{ruleout}{the class which is to be removed from classification model} 19 | 20 | \item{psd}{the percentage of data to be split into training set} 21 | 22 | \item{metadat}{the metadata path 23 | 24 | @export} 25 | } 26 | \description{ 27 | MegaR gettrainingdonerf 28 | } 29 | -------------------------------------------------------------------------------- /man/gettrainingdonesvm.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/gettrainingdonesvm.R 3 | \name{gettrainingdonesvm} 4 | \alias{gettrainingdonesvm} 5 | \title{MegaR gettrainingdonesvm} 6 | \usage{ 7 | gettrainingdonesvm(mytable3, classid, sampleid, ruleout, psd, metadat, 8 | svmmethod) 9 | } 10 | \arguments{ 11 | \item{mytable3}{processed input file with features} 12 | 13 | \item{classid}{the column number in metadata file in which the class of 14 | input data is stored} 15 | 16 | \item{sampleid}{the column number of metadata file which contain sample ids 17 | that match with input data} 18 | 19 | \item{ruleout}{the class which is to be removed from classification model} 20 | 21 | \item{psd}{the percentage of data to be split into training set} 22 | 23 | \item{metadat}{the metadata path} 24 | 25 | \item{svmmethod}{one of the many svm method available in caret} 26 | } 27 | \description{ 28 | This is the function to get class information for the input data from the 29 | metadata file and build the support vector machines as predictive models. 30 | } 31 | -------------------------------------------------------------------------------- /man/getunknpredict.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/getunknpredict.R 3 | \name{getunknpredict} 4 | \alias{getunknpredict} 5 | \title{MegaR analysis} 6 | \usage{ 7 | getunknpredict(unknormdata, a) 8 | } 9 | \arguments{ 10 | \item{unknormdata}{unknown dataset} 11 | 12 | \item{a}{model list with elements ******} 13 | } 14 | \description{ 15 | This is an internal function used to predict the given dataset. 16 | } 17 | -------------------------------------------------------------------------------- /man/megaR.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/megaRshiny.R 3 | \name{MegaR} 4 | \alias{MegaR} 5 | \title{MegaR megaRshiny 6 | Use MegaR through shiny interface} 7 | \usage{ 8 | MegaR() 9 | } 10 | \description{ 11 | This function allows the user to input data files and alter the input 12 | variables to make sure the formatting is correct. 13 | They can then run the MegaR package which will output the results and plots 14 | in the browser and allow the user to download results as needed. 15 | } 16 | \examples{ 17 | if(interactive()) {LONGO()} 18 | } 19 | -------------------------------------------------------------------------------- /man/plotimptfeatures.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plotimptfeatures.R 3 | \name{plotimptfeatures} 4 | \alias{plotimptfeatures} 5 | \title{MegaR analysis 6 | This function plots the top 10 important features for random forest 7 | classification.} 8 | \usage{ 9 | plotimptfeatures(RF_state_classify, noOffeature) 10 | } 11 | \arguments{ 12 | \item{RF_state_classify}{the random forest model} 13 | 14 | \item{noOffeature}{no. of feature =10} 15 | } 16 | \description{ 17 | MegaR analysis 18 | This function plots the top 10 important features for random forest 19 | classification. 20 | } 21 | -------------------------------------------------------------------------------- /man/readmetadata.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/readmetadata.R 3 | \name{readmetadata} 4 | \alias{readmetadata} 5 | \title{MegaR analysis 6 | This is internal function to read data} 7 | \usage{ 8 | readmetadata(x) 9 | } 10 | \arguments{ 11 | \item{x}{the path to the file} 12 | } 13 | \description{ 14 | MegaR analysis 15 | This is internal function to read data 16 | } 17 | -------------------------------------------------------------------------------- /man/readmydata.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/readmetadata.R 3 | \name{readmydata} 4 | \alias{readmydata} 5 | \title{MegaR analysis} 6 | \usage{ 7 | readmydata(x) 8 | } 9 | \arguments{ 10 | \item{x}{the path to the file} 11 | } 12 | \description{ 13 | MegaR analysis 14 | } 15 | -------------------------------------------------------------------------------- /man/savePlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/savePlot.R 3 | \name{savePlot} 4 | \alias{savePlot} 5 | \title{MegaR savePlot} 6 | \usage{ 7 | savePlot(file, plotIn) 8 | } 9 | \arguments{ 10 | \item{file}{name of the file where data is to be stored} 11 | 12 | \item{plotIn}{the plot which is stored 13 | import ggsave from ggplot2**} 14 | } 15 | \description{ 16 | This is a internal function. This function allows the program to 17 | save the plot generated in the program. 18 | } 19 | -------------------------------------------------------------------------------- /man/validation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/validation.R 3 | \name{validation} 4 | \alias{validation} 5 | \title{MegaR validation} 6 | \usage{ 7 | validation(Num, modelclas, mytable3, classid, sampleid, ruleout, psd, 8 | metadat) 9 | } 10 | \arguments{ 11 | \item{Num}{No. of sets to run for validation} 12 | 13 | \item{modelclas}{one of the model, randomforest, supportvector machine or 14 | generalized linear model} 15 | 16 | \item{mytable3}{processed input file with features} 17 | 18 | \item{classid}{the column number in metadata file in which the class of 19 | input data is stored} 20 | 21 | \item{sampleid}{the column number of metadata file which contain sample ids 22 | that match with input data} 23 | 24 | \item{ruleout}{the class which is to be removed from classification model} 25 | 26 | \item{psd}{the percentage of data to be split into training set} 27 | 28 | \item{metadat}{the metadata path} 29 | } 30 | \description{ 31 | This function conducts 10 fold cross validation on N set of data 32 | } 33 | -------------------------------------------------------------------------------- /screenshot/AUC.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/AUC.PNG -------------------------------------------------------------------------------- /screenshot/Data_input_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/Data_input_table.png -------------------------------------------------------------------------------- /screenshot/Datainput.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/Datainput.gif -------------------------------------------------------------------------------- /screenshot/Interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/Interface.png -------------------------------------------------------------------------------- /screenshot/ModelBuilding1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/ModelBuilding1.gif -------------------------------------------------------------------------------- /screenshot/ModelBuilding2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/ModelBuilding2.gif -------------------------------------------------------------------------------- /screenshot/Prediction-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/Prediction-02.png -------------------------------------------------------------------------------- /screenshot/Prediction_CustomModel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/Prediction_CustomModel.png -------------------------------------------------------------------------------- /screenshot/Prediction_CustomModel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/Prediction_CustomModel2.png -------------------------------------------------------------------------------- /screenshot/Prediction_CustomModel3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/Prediction_CustomModel3.png -------------------------------------------------------------------------------- /screenshot/Prediction_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/Prediction_table.png -------------------------------------------------------------------------------- /screenshot/Preprocess_genus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/Preprocess_genus.png -------------------------------------------------------------------------------- /screenshot/Preprocessing_species.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/Preprocessing_species.png -------------------------------------------------------------------------------- /screenshot/Preprocessing_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/Preprocessing_table.png -------------------------------------------------------------------------------- /screenshot/Train_stats.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/Train_stats.png -------------------------------------------------------------------------------- /screenshot/Validation.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/Validation.PNG -------------------------------------------------------------------------------- /screenshot/accuracy.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/accuracy.PNG -------------------------------------------------------------------------------- /screenshot/accuracy_rf_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/accuracy_rf_plot.png -------------------------------------------------------------------------------- /screenshot/data_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/data_input.png -------------------------------------------------------------------------------- /screenshot/download.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/download.PNG -------------------------------------------------------------------------------- /screenshot/features.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/features.PNG -------------------------------------------------------------------------------- /screenshot/input.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/input.gif -------------------------------------------------------------------------------- /screenshot/prediction.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/prediction.PNG -------------------------------------------------------------------------------- /screenshot/preprocessing.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/preprocessing.gif -------------------------------------------------------------------------------- /screenshot/rf_train_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/rf_train_plot.png -------------------------------------------------------------------------------- /screenshot/test_error_db.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/test_error_db.png -------------------------------------------------------------------------------- /screenshot/test_error_stats_rf_db.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/test_error_stats_rf_db.png -------------------------------------------------------------------------------- /screenshot/testerror.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/testerror.PNG -------------------------------------------------------------------------------- /screenshot/teststats.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/teststats.PNG -------------------------------------------------------------------------------- /screenshot/topimptfeature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/topimptfeature.png -------------------------------------------------------------------------------- /screenshot/trainerror.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/trainerror.PNG -------------------------------------------------------------------------------- /screenshot/trainstats.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioHPC/MegaR/4439680a734a69719362ca41a137dd425a52f91e/screenshot/trainstats.PNG -------------------------------------------------------------------------------- /scripts/README: -------------------------------------------------------------------------------- 1 | 2 | ############################################################################################## 3 | ## this is metaphlan script 4 | ############################################################################################## 5 | 6 | for entry in *.fastq.gz 7 | do 8 | metaphlan2.py --input fastq $entry --nproc 16 -t rel_ab_w_read_stats > "${entry%.fastq.gz}.profile.txt" 9 | done 10 | 11 | 12 | 13 | ###################################################################################################### 14 | ## this is script used to modify the metaphlan output files 15 | ###################################################################################################### 16 | 17 | 18 | for f in *.profile.txt 19 | do 20 | cat $f | cut -f 1,5| sed "2d;$ d" > profiles/$"${f%.profile.txt}.profile.txt" 21 | done 22 | 23 | 24 | 25 | ############################################################################################################################### 26 | ## this script is used to merge metaphlan tables 27 | ################################################################################################################################ 28 | 29 | $ merge_metaphlan_tables.py *_profile.txt > merged_abundance_table.txt 30 | --------------------------------------------------------------------------------