fmalmeida / plot_nucmer

A simple script to run an alignment with nucmer and visualise its results.
https://plot-nucmer.readthedocs.io/en/latest/
GNU General Public License v3.0
7 stars 0 forks source link

empty svg file #1

Closed Sven-Winter closed 1 year ago

Sven-Winter commented 1 year ago

Hi, I tried to plot the nucmer results with your tool but at the end it get an empty svg file and the following error:

Fehler in .normargSeqlengths(value, seqnames(x)) : length of supplied 'seqlengths' must equal the number of sequences

Do I have to do something before I can use my assemblies as inputs?

Thanks in advance

Sven

fmalmeida commented 1 year ago

Hi @sven1990,

As far as I remember, one does not need any pre-process on input data to use it. On tests and documentation I used sequences direct from NCBI.

Could you show me the exact command line you used? I can try to replicate using a random NCBI genome.

fmalmeida commented 1 year ago

Hi @sven1990,

I just executed the quickstart again. And it worked nicely. By the error message, I assume that it is possible that no actual identities were found between your genomes. So, I have a few questions / inquires for you so we can troubleshoot it:

Isacrist commented 1 year ago

Hello I have the same problem! My genome has 19 contigs! Decreased parameter values! It didn't help me. What else can I try? Thanks

fmalmeida commented 1 year ago

Hi @Isacrist,

Just to figure if it is package-related or data-related. Did the quick start work?

About your data … What was the command line executed? Did it raise any error message?

Is the genome public so I can give it a try?

Isacrist commented 1 year ago

hello the quickstart finishes despite this error, generates files but does not generate the plot. my genome is not public yet, , but I can make it available to you. I used the following commands from the beginning: wget https://repo.anaconda.com/miniconda/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh bash Miniconda3-py310_23.1.0-1-Linux-x86_64.sh conda install -c conda-forge mamba mamba create -n plot_nucmer -c conda-forge -c bioconda -c falmeida plot_nucmer conda activate plot_nucmer plot_nucmer --subject arquivo.fasta --sprefix "nomedoaarquivo" --query arquivo.fasta --qprefix "nomedoaarquivo" Thanks

fmalmeida commented 1 year ago

Hi @Isacrist , If even the QuickStart did not work, it is not the dataset. Maybe there is something wrong with it …

So first, we need to make the quickstart work. I assume some svg packages are not properly installed or maybe incompatible.

Could you try running with docker as it is shown in the Readme and also try installing with conda directly instead of using mamba?

maybe it could be something with that, because at least the QuickStart should work as I tried yesterday with the docker image available.

Isacrist commented 1 year ago

Hi @Isacrist , If even the QuickStart did not work, it is not the dataset. Maybe there is something wrong with it …

So first, we need to make the quickstart work. I assume some svg packages are not properly installed or maybe incompatible.

Could you try running with docker as it is shown in the Readme and also try installing with conda directly instead of using mamba?

maybe it could be something with that, because at least the QuickStart should work as I tried yesterday with the docker image available.

Thank you for providing me with alternatives unfortunately I couldn't use docker, I'm very new to bioinformatics. I managed to install directly through Conda but the error still persisted I don't know if it helps you understand my error, but it appears right after loading the required packages appears nb of references:12, nb of queries:5 and nb of alignments:123 and there error in .normargSeqlengths(value, seqnames(x)) : length of supplied 'seqlengths' must equal the number of sequences calls: load_and_plot_nucmer_w_ref ... seqlenghts <- -> seqlenghts <- -> seqlenghts <- -> .normalSeqlenghts sorry for so much inconvenience and for my lack of experience in the area thank you for helping me

fmalmeida commented 1 year ago

With the conda installation it also failed with the quickstart?

I will give it a try tomorrow with a small multifasta to see if I can reproduce ... The error seems odd to me.

fmalmeida commented 1 year ago

If you have docker installed, you could try:

docker run --rm -v $(pwd):/data -w /data fmalmeida/plot_nucmer plot_nucmer <all the params>

for example the command from the quickstart would be:

docker run --rm -v $(pwd):/data -w /data fmalmeida/plot_nucmer plot_nucmer --subject ecoli_k12.fna --sprefix "E. coli K12" --query ecoli_sakai.fna --qprefix "E. color Sakai"

I tried with a multifasta and the command worked with docker. Tomorrow I will try to install from scratch with conda and see if the problem is the package installation.

Isacrist commented 1 year ago

If you have docker installed, you could try:

docker run --rm -v $(pwd):/data -w /data fmalmeida/plot_nucmer plot_nucmer <all the params>

for example the command from the quickstart would be:

docker run --rm -v $(pwd):/data -w /data fmalmeida/plot_nucmer plot_nucmer --subject ecoli_k12.fna --sprefix "E. coli K12" --query ecoli_sakai.fna --qprefix "E. color Sakai"

