Skip to content

Commit

Permalink
Merge branch 'gw_dev' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kcleal authored Jul 25, 2024
2 parents afe4575 + 13b78c8 commit c0974af
Show file tree
Hide file tree
Showing 60 changed files with 27,882 additions and 1,096 deletions.
119 changes: 74 additions & 45 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:

env:
version: 0.10.1
version: 1.0.0

jobs:
mingw:
Expand Down Expand Up @@ -35,75 +35,104 @@ jobs:
name: mingw-${{ matrix.sys }}
path: ${{ github.workspace }}/*.exe

macos-intel:
runs-on: macos-12
macos-package:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-14 ] # macos-12,
include:
- os: macos-12
arch: intel
- os: macos-14
arch: m1

steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: |
brew install graphicsmagick dylibbundler glfw fontconfig
brew install imagemagick graphicsmagick dylibbundler glfw fontconfig
# npm broken for python3.12 so use this as work around
brew list | grep python@
# brew unlink [email protected]
shopt -s expand_aliases
alias python=$(brew --prefix)/bin/python3.11
alias python3=$(brew --prefix)/bin/python3.11
sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.12
sudo rm -f /usr/local/bin/python3
sudo rm -f /Library/Frameworks/Python.framework/Versions/Current/bin/python
which python && python --version
which python3 && python --version
python -m pip install packaging
python3 -m pip install packaging
npm install --global create-dmg
- name: package
- name: Build and install htslib with libdeflate
run: |
make prep
osacompile -o gw.app deps/gw_applescript_prog.txt
cp deps/gw_droplet.icns gw.app/Contents/Resources/droplet.icns
wget -O htslib.tar.bz2 https://github.com/samtools/htslib/releases/download/1.20/htslib-1.20.tar.bz2
tar -xvf htslib.tar.bz2 && mv htslib-* htslib && rm htslib.tar.bz2
git clone --depth 1 https://github.com/ebiggers/libdeflate.git
cd libdeflate && CFLAGS+=' -fPIC -O3 ' cmake -B build && CFLAGS+=' -fPIC -O3 ' cmake --build build
cp build/libdeflate.a /usr/local/lib && cp libdeflate.h /usr/local/include && cd ../
cp build/libdeflate.a ../htslib
cp libdeflate.h ../htslib
ls ../htslib
wget -O htslib.tar.bz2 https://github.com/samtools/htslib/releases/download/1.18/htslib-1.18.tar.bz2
tar -xvf htslib.tar.bz2 && mv htslib-* htslib && rm htslib.tar.bz2 && cd htslib
./configure --enable-libcurl --enable-s3 --enable-lzma --enable-bz2 --with-libdeflate
make && make install && cd ../
cd ../htslib
LDFLAGS="$LDFLAGS -L./" CPPFLAGS="$CPPFLAGS -I./" ./configure --enable-libcurl --enable-s3 --enable-lzma --enable-bz2 --with-libdeflate
make
sudo make install
- name: Make Prep
run: |
make prep
- name: package
run: |
osacompile -o gw.app deps/gw_applescript_prog.txt
cp deps/gw_droplet.icns gw.app/Contents/Resources/droplet.icns
echo "BUILDING GW"
make
brew_lib=$(brew --prefix)/lib
brew_include=$(brew --prefix)/include
brew_bin=$(brew --prefix)/bin
LDFLAGS="${LDFLAGS} -L${brew_lib}" CPPFLAGS="${CPPFLAGS} -I${brew_include}" make
mv gw ./gw.app/Contents/MacOS
rm -rf include lib src Makefile
dylibbundler -od -b -x ./gw.app/Contents/MacOS/gw -d ./gw.app/Contents/libs/ -p @executable_path/../libs/
PATH="$PATH:$brew_bin" dylibbundler -od -b -x ./gw.app/Contents/MacOS/gw -d ./gw.app/Contents/libs/ -p @executable_path/../libs/
echo "VALIDATION"
otool -L gw.app/Contents/MacOS/gw
echo ""
echo "CODE SIGNING"
ls -l
sudo chown -R $(whoami) ./gw.app
chmod -R a+rw ./gw.app
codesign --remove-signature ./gw.app
codesign --force --deep -s - gw.app -v
codesign --verify -vvvv gw.app
create-dmg 'gw.app' || true
sudo codesign --remove-signature ./gw.app
sudo codesign --force --deep -s - gw.app -v
sudo codesign --verify -vvvv gw.app
PATH="$PATH:$brew_bin" create-dmg 'gw.app' || true
ls
mv gw\ undefined.dmg gw_macos_intel.dmg
mv gw\ undefined.dmg gw_macos_${{ matrix.arch }}.dmg
ls
pwd
- name: upload
uses: actions/upload-artifact@v3
with:
name: gw_macos_intel
name: gw_macos_${{ matrix.arch }}
path: ./*.dmg

deb-package:
Expand All @@ -115,31 +144,31 @@ jobs:
sudo apt update
sudo apt-get install dh-make build-essential debhelper dh-virtualenv
sudo apt-get install debugedit devscripts fakeroot debootstrap pbuilder autotools-dev
sudo apt install zlib1g-dev libbz2-dev liblzma-dev libncurses5-dev libncursesw5-dev libssl-dev
sudo apt install zlib1g-dev libbz2-dev liblzma-dev libncurses5-dev libncursesw5-dev libssl-dev
sudo apt install libgl1-mesa-dev libfontconfig-dev libcurl4-openssl-dev libglfw3 libglfw3-dev
- name: build
run: |
BUILD_DIR=$(pwd)
mkdir -p usr/bin
mkdir -p usr/lib/x86_64-linux-gnu
mkdir -p usr/lib/gwhts
mkdir -p usr/include/gwhts
mkdir -p usr/share/icons
mkdir -p usr/share/icons/hicolor/512x512/apps/
mkdir -p usr/share/applications
sudo mkdir -p /usr/lib/gwhts
sudo mkdir -p /usr/include/gwhts/htslib
sudo cp /usr/lib/x86_64-linux-gnu/libglfw* usr/lib/x86_64-linux-gnu/.
git clone --depth 1 https://github.com/ebiggers/libdeflate.git
cd libdeflate && CFLAGS+=' -fPIC -O3 ' cmake -B build && CFLAGS+=' -fPIC -O3 ' cmake --build build
sudo cp build/libdeflate.a /usr/local/lib && sudo cp libdeflate.h /usr/local/include
echo "LIBDEFLATE BUILT" && pwd
cd ${BUILD_DIR}
wget -O htslib.tar.bz2 https://github.com/samtools/htslib/releases/download/1.20/htslib-1.20.tar.bz2
tar -xvf htslib.tar.bz2
mv htslib-1.20 htslib && rm htslib.tar.bz2 && cd htslib
Expand All @@ -148,39 +177,39 @@ jobs:
make -j3
echo "HTSLIB BUILT" && pwd
cp -rf htslib ../include
sudo cp libhts.* /usr/lib/gwhts
sudo cp libhts.* /usr/lib/gwhts
sudo cp htslib/*.h /usr/include/gwhts/htslib
cp libhts.* ${BUILD_DIR}/usr/lib/gwhts
cd ${BUILD_DIR}
sed -i '133 i \\t-mv gw usr/bin' Makefile
sed -i 's@-L/usr/local/lib@-L/usr/local/lib -L/usr/lib/gwhts@g' Makefile
make prep
cp include/gw_icon.png usr/share/icons/
cp include/gw_icon.png usr/share/icons/hicolor/512x512/apps/
cp deps/gw.desktop usr/share/applications/
- name: package
run: |
dh_make --single --createorig --packagename gw_${version} --email [email protected] --yes --native
printf "usr/bin/gw\nusr/share/icons/gw_icon.png\nusr/share/applications/gw.desktop\nusr/lib/gwhts/\nusr/lib/x86_64-linux-gnu/libglfw.so.3\nusr/lib/x86_64-linux-gnu/libglfw.so.3.3" > debian/install
export LDFLAGS="$LDFLAGS -L./lib/skia/out/Release-x64 -L/usr/local/lib -L/usr/lib -L./usr/lib/gwhts -Wl,-rpath,'$ORIGIN/../lib/gwhts'"
sed -i '/^Section/c\Section: Bioinformatics' debian/control
sed -i '/^Homepage/c\Homepage: https://github.com/kcleal/gw' debian/control
sed -i '/^Description/c\Description: Genome browser and variant annotation' debian/control
sed -i '/<insert long/d' debian/control
printf "Conflicts: libglfw3 (<< 3.3)\nReplaces: libglfw3\n" >> debian/control
# Override dh_shlibdeps to include /usr/lib/gwhts
printf '#!/usr/bin/make -f\n%%:\n\tdh $@\n\nclean:\n\tdh_clean\n\noverride_dh_shlibdeps:\n\tdh_shlibdeps -l/usr/lib/gwhts\n' > debian/rules
chmod +x debian/rules
dpkg-buildpackage -us -uc
- name: upload
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ libgw.so
/gw.wasm
/wasm_libs
/src/plot_commands.o
/src/ideogram.o
/.gw_session.ini
10 changes: 4 additions & 6 deletions .gw.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ylim=50
coverage=true
log2_cov=false
expand_tracks=true
scale_bar=true
link=none
scale_bar=true
split_view_size=10000
Expand All @@ -40,13 +41,13 @@ font_size=14
sv_arcs=true
mods=false
mods_qual_threshold=50
session_file=
session_file=/Users/sbi8kc2/CLionProjects/gw/.gw_session.ini

[view_thresholds]
soft_clip=20000
small_indel=100000
snp=500000
mod=250000
mod= 1000000
edge_highlights=1000000
variant_distance=100000
low_memory=1500000
Expand All @@ -61,7 +62,6 @@ scroll_up=PAGE_UP

[interaction]
cycle_link_mode=L
print_screen=PRINT_SCREEN
find_alignments=F
repeat_command=R
vcf_as_tracks=false
Expand All @@ -71,11 +71,9 @@ bed_as_tracks=true
number=3x3
parse_label=filter
labels=PASS,FAIL
delete_labels=DELETE
enter_interactive_mode=ENTER

[shift_keymap]
ampersand=7
ampersand= 7
bar=\
colon=;
curly_open=[
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ GW
.. |Dl badge| image:: https://img.shields.io/conda/dn/bioconda/gw.svg
:target: http://bioconda.github.io/recipes/gw/README.html

.. image:: include/banner.png
.. image:: include/resources/images/banner.png
:align: center


Expand Down Expand Up @@ -102,7 +102,7 @@ To view a genomic region e.g. chr1:1-20000, supply an indexed reference genome a

gw hg38 -b your.bam -r chr1:1-20000

.. image:: include/chr1.png
.. image:: include/resources/images/chr1.png
:align: center


Expand All @@ -112,7 +112,7 @@ A variant file in .vcf/.bcf format can be opened in a GW window by either draggi

gw hg38.fa -b your.bam -v variants.vcf

.. image:: include/tiles.png
.. image:: include/resources/images/tiles.png
:align: center


Expand Down
2 changes: 1 addition & 1 deletion deps/gw.desktop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Desktop Entry]
Encoding=UTF-8
Version=0.10.1
Version=1.0.0
Type=Application
Terminal=true
Exec=bash -c "/usr/bin/gw"
Expand Down
2 changes: 1 addition & 1 deletion docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source 'https://rubygems.org'
gem "jekyll", "~> 4.3.2" # installed by `gem jekyll`
# gem "webrick" # required when using Ruby >= 3 and Jekyll <= 4.2.2

gem "just-the-docs", "0.5.4" # pinned to the current release
gem "just-the-docs", "0.8.2" # pinned to the current release
# gem "just-the-docs" # always download the latest release

# gem "github-pages", group: :jekyll_plugins
2 changes: 1 addition & 1 deletion docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rexml (3.2.7)
rouge (3.30.0)
safe_yaml (1.0.5)
sass-embedded (1.58.3)
Expand Down
17 changes: 14 additions & 3 deletions docs/docs/guide/Alignments.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Alignment data
layout: home
parent: User guide
nav_order: 1
nav_order: 3
---

# Alignment data
Expand All @@ -11,18 +11,29 @@ The easiest way to load an alignment file (bam or cram format) is to start
GW and drag-and-drop a file into the window. This will open the file and navigate
to the first chromosome in the bam file header, showing the first 20 kb.

Using the CLI the same can be achieved using:
You can also use the `load` command from inside GW. Typing `load` in the command box followed
by the path to your bam file (not you can use tab-completion when using this command):

```
load ~/Desktop/your.bam
```

Navigate to a new region by typing e.g. `chr2` into the command box, or add a new region using `add chr2`

Using the CLI, bam files are loaded using:

```shell
gw hg38 -b your.bam -r chr1:1-20000
```


![Alt text](/assets/images/ui2.png "GW")

The hg38 argument is a genome-tag listed in the config file and will load a remote reference genome.

For much faster performance, either replace the argument with the path to a local file,
or change the config file to point to a local file rather than a remote reference genome.
or change the config file to point to a local file rather than a remote reference genome (see Genomes section
for more detail).
This command will open a GW window that can be used interactively with the mouse and keyboard.
Note multiple -b and -r options can be used.

Expand Down
Loading

0 comments on commit c0974af

Please sign in to comment.