kcleal / gw

Genome browser and variant annotation
MIT License
275 stars 7 forks source link

Saving to pdf from the main program #59

Open villena-francis opened 1 week ago

villena-francis commented 1 week ago

Hi @kcleal !

It would be great if, after adjusting the window manually to make it look good (for example) what I want to share, the main program would allow to export the window content in pdf with vector graphics.

This would be very helpful to get high quality figures for my Master's thesis, publications...

Once again, thank you very much for your work!!!!!

kcleal commented 1 week ago

Hi @villena-francis,

I have added this feature in v1.1.1. You will have to build from source to use it. The conda release might take a bit more time.

villena-francis commented 1 week ago

Hi again @kcleal, I have tried to do it based on the code in the README:

conda create -y -n gw_env -c conda-forge glfw htslib
conda activate gw_env
git clone https://github.com/kcleal/gw.git
cd gw && make prep
CONDA_PREFIX=$(conda info --base) LDLIBS+="-lcrypto -lssl" make -j4

But when I run it, I get these errors:

# Very very long /third_party blah blah blah...
third_party/externals/swiftshader/include/vulkan/vulkan_core.h
third_party/externals/swiftshader/include/vulkan/vulkan_ggp.h
third_party/externals/swiftshader/include/vulkan/vk_icd.h
third_party/externals/swiftshader/include/GLES2/
third_party/externals/swiftshader/include/GLES2/gl2ext.h
third_party/externals/swiftshader/include/GLES2/gl2.h
third_party/externals/swiftshader/include/GLES2/gl2platform.h
third_party/externals/swiftshader/include/Android/
third_party/externals/swiftshader/include/Android/nativebase/
third_party/externals/swiftshader/include/Android/nativebase/nativebase.h
third_party/externals/swiftshader/include/Android/sync/
third_party/externals/swiftshader/include/Android/sync/sync.h
third_party/externals/swiftshader/include/Android/android/
third_party/externals/swiftshader/include/Android/android/api-level.h
third_party/externals/swiftshader/include/Android/android/sync.h
third_party/externals/swiftshader/include/Android/vndk/
third_party/externals/swiftshader/include/Android/vndk/window.h
third_party/externals/swiftshader/include/Android/hardware/
third_party/externals/swiftshader/include/Android/hardware/gralloc1.h
third_party/externals/swiftshader/include/Android/hardware/hardware.h
third_party/externals/swiftshader/include/Android/hardware/gralloc.h
third_party/externals/swiftshader/include/Android/system/
third_party/externals/swiftshader/include/Android/system/graphics.h
third_party/externals/swiftshader/include/Android/cutils/
third_party/externals/swiftshader/include/Android/cutils/native_handle.h
third_party/externals/swiftshader/include/GLES3/
third_party/externals/swiftshader/include/GLES3/gl3platform.h
third_party/externals/swiftshader/include/GLES3/gl3.h
g++ -Wall -std=c++17 -fno-common -fwrapv -fno-omit-frame-pointer -O3 -DNDEBUG -g -D LINUX -D __STDC_FORMAT_MACROS -I/home/villena/miniforge3/include -I./lib/skia -I./lib/libBigWig -I./include -I.  -I./src  -c -o src/drawing.o src/drawing.cpp
g++ -Wall -std=c++17 -fno-common -fwrapv -fno-omit-frame-pointer -O3 -DNDEBUG -g -D LINUX -D __STDC_FORMAT_MACROS -I/home/villena/miniforge3/include -I./lib/skia -I./lib/libBigWig -I./include -I.  -I./src  -c -o src/glfw_keys.o src/glfw_keys.cpp
g++ -Wall -std=c++17 -fno-common -fwrapv -fno-omit-frame-pointer -O3 -DNDEBUG -g -D LINUX -D __STDC_FORMAT_MACROS -I/home/villena/miniforge3/include -I./lib/skia -I./lib/libBigWig -I./include -I.  -I./src  -c -o src/hts_funcs.o src/hts_funcs.cpp
g++ -Wall -std=c++17 -fno-common -fwrapv -fno-omit-frame-pointer -O3 -DNDEBUG -g -D LINUX -D __STDC_FORMAT_MACROS -I/home/villena/miniforge3/include -I./lib/skia -I./lib/libBigWig -I./include -I.  -I./src  -c -o src/ideogram.o src/ideogram.cpp
src/glfw_keys.cpp:7:10: fatal error: GLFW/glfw3.h: No existe el archivo o el directorio
    7 | #include <GLFW/glfw3.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make: *** [<integrado>: src/glfw_keys.o] Error 1
make: *** Se espera a que terminen otras tareas....
src/hts_funcs.cpp:12:10: fatal error: htslib/hts.h: No existe el archivo o el directorio
   12 | #include "htslib/hts.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
make: *** [<integrado>: src/hts_funcs.o] Error 1
src/drawing.cpp:23:10: fatal error: htslib/sam.h: No existe el archivo o el directorio
   23 | #include "htslib/sam.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
make: *** [<integrado>: src/drawing.o] Error 1
kcleal commented 1 week ago

Hmm looks like htslib and glfw are not being found in your conda environment. Could you check in /home/villena/miniforge3/include? There should be GLFW and htslib sub folders in there. If they are not there you will need to install them manually conda install -c conda-forge -c bioconda glfw htslib.

Actually, the CONDA_PREFIX variable should probably be set to the gw_env environment, not the base environment as is currently the case.

villena-francis commented 1 week ago

I have managed to build gw, but when I run gw --version I get this error:

(gw_env) villena@vant:~$ gw --version
gw: error while loading shared libraries: libhts.so.3: cannot open shared object file: No such file or directory

In an effort to stop being such a terrible user, I think I will wait for the next release with an associated .deb package...

kcleal commented 1 week ago

No worries. This means that the htslib library cannot be found at runtime. A simple fix is to add the library path environment variable:

LD_LIBRARY_PATH=~/miniforge3/lib gw --version

villena-francis commented 1 week ago

IT WOOOOORKS!!!!! I have to add the library every time I want to use it at the moment, but great figures for my master thesis are coming.

Thank you very much!