diff --git a/LifeSciences/README.md b/LifeSciences/README.md index 367845be4aa4e9181ab63cd49a1aa6d9bf688499..d00134a841ae4005db5c84c932ef25061184a865 100644 --- a/LifeSciences/README.md +++ b/LifeSciences/README.md @@ -1,3 +1,4 @@ Life Sciences Software List: - repositories: xxx - repositories: TRF-4.09.1 +- repositories: featureCounts-2.0.3 diff --git a/LifeSciences/featureCounts-2.0.3/build.sh b/LifeSciences/featureCounts-2.0.3/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..ac4d0b523a683136b22c060e8630a2a5f073ad8c --- /dev/null +++ b/LifeSciences/featureCounts-2.0.3/build.sh @@ -0,0 +1,55 @@ +#!/bin/bash +if [[ $# -ne 2 ]]; then + echo "The format is as follows:" + echo "bash build.sh buildpath installpath" + echo ":param buildpath: 应用构建绝对路径" + echo ":param installpath: 应用安装绝对路径" + exit 1 +fi + +[[ ! "$1" =~ ^/.* || "$1" = "/" ]] && echo "请输入正确的构建路径" && exit 1 +[[ ! "$2" =~ ^/.* || "$2" = "/" ]] && echo "请输入正确的安装路径" && exit 1 + +create_dir() +{ + local path=$1 + [[ "$path" =~ .*/$ ]] && path=${path%/*} + if [[ ! -d "$path" && ! -f "$path" ]]; then mkdir -p $path; else path=$path`date "+%y%m%d%H%M%S"` && mkdir -p $path; fi + echo $path +} + +buildpath=$(create_dir $1) +installpath=$(create_dir $2) + +yum install -y m4 environment-modules systemd-devel +source /etc/profile +module purge + +set -e +dep_dir="dependency" + +bash $dep_dir/bisheng-compiler-2.1.0.sh $buildpath $installpath +module use $installpath/bisheng-compiler-2.1.0/ +module load $installpath/bisheng-compiler-2.1.0/bisheng_modulefiles + +bash featureCounts-2.0.3.sh $buildpath $installpath + +mkdir -p pkg/featureCounts-2.0.3-hpc && cp -r $installpath/* pkg/featureCounts-2.0.3-hpc/ +cat>"pkg/featureCounts-2.0.3-hpc/run.sh"< /dev/null +current_dir=\$(cd "\$(dirname "\${BASH_SOURCE[0]}")" &> /dev/null && pwd) +for d in \$(ls \$current_dir) +do + [[ ! \$d =~ "subread" && ! -f "\$current_dir/\$d" ]] && cd \$current_dir/\$d && module use \$(pwd) && module load \$(pwd)/*modulefiles +done +cd \$current_dir +ln -s \${current_dir}/subread/bin/featureCounts /usr/local/bin/featureCounts +EOF + +cd pkg/ && tar zcvf featureCounts-2.0.3-hpc.tar.gz featureCounts-2.0.3-hpc + +rm -rf $buildpath $installpath + diff --git a/LifeSciences/featureCounts-2.0.3/dependency/bisheng-compiler-2.1.0.sh b/LifeSciences/featureCounts-2.0.3/dependency/bisheng-compiler-2.1.0.sh new file mode 100644 index 0000000000000000000000000000000000000000..f958ad90efebb9f0975587ac7e982592efc3bedb --- /dev/null +++ b/LifeSciences/featureCounts-2.0.3/dependency/bisheng-compiler-2.1.0.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +if [[ $# -ne 2 ]]; then + echo "The format is as follows:" + echo "bash bisheng-compiler-2.1.0.sh buildpath installpath" + echo ":param buildpath: 应用构建绝对路径" + echo ":param installpath: 应用安装绝对路径" + exit 1 +fi + +[[ ! "$1" =~ ^/.* || ! -d "$1" || "$1" = "/" ]] && echo "请输入正确的构建路径" && exit 1 +[[ ! "$2" =~ ^/.* || ! -d "$2" || "$2" = "/" ]] && echo "请输入正确的安装路径" && exit 1 + +buildpath=$1 +installpath=$2 +[[ "$buildpath" =~ .*/$ ]] && buildpath=${buildpath%/*} +[[ "$installpath" =~ .*/$ ]] && installpath=${installpath%/*} + +if [[ "$buildpath" = "$installpath" ]]; then + echo "构建路径与安装路径需为不同路径" + exit 1 +fi + +set -e +yum install -y wget tar environment-modules libatomic + +wget -t 0 -c -P $buildpath https://mirrors.huaweicloud.com/kunpeng/archive/compiler/bisheng_compiler/bisheng-compiler-2.1.0-aarch64-linux.tar.gz +tar xvf $buildpath/bisheng-compiler-2.1.0-aarch64-linux.tar.gz -C $buildpath && rm -rf $buildpath/bisheng-compiler-2.1.0-aarch64-linux.tar.gz +mkdir -p $installpath/bisheng-compiler-2.1.0 && cp -r $buildpath/bisheng-compiler-2.1.0-aarch64-linux/* $installpath/bisheng-compiler-2.1.0/ + +cat>"$installpath/bisheng-compiler-2.1.0/bisheng_modulefiles"<