jvarkit icon indicating copy to clipboard operation
jvarkit copied to clipboard

[SEVERE][CoverageServer]Cannot figure out type of file file:///home/silviav/jvarkit/fasta from extension

Open Caro-Ca opened this issue 4 years ago • 12 comments

#51 # Subject of the issue Hi, I followed every single step you mentioned and now I'm running the test example given and I got this message:

silviav@wildtype1:~/jvarkit:java -jar dist/coverageserver.jar --pedigree fam.ped --bed roi.bed -o comments.bed -R fasta src/test/resources/S*.bam
[SEVERE][CoverageServer]Cannot figure out type of file file:///home/silviav/jvarkit/fasta from extension. Current implementation understands the following types: [FASTA: [.fa.gz, .fna.gz, .txt, .fasta.gz, .fa, .fasta, .fna, .txt.gz], DICTIONARY: [.dict], CRAM: [.cram], SAM: [.bam, .sam], VCF: [.bcf, .vcf.gz, .vcf], INTERVAL_LIST: [.interval_list]]
htsjdk.samtools.SAMException: Cannot figure out type of file file:///home/silviav/jvarkit/fasta from extension. Current implementation understands the following types: [FASTA: [.fa.gz, .fna.gz, .txt, .fasta.gz, .fa, .fasta, .fna, .txt.gz], DICTIONARY: [.dict], CRAM: [.cram], SAM: [.bam, .sam], VCF: [.bcf, .vcf.gz, .vcf], INTERVAL_LIST: [.interval_list]]
	at htsjdk.variant.utils.SAMSequenceDictionaryExtractor$TYPE.forFile(SAMSequenceDictionaryExtractor.java:150)
	at htsjdk.variant.utils.SAMSequenceDictionaryExtractor.extractDictionary(SAMSequenceDictionaryExtractor.java:168)
	at com.github.lindenb.jvarkit.util.bio.SequenceDictionaryUtils.extractRequired(SequenceDictionaryUtils.java:137)
	at com.github.lindenb.jvarkit.tools.server.CoverageServer.doWork(CoverageServer.java:1326)
	at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMain(Launcher.java:777)
	at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMainWithExit(Launcher.java:940)
	at com.github.lindenb.jvarkit.tools.server.CoverageServer.main(CoverageServer.java:1396)
[INFO][Launcher]coverageserver Exited with failure (-1)

Your environment

  • version of jvarkit jvarkit --version jvarkit: command not found
  • version of java java 13.0.2 2020-01-14 Java(TM) SE Runtime Environment (build 13.0.2+8) Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
  • the value of ${JAVA_HOME} silviav@wildtype1:~/jvarkit:echo $PATH /home/silviav/jdk-13.0.2/bin/:13.0.2/bin:/bin:/tbb/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • which OS Linux

Thank you in advance for your help.

Caro-Ca avatar Feb 14 '20 16:02 Caro-Ca

Hi , the message is quite clear to me: the extension is not recognized because there is no extension for fasta.

this is a strange way to name a fasta reference file. It should be something like 'ref.fa' or 'ref.fasta' , not just 'fasta'.

lindenb avatar Feb 14 '20 16:02 lindenb

how I see, it's just 'fasta' in my example, I'm going to update this.

lindenb avatar Feb 14 '20 16:02 lindenb

Thank you for your help. However, I still have got an error message:

