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

geom_link() is not working properly #195

Closed
tahsinkhann opened this issue Jul 6, 2024 · 4 comments
Closed

geom_link() is not working properly #195

tahsinkhann opened this issue Jul 6, 2024 · 4 comments

Comments

@tahsinkhann
Copy link

tahsinkhann commented Jul 6, 2024

Hi, I am trying to create synteny between phages.

###upload files
s0 <- read_seqs("combined_contigs.fasta")
g0 <- read_feats("combined.gff")
colnames(g0)[18] <- "func"

gggenomes(genes=g0, seqs=s0) +
geom_seq() + geom_gene() + geom_bin_label() +
geom_gene(aes(fill=func)) +
scale_fill_brewer("Function", palette="Set3")

plot

I used all vs all nuct blast, and uploaded it in r
l0 <- read.csv("homologs.txt", sep="\t", col.names = def_names("blast"))

drawing links

gggenomes(seqs=s0,genes=g0,links=l0) +
geom_seq() + geom_gene() + geom_seq_label() +
geom_link()

Now receiving the following error

Error in geom_link():
! Problem while computing aesthetics.
ℹ Error occurred in the 5th layer.
Caused by error in .data$x:
! Column x not found in .data.
Run rlang::last_trace() to see where the error occurred.
Warning message:
In layout_links(x, seqs, ...) :
No links found between adjacent genomes in provided order of genomes, consider reordering genomes

also can't use add_links() or add_sublinks() and receive the folloing error:
Error in UseMethod("add_sublinks") :
no applicable method for 'add_sublinks' applied to an object of class "data.frame"

I have 10 other phages to compare the synteny, the solution will save my life (I mean it). Thanks

data.zip

@Rikkiff
Copy link

Rikkiff commented Jul 10, 2024

Hi. It seems to me that the seq id (e.g. VCI28MH2-S_0078) in your alignment is in a different format from the seq id in your fasta file (e.g. VCI28MH2-S) and gff file (e.g. VCI28MH2-S). I guess the seq id needs to match in order to infer any links.

@tahsinkhann
Copy link
Author

tahsinkhann commented Jul 10, 2024 via email

@Rikkiff
Copy link

Rikkiff commented Jul 12, 2024

Great that you made it work. But can you confirm whether or not the issue was the seq ids of your alignment?

@tahsinkhann
Copy link
Author

Yes, it was related to the seq_id issue (apologies for delayed response).

@iimog iimog closed this as completed Jul 28, 2024
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

3 participants