Skip to content

Commit

Permalink
Merge up-to-date with main
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahgonicholson committed Dec 17, 2024
2 parents a545dd2 + fd354a2 commit 836850f
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 21 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,27 @@ smaht-portal
Change Log
----------

0.119.0
0.121.0
=======
`PR 300 SN Remove basecalling <https://github.com/smaht-dac/smaht-portal/pull/300>`

* Remove Basecalling item and transfer properties to Software item


0.120.0
=======
`PR 306 SN Add cell_sorting_method <https://github.com/smaht-dac/smaht-portal/pull/306>`

* Add property `cell_sorting_method` to AnalytePreparation


0.119.0
=======
`PR 304 SN remove recovery_datetime from tissue <https://github.com/smaht-dac/smaht-portal/pull/304>`_

* Remove `recovery_datetime` from Tissue after having moved the property to TissueCollection, as it is protected information


0.118.0
=======
`PR 303 SN Rnaseq filenames <https://github.com/smaht-dac/smaht-portal/pull/303>`
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "encoded"
version = "0.119.0"
version = "0.121.0"
description = "SMaHT Data Analysis Portal"
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down
22 changes: 22 additions & 0 deletions src/encoded/schemas/analyte_preparation.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,28 @@
]
}
},
"cell_sorting_method": {
"title": "Cell Sorting Method",
"description": "Cell sorting method for analyte extraction, if applicable. Relevant for extraction for single-cell assays",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"enum": [
"Fluoresence-activated",
"Magnetic-activated",
"Selective Media",
"Laser Capture Microdissection",
"Micromanipulation",
"Isopycnic Sedimentation",
"Velocity Sedimentation",
"Centrifugation",
"Filtering",
"Microfluidics"
]
}
},
"extraction_method": {
"title": "Extraction Method",
"description": "Method of analyte extraction",
Expand Down
15 changes: 1 addition & 14 deletions src/encoded/schemas/tissue.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
]
},
"schema_version": {
"default": "3"
"default": "4"
},
"submitted_id": {
"pattern": "^[A-Z0-9]{3,}_TISSUE_[A-Z0-9-_.]{4,}$"
Expand Down Expand Up @@ -113,19 +113,6 @@
"description": "Notes from prosector report on the tissue recovery",
"type": "string"
},
"recovery_datetime": {
"title": "Recovery Datetime",
"description": "Date and time of tissue recovery",
"type": "string",
"anyOf": [
{
"format": "date-time"
},
{
"format": "date"
}
]
},
"sample_count": {
"title": "Sample Count",
"description": "Number of samples produced from the tissue",
Expand Down
20 changes: 19 additions & 1 deletion src/encoded/tests/data/workbook-inserts/analyte.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"concentration_unit": "ng/uL",
"samples": [
"TEST_TISSUE-SAMPLE_LIVER"
]
],
"analyte_preparation": "TEST_ANALYTE-PREPARATION_LIVER"
},
{
"uuid": "ecff361b-a0ce-4805-9201-301e42c868bf",
Expand Down Expand Up @@ -121,5 +122,22 @@
"TEST_TISSUE-SAMPLE_LIVER",
"TEST_TISSUE-SAMPLE_LIVER_2"
]
},
{
"uuid": "fa2191da-52d8-40a0-95a4-ae116b9ea518",
"submission_centers": [
"smaht"
],
"submitted_id": "TEST_ANALYTE_LIVER-CELL",
"molecule": [
"DNA"
],
"molecule_detail": [
"Total DNA"
],
"samples": [
"TEST_CELL-SAMPLE_LIVER-CELL"
],
"analyte_preparation": "TEST_ANALYTE-PREPARATION_LIVER-CELL"
}
]
17 changes: 14 additions & 3 deletions src/encoded/tests/data/workbook-inserts/analyte_preparation.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@
"smaht"
],
"submitted_id": "TEST_ANALYTE-PREPARATION_LIVER",
"cell_lysis_method": [
"Chemical"
],
"extraction_method": [
"Magnetic Beads"
]
},
{
"uuid": "6ba66ffb-d509-4b75-9c91-00f317138383",
"submission_centers": [
"smaht"
],
"submitted_id": "TEST_ANALYTE-PREPARATION_LIVER-CELL",
"cell_sorting_method": [
"Magnetic-activated"
],
"cell_lysis_method": [
"Chemical"
],
"suspension_type": "Whole Cell"
}
]
3 changes: 2 additions & 1 deletion src/encoded/tests/data/workbook-inserts/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"fragment_mean_length": 150.7,
"insert_mean_length": 150.2,
"preparation_date": "2023-05-11",
"assay": "bulk_wgs"
"assay": "bulk_wgs",
"library_preparation": "TEST_LIBRARY-PREPARATION_LIVER"
},
{
"uuid": "f14533e1-de91-4390-9c16-28e420029d41",
Expand Down
20 changes: 20 additions & 0 deletions src/encoded/tests/test_upgrade_tissue.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,24 @@ def test_upgrade_tissue_2_3(
"tissue", tissue, current_version="2", target_version="3"
)
== expected
)


@pytest.mark.parametrize(
"tissue,expected",
[
({}, {"schema_version": "4"}),
({"recovery_datetime": "2024-12-01"}, {"schema_version": "4"}),
],
)
def test_upgrade_tissue_3_4(
app: Router, tissue: Dict[str, Any], expected: Dict[str, Any]
) -> None:
"""Test tissue upgrader from version 3 to 4."""
upgrader = get_upgrader(app)
assert (
upgrader.upgrade(
"tissue", tissue, current_version="3", target_version="4"
)
== expected
)
7 changes: 7 additions & 0 deletions src/encoded/upgrade/tissue.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ def upgrade_tissue_2_3(value: Dict[str, Any], system: Dict[str, Any]) -> Dict[st
existing_recovery_interval = value.get("recovery_interval")
if existing_recovery_interval:
del value["recovery_interval"]


@upgrade_step("tissue", "3", "4")
def upgrade_tissue_3_4(value: Dict[str, Any], system: Dict[str, Any]) -> Dict[str, Any]:
existing_recovery_datetime = value.get("recovery_datetime")
if existing_recovery_datetime:
del value["recovery_datetime"]

0 comments on commit 836850f

Please sign in to comment.