Troubleshooting¶
Each error below is shown as it prints, followed by what it means and what to do.
Names and parameters¶
KeyError: "'hla' is not in the demo catalog. Did you mean one of: hla.hlahd.standardized, hla.hibag.raw?"
hla is a group of entries with no default, so c4 doesn't know which one you
want. Use one of the suggested names, or a group that has a default
("hla.hlahd"). Print the cohort to see every name.
ValueError: Invalid panel='martian' for 'hla.hibag.raw'. Choose from: ['european', 'african', 'asian', 'multiethnic']
The value isn't in the entry's params list. Use one of the listed values, or
add the new one to params in the catalog if the file exists.
ValueError: 'dna.imputed' needs chrom (chrom: 1..22 (22)).
The path is templated and this placeholder has no default. Pass it:
.path("dna.imputed", chrom=6), or use .paths("dna.imputed") for all of them.
Files¶
ValueError: No path is set for 'dna.exome' in the catalog (it is TODO).
The catalog knows this data exists but nobody has added its path yet. Ask the cohort owner (shown at the top of the cohort table), then fill it in.
FileNotFoundError: 'pcs' not found: /data/lab/demo/pca/demo_array_pruned.eigenvec
The catalog points somewhere that has nothing there. The data may have moved,
or you may not have access to that directory. Run .check() to see whether
anything else is affected, then fix the path in the catalog.
ValueError: 'dna.imputed' is genetic data; use .path('dna.imputed', ...) instead of .load().
Genetic files aren't loaded into pandas. Get the path and use bcftools, plink or a c4 command.
IDs and merging¶
Note: 1 of 7 rows in 'pcs' have no patient_id (array ID not in id_map).
Some IDs in the table aren't in the ID map. That's expected for control or
reference samples. If real patients are missing, the ID map is out of date or
the table's id: type is wrong in the catalog.
ValueError: 'hla.hibag.dup' has more than one row for 1 patient(s) (e.g. P001), so it can't be merged on patient_id. Load it on its own to inspect, or dedupe it first.
A merge would have duplicated rows. Load that table alone, decide which row to keep for each patient, and merge yourself, or fix the file.
ValueError: id_map lists 1 exome_id value(s) under more than one patient, e.g. EX-0003.
The same sample is assigned to two patients in the ID map. One of them is wrong; fix the map (and its build script).
ValueError: id_map .../demo_id_map.tsv column 'drop' must be 1, 0 or blank; found ['yes'].
The ID map's drop column has a value c4 doesn't understand. Use 1 to drop
a patient, and leave it blank (or 0) otherwise. Put any explanation in
qc_note.
ValueError: 'pcs' needs `id: {column: ..., type: ...}` in the catalog, with type one of ('patient', 'exome', 'array', 'imputed') (got column='IID', type='TODO').
The catalog entry doesn't say what kind of ID the table uses yet. Fill in
type.
ValueError: No id_map is set for demo in the catalog.
The cohort has no ID map yet, so only tables keyed by patient ID can be loaded. Build one (How IDs link) and add its path.
A merge has fewer patients than expected¶
Read the merge report. Each + line says how many patients from the first
table that table matched:
pheno.main 7 patients
+ pcs 5 matched (2 without)
+ hla.hlahd.standardized 5 matched (2 without)
Patients marked drop=1 in the ID map are left out of every table, and
.load() prints a line saying how many. If a number is much lower than you
expected, load that table alone and look at
how many of its rows got a patient_id. The usual causes are a wrong id:
type in the catalog, or sample names in the file that don't match the ID map
(a suffix, a different prefix, leading zeros).