Minimap2 error in Flye de novo assembly
1
0
Entering edit mode
3 months ago
Nilo • 0

Hello everyone,

I have a nanopore sequencing file which I am using for de novo assembly.

This is the code I used:

flye --nano-raw Data_pooled_data.fastq --out-dir assembly_outputFlye28CPU --threads 28

It has produced a draft_assembly.fasta file which looks promising (fairly large contigs), but now the code aborts at the consensus step. I will post the Flye and Minimap logs here. Anyone a clue what could cause this abortion and how to fix it? I already have the latest version of minimap installed

The flye log ends with:

[2024-01-04 04:06:15] INFO: Contained seqs: 3246
[2024-01-04 04:06:35] DEBUG: Writing FASTA
[2024-01-04 04:06:44] DEBUG: Peak RAM usage: 211 Gb
-----------End assembly log------------
[2024-01-04 04:07:34] root: DEBUG: Disjointigs length: 1210699194, N50: 14748365
[2024-01-04 04:07:34] root: INFO: >>>STAGE: consensus
[2024-01-04 04:07:34] root: INFO: Running Minimap2
[2024-01-04 04:07:39] root: ERROR: Error running minimap2, terminating. See the alignment error log  for details: /home/share/Genome_Assembly_nanopore/assembly_outputFly28CPU/10-consensus/minimap.stderr
[2024-01-04 04:07:39] root: ERROR: Command '['/bin/bash', '-c', "set -eo pipefail; /usr/bin/minimap2 '/home/share/Genome_Assembly_nanopore/assembly_outputFly28CPU/00-assembly/draft_assembly.fasta' '/home/share/Genome_Assembly_nanopore/Data_pooled_data.fastq' -x map-ont -t 28 -a -p 0.5 -N 10 --sam-hit-only -L -K 5G -z 1000 -Q --secondary-seq -I 64G | /usr/bin/samtools view -T '/home/share/Genome_Assembly_nanopore/assembly_outputFly28CPU/00-assembly/draft_assembly.fasta' -u - | /usr/bin/samtools sort -T '/home/share/Genome_Assembly_nanopore/assembly_outputFly28CPU/10-consensus/sort_240104_040734' -O bam -@ 4 -l 1 -m 4G -o '/home/share/Genome_Assembly_nanopore/assembly_outputFly28CPU/10-consensus/minimap.bam'"]' returned non-zero exit status 1.

Looking at the minimap.stderr file I read the following:

[ERROR] unknown option in "/home/share/Genome_Assembly_nanopore/Data_pooled_data.fastq" [main_samview] fail to read the header from "-". samtools sort: failed to read header from "-"

Major thanks in advance!

Flye Minimap2 • 927 views
ADD COMMENT
1
Entering edit mode

What do you see if you do samtools --version? You may have an old version of samtools.

ADD REPLY
0
Entering edit mode

Samtools 1.16.1, which is, according to when I try to update, the newest version, but I also see that 1.19 was published 3 weeks ago. I now updated to 1.19 manually but still the same error.

Versions of the others: Flye 2.9.1 Minimap2 2.24

ADD REPLY
1
Entering edit mode

Just checking, when you run which samtools, does that bring up a samtools different from the one Flye is using which is /usr/bin/samtools? Perhaps the samtools in /usr/bin is the outdated version

ADD REPLY
0
Entering edit mode

Thank you for your response!! Running: /home/share/Genome_Assembly_nanopore$ which samtools Gives: /usr/local/bin/samtools"

ADD REPLY
1
Entering edit mode

Aha see there's the problem!!! In your Flye program, it runs a different samtools:

...---secondary-seq -I 64G | /usr/bin/samtools view -T '....

Might be easiest to delete that /usr/bin/samtools and hope that Flye picks up the /usr/local/bin/samtools. The Flye Makefile also includes building a Flye-local samtools via make samtools https://github.com/fenderglass/Flye/blob/flye/Makefile

Edit: The main Flye binary (https://github.com/fenderglass/Flye/blob/flye/bin/flye) has some code that modifies Flye's PATH, you might get away by putting /usr/local/bin/ in there, too:

    sys.path.insert(0, '/usr/local/bin')

As it's at position 0 of PATH (the first position), it will use /usr/local/bin/samtools first. Hacky but should solve your issue

ADD REPLY
0
Entering edit mode

Great!!! Thanks a lot!! I removed the usr/bin/samtools, and then tried the flye makefile.

I downloaded Flye into my environment (git clone https://github.com/fenderglass/Flye.git)

and then tried to run this code:

cd /home/share/Flye/lib/samtools-1.9
sudo apt-get install build-essential libncurses5-dev libncursesw5-dev zlib1g-dev
./configure --without-curses --disable-bz2 --disable-lzma --enable-plugins
make

I get this error:

make[1]: Entering directory '/home/share/Flye/lib/samtools-1.9/htslib-1.9'
sed -n '/^static_libs=/s/[^=]*=/HTSLIB_static_LIBS = /p;/^static_ldflags=/s/[^=]*=/HTSLIB_static_LDFLAGS = /p' htslib.pc.tmp > htslib_static.mk
make[1]: Leaving directory '/home/share/Flye/lib/samtools-1.9/htslib-1.9'
make: *** No rule to make target 'test/merge/test_bam_translate.c', needed by 'test/merge/test_bam_translate.o'.  Stop.

Any help on fixing this issue?

ADD REPLY
1
Entering edit mode

Oh that might require a new post. However, since you removed the /usr/bin/samtools version, there's hopefully no need to go the route of the Makefile, perhaps Flye will just work now

ADD REPLY
0
Entering edit mode

Nope it doesn't work unfortunately...

I also tried the sys.path.insert(0, '/usr/local/bin'), but I did not have the permission to change it, so I will try that once more when I do have the permissions.

I also tried to change that line using nano, but then the error came that flye could not be found.

Thanks a lot for helping out!:)

ADD REPLY
0
Entering edit mode
3 months ago

The sys.path alters the Python import path, but the command line code is governed by the bash $PATH variable

The best solution would be to alter the $PATH of the invoking bash process that you run the tool with so that the directory that contains the correct samtools comes first. Perhaps like this:

export PATH=/usr/bin/:$PATH

Some experimentation may be needed.

ADD COMMENT

Login before adding your answer.

Traffic: 2002 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6