Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Render graph using RAST Annotations #44--FOLLOW UP #61

Closed
jdakota1305 opened this issue May 4, 2021 · 11 comments
Closed

Unable to Render graph using RAST Annotations #44--FOLLOW UP #61

jdakota1305 opened this issue May 4, 2021 · 11 comments

Comments

@jdakota1305
Copy link

Hi All,

I am trying to use some RAST annotations that seem to be generating a file that will not open in Gephi. Here is an example of the file and also an example of the pangenomeGraph file I am getting (it is blank when opening in Gephi).

Thank you! Awesome work on PPanGGOLiN
FN_KCOM1281 - Copy.zip

pangenomeGraph-RAST.zip

@axbazin
Copy link
Member

axbazin commented May 5, 2021

Hi,

I managed to replicate the error, it comes from the '&' special character in the RAST annotations apparently. I've updated PPanGGOLiN's gexf writing functions to remove this character and managed to open the gexf generated by PPanGGOLiN afterwards.

The latest commit on the master branch should fix the issue. If you used conda to install ppanggolin, you can install the new version in your conda environment by cloning the repository and install as such:

git clone https://github.com/labgem/PPanGGOLiN.git .
pip install .

and then reuse the 'write' function to obtain the gexf again, as such:

ppanggolin write -p pangenome.h5 --gexf --output MYOUTPUTDIR

I saw in the gexf file which you provided that you use an older version of PPanGGOLiN (1.1.96). If you are in a constrained environment where you cannot update the tool easily, an alternative solution is to remove the '&' character from the annotation files which breaks the gexf format for some reason. It should work well after that.

Thank you for the bug report and your nice comment :)

Adelme

@jdakota1305
Copy link
Author

jdakota1305 commented May 6, 2021

Hi,

Thank you for quickly replying to this! I was able to render the graph after removing the '&' special character. I am now trying to generate the Spots of insertion figures using the --draw_hotspots command, but I am generating figures without any labels. Is this another issue related to the annotations, or am I using the command incorrectly?

I am running

ppanggolin spot -p ./pangenome.h5 --draw_hotspots --force -o ./hotspots-fuso-1/

The file appears to be too large to share here, so I can email if it would be helpful.

@jdakota1305
Copy link
Author

Additionally, if I am using PPanGGOLiN in a conda environment, can I update to add the fix you just pushed? Thank you!

@axbazin
Copy link
Member

axbazin commented May 6, 2021

For the hotspot command, i've done multiple changes lately (related to other issues), so updating PPanGGOLiN will likely help you with the figure labels. There's actually an additional option to the spot command to control which information to use as labels, which makes things simpler. Details on how to use this option were given in this message: #56 (comment) (I've not updated the wiki yet)

If you are in a conda environment, you can just use the two lines I wrote in my first message while the environment is activated, it should work nicely. For the 'conda update' to work it involves making a new release, and then updating the bioconda recipe, which involves additional work for people other than me so I avoid doing it too often.

@jdakota1305
Copy link
Author

jdakota1305 commented May 6, 2021

Hi Adelme,

Thank you for the guidance on this! I was able to generate figures with labels, but they seem to be only general ID's such as CDS_xxxx--is there any way to have the labels be the "Annotation" seen in the matrix like this:
image

@axbazin
Copy link
Member

axbazin commented May 7, 2021

Hi,

It is not currently possible, but I can add it as an additional filter quite easily, I'll do that later today.
I'd expect the figures to be a bit hard to read though, but we'll see.

I'll tell you when the feature is on the master branch.

Adelme

@axbazin
Copy link
Member

axbazin commented May 7, 2021

The latest commit introduces the new filter 'product' to display what can be found in the 'product' field of annotation files, which is what you were looking for I believe.

You need to install it from git, like last time, and you can use it as such:

ppanggolin spot -p ./pangenome.h5 --draw_hotspots --force -o ./hotspots-fuso-1/ --label_priority product,name,ID

for example, which will display the product if there is one, if not the gene name if there is one, and if not the gene ID.

I've updated the margins as well so that the display is not too bad, but there will probably be some overlapping labels.
Adelme

@jdakota1305
Copy link
Author

Hi Adelme,

This is great! This is exactly what my PI was hoping for, so I am very thankful that you pushed that change through so quickly.

Is there by chance a way you could add the ability to scale the label font size down as an optional parameter/argument? This screenshot is of a particularly crowded figure:
image

If that is not something that can be changed, feel free to close this issue! Thank you again!
Dakota

@axbazin
Copy link
Member

axbazin commented May 8, 2021

Indeed that's quite unreadable. It's probably possible to do that, I'll take a look at it within a few days.

@axbazin
Copy link
Member

axbazin commented May 10, 2021

The latest commit on the repository adds a new option to the spot command "--fig_margin" which can help you increase the space between the represented RGPs.
Default is 100.
You can install the new version with the same method as previously.

I'll try to think of a better way to customize the figures in the futur.

Adelme

@jdakota1305
Copy link
Author

Hi Adelme,

This is great! I appreciate your willingness to work on this and to push all of these commits through so quickly. The new '--fig_margin' option is working perfectly for our purposes.

Cheers,
Dakota

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants