popitsch / nanopanel2

Nanopanel2: a somatic variant caller for Nanopore panel sequencing data
Other
9 stars 2 forks source link

Problems running release v1.01 #5

Closed charlesfoster closed 3 years ago

charlesfoster commented 3 years ago

Hi,

I downloaded release v1.01 to try out nanopanel2, but I've had a fair few problems getting it to work. Command:

singularity run nanopanel2_1.01.sif call --conf config.json --out test/

While nanopanel2 runs using minimap2 alone, the program fails when using either or both ngmlr and last.

ngmlr: The command to run ngmlr fails because nanopanel2 is trying to run using a singularity container within nanopanel2_1.01.sif, rather than just calling the ngmlr program that's already installed in the main nanopanel2_1.01.sif container. Failing command within the log file:

singularity run $SOFTWARE/SIF/ngmlr_0.2.7.sif -r nCoV-2019.reference.fasta -q test/2021-06-18/2021-06-18.sample.fq.gz -x ont -t 12 -o test/2021-06-18/2021-06-18.sample.ngms.sam --no-smallinv --no-lowqualitysplit -k 10 --match 3 --mismatch -3 --bin-size 2 --kmer-skip 1

If I shell into nanopanel2_1.01.sif and run the same command as above, but changin 'singularity run $SOFTWARE/SIF/ngmlr_0.2.7.sif" to ngmlr, the command finishes with no problems.

last: lastal fails because nanopanel2 does not correctly create a lastdb for the reference fasta file. It seems to be looking for a lastdb at '/home/cfos/Programs/nanopanel2/nCoV-2019.reference.last_db', as evidenced by the error:

ERROR:root:b"lastal: can't open file: /home/cfos/Programs/nanopanel2/nCoV-2019.reference.last_db.prj\n"
ERROR:root:ERROR Command 'lastal -Q1 /home/cfos/Programs/nanopanel2/nCoV-2019.reference.last_db test/2021-06-18/2021-06-18.sample.fq.gz > test/2021-06-18/2021-06-18.sample.last.sam.tmp' returned non-zero exit status 1. - removing outputfile test/2021-06-18/2021-06-18.sample.last.sam.tmp

The last step works if I shell into the container, create my own lastdb called 'last_db', then run the alignment:

lastdb last_db nCoV-2019.reference.fasta
lastal -Q1 last_db test/2021-06-18/2021-06-18.sample.fq.gz > test/2021-06-18/2021-06-18.sample.last.sam.tmp

If I delete the ngmlr and last sections from the config, nanopanel2 completes.

Cheers, Charles

popitsch commented 3 years ago

Thanks for the bug report, Charles!

Re. ngmlr: do you have "singularity run $SOFTWARE/SIF/ngmlr_0.2.7.sif" configured in the 'exe/ngmlr' section of your config file as in the config file template? np2 overrides standard call paths (e.g., 'ngmlr' within the Singularity container) with paths from this section to enable local tool installations/versions. So, hopefully it works if you remove this entry from the config file.

Re. last: np2 looks for a 'last_db' entry in the mappers/last section and if this is not found tries to find a last db at ${reference}.last_db (as it seems common practice to but this file next to the reference fasta file). The respective code is: last_db = config['mappers'][m]['last_db'] if 'last_db' in config['mappers'][m] else os.path.splitext(ref)[0]+'.last_db' (where m=='last').

I will improve documentation in both matters!

Having said that, we currently recommend to run np2 with minimap2 only anyway as this mapper showed the best results in our evaluation.

charlesfoster commented 3 years ago

I can't say definitively what I had for the ngmlr block of the config file any more because I deleted the block instead of commenting (oops). However, I'm 99% sure that it was simply in the form of:

        "mappers": {                                    # configured long-read mappers. Supported types are 'minimap2', 'ngmlr' and 'last'.
                "ngmlr" : {
                        "type": "ngmlr",
                        "additional_param": <options>
                        }
                }

Thanks for the clarification of the docs :+1: