Skip to content
Snippets Groups Projects
Commit cf16ca85 authored by Marco Del Tufo's avatar Marco Del Tufo
Browse files

Update properties-handled-by-scripts.md

parent a3096628
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -188,30 +188,32 @@ You can test your script on selected entities ...@@ -188,30 +188,32 @@ You can test your script on selected entities
2. Calculate a new float value based some other values 2. Calculate a new float value based some other values
```java ```java
import java.lang.String as String import java.lang.String as String
def calculateValue(): def calculateValue():
nM = 0 nM = 0
uLDNA = 0 uLDNA = 0
if entity.propertyValue('CONCENTRATION_PREPARED_ILLUMINA') != '' and \ if entity.propertyValue('CONCENTRATION_PREPARED_ILLUMINA') != '' and \
entity.propertyValue('FRAGMENT_SIZE_PREPARED_ILLUMINA') != '' : entity.propertyValue('FRAGMENT_SIZE_PREPARED_ILLUMINA') != '' :
nM = float(entity.propertyValue('CONCENTRATION_PREPARED_ILLUMINA')) / \ nM = float(entity.propertyValue('CONCENTRATION_PREPARED_ILLUMINA')) / \
float(entity.propertyValue('FRAGMENT_SIZE_PREPARED_ILLUMINA')) * \ float(entity.propertyValue('FRAGMENT_SIZE_PREPARED_ILLUMINA')) * \
1000000 / 650 1000000 / 650
if float(entity.propertyValue('UL_STOCK')) !='' : if float(entity.propertyValue('UL_STOCK')) !='' :
uLDNA = float(entity.propertyValue('UL_STOCK')) * 2 / nM uLDNA = float(entity.propertyValue('UL_STOCK')) * 2 / nM
uLEB = float(entity.propertyValue('UL_STOCK')) - uLDNA uLEB = float(entity.propertyValue('UL_STOCK')) - uLDNA
return String.format("%16.1f", uLEB) return String.format("%16.1f", uLEB)
return 0 return 0
def calculate(): def calculate():
"""Main script function. The result will be used as the value of appropriate dynamic property.""" """Main script function. The result will be used as the value of appropriate dynamic property."""
return calculateValue() return calculateValue()
``` ```
3. Calculate a time difference between two time stamps: 3. Calculate a time difference between two time stamps:
```java ```java
from datetime import datetime from datetime import datetime
def dateTimeSplitter(openbisDate): def dateTimeSplitter(openbisDate):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment