From 9636f06938619e7596ec19b65daba5dbe8c212c4 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 10 Jan 2017 15:25:42 +0100 Subject: Brief tutorial in README.md --- README.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 431c8b9..6354606 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,73 @@ Installation The output should give you more verbose information that can help in debugging (e.g. to identify missing libraries). +Tutorial +-------- + +Execute the following commands either from an interactive Ruby shell or a Ruby script: + +Create and use `lazar` models for small molecules +................................................. + +#### Create a training dataset + + Create a CSV file with two columns. The first line should contain either SMILES or InChI (first column) and the endpoint (second column). The first column should contain either the SMILES or InChI of the training compounds, the second column the training compounds toxic activities (qualitative or quantitative). Use -log10 transformed values for regression datasets. Add metadata to a JSON file with the same basename containing the fields "species", "endpoint", "source" and "unit" (regression only). You can find example training data at [Github](https://github.com/opentox/lazar-public-data). + +#### Create and validate a `lazar` model with default algorithms and parameters + + `validated_model = Model::Validation.create_from_csv_file EPAFHM_log10.csv` + +#### Inspect crossvalidation results + + `validated_model.crossvalidations` + +#### Predict a new compound + + Create a compound + + `compound = Compound.from_smiles "NC(=O)OCCC"` + + Predict Fathead Minnow Acute Toxicity + + `validated_model.predict compound` + +#### Experiment with other algorithms + + You can pass algorithms parameters to the `Model::Validation.create_from_csv_file` command. The [API documentation](http://rdoc.info/gems/lazar) provides detailed instructions. + +Create and use `lazar` nanoparticle models +........................................ + +#### Create and validate a `nano-lazar` model from eNanoMapper with default algorithms and parameters + + `validated_model = Model::Validation.create_from_enanomapper` + + This command will mirror the eNanoMapper database in the local database, create a `nano-lazar` model and validate it with five independent 10-fold crossvalidations. + +#### Inspect crossvalidation results + + `validated_model.crossvalidations` + +#### Predict nanoparticle toxicities + + Choose a random nanoparticle from the "Potein Corona" dataset + ``` + training_dataset = Dataset.where(:name => "Protein Corona Fingerprinting Predicts the Cellular Interaction of Gold and Silver Nanoparticles").first + nanoparticle = training_dataset.substances.shuffle.first + ``` + + Predict the "Net Cell Association" endpoint + + `validated_model.predict nanoparticle` + +#### Experiment with other datasets, endpoints and algorithms + + You can pass training_dataset, prediction_feature and algorithms parameters to the `Model::Validation.create_from_enanomapper` command. The [API documentation](http://rdoc.info/gems/lazar) provides detailed instructions. + Documentation ------------- * [API documentation](http://rdoc.info/gems/lazar) Copyright --------- -Copyright (c) 2009-2015 Christoph Helma, Martin Guetlein, Micha Rautenberg, Andreas Maunz, David Vorgrimmler, Denis Gebele. See LICENSE for details. +Copyright (c) 2009-2017 Christoph Helma, Martin Guetlein, Micha Rautenberg, Andreas Maunz, David Vorgrimmler, Denis Gebele. See LICENSE for details. -- cgit v1.2.3 From 5db4a0d44073ddce8c1641a29450d31474b9e831 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 10 Jan 2017 15:27:56 +0100 Subject: README.md headings fixed --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 6354606..0cffb15 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,7 @@ Tutorial Execute the following commands either from an interactive Ruby shell or a Ruby script: -Create and use `lazar` models for small molecules -................................................. +### Create and use `lazar` models for small molecules #### Create a training dataset @@ -60,8 +59,7 @@ Create and use `lazar` models for small molecules You can pass algorithms parameters to the `Model::Validation.create_from_csv_file` command. The [API documentation](http://rdoc.info/gems/lazar) provides detailed instructions. -Create and use `lazar` nanoparticle models -........................................ +### Create and use `lazar` nanoparticle models #### Create and validate a `nano-lazar` model from eNanoMapper with default algorithms and parameters -- cgit v1.2.3 From 093583c8c23b20f18cf82fb15913fe257a3dd72b Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 10 Jan 2017 15:31:25 +0100 Subject: README.md CV information fixed --- README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 0cffb15..7e0e420 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,8 @@ Execute the following commands either from an interactive Ruby shell or a Ruby s `validated_model = Model::Validation.create_from_csv_file EPAFHM_log10.csv` + This command will create a `lazar` model and validate it with three independent 10-fold crossvalidations. + #### Inspect crossvalidation results `validated_model.crossvalidations` -- cgit v1.2.3 From ed0d7edee4ac9831b58a01555de8bdba3534495e Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Wed, 11 Jan 2017 08:24:23 +0100 Subject: model documentation updated --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 7e0e420..28ed18f 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Execute the following commands either from an interactive Ruby shell or a Ruby s #### Experiment with other datasets, endpoints and algorithms - You can pass training_dataset, prediction_feature and algorithms parameters to the `Model::Validation.create_from_enanomapper` command. The [API documentation](http://rdoc.info/gems/lazar) provides detailed instructions. + You can pass training_dataset, prediction_feature and algorithms parameters to the `Model::Validation.create_from_enanomapper` command. The [API documentation](http://rdoc.info/gems/lazar) provides detailed instructions. Detailed documentation and validation results can be found in this [publication](https://github.com/enanomapper/nano-lazar-paper/blob/master/nano-lazar.pdf). Documentation ------------- -- cgit v1.2.3