seppinho / haplogrep-cmd

HaploGrep - mtDNA haplogroup classification. Supporting rCRS and RSRS.
https://haplogrep.i-med.ac.at/
MIT License
74 stars 23 forks source link

java.nio.file.DirectoryNotEmptyException #47

Closed WZo0o closed 1 year ago

WZo0o commented 2 years ago

Hello,when I run haplogrep in Linux, I will meet an exception.

''''' mtDNA Haplogroup Classifiction v2.4.0 https://github.com/seppinho/haplogrep-cmd (c) Sebastian Schönherr, Hansi Weissensteiner, Lukas Forer, Dominic Pacher sebastian.schoenherr@i-med.ac.at

[classify, --in, /lustre/wangzh/mtDNA/genebank/sample/AB055387.1.fasta, --format, fasta, --extend-report, --out, /lustre/wangzh/mtDNA/genebank/result/AB055387.txt] phylotree17_FU1.xml Parameters: Input format: fasta Phylotree version: 17_FU1 Reference: rCRS Extended report: true Skip alignment rules: false Used metric: kulczynski Chip array data: false Lineage: 0

Start Classification... [M::bwa_idx_load_from_disk] read 0 ALT contigs java.nio.file.DirectoryNotEmptyException: jbwa-1639799703095 at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:242) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at org.apache.commons.io.FileUtils.delete(FileUtils.java:1175) at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1194) at importer.FastaImporter.load(FastaImporter.java:165) at genepi.commands.HaplogrepCommand.call(HaplogrepCommand.java:167) at genepi.commands.HaplogrepCommand.call(HaplogrepCommand.java:20) at picocli.CommandLine.executeUserObject(CommandLine.java:1953) at picocli.CommandLine.access$1300(CommandLine.java:145) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352) at picocli.CommandLine$RunLast.handle(CommandLine.java:2346) at picocli.CommandLine$RunLast.handle(CommandLine.java:2311) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179) at picocli.CommandLine.execute(CommandLine.java:2078) at genepi.App.main(App.java:59) ........

Could you tell me how to fix this exception?

TCLamnidis commented 1 year ago

I installed haplogrep through conda and I have the same issue

$ haplogrep classify --in ~/contammix_pipeline/ESP060/ivar_consensus/ESP060.fa --out test.txt --format fasta --rsrs

mtDNA Haplogroup Classifiction v2.4.0
https://github.com/seppinho/haplogrep-cmd
(c) Sebastian Schönherr, Hansi Weissensteiner, Lukas Forer, Dominic Pacher
sebastian.schoenherr@i-med.ac.at

[classify, --in, /home/thiseas_christos_lamnidis/ESP060/ivar_consensus/ESP060.fa, --out, test.txt, --format, fasta, --rsrs]
phylotree17_FU1_rsrs.xml
Parameters:
Input format: fasta
Phylotree version: 17_FU1
Reference: RSRS
Extended report: false
Skip alignment rules: false
Used metric: kulczynski
Chip array data: false
Lineage: 0

Start Classification...
[M::bwa_idx_load_from_disk] read 0 ALT contigs
java.nio.file.DirectoryNotEmptyException: jbwa-1663762288140
    at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:246)
    at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105)
    at java.base/java.nio.file.Files.delete(Files.java:1152)
    at org.apache.commons.io.FileUtils.delete(FileUtils.java:1175)
    at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1194)
    at importer.FastaImporter.load(FastaImporter.java:165)
    at genepi.commands.HaplogrepCommand.call(HaplogrepCommand.java:165)
    at genepi.commands.HaplogrepCommand.call(HaplogrepCommand.java:20)
    at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
    at picocli.CommandLine.access$1300(CommandLine.java:145)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
    at picocli.CommandLine.execute(CommandLine.java:2078)
    at genepi.App.main(App.java:59)

OS:

NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

It seems that during runtime haplogrep creates a temporary directory jbwa-XXXXXXX that it cannot delete as it is not empty. I checked the directory after the program failed and it is empty and removable by rmdir.

I have successfully ran haplogrep (v2.1.25) in the past without running into such an issue.

WZo0o commented 1 year ago

Thanks for your reply