jts / nanopolish

Signal-level algorithms for MinION data
MIT License
568 stars 159 forks source link

Error faidx could not get contig length for contig {1} #1082

Open lidi4 opened 1 year ago

lidi4 commented 1 year ago

Hello,

I've looked through each of the previous issues with this same error and haven't been able to find a solution that will work for me. I'm trying to polish my assembly (produce by Flye/metaFlye from ONT metagenomic dataset).

This is my current full command:

python3 ./scripts/nanopolish_makerange.py assembly.fasta | parallel --results nanopolish.results -P 8 \ 
nanopolish variants --consensus -o polished.{1}.vcf -w {1} -r SRR12390956.fasta.index -b ~/remapping/aln-se.sorted.bam -g renamedassembly.fasta --min-candidate-frequency 0.1

I have tried different naming conventions within the assembly/contig file including :

>contig_1 (original format)
ATCG....

1
ATCG...

>contig_1:ATCG...

with no luck, all the same error. The first portion of the command, before "nanopolish variants --consensus" is called, works fine it seems. I have 26 (or 28?) contigs in the assembly file. I was not able to use "nanopolish index" to index the fast5 file because I unfortunately do not have access to the fast5 file. I don't know how much that matters?

I am working on Ubuntu 20.04.6 LTS with WSL2

Please let me know what else information would be helpful, as I am not the most experienced! And thank you for any advice.

jts commented 1 year ago

I was not able to use "nanopolish index" to index the fast5 file because I unfortunately do not have access to the fast5 file. I don't know how much that matters?

Without the fast5s you'll be unable to run nanopolish since it requires access to the signal data. I recommend medaka instead.

lidi4 commented 1 year ago

Ok, so even though I have the reads in fasta (ignore the ".index" portion that was a mistake) for the portion of nanopolish I put above, I am still missing some sort of information that nanopolish would have given? I didn't realize there could be differences in information in fasta files

jts commented 1 year ago

What is the exact error message that you got?

lidi4 commented 1 year ago

my exact error message is just error: faidx could not get contig length for contig {1}

jts commented 1 year ago

The {1} token is supposed to be replaced with the contig name by parallel. Perhaps there is a problem with how you're calling parallel?