Перейти к основному содержимому

Import from Excel or CSV

Import fills the data table from a spreadsheet instead of from photos. Use it for data measured elsewhere, or to load a table you exported and edited in Excel.

Open the dialog with Import Data (shown while the experiment has no data) or with Import in the header of the data table.

Import replaces the table

The imported file becomes the whole data table. The previous table, including manual edits and adjustments, is replaced. Analyses that already ran keep their results.

Supported file format​

The dialog before a file is chosen.

Click the dashed area, choose a file and click Upload & Preview.

  • File types: .xlsx, .xls and .csv.
  • One row per well (or per measurement), one column per variable.
  • The first row holds the column names. Everything below it is data.
  • One column with sample names is required. Rows with the same sample name are replicates of one sample (see replicates).
  • Class columns (optional): one column per class type, the class of the row as text.
  • Data columns: numbers. Use a dot as the decimal separator in CSV files: in a CSV file 12,5 is not a number and is imported as 0. In Excel files numeric cells are read as numbers whatever the locale.
  • CSV files: the encoding (UTF-8, Windows-1251 and others) and the separator (comma, semicolon or tab) are detected automatically.

A minimal file:

SampleOriginIMG_001 RIMG_001 GIMG_001 BIMG_002 Avg
Tea AChina18212164118.67
Tea AChina18112064117.33
Tea BIndia151984796.33

Sheet and column mapping​

After the upload the dialog shows the file name and size and three tabs:

  • Sheets — choose the sheet to import (an Excel file can have several; a CSV file has one, CSV Data) and see its columns and number of rows. Changing the sheet resets the column mapping.
  • Preview — the column mapping and the first rows of the sheet.
  • Info — number of sheets, columns and rows, file type, encoding.

On Preview you tell Chrometrica what each column is:

Interactive demo: click column headers, Ctrl+click, or use Auto-detect.
TypeHeader colourBadgeBecomes
Sample NameblueSthe SAMPLE NAME column. Exactly one column. Required.
ClassificationcyanCa class column; the header is the class type
DatagreenDa data column (feature)
UndefinedwhiteUnot imported

Ways to set the types:

  • Click a column header to cycle its type: Sample → Class → Data → Sample. There is only one sample column: when you make another column the sample column, the previous one becomes Undefined.

  • Ctrl+click (Cmd+click on macOS) a header, or choose it in Set All After as Data, to mark this column and all columns to its right as data. A yellow arrow marks the first data column.

  • Auto-detect guesses all types from the headers:

    • the first header that contains sample or name is the sample column (an empty header is read as Unnamed: N and matches too); later matches become classification columns; if nothing matches, the first column is used;
    • headers that end with R, G, B or Avg, or contain .jpg, .jpeg, .png, _r, _g, _b or _intensity (any case) are data;
    • all other headers are classification columns.

    Check the result: a header like Batch_B is taken as data.

  • Clear All makes every column Undefined again. This is the only way to turn a column back to Undefined.

Column Mapping Summary under the preview lists the result. Start Import is enabled once a sample column is chosen. The dialog closes and the stage loads the new table when the import is finished.

How the columns are converted​

  • The sample column is renamed sample_name. An imported table has no CELL COORDINATE column.
  • A class column keeps its header as the class type. A header class_Origin (as in exported files) gives the class type Origin. Trailing spaces are removed from class values; an empty class cell means "no class", and supervised analyses skip such rows.
  • A data column header is split into a photo name and a channel: IMG_001 R → photo IMG_001, channel R; IMG_002 Avg → channel intensity; plate_01.jpg_G (exported files) → photo plate_01.jpg, channel G. Any other header becomes a photo of that name with channel intensity, so any numeric column can be imported.
  • Data columns are then grouped by photo name (in the order the photos first appear in the file) and ordered R, G, B, intensity inside a photo. The column order in the table can therefore differ from the file.
  • Empty data cells and cells that are not numbers become 0. Rows where all data cells are empty are skipped.
  • Row order is the order of the file.

Re-importing an exported file​

A file from Export has the table on the first sheet, Data, which the dialog selects by default. Map the columns like this:

  • sample_name → Sample Name;
  • class_… columns → Classification;
  • Ctrl+click the first photo column → Data;
  • leave cell_coordinate Undefined.

Auto-detect marks cell_coordinate as a classification column. It does no harm, but it then appears in the list of label columns.

Common import errors​

  • Please select an Excel file (.xlsx, .xls) or CSV file — the file has another extension. Save it as .xlsx or .csv.
  • Start Import is disabled — no sample column is chosen. Click the header of the sample column once, or use Auto-detect.
  • All values of a column are 0 — the column holds text, not numbers: decimal commas in a CSV file, units in the cells (12 mg), or a text-formatted Excel column. Fix the file and import again.
  • Fewer rows than in the file — rows with all data cells empty are skipped. Check that the data columns are mapped as Data.
  • File is already completed — this uploaded file was imported already. Reload the page, then upload the file again.
  • Data generation failed: … after an import — the file could not be read with this mapping. The message gives the reason. The stage then shows No Data Available: import a corrected file or generate the data from the photos.