Explain how you would handle string manipulation tasks involving DNA sequences using SQL and/or Python.
Using the provided tables, write a PostgreSQL query that returns valid DNA sequences after trimming and uppercasing the input. Exclude null, empty, invalid, short, and unmatched records.
sample_label, sequence_id, normalized_sequence, sequence_length, gc_count, and reverse_complementsample_label, then sequence_id| Column | Type | Description |
|---|---|---|
| sequence_idPK | INT | Unique identifier for the DNA sequence |
| sample_id | INT | References the DNA sample |
| sequence_text | TEXT | Raw DNA sequence text |
| Column | Type | Description |
|---|---|---|
| sample_idPK | INT | Unique identifier for the sample |
| sample_label | VARCHAR(100) | Human-readable sample label |