fastq_qc¶
fastq_qc
¶
Raw FASTQ QC results: the sample_fastq_qc table (schema 008).
One row per sample with the headline numbers and flags of its FASTQ quality
control, written by noxqc noxdb register from the sample's QC JSON (which
is itself registered in sample_files as file type fastq_qc)::
fastq_qc.upsert(cur, sample_id, row) # -> "inserted" | "updated" | "unchanged"
fastq_qc.get(cur, sample_id) # -> dict | None
fastq_qc.for_project(cur, project_id) # -> DataFrame, one row per project sample
fastq_qc.delete(cur, sample_id) # -> bool
upsert is idempotent (INSERT ... ON DUPLICATE KEY UPDATE on the
primary key): re-running the QC of a sample overwrites its row.
upsert
¶
Insert or overwrite the QC row of a sample. Idempotent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cur
|
Audit-logging cursor from |
required | |
sample_id
|
int
|
The sample (must exist). |
required |
row
|
dict[str, Any]
|
Column -> value. Unknown columns are rejected; |
required |
Returns:
| Type | Description |
|---|---|
SetResult
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
On unknown or missing columns, or an invalid enum value. |
Source code in src/noxdb/fastq_qc.py
get
¶
Return the QC row of a sample, or None if it has none.
Source code in src/noxdb/fastq_qc.py
delete
¶
Delete the QC row of a sample. Returns True if a row was removed.
for_project
¶
One row per sample of a project (controls included), with its QC.
Samples without a QC result are kept, with NULL QC columns, so the result also shows what is still unchecked.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cur
|
Audit-logging cursor from |
required | |
project_id
|
int
|
Project to scan. |
required |
Returns:
| Type | Description |
|---|---|
'pd.DataFrame'
|
A |
'pd.DataFrame'
|
|
'pd.DataFrame'
|
|
Raises:
| Type | Description |
|---|---|
ImportError
|
If pandas is not installed. |