Bmk_Space_mapping.R Operating Instructions
2022-08-25
BMKMANU S1000 Mouse Embryo Head Demo Data — Results
2022-11-23

1. Software Dependencies and Installation

Dependencies:

  • python: version 9, with the cv2 module (version 4.0 or above), Cython, numpy and seaborn installed
  • Minimap2
  • Samtools: version 2 or above

The dependent software must be added to the environment variables using export so that the pipeline can invoke it.

Installation: run the following command in the pipeline directory

pip install ./bmk-ocean-stars

2. Input Data Preparation

  • Sequencing data: ONT sequencing fastq data (.gz format supported).
  • Reference genome data: genome fa sequence file and gtf file (including gene and exon).
  • Fluorescence decoding file and HE image file.

3. Writing the Configuration File

Configuration file:

## Sequencing data

FQ     /path/to/ont-reads.fastq

## Fluorescence decoding file

FLU     /path/to/flu_info.txt

## Reference genome sequence and gtf file

Genome   /path/to/ref/genome/fasta

GTF       /path/to/ref/gene/gtf

## HE image file

HE      /path/to/HE.tif

## Output directory and output prefix

OUTDIR  /path/to/result/dir/

PREFIX  outfile-prefix

### Number of program threads

Threads     8

Link1       TACGT

4. Running the Pipeline

  • Workflow description:

The pipeline consists of 4 steps, as follows:

  • Step 1: Run GenomeMap to align ONT reads to the reference genome.
  • Step 2: Run MatrixMake to identify barcodes and UMIs and generate the expression matrix file.
  • Step 3: Run AllheStat to process the HE images.
  • Step 4: Run WebReport to generate the web-based report.
  • Workflow parameters:

-c config.txt data configuration file

-s Step selection. 0 runs all steps 1–4; individual steps can also be selected and run separately, with multiple steps separated by “,”.

  • Reference commands:

./BSTMatrixONT -c config.txt -s 0

./BSTMatrixONT -c config.txt -s 1,2,3,4

./BSTMatrixONT -c config.txt -s 1,2

5. Description of Result Files

  • Directory structure and description of results:

outdir/

├── 01.GenomeMap                  Step 1 output directory

│   ├── HXFA2-3.sort.bam                 Genome alignment bam file

│   ├── HXFA2-3.sort.bam.bai

│   └── mapping.sh

├── 02.MatrixMake                    Step 2 output directory

│   ├── bam

│   ├── bc_umi_read.tsv                    barcode-umi-reads count file

│   ├── bc_umi_read.tsv.stat

│   ├── cache_raw_expression.pkl

│   ├── filtered_feature_bc_matrix

│   ├── final_matrix                        Filtered matrix file

│   ├── flu_recognition                     Barcode chip position identification directory

│   ├── HXFA2-3.bc_gene_umi.bc_stat         Barcode detection statistics file

│   ├── HXFA2-3.bc_gene_umi.map_stat       Alignment type statistics file

│   ├── HXFA2-3.bc_gene_umi.stat            barcode-gene-umi mapping file

│   ├── raw_feature_bc_matrix

│   ├── reads_cumi.tsv                      barcode-gene-umi count file

│   ├── reads_info.tsv                       reads-related information file

│   └── web_summary.html                  Web-based statistics result file

├── 03.AllheStat                      Step 3 output directory

│   ├── allhe

│   ├── all_level_stat.txt                   Spot statistics at different levels

│   ├── BSTViewer_project                 BSTViewer software input data

│   ├── heAuto_level_matrix

│   ├── level_matrix

│   ├── stat.txt

│   └── umi_plot                         umi count image statistics directory

├── 04.WebReport                    Step 4 output directory

│   ├── prefix.filelist

│   ├── index.html                        Web-based report html file

│   └── src                              Web report src directory

└── prefix                          Directory of collected gene expression matrices and other files

├── barcode_pos.tsv                  File of chip positions corresponding to barcode types

├── barcode.tsv                      File of barcode types corresponding to chip positions

├── bc_gene_umi.stat.gz               barcode-gene-umi mapping file

├── bc_umi_read.tsv.gz                barcode-umi-reads count file

├── features.tsv                      features.tsv file

└── matrix.tsv                       Gene expression matrix file