Skip to content

Commit

Permalink
Merge pull request #67 from usegalaxy-eu/unit
Browse files Browse the repository at this point in the history
Adding units to templates
  • Loading branch information
bedroesb authored May 2, 2022
2 parents 0cb023d + 8ae89b3 commit e5c693c
Show file tree
Hide file tree
Showing 36 changed files with 627 additions and 2 deletions.
22 changes: 22 additions & 0 deletions ena_upload/templates/ENA_template_samples_ERC000012.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>sample volume or weight for DNA extraction</TAG>
<VALUE>${row['sample volume or weight for DNA extraction']}</VALUE>
<UNITS>ng</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'nucleic acid extraction')">
Expand Down Expand Up @@ -197,6 +198,7 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>geographic location (altitude)</TAG>
<VALUE>${row['geographic location (altitude)']}</VALUE>
<UNITS>m</UNITS>
</SAMPLE_ATTRIBUTE>
<SAMPLE_ATTRIBUTE>
<TAG>geographic location (country and/or sea)</TAG>
Expand All @@ -205,10 +207,12 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>geographic location (latitude)</TAG>
<VALUE>${row['geographic location (latitude)']}</VALUE>
<UNITS>DD</UNITS>
</SAMPLE_ATTRIBUTE>
<SAMPLE_ATTRIBUTE>
<TAG>geographic location (longitude)</TAG>
<VALUE>${row['geographic location (longitude)']}</VALUE>
<UNITS>DD</UNITS>
</SAMPLE_ATTRIBUTE>
<py:if test="attributetest(row, 'geographic location (region and locality)')">
<SAMPLE_ATTRIBUTE>
Expand Down Expand Up @@ -236,12 +240,14 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>geographic location (elevation)</TAG>
<VALUE>${row['geographic location (elevation)']}</VALUE>
<UNITS>m</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'ventilation rate')">
<SAMPLE_ATTRIBUTE>
<TAG>ventilation rate</TAG>
<VALUE>${row['ventilation rate']}</VALUE>
<UNITS>m3/min</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'ventilation type')">
Expand Down Expand Up @@ -284,6 +290,7 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>amount or size of sample collected</TAG>
<VALUE>${row['amount or size of sample collected']}</VALUE>
<UNITS>m3</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'oxygenation status of sample')">
Expand All @@ -302,12 +309,14 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>sample storage duration</TAG>
<VALUE>${row['sample storage duration']}</VALUE>
<UNITS>years</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'sample storage temperature')">
<SAMPLE_ATTRIBUTE>
<TAG>sample storage temperature</TAG>
<VALUE>${row['sample storage temperature']}</VALUE>
<UNITS>°C</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'sample storage location')">
Expand All @@ -332,24 +341,28 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>barometric pressure</TAG>
<VALUE>${row['barometric pressure']}</VALUE>
<UNITS>mm Hg</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'humidity')">
<SAMPLE_ATTRIBUTE>
<TAG>humidity</TAG>
<VALUE>${row['humidity']}</VALUE>
<UNITS>g/m3</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'pollutants')">
<SAMPLE_ATTRIBUTE>
<TAG>pollutants</TAG>
<VALUE>${row['pollutants']}</VALUE>
<UNITS>mg/L</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'solar irradiance')">
<SAMPLE_ATTRIBUTE>
<TAG>solar irradiance</TAG>
<VALUE>${row['solar irradiance']}</VALUE>
<UNITS>W/m2</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'wind direction')">
Expand All @@ -362,54 +375,63 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>wind speed</TAG>
<VALUE>${row['wind speed']}</VALUE>
<UNITS>m/s</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'temperature')">
<SAMPLE_ATTRIBUTE>
<TAG>temperature</TAG>
<VALUE>${row['temperature']}</VALUE>
<UNITS>ºC</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'carbon dioxide')">
<SAMPLE_ATTRIBUTE>
<TAG>carbon dioxide</TAG>
<VALUE>${row['carbon dioxide']}</VALUE>
<UNITS>µmol/L</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'carbon monoxide')">
<SAMPLE_ATTRIBUTE>
<TAG>carbon monoxide</TAG>
<VALUE>${row['carbon monoxide']}</VALUE>
<UNITS>µM/L</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'oxygen')">
<SAMPLE_ATTRIBUTE>
<TAG>oxygen</TAG>
<VALUE>${row['oxygen']}</VALUE>
<UNITS>parts/million</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'respirable particulate matter')">
<SAMPLE_ATTRIBUTE>
<TAG>respirable particulate matter</TAG>
<VALUE>${row['respirable particulate matter']}</VALUE>
<UNITS>µg/m3</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'volatile organic compounds')">
<SAMPLE_ATTRIBUTE>
<TAG>volatile organic compounds</TAG>
<VALUE>${row['volatile organic compounds']}</VALUE>
<UNITS>µg/m3</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'sample salinity')">
<SAMPLE_ATTRIBUTE>
<TAG>sample salinity</TAG>
<VALUE>${row['sample salinity']}</VALUE>
<UNITS>psu</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'methane')">
<SAMPLE_ATTRIBUTE>
<TAG>methane</TAG>
<VALUE>${row['methane']}</VALUE>
<UNITS>µM/L</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'miscellaneous parameter')">
Expand Down
19 changes: 19 additions & 0 deletions ena_upload/templates/ENA_template_samples_ERC000013.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>sample volume or weight for DNA extraction</TAG>
<VALUE>${row['sample volume or weight for DNA extraction']}</VALUE>
<UNITS>ng</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'nucleic acid extraction')">
Expand Down Expand Up @@ -198,6 +199,7 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>geographic location (altitude)</TAG>
<VALUE>${row['geographic location (altitude)']}</VALUE>
<UNITS>m</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<SAMPLE_ATTRIBUTE>
Expand All @@ -207,10 +209,12 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>geographic location (latitude)</TAG>
<VALUE>${row['geographic location (latitude)']}</VALUE>
<UNITS>DD</UNITS>
</SAMPLE_ATTRIBUTE>
<SAMPLE_ATTRIBUTE>
<TAG>geographic location (longitude)</TAG>
<VALUE>${row['geographic location (longitude)']}</VALUE>
<UNITS>DD</UNITS>
</SAMPLE_ATTRIBUTE>
<py:if test="attributetest(row, 'geographic location (region and locality)')">
<SAMPLE_ATTRIBUTE>
Expand All @@ -226,6 +230,7 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>geographic location (depth)</TAG>
<VALUE>${row['geographic location (depth)']}</VALUE>
<UNITS>m</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<SAMPLE_ATTRIBUTE>
Expand All @@ -244,6 +249,7 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>geographic location (elevation)</TAG>
<VALUE>${row['geographic location (elevation)']}</VALUE>
<UNITS>m</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'source material identifiers')">
Expand Down Expand Up @@ -280,6 +286,7 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>amount or size of sample collected</TAG>
<VALUE>${row['amount or size of sample collected']}</VALUE>
<UNITS>m3</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'host body product')">
Expand All @@ -292,6 +299,7 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>host dry mass</TAG>
<VALUE>${row['host dry mass']}</VALUE>
<UNITS>mg</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'oxygenation status of sample')">
Expand All @@ -310,12 +318,14 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>sample storage duration</TAG>
<VALUE>${row['sample storage duration']}</VALUE>
<UNITS>years</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'sample storage temperature')">
<SAMPLE_ATTRIBUTE>
<TAG>sample storage temperature</TAG>
<VALUE>${row['sample storage temperature']}</VALUE>
<UNITS>°C</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'sample storage location')">
Expand Down Expand Up @@ -346,6 +356,7 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>host age</TAG>
<VALUE>${row['host age']}</VALUE>
<UNITS>years</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'host taxid')">
Expand Down Expand Up @@ -376,12 +387,14 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>host height</TAG>
<VALUE>${row['host height']}</VALUE>
<UNITS>mm</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'host length')">
<SAMPLE_ATTRIBUTE>
<TAG>host length</TAG>
<VALUE>${row['host length']}</VALUE>
<UNITS>mm</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'host growth conditions')">
Expand All @@ -400,6 +413,7 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>host total mass</TAG>
<VALUE>${row['host total mass']}</VALUE>
<UNITS>kg</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'host infra-specific name')">
Expand All @@ -424,6 +438,7 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>host body temperature</TAG>
<VALUE>${row['host body temperature']}</VALUE>
<UNITS>ºC</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'host color')">
Expand All @@ -448,12 +463,14 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>temperature</TAG>
<VALUE>${row['temperature']}</VALUE>
<UNITS>ºC</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'sample salinity')">
<SAMPLE_ATTRIBUTE>
<TAG>sample salinity</TAG>
<VALUE>${row['sample salinity']}</VALUE>
<UNITS>psu</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'miscellaneous parameter')">
Expand All @@ -466,12 +483,14 @@ def attributetest(row, column):
<SAMPLE_ATTRIBUTE>
<TAG>host blood pressure diastolic</TAG>
<VALUE>${row['host blood pressure diastolic']}</VALUE>
<UNITS>mm Hg</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'host blood pressure systolic')">
<SAMPLE_ATTRIBUTE>
<TAG>host blood pressure systolic</TAG>
<VALUE>${row['host blood pressure systolic']}</VALUE>
<UNITS>mm Hg</UNITS>
</SAMPLE_ATTRIBUTE>
</py:if>
<py:if test="attributetest(row, 'host diet')">
Expand Down
Loading

0 comments on commit e5c693c

Please sign in to comment.