> For the complete documentation index, see [llms.txt](https://academy.dnanexus.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://academy.dnanexus.com/public-datasets-on-the-dnanexus-platform/csv-builders-for-nextflow-pipelines/csv-builder-for-scrnaseq.md).

# CSV Builder for scrnaseq

## Necessary Disclaimers and Legal

The user is responsible for reviewing and complying with the license requirements of the software, and data referenced in this documentation.

Users are responsible for the costs associated with analyzing data, software and its storage in their project spaces.&#x20;

Instance type availability and pricing are subject to the contract between the user or the user’s organization and DNAnexus.

## Overview

Preparing a samplesheet input file for nf-core/scrnaseq requires understanding the pipeline's input schema, writing file paths in the correct DNAnexus format, and ensuring all values pass validation. This process is time-consuming and error-prone, especially for new users.

The CSV Builder for nf-core/scrnaseq is a lightweight GUI applet on DNAnexus that helps users create a pipeline-ready samplesheet without any programming. It validates inputs against the pipeline schema, converts selected files into the correct dx:// file path format automatically, supports both manual entry and prefilled metadata (.csv) upload, and saves the output samplesheet directly to the user's DNAnexus project.<br>

This applet targets nf-core/scrnaseq v4.1.0 and accepts paired-end FASTQ files as input. The required and optional columns are:

| Column name     | Format  | Required | Constraint                                                                       |
| --------------- | ------- | -------- | -------------------------------------------------------------------------------- |
| sample          | string  | Yes      | Must contain no spaces.                                                          |
| fastq\_1        | string  | Yes      | <p>Must contain no spaces.</p><p>Must have extension '.fq.gz' or '.fastq.gz'</p> |
| fastq\_2        | string  | Yes      | <p>Must contain no spaces.</p><p>Must have extension '.fq.gz' or '.fastq.gz'</p> |
| fastq\_barcode  | string  | No       | File-path like string                                                            |
| expected\_cells | integer | No       | <p><br></p>                                                                      |
| seq\_center     | string  | No       | <p><br></p>                                                                      |
| sample\_type    | string  | No       | Must be one of these options: "atac", "gex"                                      |
| feature\_type   | enum    | No       | Must be one of these options: "gex", "vdj", "ab", "crispr", "cmo".               |

Official nf-core documentation: <https://nf-co.re/scrnaseq/4.1.0/docs/usage>.&#x20;

## Interface Overview

The applet has two tabs: INPUTS and OUTPUTS. All configuration is done in the INPUTS tab.

* prefilled samplesheet uploads an existing .csv file containing sample names and file references. Use this when you have already prepared a metadata file.
* fastq\_1 selects one or more Read 1 FASTQ files directly from DNAnexus. Use this when you do not have a prefilled samplesheet.
* fastq\_2 selects one or more Read 2 FASTQ files directly from DNAnexus. Each file must correspond to the file selected in fastq\_1 at the same position.
* scrnaseq pipeline version displays the pipeline version the applet validates against. Currently fixed at 4.1.0.
* REQUIRED COLUMNS accepts values for required columns not covered by your input source, such as sample.
* OPTIONAL COLUMNS accepts values for optional columns such as expected\_cells, seq\_center, sample\_type, and feature\_type.
* OUTPUT SAMPLESHEET NAME sets the name of the output .csv file. If left empty, defaults to sample\_sheet.csv.

<br>

<img src="/files/w9niVpqthcf5fm2egMc8" alt="" height="499" width="624">

## Copying the applet and example dataset into a project

To get started, copy the applet and example dataset from the public project into your own project space.

1. Create a project for your analysis, billed to your own organization. Tutorials on how to set up a project can be found on[ this page](https://academy.dnanexus.com/overview-of-the-platform/setting-up-a-project)
2. Navigate to the Resources tab and locate the project titled "Public Datasets AWS US (East)", then go to nf-core\_input\_csv\_builder.&#x20;

<figure><img src="/files/vayaqLFPlShigjTYlgtG" alt=""><figcaption></figcaption></figure>

3. Next, go to folderproteinfold\_csv\_builder, then select the applet scrnaseq\_samplesheet\_builder\_v0.1.1, and the scrnaseq\_example.
4. Click Copy in the top-right menu and select the project created in Step 1.

<figure><img src="/files/1a15fNKRoAv4jotFiXTu" alt=""><figcaption></figcaption></figure>

5. Return to your project space to begin using the applet.

## Quick start

1. Launch the applet scrnaseq\_samplesheet\_builder\_v0.1.1 from the DNAnexus GUI.
2. Click the fastq\_1 field and navigate to nf-core\_input\_csv\_builder/scrnaseq\_example/fastq/. Select the Read 1 FASTQ file.

<img src="/files/Re4NZ3Zp7ixEAiWysb3o" alt="" height="345.7546526935773" width="480">

3. Click the fastq\_2 field and select the corresponding Read 2 FASTQ file.

<img src="/files/HVhhymkrFnEzRDJk3Sf6" alt="" height="331" width="492">

4. In the REQUIRED COLUMNS section, enter the sample name in the sample field.

<img src="/files/SczKTVur84QNgIoLUH7H" alt="" height="656" width="515">

5. Provide output name and use the default instance to launch the job

The job takes approximately 2 minutes. Once the job is complete, verify the following:

* Job status shows Done
* Log file contains no errors or warnings related to the samplesheet

<img src="/files/D3EDAMWptRabUSAKIyuf" alt="" height="39" width="624">

* Output CSV columns match the v4.1.0 schema (sample, fastq\_1, fastq\_2)

<img src="/files/XfjiQsI9mUzkH6wYGxE1" alt="" height="73" width="624">

To confirm the output samplesheet works with the pipeline, run a quick verification using nf-core/scrnaseq v4.1.0 with the test and docker profiles.

For more detailed examples including prefilled samplesheets, folder input, and error scenarios, see the Example jobs section.

## Input flow

The applet supports three ways to provide input data:

* Prefilled samplesheet: upload an existing CSV file that follows the scrnaseq schema. The applet will parse and validate the file, resolve all file references into dx:// paths, and produce the final output samplesheet.
* Manual input: enter data directly into the applet. Values can be provided as an array (multiple values separated by commas) or as a constant (a single value replicated across all rows). FASTQ files can also be selected directly from DNAnexus.
* Folder input: provide a DNAnexus folder path containing FASTQ files. The applet will automatically pair R1 and R2 files based on their filenames, without requiring the user to map them manually.

## File path format

For supported file path formats, see File path format in the CSV Builder for nf-core/proteinfold guide.

## Example runs

To follow along with the examples in this guide, we have prepared a dedicated folder on DNAnexus at nf-core\_input\_csv\_builder/scrnaseq\_example containing the following:

* fastq: sample FASTQ files used as input
* metadata\_example: example prefilled samplesheets
* samplesheet\_output: expected output samplesheets for reference

### Example 1: Providing input via prefilled samplesheet

Scenario: A user has already prepared a CSV file with sample names and FASTQ file references and wants to use it directly as input to the applet.&#x20;

Here is an example

sample,fastq\_1,fastq\_2

S10,S10\_L001\_R1\_001.fastq.gz,S10\_L001\_R2\_001.fastq.gz

SRR8599150,/nf-core\_input\_csv\_builder/scrnaseq\_example/fastq/SRR8599150\_S1\_L001\_R1\_001.sub5000.fastq.gz,/nf-core\_input\_csv\_builder/scrnaseq\_example/fastq/SRR8599150\_S1\_L001\_R2\_001.sub5000.fastq.gz

The prefilled file shows different file path formats supported by the applet including absolute paths, file name. The prefilled file may contain any number of additional columns, the applet will automatically keep only the columns required by the pipeline schema and drop the rest.&#x20;

Note: Users can use file-id and the applet will find the file and provide full dx: path or users can provide full path (dx://…)

Expected output: scrnaseq\_v4.1.0\_samplesheet.csv in /nf-core\_input\_csv\_builder/scrnaseq\_example/samplesheet\_output/

sample,fastq\_1,fastq\_2

S10,dx://project-xxx:/nf-core\_input\_csv\_builder/scrnaseq\_example/fastq/S10\_L001\_R1\_001.fastq.gz,dx://project-xxx:/nf-core\_input\_csv\_builder/scrnaseq\_example/fastq/S10\_L001\_R2\_001.fastq.gz

SRR8599150,dx://project-xxx:/nf-core\_input\_csv\_builder/scrnaseq\_example/fastq/SRR8599150\_S1\_L001\_R1\_001.sub5000.fastq.gz,dx://project-xxx:/nf-core\_input\_csv\_builder/scrnaseq\_example/fastq/SRR8599150\_S1\_L001\_R2\_001.sub5000.fastq.gz

Steps:&#x20;

1. Click to prefilled samplesheet box and choose your metadata (csv) file
2. Leave required columns empty because it will use information in the metadata
3. Name your output csv: It can be scrnaseq\_v4.1.0\_samplesheet.csv or scrnaseq\_v4.1.0\_samplesheet. If you leave this box empty, it will use default name: samplesheet
4. Choose output destination
5. Use default instance and launch the job

<img src="/files/QDmMZC1oqyCAj9VM5Cqw" alt="" height="483" width="439">

Runtime: 2 minutes

Successful job checklist:

* Job status shows Done
* Log file contains no errors or warnings related to the samplesheet

<img src="/files/SmJZbLRCFUU6cK9OXVDT" alt="" height="64" width="624">

* Output CSV columns match the v4.1.0 schema (sample, fastq\_1, fastq\_2)

### Example 2: Provide FASTQ folder, sample name and optional columns

Scenario: A user provides a DNAnexus folder containing FASTQ files and wants the applet to automatically pair R1 and R2 files. In addition, the user manually enters the sample name and expected cell count for each sample. This example replicates the samplesheet from nf-core/scrnaseq: <https://github.com/nf-core/scrnaseq/blob/4.1.0/assets/samplesheet.csv>&#x20;

Steps:

1. Copy the full path of the folder containing your FASTQ files. Note that when using the folder option, the applet will include all FASTQ files in the folder and automatically pair R1 and R2 files. For example, if the folder contains two samples (Sample\_X and Sample\_Y) across two lanes, the applet will pair them accordingly.

<img src="/files/0NgN1U7S0J9epD3hQDNb" alt="" height="261" width="624">

2. Fill in the required fields including fastq\_folder, sample name, expected\_cells, and output file name.

<img src="/files/vpJ0hB1WNVeFlGG6YlLR" alt="" height="926" width="495">

3. Select output destination, use the default instance and launch the job

Expected output

* R1 and R2 files are automatically paired based on their filenames
* The output samplesheet contains one row per lane per sample, with sample, fastq\_1, fastq\_2, and expected\_cells columns populated
* All file references are resolved to dx:// paths

<img src="/files/03kYEeEAgFAJErxnmAPr" alt="" height="69" width="624">

* Run verification with nf-core/scrnaseq version 4.1.0 successfully.

dx run project-J5Xqzy009Qz80FqQpy7QGKfV:/scrnaseq/scrnaseq\_v4.1.0 \\

&#x20; -ioutdir='scrnaseq\_v410' \\

-iinput='project-J5Xqzy009Qz80FqQpy7QGKfV:/nf-core\_input\_csv\_builder/scrnaseq\_example/sample\_sheet\_output/samplesheet.csv' \\

&#x20; -inextflow\_run\_opts='-profile test,docker' \\

&#x20; \--destination 'project-J5Xqzy009Qz80FqQpy7QGKfV:/users/ivy/test\_csv\_builder/test\_06\_05\_26/' \\

&#x20; \--priority high \\

&#x20; \--name "scrnaseq\_test\_csv\_builder" \\

&#x20; -y

### Negative cases

#### Example 3: Upload CSV with multiple files with same name in project

Scenario: A user uploads a prefilled samplesheet using filename only for fastq\_1 and fastq\_2, but multiple files with the same name exist in the project. The applet cannot resolve the file path and logs a warning.

For example, there are several files: SRR8599150\_S1\_L001\_R1\_001.sub5000.fastq.gz in project

<img src="/files/jPGo4MzkVibHngwqWGKJ" alt="" height="123" width="624">

Expected output

* Job completes successfully

<img src="/files/dMqmmhbBfy9z43I0n7bO" alt="" height="225" width="624">

* Validation logs "Found 2 files" for both fastq\_1 and fastq\_2

<img src="/files/ogNOLLzsqSftUCeAeFWv" alt="" height="100" width="624">

#### Example 4: Upload prefilled samplesheet CSV with R1 file assigned to both fastq\_1 and fastq\_2

Scenario: A user accidentally assigns the same R1 file to both fastq\_1 and fastq\_2 in the prefilled samplesheet instead of providing the correct R2 file. The applet will still generate the output samplesheet but will log a validation warning indicating that the file assigned to fastq\_2 does not contain R2 in its filename.

Expected output

* Job completes successfully

<img src="/files/XozAfN2UR5He8vxgouWx" alt="" height="209" width="624">

* The log file contains a validation warning: "File name must contain 'R2'" for fastq\_2

<img src="/files/74qC6JdF46clPbWGgXJc" alt="" height="84" width="624">

* The output samplesheet is generated with the incorrect file reference included
* Users are responsible for correcting the file assignment before running the pipeline

For technical considerations, limitations, and troubleshooting that apply to all CSV builder applets, see Technical Considerations.&#x20;

<br>
