iferres / pagoo

A comprehensive and intuitive encapsulated OO class system for analyzing bacterial pangenomes in R.
https://iferres.github.io/pagoo/
28 stars 4 forks source link

Cluster annotations do not match cluster names #55

Closed eam12 closed 2 years ago

eam12 commented 2 years ago

I just discovered this tool and am really enjoying it for processing my output data from Roary. Thank you for creating it!

I'm using roary_2_pagoo() to read my Roary output file. However, when I then run p$clusters the annotations do not match the cluster names. It seems that the "Annotations" column was somehow scrambled during the conversion to the R6 class object. I can't seem to figure out if there's a pattern to the shifts (e.g. all Annotation rows are shifted down one), but I haven't found anything.

I'm using Pagoo version 0.3.9 with R version 4.1.2.

test <- roary_2_pagoo("test.csv")

Reading csv file (roary). Processing csv file. Loading PgR6M class object. Checking class. Checking dimnames. Creating gid (gene ids). Checking provided cluster metadata. Creating panmatrix. Populating class. Done.

test$clusters

DataFrame with 30 rows and 2 columns cluster Annotation

1 ccdA IS200/IS605 family t.. 2 ccdB hypothetical protein 3 dbpA hypothetical protein 4 faeE putative protein YjiK 5 group_103 hypothetical protein ... ... ... 26 lpfC' Antitoxin CcdA 27 pemI hypothetical protein 28 pemK hypothetical protein 29 xerD Antitoxin PemI 30 yjiK hypothetical protein
iferres commented 2 years ago

Hi @eam12, thanks for reporting this! Could you upload roary's file here ("test.csv") so I can debug it?

eam12 commented 2 years ago

Thanks so much!

test.csv

iferres commented 2 years ago

I have just pushed changes to fix it. Re-install pagoo from source:

remotes::install_github("iferres/pagoo")

Please, let me know if anything. And thanks again for reporting!

eam12 commented 2 years ago

Looks like its working now. Thanks so much!

iferres commented 2 years ago

Great! I will push the latest version to CRAN as soon as possible.