
# HOW TO - Add new sample types
24.1.2025

## DB changes (local on each server machine)

### Table - cf_proteomics_core_sampletype

#### Clone rows:
 - intact cells/tissue
 - other
 - protein sample

#### Old sample types:
 - append ` (DEPRECATED)` to title

#### New sample types:
 - set correct **id** for each new sample type. The IDs must be the same as in local dev DB.
 - set correct **created_at** and **updated_at** - `NOW()`
 - in **json_metadata** add this after first column (Sample Name):
    ```

        {
            "type": "text",
            "required": "true",
            "info": "please indicate the sample type/group name you would like us to use during the data evaluation phase; should be identical with the sample type/group names mentioned in the \"Compare samples within this order\" / \"Comparison description\" field",
            "name": "Sample Type/Group"
        },
        {
            "type": "text",
            "required": "true",
            "info": "please indicate the samples preparation batches using e.g., integers or any other characters as per your preferences - the samples with the same value in this column will be expected to be prepared together (we will try to use the provided values during the data evaluation phase if different for some replicates); for example, in case you prepared first replicate of all sample types in one week, 2nd replicate in the next week and 3rd replicate in the last one, use e.g., \"1\" for all sample types 1st replicate, \"2\" for all sample types 2nd replicate and \"3\" for all sample types 3rd replicate",
            "name": "Sample preparation batch"
        },
    ```
    ```
    Minify:

    {"type":"text","required":"true","info":"please indicate the sample type/group name you would like us to use during the data evaluation phase; should be identical with the sample type/group names mentioned in the \"Compare samples within this order\" / \"Comparison description\" field","name":"Sample Type/Group"},{"type":"text","required":"true","info":"please indicate the samples preparation batches using e.g., integers or any other characters as per your preferences - the samples with the same value in this column will be expected to be prepared together (we will try to use the provided values during the data evaluation phase if different for some replicates); for example, in case you prepared first replicate of all sample types in one week, 2nd replicate in the next week and 3rd replicate in the last one, use e.g., \"1\" for all sample types 1st replicate, \"2\" for all sample types 2nd replicate and \"3\" for all sample types 3rd replicate","name":"Sample preparation batch"},
    ```



## SOURCE CODE changes (git)

### cf_proteomics_client/entry_form/entryForm.js
Set hardcoded changing if IDs from old sample types to new sample types (in 2 places in the source code):
 - 12 > 17
 - 14 > 18
 - 15 > 19

### cf_proteomics_web/cf_proteomics_core/cf_entry_form/forms.py
Small fix of sample type choices creation for Edit sample data