Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MuSE to latest version 2.1.2 #47957

Merged
merged 60 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
11090fb
update version, change build number, change to sha256
famosab May 21, 2024
6d2a823
Merge branch 'master' into update-muse
famosab May 23, 2024
9b4cc4e
add run_exports
famosab May 23, 2024
6189439
edit sha256
mencian May 28, 2024
9b2c8c5
clean up recipe
mencian Jun 4, 2024
ab2ea3c
re-trigger CI
mencian Jun 4, 2024
dd152fc
Merge branch 'master' into update-muse
mencian Jun 4, 2024
7c22a5a
edit typo
mencian Jun 4, 2024
24c8d84
add C compiler and openmp
mencian Jun 4, 2024
005da74
add bzip2
mencian Jun 4, 2024
43e5765
add xz
mencian Jun 4, 2024
faed9ee
add make flags
mencian Jun 4, 2024
90c8fe7
add libcurl
mencian Jun 4, 2024
f2c34e2
edit build.sh
mencian Jun 5, 2024
1fff731
Merge branch 'master' into update-muse
famosab Jun 10, 2024
b198426
Pass the C++ env vars
martin-g Jun 10, 2024
270d380
Patch install_muse.sh
martin-g Jun 10, 2024
d8275f2
add build reqs
famosab Jun 19, 2024
2642da4
Merge branch 'master' into update-muse
famosab Jun 19, 2024
6528cdb
move boost-cpp, htslib, and gperftools
mencian Jun 20, 2024
4058487
add missing deps
mencian Jun 20, 2024
76e412b
edit dependencies
mencian Jun 20, 2024
45b67d1
Merge branch 'master' into update-muse
famosab Jul 5, 2024
d760694
Merge branch 'master' into update-muse
mencian Aug 21, 2024
5ec8d6a
update to 2.1.1
mencian Sep 24, 2024
3341442
Merge branch 'master' into update-muse
mencian Sep 24, 2024
8809c31
fix patch
mencian Sep 24, 2024
83a67ba
Merge branch 'master' into update-muse
famosab Oct 14, 2024
814f2fa
coderabbit suggestions
famosab Oct 15, 2024
d64ce4d
update to 2.1.2
famosab Oct 15, 2024
346ec67
add makefile patch
mencian Oct 15, 2024
3429aba
Merge branch 'master' into update-muse
ramprasadn Nov 1, 2024
395ae1e
Merge branch 'master' into update-muse
famosab Nov 6, 2024
4288a47
change to inc
famosab Nov 6, 2024
616b803
add debug statements
famosab Nov 11, 2024
1cca06d
edit patch
mencian Nov 13, 2024
ff5873d
Update build.sh
mencian Nov 13, 2024
2fe616f
edit build.sh
mencian Nov 13, 2024
0f0d10d
edit build.sh
mencian Nov 13, 2024
42a117f
Update fix-install_muse.sh.patch
mencian Nov 13, 2024
e72f4b0
edit build.sh
mencian Nov 13, 2024
08043ca
edit build.sh
mencian Nov 13, 2024
20e095d
edit build.sh
mencian Nov 13, 2024
fd536d8
edit build.sh
mencian Nov 13, 2024
9623596
edit build.sh
mencian Nov 13, 2024
f1fca89
edit build.sh
mencian Nov 13, 2024
dc3128c
edit build.sh
mencian Nov 13, 2024
14b77cb
edit build.sh
mencian Nov 13, 2024
13835f6
edit build.sh
mencian Nov 13, 2024
60b0bcd
edit build.sh
mencian Nov 13, 2024
bb774d8
edit build.sh
mencian Nov 13, 2024
e73c5fd
clean up recipe
mencian Nov 13, 2024
f511250
edit makefile.patch
mencian Nov 13, 2024
4539c4f
add patch
mencian Nov 13, 2024
bdead6d
edit patches
mencian Nov 13, 2024
f4e359f
add -ldl
mencian Nov 13, 2024
1cb5cfb
Merge branch 'master' into update-muse
mencian Nov 13, 2024
894b3f5
edit build.sh
mencian Nov 14, 2024
e7a4f93
edit build.sh
mencian Nov 14, 2024
54bfcb9
skip osx x86_64 for now
mencian Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions recipes/muse/0001-Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff --git a/Makefile b/Makefile
index 5edd6e1..78d946c 100755
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
-CPP := g++
-CC := gcc
-LINK := g++
+CPP := ${CXX}
+CC := ${CC}
+LINK := ${CXX}
mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

