cropgeeks / tablet

Tablet is a lightweight, high-performance graphical viewer for next generation sequence assemblies and alignments.
https://ics.hutton.ac.uk/tablet
BSD 2-Clause "Simplified" License
38 stars 3 forks source link

avoid providing absolute path in Tablet XML file #15

Closed songweizhi closed 3 years ago

songweizhi commented 3 years ago

Hi, Is it possible to use the path of the Tablet XML file as path to the assembly and reference files by default in the XML file. Thanks, Weizhi

imilne commented 3 years ago

Sorry, I'm not sure what you mean by this. Can you explain in a bit more detail, please?

songweizhi commented 3 years ago

Thanks for your reply, Iain.

I need to generate hundreds of sam files for visualisation in my program. So opening them in Tablet with the XML file will make life easier for my users.

However, In the XML file, I need to provide full path to the sam and reference files (as show below). If I changed the location of the sam and reference files, the corresponding XML won't work.

<tablet>
        <assembly>/full/path/to/Example4.sam</assembly>
        <reference>/full/path/to/Example4.fasta</reference>
</tablet>

I just wondering is it possible to avoid providing absolute path in the XML file (like below). One possible solution is to prepare one XML file (e.g. Example4.tablet) for each pair of sam and reference files, and put them in the same folder. Tablet can by default looking for the specified files in the folder where the XML is in.

<tablet>
        <assembly>Example4.bam</assembly>
        <reference>Example4.fasta</reference>
</tablet>

please let me know if I haven't make it clear.

Thanks, Weizhi

imilne commented 3 years ago

I'm only guessing here (I'll take a proper look at the code later) that it probably does open files with relative paths, but it probably treats them as relative to where Tablet was launched from, rather than to the location of the XML file itself. I think Tablet's working directory defaults to where it was installed...try placing a file there and see if it opens it ok? I know that's not a solution, but it'll help me work out what's happening...

songweizhi commented 3 years ago

Hi Iain,

I just tested it on Mac system, it works if I put the sam and reference files in '/Applications/Tablet.app/'. all other locations (including home, the XML file folder) won't work. Cheers, Weizhi

songweizhi commented 3 years ago

Hi Iain, Once you have done the updates, could you please share with me a beta version of the next release? I am currently developing a pipeline to link Metagenome-assembled genomes to 16S sequences and need to check reads mapping quite often. such a feature would be really helpful. Thanks, Weizhi

imilne commented 3 years ago

Yes, I'll share any beta code once it's ready, but I can't promise when I'll find the time to work on this - hopefully v soon though.

imilne commented 3 years ago

Drop http://bioinf.hutton.ac.uk/tablet/beta/tablet.jar into Tablet's lib folder (on a mac it'll be somewhere inside of that /Applications/Tablet.app/ structure) and let me know how you get on?

songweizhi commented 3 years ago

It works perfect, Thank you so much Iain !!! Btw, this is the place where I put tablet.jar : /Applications/Tablet.app/Contents/java/app/lib/