Help center

Fix: tree IDs don't match between phenotype and genotype files

Why trees in your phenotype and genotype files don't match, and how to fix the IDs.

Fewer matched trees than you expect on the upload screen means some IDs in your phenotype file don’t match a sample ID in your genotype file.

Symptoms

  • The genotype file’s line on the upload screen says “N of M phenotype trees matched to genotypes (x%, on “Tree”)“ with a low number. The name in quotes is the phenotype ID column used for matching. The same line says how many matched only after normalizing (see below) and shows a few unmatched examples.
  • GWAS, heritability or QTL results use fewer trees than your trial has.
  • The results folder’s ID_matching folder has an …_unmatched_ids.csv file listing many IDs, and the README repeats the count.

Cause

CacaoIQ links a row of your phenotype file to a sample in your genotype file by its ID. A phenotype ID matches a genotype sample when:

  1. the text is identical, or
  2. the text is identical after ignoring surrounding spaces, upper and lower case, separators and spaces, and leading zeros of every number in the ID.
These match These don’t
CCN-51 = ccn 51 = CCN_51 1-2 and 12 (a separator between two digits is kept)
007 = 7 T12_rep1 and T12 (extra text)
IMC-0105 = IMC105 = imc 105 T007 and T7 both in one genotype file (ambiguous, see below)
1-02 = 1-2 AB12 and AB12b (extra text)

An ID is never matched when the match would be ambiguous: two genotype samples that become the same ID after normalizing (such as T007 and T7 in one genotype file), or two phenotype IDs claiming one sample. These are left unmatched and reported.

Plain-number IDs (such as 101) work like any other ID.

Fix

Option 1: Make the IDs the same in both files

  1. Look at the unmatched examples on the upload screen, or open …_unmatched_ids.csv from an earlier run. It lists the IDs found in only one of the two files.
  2. Compare how the same tree is written in each file. Common differences: a suffix or plate code added by the lab, a different separator between digits, or a field code in one file and a clone name in the other.
  3. Edit a copy of your phenotype file (or genotype file) so the IDs follow one pattern. CacaoIQ never changes your uploaded files, so you always keep the original.
  4. Upload the corrected file. The matched count updates on the upload screen.

Option 2: Use the right ID column in a clonal trial

If your trial has several trees per clone, give the clone and the tree their own columns and mark both as Identifier. In Gene Discovery the models use the ID column that matches your genotype file, and the run panel says which. When the lab genotyped one sample per clone, the clone column is the one that should match.

Option 3: Resolve duplicate samples

If two samples in your genotype file have IDs that are the same after normalizing (for example CCN-51 and CCN_51), the match is ambiguous and neither sample is matched. Rename or remove one of the two samples.

Separately, the genotype quality control lists possible duplicates: pairs of samples that are far more related than any other pair, whatever their IDs (a tree sampled twice, or a label swap). They are listed for you to check, not removed.

What still works with unmatched trees

Trees without genotypes are left out of the genomic analyses (GWAS, heritability, QTL), not out of the field-data BLUPs.

Prevention

Send samples to the lab under the same IDs your phenotype file uses, and keep one list of IDs for both files.

Still having issues?

Email support@scilytics.ai with:

  • the exact text of the genotype line on the upload screen
  • the column headers of both files
  • two or three IDs written the way each file writes them (made-up IDs in the same pattern are fine, for example AB-012 in one file and ab12 in the other)

Still stuck? Write to support@scilytics.ai with your system and what you see on screen. Don’t attach data files. The first reply comes within 2 business days.