diff --git a/LifeSciences/README.md b/LifeSciences/README.md index 6c9d77d3dc76df3bd39a0fba37fc25eea28ca522..67ad7a49a2aed617a110086d81ac6458cbe59d65 100644 --- a/LifeSciences/README.md +++ b/LifeSciences/README.md @@ -8,4 +8,5 @@ Life Sciences Software List: - repositories: redundans-v0.13c - repositories: bamtools-2.5.2 - repositories: flye-2.9 -- repositories: Manta-1.6.0 \ No newline at end of file +- repositories: Manta-1.6.0 +- repositories: wham-1.8.0 \ No newline at end of file diff --git a/LifeSciences/wham-1.8.0/build.sh b/LifeSciences/wham-1.8.0/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..904ad6eb144e5c648304f4a14ba27c19b1c89213 --- /dev/null +++ b/LifeSciences/wham-1.8.0/build.sh @@ -0,0 +1,63 @@ +#!/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 +yum install -y cmake zlib zlib-devel xz xz-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel openssl-devel patch +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 $dep_dir/bwa-0.7.17.sh "$buildpath" "$installpath" +module use "$installpath"/bwa-0.7.17 +module load "$installpath"/bwa-0.7.17/bwa_modulefiles + +bash $dep_dir/samtools-1.15.1.sh "$buildpath" "$installpath" +module use "$installpath"/samtools-1.15.1 +module load "$installpath"/samtools-1.15.1/samtools_modulefiles + +bash wham-1.8.0.sh "$buildpath" "$installpath" + +mkdir -p pkg/wham-1.8.0-hpc && cp -r "$installpath"/* pkg/wham-1.8.0-hpc/ +cat>"pkg/wham-1.8.0-hpc/run.sh"< /dev/null +current_dir="\$(cd "\$(dirname "\${BASH_SOURCE[0]}")" && pwd -P)" +for f in "\${current_dir}"/*; do + if [[ -d "\${f}" && -f "\$(ls "\${f}"/*modulefiles 2>&1)" ]]; then + module use "\${f}" && module load "\${f}"/*modulefiles + fi +done +echo -e "\033[1;32;1mwham environment initialization completed.\033[0m" + +EOF +cd pkg/ && tar zcvf wham-1.8.0-hpc.tar.gz wham-1.8.0-hpc + +rm -rf "$buildpath" "$installpath" diff --git a/LifeSciences/wham-1.8.0/dependency/bisheng-compiler-2.1.0.sh b/LifeSciences/wham-1.8.0/dependency/bisheng-compiler-2.1.0.sh new file mode 100644 index 0000000000000000000000000000000000000000..af0c0c656a867d5d95bdfd1c6f5be67dc046f1a0 --- /dev/null +++ b/LifeSciences/wham-1.8.0/dependency/bisheng-compiler-2.1.0.sh @@ -0,0 +1,42 @@ +#!/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%/*} +[[ "$buildpath" == "$installpath" ]] && echo "构建路径与安装路径需为不同路径" && exit 1 +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 xf "$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"<"$installpath/bwa-0.7.17/bwa_modulefiles"<"$installpath/samtools-1.15.1/samtools_modulefiles"<(fields[1], true) ) ; ++ resolver.ReadNames.insert( pair(fields[1], true) ) ; + } + + // if here, return success +@@ -609,7 +609,7 @@ + resolver.IsAmbiguous = ( fields.at(6) == TRUE_KEYWORD ); + + // store RG entry and return success +- readGroups.insert( make_pair(name, resolver) ); ++ readGroups.insert( pair(name, resolver) ); + return true; + } + +@@ -1016,7 +1016,7 @@ + } + + // if read name not found, store new entry +- else resolver.ReadNames.insert( make_pair(al.Name, isCurrentMateUnique) ); ++ else resolver.ReadNames.insert( pair(al.Name, isCurrentMateUnique) ); + } + + // close files +@@ -1048,7 +1048,7 @@ + SamReadGroupConstIterator rgEnd = header.ReadGroups.ConstEnd(); + for ( ; rgIter != rgEnd; ++rgIter ) { + const SamReadGroup& rg = (*rgIter); +- m_readGroups.insert( make_pair(rg.ID, ReadGroupResolver()) ); ++ m_readGroups.insert( pair(rg.ID, ReadGroupResolver()) ); + } + } + +@@ -1205,7 +1205,7 @@ + } + + // initialize read group map with default (empty name) read group +- m_readGroups.insert( make_pair("", ReadGroupResolver()) ); ++ m_readGroups.insert( pair("", ReadGroupResolver()) ); + + // init readname filename + // uses (adjusted) stats filename if provided (req'd for makeStats, markPairs modes; optional for twoPass) +diff -r -u wham-1.8.0/src/Complete-Striped-Smith-Waterman-Library/src/main.c wham-1.8.0_change/src/Complete-Striped-Smith-Waterman-Library/src/main.c +--- wham-1.8.0/src/Complete-Striped-Smith-Waterman-Library/src/main.c 2022-07-03 09:46:16.219130330 +0800 ++++ wham-1.8.0_change/src/Complete-Striped-Smith-Waterman-Library/src/main.c 2022-07-03 09:45:08.114333990 +0800 +@@ -6,7 +6,7 @@ + + #include + #include +-#include ++#include "sse2neon.h" + #include + #include + #include +diff -r -u wham-1.8.0/src/Complete-Striped-Smith-Waterman-Library/src/Makefile wham-1.8.0_change/src/Complete-Striped-Smith-Waterman-Library/src/Makefile +--- wham-1.8.0/src/Complete-Striped-Smith-Waterman-Library/src/Makefile 2022-07-03 09:46:16.219130330 +0800 ++++ wham-1.8.0_change/src/Complete-Striped-Smith-Waterman-Library/src/Makefile 2022-07-03 09:45:27.438566260 +0800 +@@ -1,5 +1,5 @@ +-CC = gcc +-CXX = g++ ++CC = clang ++CXX = clang++ + CFLAGS := -Wall -O3 -pipe #-pg + CXXFLAGS := $(CFLAGS) + LOBJS = ssw.o +diff -r -u wham-1.8.0/src/Complete-Striped-Smith-Waterman-Library/src/ssw.c wham-1.8.0_change/src/Complete-Striped-Smith-Waterman-Library/src/ssw.c +--- wham-1.8.0/src/Complete-Striped-Smith-Waterman-Library/src/ssw.c 2022-07-03 09:46:16.219130330 +0800 ++++ wham-1.8.0_change/src/Complete-Striped-Smith-Waterman-Library/src/ssw.c 2022-07-03 09:45:08.890343318 +0800 +@@ -35,7 +35,7 @@ + * + */ + +-#include ++#include "sse2neon.h" + #include + #include + #include +diff -r -u wham-1.8.0/src/Complete-Striped-Smith-Waterman-Library/src/ssw.h wham-1.8.0_change/src/Complete-Striped-Smith-Waterman-Library/src/ssw.h +--- wham-1.8.0/src/Complete-Striped-Smith-Waterman-Library/src/ssw.h 2022-07-03 09:46:16.219130330 +0800 ++++ wham-1.8.0_change/src/Complete-Striped-Smith-Waterman-Library/src/ssw.h 2022-07-03 09:45:08.106333894 +0800 +@@ -14,7 +14,7 @@ + #include + #include + #include +-#include ++#include "sse2neon.h" + + #ifdef __cplusplus + extern "C" { +diff -r -u wham-1.8.0/src/fastahack/Makefile wham-1.8.0_change/src/fastahack/Makefile +--- wham-1.8.0/src/fastahack/Makefile 2022-07-03 09:46:16.243130606 +0800 ++++ wham-1.8.0_change/src/fastahack/Makefile 2022-07-03 09:45:21.658496786 +0800 +@@ -1,4 +1,4 @@ +-CXX=g++ ++CXX=clang++ + CFLAGS=-O3 -D_FILE_OFFSET_BITS=64 + + fastahack: Fasta.o FastaHack.cpp split.o disorder.o +diff -r -u wham-1.8.0/src/lib/ssw.c wham-1.8.0_change/src/lib/ssw.c +--- wham-1.8.0/src/lib/ssw.c 2015-12-24 08:30:54.000000000 +0800 ++++ wham-1.8.0_change/src/lib/ssw.c 2022-07-03 09:45:08.098333798 +0800 +@@ -35,7 +35,7 @@ + * + */ + +-#include ++#include "sse2neon.h" + #include + #include + #include diff --git a/LifeSciences/wham-1.8.0/wham-1.8.0.sh b/LifeSciences/wham-1.8.0/wham-1.8.0.sh new file mode 100644 index 0000000000000000000000000000000000000000..8ad83dc2836f2a84e3d4dc016d450ba689b64fc8 --- /dev/null +++ b/LifeSciences/wham-1.8.0/wham-1.8.0.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +if [[ $# -ne 2 ]]; then + echo "The format is as follows:" + echo "bash wham-1.8.0.sh buildpath installpath" + echo ":param buildpath: 应用构建绝对路径" + echo ":param installpath: 应用安装绝对路径" + exit 1 +fi + +[[ ! "$1" =~ ^/.* || "$1" = "/" ]] && echo "请输入正确的构建路径" && exit 1 +[[ ! "$2" =~ ^/.* || "$2" = "/" ]] && echo "请输入正确的安装路径" && exit 1 + +buildpath=$1 +installpath=$2 +[[ "$buildpath" =~ .*/$ ]] && buildpath=${buildpath%/*} +[[ "$installpath" =~ .*/$ ]] && installpath=${installpath%/*} +[[ "$buildpath" == "$installpath" ]] && echo "构建路径与安装路径需为不同路径" && exit 1 +yum install -y environment-modules csh time patch libatomic perl-Data-Dumper autoconf automake libtool numactl binutils systemd-devel valgrind flex wget + +set -e +wget -t 20 -c -P $buildpath https://github.com/zeeev/wham/archive/refs/tags/1.8.0.zip +wget -t 40 -c -P $buildpath https://github.com/mengyao/Complete-Striped-Smith-Waterman-Library/archive/8c9933a1685e0ab50c7d8b7926c9068bc0c9d7d2.zip +wget -t 40 -c -P $buildpath https://github.com/pezmaster31/bamtools/archive/2d7685d2aeedd11c46ad3bd67886d9ed65c30f3e.zip +wget -t 40 -c -P $buildpath https://github.com/ekg/fastahack/archive/0a8ca3de9239b061839418b306bb6a9072990158.zip +wget -t 40 -c -P $buildpath https://github.com/seqan/seqan/archive/7f3ca44fbe777f3b637ff57ccc1dcd975cca1661.zip + +unzip -d $buildpath "$buildpath"/1.8.0.zip && rm -rf "$buildpath"/1.8.0.zip +unzip -d $buildpath "$buildpath"/0a8ca3de9239b061839418b306bb6a9072990158.zip && rm -rf "$buildpath"/0a8ca3de9239b061839418b306bb6a9072990158.zip +unzip -d $buildpath "$buildpath"/2d7685d2aeedd11c46ad3bd67886d9ed65c30f3e.zip && rm -rf "$buildpath"/2d7685d2aeedd11c46ad3bd67886d9ed65c30f3e.zip +unzip -d $buildpath "$buildpath"/7f3ca44fbe777f3b637ff57ccc1dcd975cca1661.zip && rm -rf "$buildpath"/7f3ca44fbe777f3b637ff57ccc1dcd975cca1661.zip +unzip -d $buildpath "$buildpath"/8c9933a1685e0ab50c7d8b7926c9068bc0c9d7d2.zip && rm -rf "$buildpath"/8c9933a1685e0ab50c7d8b7926c9068bc0c9d7d2.zip + +cp -rf "$buildpath"/Complete-Striped-Smith-Waterman-Library-8c9933a1685e0ab50c7d8b7926c9068bc0c9d7d2/* "$buildpath"/wham-1.8.0/src/Complete-Striped-Smith-Waterman-Library/ && rm -rf "$buildpath"/Complete-Striped-Smith-Waterman-Library-8c9933a1685e0ab50c7d8b7926c9068bc0c9d7d2 +cp -rf "$buildpath"/bamtools-2d7685d2aeedd11c46ad3bd67886d9ed65c30f3e/* "$buildpath"/wham-1.8.0/src/bamtools/ && rm -rf "$buildpath"/bamtools-2d7685d2aeedd11c46ad3bd67886d9ed65c30f3e +cp -rf "$buildpath"/fastahack-0a8ca3de9239b061839418b306bb6a9072990158/* "$buildpath"/wham-1.8.0/src/fastahack/ && rm -rf "$buildpath"/fastahack-0a8ca3de9239b061839418b306bb6a9072990158 +cp -rf "$buildpath"/seqan-7f3ca44fbe777f3b637ff57ccc1dcd975cca1661/* "$buildpath"/wham-1.8.0/src/seqan/ && rm -rf "$buildpath"/seqan-7f3ca44fbe777f3b637ff57ccc1dcd975cca1661 +cp "$buildpath"/sse2neon-master/sse2neon.h "$buildpath"/wham-1.8.0/src/lib/ +cp "$buildpath"/sse2neon-master/sse2neon.h "$buildpath"/wham-1.8.0/src/Complete-Striped-Smith-Waterman-Library/src/ && rm -rf "$buildpath"/sse2neon-master +cp wham-1.8.0.patch "$buildpath" + +cd "$buildpath" +patch -f -p0 < wham-1.8.0.patch && rm -rf "$buildpath"/wham-1.8.0.patch +cd wham-1.8.0 +make + +mkdir -p "$installpath"/wham-1.8.0 && cp -r "$buildpath"/wham-1.8.0/* "$installpath"/wham-1.8.0 +cat>"$installpath/wham-1.8.0/wham_modulefiles"<