.
├── eval
├── hisat-3n
├── hisat-3n-table
├── htslib
├── m5C-UBSseq
├── samtools
├── split
├── Umicollapse-bf
├── build.sh
├── Makefile
├── README.md
├── run.sh
├── Snakefile-stage1
└── Snakefile-stage2
- Clone the Repository:
git clone git@github.com:asc-rna/rna-workflow.git
cd rna-workflow && git submodule update --init --recursive- Python env creating
python venv(recommended)
python -m venv venv-rna
source ~/venv-rna/bin/activate
pip install --upgrade pip
pip install cutseq snakemake polars scipyconda create --name rna
conda info --envs
conda activate rna
pip install --upgrade pip
pip install cutseq snakemake polars scipy- Compiling the tools:
./build.shYou may need to handle the errors manually when running the build.sh, e.g. installing libbz2-dev and liblzma-dev.
- (Don't do this! Set INPUT DIR to
/mnt/treasure/asc25/rna/inputor/mnt/ramdisk/rna/inputin the running phase to skip this step) Build indexes for the reference genome and non-coding RNA (ncRNA) if files likeHomo_sapiens.GRCh38.dna.primary_assembly.fa.3n.CT.1.ht2are missing.
export INPUT_DIR=/mnt/treasure/asc25/rna/input
export OUTPUT_DIR=/mnt/treasure/asc25/jiazhaopeng/rna/output
make- When all things are prepared, run the workflow as follows:
Modify the paths in Snakefile-stage1 and Snakefile-stage2 to make sure you have the authority to read/write them. It's suggested to put the input files and intermediate files into ramdisk (/mnt/ramdisk in i1-i3) to accelerate IO.
An example of Snakefile-stage1 using treasure(disk):
OUTPUT_DIR = "/mnt/treasure/asc25/jiazhaopeng/rna/output"
TEMP_DIR = config.get('temp_dir') or "/mnt/treasure/asc25/jiazhaopeng/rna/tmp"
CASE_ID = config.get('case_id') or "SRR23538290"
INPUT_DIR = "/mnt/treasure/asc25/rna/input"
REF_DIR = INPUT_DIR
FASTQ_DIR = "/mnt/treasure/asc25/rna/fastq"
RESULT_DIR = "/mnt/treasure/asc25/jiazhaopeng/rna/result"Then modify and run the script.
bash run.shIt will run in tmux, rna session, of all specified hosts.
You can find the three .filtered.tsv file in RESULT_DIR.
- Evaluate. Change the
ANS_DIRineval/eval.shto yourRESULT_DIRand run the script.
bash eval.shThe output should be like:
presicion:
97.67
Correlation:
0.99796
It is required that
- Build docker on three different nodes, for example, i1, i2, i3.
docker build -t asc-rna:0219 . --network=host-
Modify
runi{1-3}.sh, change mount directory of <input_dir>, <tmp_dir>, <result_dir>. -
Prepare input fastq and index file in <input_dir>, including:
Homo_sapiens.GRCh38.dna.primary_assembly.fa*
Homo_sapiens.GRCh38.ncrna.fa*
SRR2353829{0,1,2}.fastq
For our experiment setup, we create 100G RAM disk named "ramdisk" each for i{1-3}, storing index file and corresponding SRR2353829{0,1,2}.fastq file on each RAM disk.
For our experiment setup, "treasure" is a disk shared by all three nodes, where the results from the three cases are merged and further processed.
For our experiment setup, case2 takes the longest time. so we run stage2 on scripts for i2(case2), immediately after case2-stage1 is finished. It should be reconsiderated if the cases or their processing times change.
- Run docker simultaneously on three different nodes.
# seperately on i{1-3}
./runi{1,2,3}.sh(暂时没搞定)
方便起见,我们使用静态链接方法。
cd htslib
autoreconf -i
export CFLAGS=-flto -O3
export LDFLAGS=-flto
./configure --enable-static --disable-shared
make -j 16经过(漫长的)等待后,得到一个 libhts.a 文件。直接把这个文件扔到仓库里面。
但运行的时候需要各种连接,暂时没搞定这个问题
Updated on 2025.1.16
克隆仓库后,参考下面内容安装除了 sra-tools 以外的依赖软件,输入数据和产生的中间文件放在 /mnt/treasure/ 里,参考 Makefile 运行。
-
sra-tools(只用于下载数据): https://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/3.1.1/sratoolkit.3.1.1-ubuntu64.tar.gz
git clone https://github.com/DaehwanKimLab/hisat2.git hisat-3n
cd hisat-3n
git checkout -b hisat-3n origin/hisat-3n
make
autoheader # Build config.h.in (this may generate a warning about
# AC_CONFIG_SUBDIRS - please ignore it).
autoconf -Wno-syntax # Generate the configure script
./configure # Needed for choosing optional functionality
make
# make install
- m5C-UBSseq
git clone https://github.com/y9c/m5C-UBSseq
- cutseq
python3 -m venv cutseq
cd cutseq
source ./bin/activate.sh
pip3 install cutseq
- umicollapse: https://raw.githubusercontent.com/Daniel-Liu-c0deb0t/UMICollapse/refs/heads/master/umicollapse.jar
dependency:
mkdir lib
cd lib
curl -O -L https://repo1.maven.org/maven2/com/github/samtools/htsjdk/2.19.0/htsjdk-2.19.0.jar
curl -O -L https://repo1.maven.org/maven2/org/xerial/snappy/snappy-java/1.1.7.3/snappy-java-1.1.7.3.jar
cd ..
- 下载 GRCh38
目前在网上找到的较新版本:
ncrna: http://ftp.ensembl.org/pub/release-113/fasta/homo_sapiens/ncrna/Homo_sapiens.GRCh38.ncrna.fa.gz
- 下载输入文件
prefetch <ID>
fasterq-dump --fasta <ID>
输入文件:ascii 字符串,都是 ACGTU 状物,fastq 格式 120+G,这题共有 3 个。
小样例:SRR23538290,文件约 20G,是题目 workflow example 里面的例子,应该保证能跑通流程。
Homo_sapien 开头的数据一般不用动,如果要改可以通过 make 两个 index_phony 生成。
单个 case 的 make 写在了单独的 Makefile_case 里,通过外面指定 CASE_ID 来决定处理哪个 case,应该也只需要优化这一部分。
直接在这个目录 make all 就可以得到所有答案,make -j3 可以让三个 CASE 并行。
Updated on 2025.1.8
克隆仓库后,参考下面内容安装除了 sra-tools 以外的依赖软件,输入数据和产生的中间文件放在 /mnt/treasure/ 里,参考 Makefile 运行。
-
sra-tools(只用于下载数据): https://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/3.1.1/sratoolkit.3.1.1-ubuntu64.tar.gz
git clone https://github.com/DaehwanKimLab/hisat2.git hisat-3n
cd hisat-3n
git checkout -b hisat-3n origin/hisat-3n
make
autoheader # Build config.h.in (this may generate a warning about
# AC_CONFIG_SUBDIRS - please ignore it).
autoconf -Wno-syntax # Generate the configure script
./configure # Needed for choosing optional functionality
make
# make install
- m5C-UBSseq
git clone https://github.com/y9c/m5C-UBSseq
- cutseq
python3 -m venv cutseq
cd cutseq
source ./bin/activate.sh
pip3 install cutseq
- umicollapse: https://raw.githubusercontent.com/Daniel-Liu-c0deb0t/UMICollapse/refs/heads/master/umicollapse.jar
dependency:
mkdir lib
cd lib
curl -O -L https://repo1.maven.org/maven2/com/github/samtools/htsjdk/2.19.0/htsjdk-2.19.0.jar
curl -O -L https://repo1.maven.org/maven2/org/xerial/snappy/snappy-java/1.1.7.3/snappy-java-1.1.7.3.jar
cd ..
- 下载 GRCh38
目前在网上找到的较新版本:
ncrna: http://ftp.ensembl.org/pub/release-113/fasta/homo_sapiens/ncrna/Homo_sapiens.GRCh38.ncrna.fa.gz
- 下载输入文件
(先进入 sra-tools 的 bin 目录)
获取 sra 文件: ./prefetch <accession> -O <accession-path>,转换成 fastq 格式:./fasterq-dump <accession-path> --temp <temp-path> -O <fastq-path> -x
例子:
./prefetch GSM7051153 -O /mnt/treasure2/scc/rna/fastq
./fasterq-dump /mnt/ramdisk/fastq/SRR23538288/SRR23538288.sra --temp /mnt/ramdisk -O /mnt/ramdisk/fastq -x输入文件:ascii 字符串,都是 ACGTU 状物,fastq 格式 120+G,这题共有 3 个。
小样例:SRR23538290,文件约 20G,是题目 workflow example 里面的例子,应该保证能跑通流程。
Homo_sapien 开头的数据一般不用动,如果要改可以通过 make 两个 index_phony 生成。
单个 case 的 make 写在了单独的 Makefile_case 里,通过外面指定 CASE_ID 来决定处理哪个 case,应该也只需要优化这一部分。
直接在这个目录 make all 就可以得到所有答案,make -j3 可以让三个 CASE 并行。