silviav@wildtype1:~/jvarkit:java -jar dist/coverageserver.jar \
> --pedigree fam.ped \
> --bed roi.bed \
> -o comments.bed \
> -R ref.fa src/test/resources/S*.bam
[SEVERE][CoverageServer]Error opening file: ref.fa
htsjdk.samtools.SAMException: Error opening file: ref.fa
	at htsjdk.samtools.util.IOUtil.openFileForReading(IOUtil.java:687)
	at htsjdk.samtools.reference.FastaSequenceFile.<init>(FastaSequenceFile.java:64)
	at htsjdk.samtools.reference.ReferenceSequenceFileFactory.getReferenceSequenceFile(ReferenceSequenceFileFactory.java:144)
	at htsjdk.samtools.reference.ReferenceSequenceFileFactory.getReferenceSequenceFile(ReferenceSequenceFileFactory.java:122)
	at htsjdk.samtools.reference.ReferenceSequenceFileFactory.getReferenceSequenceFile(ReferenceSequenceFileFactory.java:111)
	at htsjdk.variant.utils.SAMSequenceDictionaryExtractor$TYPE$1.extractDictionary(SAMSequenceDictionaryExtractor.java:55)
	at htsjdk.variant.utils.SAMSequenceDictionaryExtractor.extractDictionary(SAMSequenceDictionaryExtractor.java:168)
	at com.github.lindenb.jvarkit.util.bio.SequenceDictionaryUtils.extractRequired(SequenceDictionaryUtils.java:137)
	at com.github.lindenb.jvarkit.tools.server.CoverageServer.doWork(CoverageServer.java:1326)
	at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMain(Launcher.java:777)
	at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMainWithExit(Launcher.java:940)
	at com.github.lindenb.jvarkit.tools.server.CoverageServer.main(CoverageServer.java:1396)
Caused by: java.nio.file.NoSuchFileException: ref.fa
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:374)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:425)
	at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
	at java.base/java.nio.file.Files.newInputStream(Files.java:159)
	at htsjdk.samtools.util.IOUtil.openFileForReading(IOUtil.java:683)
	... 11 more
[INFO][Launcher]coverageserver Exited with failure (-1)

Caro-Ca avatar Feb 14 '20 17:02 Caro-Ca

the line you're trying to execute is an example. It uses a genome reference file named 'ref.a'. Of course, it won't work if you don't have this file, it you don't have any bam , etc...

lindenb avatar Feb 14 '20 17:02 lindenb

in jvarkit you can try::

java -jar dist/coverageserver.jar -R src/test/resources/rotavirus_rf.fa src/test/resources/S*.bam

lindenb avatar Feb 14 '20 17:02 lindenb

my PATH looks like this:

[SCREEN]:~:echo $PATH
/home/silviav/jdk-13.0.2/bin:/bin:/tbb/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

and The stdout is:

[SCREEN]:~/jvarkit:java -jar dist/coverageserver.jar -R src/test/resources/rotavirus_rf.fa src/test/resources/S*.bam
2020-02-19 10:00:52.787:INFO::main: Logging initialized @1007ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.eclipse.jetty.util.BufferUtil (file:/home/silviav/jvarkit/dist/coverageserver.jar) to field java.nio.MappedByteBuffer.fd
WARNING: Please consider reporting this to the maintainers of org.eclipse.jetty.util.BufferUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO][CoverageServer]Starting server coverageserver on port 8080
2020-02-19 10:00:52.839:INFO:oejs.Server:main: jetty-9.3.z-SNAPSHOT
2020-02-19 10:00:52.858:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@44f75083{/,file:///home/silviav/jvarkit/,AVAILABLE}
2020-02-19 10:00:52.879:INFO:oejs.ServerConnector:main: Started ServerConnector@3d3fcdb0{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
2020-02-19 10:00:52.879:INFO:oejs.Server:main: Started @1100ms
[INFO][CoverageServer]Server started. Press Ctrl-C to stop. http://localhost:8080/coverage

Could you tell me what is missing Thank you in advance for your help

Caro-Ca avatar Feb 19 '20 12:02 Caro-Ca

I don't see any error here. what's the problem. Did you just open a browser at http://localhost:8080/coverage ?

PS: I updated the source code a few hours ago.

lindenb avatar Feb 19 '20 13:02 lindenb

http://localhost:8080/coverage says that this site can’t be reached. On the other hand, I was worried about the time, is it normal to take that long? Thanks

Caro-Ca avatar Feb 19 '20 13:02 Caro-Ca

check you proxy settings...

lindenb avatar Feb 19 '20 13:02 lindenb

is there another way to get the output? I cannot access to the localhost as I am using a different server.

Caro-Ca avatar Feb 19 '20 13:02 Caro-Ca

I cannot access to the localhost as I am using a different server

no, or ask your sys-admin to redirect the localhost elsewhere

lindenb avatar Feb 19 '20 14:02 lindenb

I will try to redirect the localhost then. Thank you for your help. You were really helpful.

Caro-Ca avatar Feb 20 '20 08:02 Caro-Ca