Skip to content

Commit

Permalink
documentation updated
Browse files Browse the repository at this point in the history
  • Loading branch information
achiocch committed Jul 27, 2023
1 parent 4054209 commit 2fa21ec
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 49 deletions.
149 changes: 100 additions & 49 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,79 +25,134 @@

## Introduction

This is ELABLOADER, a simple-to-use, no-bullshit, non bloating, console based software solution for the modern, digitalized lab. It was created to meet the developers requirements of transfering data between the API provided by Elab and the tables provided by the physical lab. It is utilized mainly by reading in prepared XLSX files. Also, its now in Beta and that's pretty sick. Please do report any bugs! Thanks!
This is ELABLOADER, a simple-to-use, no-bullshit, non bloating, console based solution to transfer data between the API provided by [elabFTW](https://www.elabftw.net/) and tables provided by the physical lab.
It is utilized mainly by reading in prepared XLSX, CSV, or TXT files.
Current version is under development.
Please do report any bugs! Thanks!

Only works with [elabFTW](https://www.elabftw.net/) installed
A demo version of [elabFTW](https://www.elabftw.net/) is available at https://demo.elabftw.net/

## Installation

A simple download of a folder is all it takes. And the usual Python stuff.
We tested on Python 3.9 .
<br>
<br>
This is the official download source, the place to praise and the place to complain:
You must have Python 3.9 with the following libraries installed

* elabapi_python
* pandas
* numpy

Github is the official download source, the place to praise and the place to complain:
Simply clone the project and you shouldbe good to go.

```
path to git, add on publihing
git clone https://github.com/KJPMolgenLab/ELAB_LOADER.git
```

## Getting started

So you want to upload stuff onto the database? Cool, lets get started.

What do I need? <br>
-The Elab API Key (Kindly ask your Admin if unsure)<br>
-The Elab URL (Also, kindly ask your Admin if unsure)<br>
-Category ID in Elab (As you guessed, ask your Admin if you need this ID.)<br>
What do I need?
- The elabFTW URL to the API
- e.g. ```https://demo.elabftw.net/api/v2```
- Also, kindly ask your Admin if unsure
<br><br>
- an API Key
- can be generated in the user panel
- needs to have write permisseion
- Online information see [Info](https://doc.elabftw.net/user-guide.html#api-keys-tab)
- Kindly ask your Admin if unsure
<br><br>

- The Category ID of the type of item you want to update in Elab:
- The type of item has to be predefined in the labbook
- If you select the type of item in your database view you can get the id from the url
- e.g. ```https://demo.elabftw.net/database.php?q=&cat=7&mode=show&limit=15``` gives category 7
- And you guessed it ask your Admin if unsure

## Data preparation

First, carefully prepare a list of the items to be added in XLSX format (Excel sheet). I strongly suggest using XLSX for comforts sake.
Make sure the mandatory columns and header names are present in the file. These vary between the different types of data you can upload.
If you are lost, head over to the ./Examples folder.
First, carefully prepare a list of the items to be added in XLSX format (Excel sheet).
We strongly suggest using XLSX for comforts sake.
Make sure the mandatory columns and header names are present in the file.
These vary between the different types of data you can upload.
For the different modes we provided templates in the Example folders

## Modes
**Everything marked red in the ./Examples Excel files is a mandatory entry and is case SENSITIVE!**

### Everything marked red in the ./Examples Excel files is a mandatory entry and is case SENSITIVE!
You can add as many columns as you wish, they will be added to the items in tabular format

### Mode seqp
Fill out the mandatory columns. It is recommended to also fill out the existing ones, or remove them if not needed.
Any additional columns will be added into the Elab table.
Results can vary due to Elab's CSS.

## Modes

### Mode seqp
This mode will upload sequencing primers onto Elab.
Fill out the mandatory columns. It is recommended to also fill out the existing ones, or remove them if not needed.
Any additional columns will be added into the Elab table. Results can vary due to Elab's CSS.
The algorithm will check if the primer sequence already exists in the database, if yes the program does not upload or change the primer again
and give you feedback about it
If the Primer sequence cannot be identified a new entry is generated

### Mode qpcr

This mode will upload qpcr primers onto Elab.
Fill out the mandatory columns. It is recommended to also fill out the existing ones, or remove them if not needed.
Any additional columns will be added into the Elab table. Results can vary due to Elab's CSS.
The template here assumes a primer pair and a Probe
If you do not have a Probe in your qPCR designs just leave the column empty

### Mode rest
Similarity check will be done on the sequences of the primers and the probe
Identical items will be patched, i.e. replaced by the information in the table
If no item can be identified to be similar a new entry is generated

### Mode rest
This mode will upload restriction enzymes onto Elab.
Fill out the mandatory columns. It is recommended to also fill out the existing ones, or remove them if not needed.
Any additional columns will be added into the Elab table. Results can vary due to Elab's CSS.
Similarity check will be done based on the Supplier and the Ordernumber
If the Restriction enzyme cannot be identified a new entry is generated, otherwise the item is skipped with a feedback

### Mode plas

This mode will upload plasmids onto Elab.
Fill out the mandatory columns. It is recommended to also fill out the existing ones, or remove them if not needed.
Any additional columns will be added into the Elab table. Results can vary due to Elab's CSS.
Similarity check will be done based on the Name/title of the entry
If the Plasmid cannot be identified a new entry is generated, otherwise the item is skipped with a feedback

### Mode cons

This mode will upload consumables (e.g. Chemicals, Tools, etc.) onto Elab.
Fill out the mandatory columns. It is recommended to also fill out the existing ones, or remove them if not needed.
Any additional columns will be added into the Elab table. Results can vary due to Elab's CSS.
Similarity check will be done based on the Supplier and the Ordernumber.
If the Restriction enzyme cannot be identified a new entry is generated, otherwise the item is skipped with a feedback

## Running
## Running the algorithm

Download the ELABLOADER folder from GitHub.
Double-click the "elabloader.py" file (after consulting the /Examples folder if lost).
When the console window pops up and is ready to receive user input, simply enter the command.
to test if your program runs go to a command line terminal move to the folder of the
Elabloader and check is the elabloader.py file is executable

```commandline
cd <PathtoElabloader>
./elabloader.py
```
if all libraries are installed successfully the following message should appear

```commandline
All libraries loaded and ready
______ _ ____ _ ____ _____ ______ _____
| ____| | /\ | _ \| | / __ \ /\ | __ \| ____| __ \
| |__ | | / \ | |_) | | | | | | / \ | | | | |__ | |__) |
| __| | | / /\ \ | _ <| | | | | |/ /\ \ | | | | __| | _ /
| |____| |____ / ____ \| |_) | |___| |__| / ____ \| |__| | |____| | \ \
|______|______/_/ \_\____/|______\____/_/ \_\_____/|______|_| \_\
no arguments provided
type --help for more information
```

## Arguments and Flags

The program needs arguments to work; so-called "Flags". These are instructions you give via a dash.
The following instructions are available and mandatory.

Please make sure you do not miss any, or the program will report back an error:


The following instructions are available and mandatory. Please make sure you do not miss any, or the program will report back an error:
```
-k, --apikey API key as generated on the ElabFTW user panel
needs to have write and read access
Expand Down Expand Up @@ -129,9 +184,7 @@ The following instructions are available and mandatory. Please make sure you do
### Command examples

Now that you have learned about the flags, it's time to finally send the command.

In the "Terminal", enter the following:
(if not in the "ElabLoader" Folder, navigate to it. (cd ForEndusers / cd ElabLoader)

```shell
./elabloader.py [Flags]
Expand All @@ -141,14 +194,12 @@ In the "Terminal", enter the following:

```shell
./elabloader.py --apikey <enteryourkey> \
--url <https://yourelab.yourelabsending/api/v2/> \
--file </files/ForEndusers/ElabLoader/Input/example.xlsx> \
--cat_id numberofyourcatid > Debug/output.log
--url <https://yourelab.yourelabsending.lab/api/v2/> \
--file <./Example/Example_cons.xlsx> \
--cat_id <numberofyourcatid
```


For logging, you can dump the output to a file.

For logging, you can dump the output to a file.
```shell
./elabloader.py --apikey <enteryourkey> \
--url <https://yourelab.yourelabsending/api/v2/> \
Expand All @@ -158,10 +209,10 @@ For logging, you can dump the output to a file.

# Legal and Credits

### This Script is published under [CC BY 4.0 License](https://creativecommons.org/licenses/by/4.0/)
**This Script is published under [CC BY 4.0 License](https://creativecommons.org/licenses/by/4.0/)**

## ELABLOADER was created by:
<br>
@achiocch
<br>
@LF-KGU

* [achiocch](https://github.com/achiocch)
* [LF-KGU](https://github.com/LF-KGU)

17 changes: 17 additions & 0 deletions elabloader.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,23 @@ def create_body_restriction_enzymes(entry):

argv = sys.argv[1:]

if len(argv) == 0:
titleasci = "\033[92m" + r"""
All libraries loaded and ready
______ _ ____ _ ____ _____ ______ _____
| ____| | /\ | _ \| | / __ \ /\ | __ \| ____| __ \
| |__ | | / \ | |_) | | | | | | / \ | | | | |__ | |__) |
| __| | | / /\ \ | _ <| | | | | |/ /\ \ | | | | __| | _ /
| |____| |____ / ____ \| |_) | |___| |__| / ____ \| |__| | |____| | \ \
|______|______/_/ \_\____/|______\____/_/ \_\_____/|______|_| \_\
""" + "\x1b[0m"
print(titleasci)
print("no arguments provided")
print("type --help for more information")
exit(0)

short_opts = "aufcmh:"
long_opts = ["apikey=", "url=", "file=", "cat_id=", "mode=", "help"]
args = []
Expand Down

0 comments on commit 2fa21ec

Please sign in to comment.