4 Lab 2: From .bcl to count matrix
4.1 Demultiplexing sequencing data with cellranger mkfastq
Navigate to your terminal in RStudio on AWS.
Go to the cellranger mkfastq page and read the Overview.
Go to the Terminal tab in your RStudio and take a look at the 10x samplesheet file:
bash
cat ~/Share/data_wrangling/cellranger-tiny-bcl-simple-1.2.0.csvNext, explore the contents of the sequencing directory:
bash
ls -l Share/data_wrangling/cellranger-tiny-bcl-1.2.0Now we can demultiplex our bcl files by running the following command in the terminal:
bash
cellranger mkfastq --id tiny-bcl --run ~/Share/data_wrangling/cellranger-tiny-bcl-1.2.0 --csv ~/Share/data_wrangling/cellranger-tiny-bcl-simple-1.2.0.csvThe output folders can be viewed by running the ls command:
bash
ls -l tiny-bcl/outs/fastq_path/H35KCBCXY/test_sampleLook at the index read (I1), read 1 (R1), and read (R2) files using the command less fastq_file_name.gz. You can type q in the terminal to leave this view.
Open the html file tiny-bcl/outs/fastq_path/Reports/html/index.html by navigating to the file in RStudio, using the Files Tab. When you click on the file, select the option to View in Web Browser. Take some time to explore the demultiplexed outputs.
4.2 Generating gene count matrices with cellranger count
Go to the cellranger count algorithm overview and read the section on Alignment (Read Trimming, Genome Alignment, MAPQ adjustment, Transcriptome Alignment, UMI Counting).
In the terminal run the command:
bash
cellranger count --id counts --transcriptome ~/Share/refdata-gex-mm10-2020-A/ --fastqs tiny-bcl/outs/fastq_path/H35KCBCXY/test_sample --sample test_sampleWhile the count command is running, read about the format of the feature-barcode matrices.
Once the count command is finished running, the pipeline outputs can be viewed as follows:
bash
ls counts/outsCan you locate the feature-barcode matrices? What is the difference between the raw_feature_bc_matrix and filtered_feature_bc_matrix data types?
Now open the html file counts/outs/web_summary.html by navigating to the file in RStudio, using the Files Tab. When you click on the file, select the option to View in Web Browser. Take some time to explore the gene expression matrix outputs.