cellranger aggr and it failed with the following errors even when my
aggr.csv file was accurate:
raise StageException(message) martian.StageException: Could not generate .cloupe file:
The above errors are due to the formatting of the CSV file that is being inputted.
Listed below are the most frequently observed issues:
- Missing new-line character at the end of file (\n)
- NonWordChars at the beginning of the file (eg: 357, 273, 277)
You can verify this by using
od -c command on your input CSV files. Please see an example below:
You can issue the below commands to fix this by adding the new line and by truncating for all ASCII characters except standard text, linefeed, and space characters, respectively.
echo $'' >> file.csv
tr -cd '\11\12\40-\176' < file.csv > aggr.csv
In the above, ensure to replace
file.csvwith the original input CSV file name.
Use the resulting formatted
aggr.csv file as input to the
cellranger aggr pipeline to resolve this issue. Rarely there could be instances where there is a possibility of CTRL-M characters too. This article here describes a few ways to remove CTRL-M characters from files in UNIX.
If you are using Cell Ranger, versions 4 and earlier, you might encounter a PREFLIGHT sample definition error while running
cellranger countfor a Feature barcode dataset even if the fields in
feature_ref.csv files are accurate.
[error] Libraries csv file must contain the following comma-delimited fields: "fastqs, sample, library_type".
[error] Feature reference contains non-ascii characters.
These errors are also related to CSV formatting. The solution proposed for the CLOUPE_PREPROCESS error also applies to resolve this issue. Alternatively, for this sample definition error in
cellranger count, you can upgrade to Cell Ranger v6 and later.
Products: Single Cell Gene Expression