diff --git "a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/Linux\347\216\257\345\242\203\344\270\213\345\237\272\344\272\216conda\347\232\204kallisto\350\275\257\344\273\266\345\214\205\346\265\213\350\257\225\346\212\245\345\221\212.md" "b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/Linux\347\216\257\345\242\203\344\270\213\345\237\272\344\272\216conda\347\232\204kallisto\350\275\257\344\273\266\345\214\205\346\265\213\350\257\225\346\212\245\345\221\212.md" new file mode 100644 index 0000000000000000000000000000000000000000..388267c9ec0db8c1af6788d557e9ff6eee3c02f0 --- /dev/null +++ "b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/Linux\347\216\257\345\242\203\344\270\213\345\237\272\344\272\216conda\347\232\204kallisto\350\275\257\344\273\266\345\214\205\346\265\213\350\257\225\346\212\245\345\221\212.md" @@ -0,0 +1,67 @@ +# Linux环境下基于conda的kallisto软件包测试报告 + +> 测试的主要思路是使用 x86 平台上命令执行的结果作为基准比对数据,与迁移成功后的鲲鹏平台上执行的结果进行比对。 + +[TOC] + +### 一、准备测试物料 + +1. **生成 x86 平台执行结果** + + *[生成完成请将结果移至鲲鹏平台进行下一步比对测试,其中测试用例数据来源于 [kallisto GitHub](https://github.com/pachterlab/kallisto/archive/v0.48.0.tar.gz) ]* + + ![image-20220610165910443](images/image-report-001.png) + ![image-20220610170055797](images/image-report-002.png) + ![image-20220610170134255](images/image-report-003.png) + ![image-20220610170200202](images/image-report-004.png) + + ```shell + # 脚本的参数为当前系统的 Anaconda 或 Miniconda 的根路径 + # 脚本执行完成后会在 ~/hpc/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/TestCase 下载测试用例数据 + # 脚本执行完成后会在 ~/hpc/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/Expected 生成执行结果 + bash ~/hpc/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/generate_expected_data.sh /root/anaconda3 + ``` + +2. **生成 鲲鹏 平台执行结果** + + ![image-20220610170916459](images/image-report-005.png) + ![image-20220610171126315](images/image-report-006.png) + ![image-20220610171156048](images/image-report-007.png) + ![image-20220610171257281](images/image-report-008.png) + ![image-20220610171335183](images/image-report-009.png) + + ```shell + # 脚本的参数为当前系统的 Anaconda 或 Miniconda 的根路径 + # 脚本执行完成后会在 ~/hpc/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/Practical 生成执行结果 + bash ~/hpc/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/generate_practical_data.sh /root/anaconda3 + ``` + + +### 二、执行比对测试 + +![image-20220610171605541](images/image-report-010.png) +![image-20220610171820568](images/image-report-011.png) +![image-20220610171919491](images/image-report-012.png) +![image-20220610172001988](images/image-report-013.png) + +```shell +# 脚本的参数为当前系统的 Anaconda 或 Miniconda 的根路径 +# 主要实现鲲鹏平台下迁移成功的软件包执行结果与 x86 平台的执行结果的基准数据的比较 +bash ~/hpc/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/run_test.sh /root/anaconda3 +``` + +相关资源连接: + +conda 相关文档: https://docs.conda.io/en/latest/ + +conda: https://docs.conda.io/projects/conda/en/latest/ + +conda-build: https://docs.conda.io/projects/conda-build/en/latest/ + +ANACONDA.ORG: https://anaconda.org/ + +kallisto: https://pachterlab.github.io/kallisto/ + +pachterlab/kallisto GitHub: https://github.com/pachterlab/kallisto + +kallisto anaconda package: https://anaconda.org/bioconda/kallisto diff --git "a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/Linux\347\216\257\345\242\203\344\270\213\345\237\272\344\272\216conda\347\232\204kallisto\350\275\257\344\273\266\345\214\205\350\277\201\347\247\273\346\214\207\345\215\227.md" "b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/Linux\347\216\257\345\242\203\344\270\213\345\237\272\344\272\216conda\347\232\204kallisto\350\275\257\344\273\266\345\214\205\350\277\201\347\247\273\346\214\207\345\215\227.md" index afeee6711b2ad7224e443e5b2386b3b661425605..d78323c902f218ac7a3c7f6bf5100cd5eb677a47 100644 --- "a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/Linux\347\216\257\345\242\203\344\270\213\345\237\272\344\272\216conda\347\232\204kallisto\350\275\257\344\273\266\345\214\205\350\277\201\347\247\273\346\214\207\345\215\227.md" +++ "b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/Linux\347\216\257\345\242\203\344\270\213\345\237\272\344\272\216conda\347\232\204kallisto\350\275\257\344\273\266\345\214\205\350\277\201\347\247\273\346\214\207\345\215\227.md" @@ -1,4 +1,4 @@ -# 在 Linux 环境下将 conda x86 架构的软件包迁移至 aarch64 架构的软件包 +# Linux环境下基于conda的kallisto软件包迁移指南 > 本文档主要以 **bioconda/kallisto** 作为本次迁移演示用例,迁移的主要思路是基于 [**linux-64/kallisto-0.48.0-h0d531b0_1.tar.bz2**](https://anaconda.org/bioconda/kallisto/0.48.0/download/linux-64/kallisto-0.48.0-h0d531b0_1.tar.bz2) 的 **x86** 平台软件包,修改 **kallisto-0.48.0-h0d531b0_1/info/recipe/** 路径下的各配置文件,最后使用 [**Conda-build**](https://docs.conda.io/projects/conda-build/en/latest/) 进行软件包构建。在进行迁移构建之前请参考 [**《Linux环境中安装Anaconda.md》**](./Linux环境中安装Anaconda/Linux环境中安装Anaconda.md) 完成迁移环境搭建。 @@ -441,12 +441,16 @@ kallisto 相关资源连接: -[conda 相关文档]: https://docs.conda.io/en/latest/ -[conda]: https://docs.conda.io/projects/conda/en/latest/ -[conda-build]: https://docs.conda.io/projects/conda-build/en/latest/ -[ANACONDA.ORG]: https://anaconda.org/ +conda 相关文档: https://docs.conda.io/en/latest/ -[kallisto]: https://pachterlab.github.io/kallisto/ -[pachterlab/kallisto GitHub]: https://github.com/pachterlab/kallisto -[kallisto anaconda package]: https://anaconda.org/bioconda/kallisto +conda: https://docs.conda.io/projects/conda/en/latest/ +conda-build: https://docs.conda.io/projects/conda-build/en/latest/ + +ANACONDA.ORG: https://anaconda.org/ + +kallisto: https://pachterlab.github.io/kallisto/ + +pachterlab/kallisto GitHub: https://github.com/pachterlab/kallisto + +kallisto anaconda package: https://anaconda.org/bioconda/kallisto diff --git "a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/Linux\347\216\257\345\242\203\344\270\255\345\256\211\350\243\205Anaconda/Linux\347\216\257\345\242\203\344\270\255\345\256\211\350\243\205Anaconda.md" "b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/Linux\347\216\257\345\242\203\344\270\255\345\256\211\350\243\205Anaconda/Linux\347\216\257\345\242\203\344\270\255\345\256\211\350\243\205Anaconda.md" index afe947e22914985ff2cc273a3c3e07eee13b44e5..262bbcd9d8cc374b1c1248e13044a93f634e648a 100644 --- "a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/Linux\347\216\257\345\242\203\344\270\255\345\256\211\350\243\205Anaconda/Linux\347\216\257\345\242\203\344\270\255\345\256\211\350\243\205Anaconda.md" +++ "b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/Linux\347\216\257\345\242\203\344\270\255\345\256\211\350\243\205Anaconda/Linux\347\216\257\345\242\203\344\270\255\345\256\211\350\243\205Anaconda.md" @@ -176,12 +176,10 @@ ![image-020.png](images/image-020.png) +相关资源连接: - - 相关资源连接: - - [Anaconda 官网]: https://www.anaconda.com/ - [Anaconda Packages repository]: https://repo.anaconda.com/pkgs/ - [Anaconda Documentation]: https://docs.anaconda.com/ - - +Anaconda 官网: https://www.anaconda.com/ + +Anaconda Packages repository: https://repo.anaconda.com/pkgs/ + +Anaconda Documentation: https://docs.anaconda.com/ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-001.png b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-001.png new file mode 100644 index 0000000000000000000000000000000000000000..46eb5c0b3a281a2ae9a8fce7adf06dc33372f26d Binary files /dev/null and b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-001.png differ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-002.png b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-002.png new file mode 100644 index 0000000000000000000000000000000000000000..69ac09189ffc69792c8933242d047af498b691bc Binary files /dev/null and b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-002.png differ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-003.png b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-003.png new file mode 100644 index 0000000000000000000000000000000000000000..906d241c2dd99d1c100c77e7d55285ad3fb7c44e Binary files /dev/null and b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-003.png differ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-004.png b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-004.png new file mode 100644 index 0000000000000000000000000000000000000000..6a43a031727d98d2074f2ac59ccefe1575275909 Binary files /dev/null and b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-004.png differ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-005.png b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-005.png new file mode 100644 index 0000000000000000000000000000000000000000..99c6909339dcba30ab263fb8e3cb5a119c6320d8 Binary files /dev/null and b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-005.png differ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-006.png b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-006.png new file mode 100644 index 0000000000000000000000000000000000000000..4df26f9901d42148202b03ba31a4b71978ec0dc5 Binary files /dev/null and b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-006.png differ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-007.png b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-007.png new file mode 100644 index 0000000000000000000000000000000000000000..9ee3e906688141d7d9900e17152d57115bf3c26d Binary files /dev/null and b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-007.png differ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-008.png b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-008.png new file mode 100644 index 0000000000000000000000000000000000000000..3bce178a864d4dfc71e356536f03b647ecfce53b Binary files /dev/null and b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-008.png differ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-009.png b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-009.png new file mode 100644 index 0000000000000000000000000000000000000000..96fb5ac06158e5ccb6f5a93d49c8f695ef797a1a Binary files /dev/null and b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-009.png differ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-010.png b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-010.png new file mode 100644 index 0000000000000000000000000000000000000000..cbd78599f0dc2d07a20be8ee6a6f55fdd33700e9 Binary files /dev/null and b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-010.png differ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-011.png b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-011.png new file mode 100644 index 0000000000000000000000000000000000000000..84669c76da646c7c2329bf9e5fbf7927384d46b0 Binary files /dev/null and b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-011.png differ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-012.png b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-012.png new file mode 100644 index 0000000000000000000000000000000000000000..0764c8079364ce57de3af733e2e88a6a47d04313 Binary files /dev/null and b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-012.png differ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-013.png b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-013.png new file mode 100644 index 0000000000000000000000000000000000000000..024d431ae68eaa5dd63998d7af2d238f623d2011 Binary files /dev/null and b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/documentation/images/image-report-013.png differ diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/common.sh b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/common.sh index b53a40b54a5f599e52c7a8d93c4dc1dd86f5822f..a39329115d4317f0e9848d034adfc1ce9c97bb48 100644 --- a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/common.sh +++ b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/common.sh @@ -11,14 +11,14 @@ function set_script_dir() { SCRIPT_DIR="$(cd "${REL_SCRIPT_DIR}" && pwd)" || return 1 } -function delete_a_directory() { +function delete_a_directory_or_file() { if [ -e "$1" ]; then rm -rf "$1" || return 1 fi } function safely_create_a_directory() { - delete_a_directory "$1" + delete_a_directory_or_file "$1" mkdir "$1" || return 1 } @@ -60,3 +60,40 @@ function generate_execution_result_data() { --genomebam --gtf "$2/transcripts.gtf.gz" --chromosomes \ "$2/chrom.txt" "$2/reads_1.fastq.gz" "$2/reads_2.fastq.gz" } + +function generate_HDF5_intermediate_alignment_files() { + for i in "$@"; do + for j in "$i/outputGenomebam" "$i/outputQuantification" "$i/outputSingleEndReads"; do + if [ ! -e "$j" ]; then + echo -e "\033[1;31;1mThe current path does not exist. [$j]\033[0m" + return 1 + fi + delete_a_directory_or_file "$j/abundance.h5.ali" + # To use h5dump, kallisto needs to be installed in the conda environment. + h5dump "$j/abundance.h5" >"$j/abundance.h5.ali" + if [ $? -eq 1 ]; then + echo -e "\033[1;31;1mh5dump execution failed,Please rerun the current script.\033[0m" + return 1 + fi + done + done +} + +function print_execution_result() { + if [ "$1" -eq 0 ]; then + echo -e "\033[1;32;1m'$2' executed successfully.\n\033[0m" + else + echo -e "\033[1;31;1m'$2' execution result does not match expected result.\n\033[0m" + return "$1" + fi +} + +function compare_file_content_by_diff() { + diff "$1" "$2" >/dev/null + print_execution_result "$?" "$3" || return 1 +} + +function compare_file_content_by_cmp() { + cmp "$1" "$2" >/dev/null + print_execution_result "$?" "$3" || return 1 +} diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/generate_expected_data.sh b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/generate_expected_data.sh index c6f34bb214a1490285435a61b16fcc8d289860d9..bc218e6580843979551de0289863bf46edd60766 100644 --- a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/generate_expected_data.sh +++ b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/generate_expected_data.sh @@ -41,8 +41,8 @@ function main() { echo -e "\033[1;32;1mSuccessfully generated expected data.\033[0m" else echo -e "\033[1;31;1mFailed to generate expected data.\033[0m" - delete_a_directory "${TEST_CASE_DIR}" - delete_a_directory "${EXPECTED_DIR}" + delete_a_directory_or_file "${TEST_CASE_DIR}" + delete_a_directory_or_file "${EXPECTED_DIR}" fi } diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/generate_practical_data.sh b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/generate_practical_data.sh index e5a14a662e6081d945dd41ef94c88dafd4eb7584..18727832382a3f21006cba1ca1d02a8e56a5d85f 100644 --- a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/generate_practical_data.sh +++ b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/generate_practical_data.sh @@ -19,8 +19,8 @@ function main() { echo -e "\033[1;32;1mSuccessfully generated practical data.\033[0m" else echo -e "\033[1;31;1mFailed to generate practical data.\033[0m" - delete_a_directory "${TEST_CASE_DIR}" - delete_a_directory "${PRACTICAL_DIR}" + delete_a_directory_or_file "${TEST_CASE_DIR}" + delete_a_directory_or_file "${PRACTICAL_DIR}" fi } diff --git a/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/run_test.sh b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/run_test.sh new file mode 100755 index 0000000000000000000000000000000000000000..9a37c3b764572b799f769018a201c12566c25f7a --- /dev/null +++ b/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/run_test.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +source "$( + cd "$(dirname "$0")" || exit 1 + pwd +)/common.sh" + +function set_dir() { + EXPECTED_DIR="${SCRIPT_DIR}/Expected" || return 1 + PRACTICAL_DIR="${SCRIPT_DIR}/Practical" || return 1 + TEST_CASE_DIR="${SCRIPT_DIR}/TestCase" || return 1 +} + +function comparison_of_quantification_results() { + # The ignored fields "start_time" and "call" are related to the command execution time stop and parameter path, not due to feature comparison + diff <(sed '11,12d' "$1/run_info.json") <(sed '11,12d' "$2/run_info.json") >/dev/null || return 1 + # Mainly ignore the difference between the generated HDF5 file path, the absolute path of the executed command and the time stamp. + diff <(sed '1d;428d;435d;570d;571d' "$1/abundance.h5.ali") <(sed '1d;428d;435d;570d;571d' "$2/abundance.h5.ali") >/dev/null || return 1 + diff "$1/abundance.tsv" "$2/abundance.tsv" >/dev/null || return 1 +} + +function visualize_the_pseudoalignments_comparison_of_results() { + comparison_of_quantification_results "$1" "$2" || return 1 + cmp "$1/pseudoalignments.bam" "$2/pseudoalignments.bam" >/dev/null || return 1 + cmp "$1/pseudoalignments.bam.bai" "$2/pseudoalignments.bam.bai" >/dev/null || return 1 +} + +function start_test() { + compare_file_content_by_diff "$1/kallistoUsage" "$2/kallistoUsage" \ + "kallisto" || return 1 + + compare_file_content_by_cmp "$1/transcripts.idx" "$2/transcripts.idx" \ + "kallisto index -i transcripts.idx transcripts.fasta.gz" || return 1 + + comparison_of_quantification_results "$1/outputQuantification" "$2/outputQuantification" + print_execution_result "$?" "kallisto quant -i transcripts.idx -o output -b 100 reads_1.fastq.gz reads_2.fastq.gz" || return 1 + + comparison_of_quantification_results "$1/outputSingleEndReads" "$2/outputSingleEndReads" + print_execution_result "$?" "kallisto quant -i transcripts.idx -o output -b 100 --single -l 180 -s 20 reads_1.fastq.gz" || return 1 + + visualize_the_pseudoalignments_comparison_of_results "$1/outputGenomebam" "$2/outputGenomebam" + print_execution_result "$?" "kallisto quant -i transcripts.kidx -b 30 -o kallisto_out --genomebam --gtf transcripts.gtf.gz --chromosomes chrom.txt reads_1.fastq.gz reads_2.fastq.gz" || return 1 +} + +function test_clean() { + for i in "$@"; do + delete_a_directory_or_file "$i" + done +} + +function main() { + is_expected_architecture aarch64 || return 1 + set_script_dir || return 1 + set_dir || return 1 + conda_initialize "$1" + create_and_activate_conda_env local || return 1 + generate_HDF5_intermediate_alignment_files "${EXPECTED_DIR}" "${PRACTICAL_DIR}" || return 1 + start_test "${EXPECTED_DIR}" "${PRACTICAL_DIR}" + if [[ $? -eq 0 ]]; then + echo -e "\033[1;32;5mThe test was successful.\n\033[0m" + else + echo -e "\033[1;31;1mTest failed.\n\033[0m" + fi + test_clean "${TEST_CASE_DIR}" "${EXPECTED_DIR}" "${PRACTICAL_DIR}" || return 1 +} + +# /bin/bash ~/hpc/Anaconda/bioconda/kallisto/0.48.0/h0d531b0_1/test/generate_practical_data.sh /opt/anaconda3 +main "$@"