dariober / ASCIIGenome

Text Only Genome Viewer!
http://asciigenome.readthedocs.io/en/latest/description.html
MIT License
204 stars 14 forks source link

Enable changing of background color #56

Closed mptrsen closed 7 years ago

mptrsen commented 7 years ago

Currently a white background is used for all text, which looks weird on terminals that have a different background color such as black (used by the super-hacker-y types). It would be great if the user could change the background color or set it to transparency.

dariober commented 7 years ago

Hi- Thanks for sending feedback. Would you mind explaining what makes the colouring scheme weird? It would be great if you could attach a screenshot of a weird view.

ASCIIGenome should use white background and the same colours regardless of the user's colouring scheme. In theory there should be no interference between ASCIIGenome's and user's colours. However since I almost always use black on white (i.e. MacOS default), it may well be that I missed something when other colour options are used.

(I could add the option of settings colours if that helps but first let's see if your issue is due to a bug)

mptrsen commented 7 years ago

With a black background, ASCIIGenome looks like this:

asciigenome-background

For me it seems that ASCIIGenome should fill empty "cells" with the background color as well. It would be great if users could change that, similar as in colorTrack.

dariober commented 7 years ago

Indeed, this is a bug. Empty cells should be painted white. Sorry about that and thanks for reporting it. I should be able to fix it quite soon and I'll post here as soon as the fix is done.

dariober commented 7 years ago

Hi- Would you mind trying the new version v1.2.1? It should have this bug fixed. The bioconda repository (if you use it) is not up to date just now. To download and use the new version, as per docs, you can do:

wget https://github.com/dariober/ASCIIGenome/releases/download/v1.2.1/ASCIIGenome-1.2.1.zip
unzip ASCIIGenome-1.2.1.zip
rm ASCIIGenome-1.2.1.zip

cd ASCIIGenome-1.2.1/
chmod a+x ASCIIGenome
cp ASCIIGenome.jar /usr/local/bin/ # Or else in your PATH e.g. ~/bin/
cp ASCIIGenome /usr/local/bin/     # Or else in your PATH e.g. ~/bin/
mptrsen commented 7 years ago

Thank you for your quick reaction! And sorry, but version 1.2.1 does not fix this issue on my end. It still looks the same.

Let me know if you need more information about my system to further investigate this.

dariober commented 7 years ago

Hi- Sorry about that. Could you post information on the operating system you are using (Mac, Linux, etc) and the terminal you use? Also, just checking, make sure you are running v1.2.1 instead of the previous installation (e.g. by ASCIIGenome -v or even better use the full explicit path as java -jar /path/to/ASCIIGenome.jar).

Finally, would you be able to send the minimal commands that generate the issue, like

ASCIIGenome aln.bam
goto chr1:1000-1100

(From your screenshot it appears your terminal is correctly interpreting the ansi escapes for colours, so I don't see why the fix doesn't work...)

At the moment I have only access to a Mac laptop and I can reproduce the issue with v1.2.0, but I get it fixed in 1.2.1.

Thank you!

mptrsen commented 7 years ago

I used your example:

$ java -jar ASCIIGenome.jar --version                                                   
ASCIIGenome 1.2.1
$ java -jar ASCIIGenome.jar -x "goto Scaffold1:1000-1100" -g genome.fa reads.bam TEs.bed

asciigenome

I am using Terminator 0.97-2ubuntu0.1 on Linux Mint 17.3 64 bit. I forgot to mention that I was starting ASCIIGenome from within tmux; outside of tmux the problem disappears with v1.2.1. tmux is set to "screen-256color".

Hope that helps. Looking forward to your response. Thank you!

dariober commented 7 years ago

Thanks for feedback - I'm not familiar with tmux but I will install it and try to reproduce the issue. For the time being, you could try to start tmux with -2 option. From http://unix.stackexchange.com/questions/1045/getting-256-colors-to-work-in-tmux:

The -2 flag tells tmux to force the usage of 256 colors

dariober commented 7 years ago

Hi- If you are still interested in this issue (and in ASCIIGenome in general), I uploaded version 1.3.0 which should fix some issues with tmux and most importantly allows custom configuration of the colours. See FAQ.

Version 1.3.0 also introduces the sys command to execute system commands (I find this quite useful to execute commands like pwd and ls).

Please let me know of any further issues.

mptrsen commented 7 years ago

Awesome! Thank you!

dariober commented 7 years ago

Ok, thanks! I'm going to close this issue but do get back if you have any troubles.