jordanlab / tagore

The script presents a simple way to visualize features on human chromosome ideograms
GNU General Public License v3.0
39 stars 9 forks source link

rsvg issue #1

Closed njbowen closed 4 years ago

njbowen commented 4 years ago

getting: Could not find rsvg in PATH.

I have libsvg installed, it seems to want to call rsvg-convert instead of just rsvg

any suggestions?

thanks,

ar0ch commented 4 years ago

Hey Nathan,

'rsvg-convert' is installed along with rsvg when you install the lib package. Depending on your operating system, may have to specify 'librsvg2' when using the package manager. What does "which rsvg" return?

ar0ch commented 4 years ago

Also libsvg and librsvg are different packages, could you double check which one you installed?

njbowen commented 4 years ago

which rsvg won't return anything. that's the thing. I can't get it installed. I'll try librsvg2 again. how do you recommend via brew? conda? thanks so much.

ar0ch commented 4 years ago

The Homebrew one looks a little janky. I know the conda package definitely works, it's how I use Tagore

https://anaconda.org/conda-forge/librsvg

njbowen commented 4 years ago

says librsvg is installed but still get rsvp error. "which rsvp" still no return. not sure how to specify librsvg2 with package manager.

njbowen commented 4 years ago

do you run Tagore on a Mac or on another unix platform?

njbowen commented 4 years ago

it appears that calling rsvg directly was replaced with rsvg-convert in current installations of librsvg? does that seem possible to you? thanks.

ar0ch commented 4 years ago

We tend to run everything on Unix systems (generally CentOS and Ubuntu).

Can you try using this version of the Tagore script? https://raw.githubusercontent.com/jordanlab/tagore/rsvg-convert/tagore.py

njbowen commented 4 years ago

Will do ASAP, prob by after 1:30p today. Thanks so much.

njbowen commented 4 years ago

The new .py does appear to work. It produces an out.svg file from the test.bed file.

njbowen commented 4 years ago

here's the command and output

it writes out.svg into the working folder I opened it with Inkscape and it looks fine.

$ python ./tagore.py -i example_ideogram/test.bed Multiple SVG files are only allowed for PDF and (E)PS output. Traceback (most recent call last): File "./tagore.py", line 249, in raise rsvg_e File "./tagore.py", line 246, in subprocess.check_outp

ut(f"{rsvg} {ARGS.prefix}.svg {ARGS.prefix}.png", shell=True) File "/Users/nbowen/miniconda3/lib/python3.7/subprocess.py", line 395, in check_output **kwargs).stdout File "/Users/nbowen/miniconda3/lib/python3.7/subprocess.py", line 487, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command 'rsvg-convert out.svg out.png' returned non-zero exit status 1.

ar0ch commented 4 years ago

Interesting. Let me dig in to the new rsvg commands

njbowen commented 4 years ago

and is there an option to draw 2 X's or am I missing it somehow? here's a whole genome paint where I'm painting one haplotype with red and one haplotype with blue depending on the overall ancestry at that position in a group of admixed individuals. I converted the .svg to .png with Inkscape.
out

ar0ch commented 4 years ago

Tagore doesn't support X's, but you can do circles, triangles and lines at specific places.

I've just published a new version of Tagore on PyPi, could you pip install --upgrade tagore and give that a try?

ar0ch commented 4 years ago

@njbowen Have you had a chance to try the new version?

njbowen commented 4 years ago

didn't realize there was a new one since the rsvg-convert version. I used it and showed you the svg image above that was produced. is there an additional new version? I'll look now at the dates on your builds.

ar0ch commented 4 years ago

The newest version on PyPI (and Github) is similar to the one I linked to above and also supports exporting as PDF (-ofmt pdf) if you have rsvg-convert available on your system. If the previous one worked fine then this one should too. I just want to double check 😄

njbowen commented 4 years ago

yes, it worked. 2 comments:

  1. in the more advanced example: tagore -input /example_ideogram/1KGP-MXL104_tagore.bed --prefix example_ideogram/1KGP-MXL104 --build hg37 --verbose

I had to change it to ./tagore --input or ./tagore -i

  1. why is the example 1KGP-MXL104.png paint the whole genome when the rfmix2tagore.py script only called chr1 and chr2 bed files?

thanks, Nathan

1KGP-MXL104

njbowen commented 4 years ago

oh, I got it. chr1 is one haplotype and chr2 is the other haplotype.
Thanks so much. Really appreciate it.

ar0ch commented 4 years ago

I'll get that typo fixed!

As for the rfmix example, rfmix paints the individual chromosome copies separately, so the chr1 file has chromosome copy 1 for all 22 chromosome and chr2 has copy 2 for all 22 chromosomes. The file names a little deceiving