CSOURCES= $(wildcard src/*.c)
@@ -11,12 +11,12 @@ COMMONOBJS= lib/libhts.a lib/libboost_iostreams.a lib/libtcmalloc_minimal.a
Warnings=-Wreturn-type -Warray-bounds -Wmaybe-uninitialized -Waddress
WarningsAsErrors=$(Warnings) -Werror=return-type -Werror=array-bounds -Werror=address
CFLAGS= $(WarningsAsErrors) -Wno-unused-function
-CPPFLAGS= $(WarningsAsErrors) -Wno-unused-function -std=c++11
+CPPFLAGS= $(WarningsAsErrors) -Wno-unused-function -std=c++14
Comment on lines +19 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

C++14 compatibility issues detected with dependencies.

  • recipes/muse/meta.yaml specifies libdeflate which may require C++11.
🔗 Analysis chain

Verify C++14 compatibility with dependencies.

The upgrade from C++11 to C++14 standard might affect compatibility. Please ensure:

  1. All dependencies support C++14
  2. This change is required/recommended for MuSE 2.1.2
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if any dependencies explicitly require C++11 or have C++14 compatibility issues
rg -l "std=(c\+\+|c)\s*11" --type cpp

Length of output: 1825


RELEASE_FLAGS= -O3 -g

# Includes
-INCLUDES = -Iinc/
+INCLUDES += -Iinc/ -Iinc/htslib -I$(PREFIX)/include
#
# Common flags
COMMONFLAGS += $(INCLUDES)
@@ -24,7 +24,7 @@ COMMONFLAGS += $(INCLUDES)
CXXFLAGS += $(COMMONFLAGS)
CFLAGS += $(COMMONFLAGS)
CPPFLAGS += $(COMMONFLAGS)
-COMMONLIBS= -Llib/ -lz -lm -lpthread -lbz2 -lcurl -lcrypto -llzma -fopenmp
+COMMONLIBS += -Llib/ -lz -lm -lpthread -lbz2 -lcurl -lcrypto -llzma -lhts -ldl -fopenmp -L${PREFIX}/lib

#LIBS += $(COMMONLIBS) -ltcmalloc
LIBS += $(COMMONLIBS)
@@ -38,10 +38,10 @@ all: $(TARGET)
.SUFFIXES: .c .cpp .o

%.c.o: %.c
- $(CC) $(CFLAGS) $(RELEASE_FLAGS) -c $< -o $@
+ $(CC) $(CFLAGS) $(RELEASE_FLAGS) $(INCLUDES) $(LIBS) -c $< -o $@

%.cpp.o: %.cpp
- $(CPP) $(CPPFLAGS) $(RELEASE_FLAGS) $(OPENMP) -c $< -o $@
+ $(CPP) $(CPPFLAGS) $(RELEASE_FLAGS) $(OPENMP) $(INCLUDES) $(LIBS) -c $< -o $@

$(TARGET): $(OBJS) Makefile
$(LINKLINE)
7 changes: 0 additions & 7 deletions recipes/muse/0001-add-LDFLAGS.patch

This file was deleted.

31 changes: 27 additions & 4 deletions recipes/muse/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
#!/usr/bin/env bash
#!/bin/bash
set -euo pipefail

make CPP="${CXX}" CPPFLAGS="${CXXFLAGS}"
export LIBPATH="-L${PREFIX}/lib"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
export CFLAGS="${CFLAGS} -O3"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove explicit -O3 flag from CFLAGS

Conda-build already sets appropriate optimization flags in CFLAGS. Adding -O3 explicitly might override better compiler-specific optimizations.

-export CFLAGS="${CFLAGS} -O3"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export CFLAGS="${CFLAGS} -O3"

Comment on lines +4 to +6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Optimize environment variable setup

  1. LIBPATH is redundant since the library path is already included in LDFLAGS
  2. Explicit -O3 flag should be removed as Conda-build already sets appropriate optimization flags

Apply this diff:

-export LIBPATH="-L${PREFIX}/lib"
-export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
-export CFLAGS="${CFLAGS} -O3"
+export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export LIBPATH="-L${PREFIX}/lib"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
export CFLAGS="${CFLAGS} -O3"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"

mkdir -p "${PREFIX}/bin"
cp MuSE "${PREFIX}/bin/"
rm -rf boost_1_70_0/

if [[ `uname` == "Darwin" ]]; then
ln -sf ${CC} ${PREFIX}/bin/clang
ln -sf ${CXX} ${PREFIX}/bin/clang++
else
ln -sf ${CC} ${PREFIX}/bin/gcc
ln -sf ${CXX} ${PREFIX}/bin/g++
fi

Comment on lines +10 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove compiler symlinks - Critical Security Risk

Creating compiler symlinks in ${PREFIX}/bin is dangerous and non-standard:

  1. Could interfere with system compilers
  2. Potential security risk by modifying system paths
  3. Not a standard practice in Conda recipes

Instead of creating symlinks, modify install_muse.sh to use ${CC} and ${CXX} directly. Remove this entire block and update install_muse.sh to use environment variables:

-if [[ `uname` == "Darwin" ]]; then
-	ln -sf ${CC} ${PREFIX}/bin/clang
-	ln -sf ${CXX} ${PREFIX}/bin/clang++
-else
-	ln -sf ${CC} ${PREFIX}/bin/gcc
-	ln -sf ${CXX} ${PREFIX}/bin/g++
-fi

Committable suggestion skipped: line range outside the PR's diff.

./install_muse.sh

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling for install script execution

The installation script execution needs better error handling and verification.

Apply this improvement:

-./install_muse.sh
+if [ ! -f "install_muse.sh" ]; then
+    echo "Error: install_muse.sh not found"
+    exit 1
+fi
+
+if [ ! -x "install_muse.sh" ]; then
+    chmod +x install_muse.sh
+fi
+
+./install_muse.sh || exit 1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
./install_muse.sh
if [ ! -f "install_muse.sh" ]; then
echo "Error: install_muse.sh not found"
exit 1
fi
if [ ! -x "install_muse.sh" ]; then
chmod +x install_muse.sh
fi
./install_muse.sh || exit 1

if [[ `uname` == "Darwin" ]]; then
rm -rf ${PREFIX}/bin/clang
rm -rf ${PREFIX}/bin/clang++
else
rm -rf ${PREFIX}/bin/gcc
rm -rf ${PREFIX}/bin/g++
fi

Comment on lines +20 to +26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove symlinks cleanup block

This cleanup block should be removed along with the symlinks creation block above.

Remove this entire block as it's related to the dangerous practice of creating compiler symlinks:

-if [[ `uname` == "Darwin" ]]; then
-	rm -rf ${PREFIX}/bin/clang
-	rm -rf ${PREFIX}/bin/clang++
-else
-	rm -rf ${PREFIX}/bin/gcc
-	rm -rf ${PREFIX}/bin/g++
-fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [[ `uname` == "Darwin" ]]; then
rm -rf ${PREFIX}/bin/clang
rm -rf ${PREFIX}/bin/clang++
else
rm -rf ${PREFIX}/bin/gcc
rm -rf ${PREFIX}/bin/g++
fi

install -d "${PREFIX}/bin"
install -v -m 0755 MuSE "${PREFIX}/bin"
84 changes: 84 additions & 0 deletions recipes/muse/fix-install_muse.sh.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
diff --git a/install_muse.sh b/install_muse.sh
index 7bc2153..f8ab6e3 100755
--- a/install_muse.sh
+++ b/install_muse.sh
@@ -4,13 +4,21 @@ make clean

mkdir -p lib

+if [[ `uname` == "Darwin" ]]; then
+ export TOOL=clang
+else
+ export TOOL=gcc
+fi
+
# compile boost library
-cd boost_1_70_0/
-./bootstrap.sh
+cd boost-1.86.0/
+./bootstrap.sh --with-toolset="${TOOL}" --prefix="${PREFIX}"
./b2 --clean
-./b2
+./b2 toolset="${TOOL}" --layout=system link=static \
+ threading=multi strip=on include="${PREFIX}/include" \
+ variant=release address-model=64 install

-cp stage/lib/libboost_iostreams.a ../lib/
+cp -f ${PREFIX}/lib/libboost_iostreams.a ../lib/
cd ..

# compile libtcmalloc
@@ -22,12 +30,12 @@ fi

git clone https://github.com/gperftools/gperftools.git
cd gperftools
-git checkout gperftools-2.9.1
+git checkout gperftools-2.16
./autogen.sh
-./configure --libdir="$PWD"
-make -j4
+./configure --libdir="${PWD}" --prefix="${PREFIX}"
+make -j${CPU_COUNT}
make install
-cp libtcmalloc_minimal.a ../lib/
+cp -f libtcmalloc_minimal.a ../lib/
cd ..

# combine htslib
@@ -42,27 +50,15 @@ cd htslib
git checkout 1.9
#git submodule update --init --recursive
autoreconf -i
-./configure
-make -j4
-cp libhts.a ../lib/
+./configure --enable-libcurl --enable-plugins \
+ LDFLAGS="-L${PREFIX}/lib -Wl,-R${PREFIX}/lib" \
+ CPPFLAGS="-I${PREFIX}/include"
+make -j${CPU_COUNT}
+cp -f libhts.a ../lib/

cd ..

-make
-
-#clean htslib and gperftools and boost libraries
-rm -r boost_1_70_0/stage
-
-chmod -R 755 gperftools
-rm -r gperftools
-
-chmod -R 755 htslib
-rm -r htslib
-
-
-
-
-
-
-
-
+CFLAGS="${CFLAGS} -O3 ${LDFLAGS}" \
+ CC="${CC}" CXX="${CXX}" CXXFLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include" \
+ LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" \
+ make -j"${CPU_COUNT}"
Comment on lines +81 to +84
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve compiler flags handling

The current approach of setting compiler flags could be improved:

  1. Avoid duplicating -O3 in multiple variables
  2. Consider using CPPFLAGS for include paths
  3. Ensure optimization flags don't conflict with conda-forge's defaults
-CFLAGS="${CFLAGS} -O3 ${LDFLAGS}" \
-    CC="${CC}" CXX="${CXX}" CXXFLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include" \
-    LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" \
-    make -j"${CPU_COUNT}"
+CPPFLAGS="-I${PREFIX}/include" \
+    CFLAGS="${CFLAGS}" \
+    CXXFLAGS="${CXXFLAGS}" \
+    LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" \
+    make -j"${CPU_COUNT}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
+CFLAGS="${CFLAGS} -O3 ${LDFLAGS}" \
+ CC="${CC}" CXX="${CXX}" CXXFLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include" \
+ LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" \
+ make -j"${CPU_COUNT}"
CPPFLAGS="-I${PREFIX}/include" \
CFLAGS="${CFLAGS}" \
CXXFLAGS="${CXXFLAGS}" \
LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" \
make -j"${CPU_COUNT}"

53 changes: 41 additions & 12 deletions recipes/muse/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,60 @@
{% set name = "MuSE" %}
{% set version = "2.1.2" %}
{% set sha256 = "48df7ec3f64244400243163b48eb658105854b7b0d6287af98242dd89f396f59" %}

package:
name: muse
version: 1.0.rc
name: {{ name|lower }}
version: {{ version }}

source:
md5: c63fdb48c041f6f9545879f1a7e4da58
url: https://github.com/danielfan/MuSE/archive/v1.0-rc.tar.gz
- url: https://github.com/wwylab/MuSE/archive/refs/tags/v{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
- 0001-add-LDFLAGS.patch
- 0001-Makefile.patch
- fix-install_muse.sh.patch
- url: https://github.com/boostorg/boost/releases/download/boost-1.86.0/boost-1.86.0-b2-nodocs.tar.gz
sha256: 2128a4c96862b5c0970c1e34d76b1d57e4a1016b80df85ad39667f30b1deba26
folder: boost-1.86.0
Comment on lines +15 to +17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider using conda-forge's boost package.

Including Boost source directly in the recipe is unusual. Conda-forge provides pre-built Boost packages that are better maintained and tested. Consider using boost-cpp from conda-forge instead.

-  - url: https://github.com/boostorg/boost/releases/download/boost-1.86.0/boost-1.86.0-b2-nodocs.tar.gz
-    sha256: 2128a4c96862b5c0970c1e34d76b1d57e4a1016b80df85ad39667f30b1deba26
-    folder: boost-1.86.0

Then add to host requirements:

  host:
    - boost-cpp


build:
number: 8
number: 0
run_exports:
- {{ pin_subpackage('muse', max_pin="x") }}

requirements:
build:
- make
- {{ compiler('cxx') }}
- {{ compiler('c') }}
- make
- autoconf
- automake
- libtool
host:
- llvm-openmp # [osx]
- libgomp # [linux]
- libcurl
- icu
- bzip2
- xz
- zlib
run:
- zlib
- llvm-openmp # [osx]
- libgomp # [linux]

test:
commands:
- MuSE 2>&1 | grep Version > /dev/null
- "MuSE 2>&1 | grep Version > /dev/null"
famosab marked this conversation as resolved.
Show resolved Hide resolved

about:
home: "http://bioinformatics.mdanderson.org/main/MuSE"
license: "https://github.com/danielfan/MuSE/blob/master/LICENSE"
summary: Somatic point mutation caller
home: "https://github.com/wwylab/MuSE"
license: "GPL-2.0-or-later"
license_family: GPL
license_file: "LICENSE"
summary: "An accurate and ultra-fast somatic point mutation calling tool for whole-genome sequencing (WGS) and whole-exome sequencing (WES) data from heterogeneous tumor samples."
doc_url: "https://bioinformatics.mdanderson.org/public-software/muse"
dev_url: "https://github.com/wwylab/MuSE"

extra:
identifiers:
- doi:10.1101/gr.278456.123
- doi:10.1186/s13059-016-1029-6
Loading