I tried with a multifasta and the command worked with docker. Tomorrow I will try to install from scratch with conda and see if the problem is the package installation.

Hello thank you so much for your patience and for help me! I got it with docker thank you very much

fmalmeida commented 1 year ago

Hi @Isacrist , Thank you for the feedback. Really glad to hear that it worked with Docker so it means that it is nothing wrong with the code but actually with the conda/mamba installation.

I will need some work on that to figure what’s happening with the installation. But for now, one can work with Docker.

@Sven-Winter , If still interested or relevant for you, maybe you could also try Docker to figure whether this as really the source of problems.

Once again, Thank you both for reporting the issue.

Isacrist commented 1 year ago

Hi @Isacrist , Thank you for the feedback. Really glad to hear that it worked with Docker so it means that it is nothing wrong with the code but actually with the conda/mamba installation.

I will need some work on that to figure what’s happening with the installation. But for now, one can work with Docker.

@Sven-Winter , If still interested or relevant for you, maybe you could also try Docker to figure whether this as really the source of problems.

Once again, Thank you both for reporting the issue.

hello I made an improvement in the assembly of my genome and I'm trying to run it through docker again and I can't... Have there been any changes? because I did everything like the other time... the error is "--subject requires an argument" thanks

fmalmeida commented 1 year ago

Hi @Isacrist , There were no changes. Could you share the command line? I think maybe the file was not properly made visible to the container.

fmalmeida commented 1 year ago

I recently tried installing the packages again with mamba and it worked just as with the docker container. I think it had some broken packages now fixed for installation. Thus I am now closing this ticket as it was related to dependencies installation instead of the code.

If it persists, feel welcomed to re-open.

Isacrist commented 1 year ago

Hello! I ran the script again and with Mamba and it worked! but I had the same problem with mamba and docker, the outputs come with a lock and I can't save to send my results to someone for example. Another question, how can I see the percentage of aligned regions? thank you very much in advance!

fmalmeida commented 1 year ago

Hi @Isacrist ,

just to make sure, when you run the QuickStart with the new installation, it works right? The problem comes when using your data, right?

Is there a way that I could have it a look / try? Would you be allowed to share with me the input files or the alignment files together with the executed command line so I can try it?

Isacrist commented 1 year ago

just to make sure, when you run the QuickStart with the new installation, it works right? The problem comes when using your data, right?

Is there a way that I could have it a look / try? Would you be allowed to share with me the input files or the alignment files together with the executed command line so I can try it?

Exactly It works fine! but I can't share the files... because they come restricted to reading It saves on my computer with a lock but does not allow me to send it by email

fmalmeida commented 1 year ago

What do you mean, you cannot open them? You are talking about the fasta files or the files with the alignments that are used to generate the plot?

Isacrist commented 1 year ago

What do you mean, you cannot open them? You are talking about the fasta files or the files with the alignments that are used to generate the plot?

I'm talking about the output files, alignments and the plot I can open but I can't send them because it comes restricted, icon with padlock sorry my english is terrible

fmalmeida commented 1 year ago

You executed it with Docker, right? I think that is the case … docker may be messing with permissions. What happens if you execute it with the mamba installation or with docker, but adding the parameter “-u”, like:

docker run --rm -u $(id -u):$(id -g) -v $(pwd):/data -w /data fmalmeida/plot_nucmer plot_nucmer etc… ?

Can you check if the files are available like that? Otherwise, if the input genomes are public, I could give it a try as well.

btw, your english is perfectly fine. I am a also not native speaker 😉

Isacrist commented 1 year ago

You executed it with Docker, right? I think that is the case … docker may be messing with permissions. What happens if you execute it with the mamba installation or with docker, but adding the parameter “-u”, like:

docker run --rm -u $(id -u):$(id -g) -v $(pwd):/data -w /data fmalmeida/plot_nucmer plot_nucmer etc… ?

Can you check if the files are available like that? Otherwise, if the input genomes are public, I could give it a try as well.

btw, your english is perfectly fine. I am a also not native speaker 😉

our English is native to Unb right?! I've always used docker but today I'm using mamba I don't know why docker didn't run I just tried again with the new command and nothing but it was no longer running and the problem could be me and my total inexperience in bioinformatics but in both docker and mamba the outputs are restricted to reading I am making the deposit in the NCBI this week of my data and I will be able to share or I can share it by email with you too The article is about to be released and even the plot_nucmer will be referenced but i needed better picture quality and as the image is restricted I can only print the screen

fmalmeida commented 1 year ago

I see. Please send me a message with it at “felipemarques89@gmail.com” (in pt-br ;) )

I can generate help generating a proper image for you.

I guess the problem is the filesystem then which does not allow you to download it. Thus it does not seem like a problem with the tool, I will close it again.