-
Notifications
You must be signed in to change notification settings - Fork 21
Cannot convert CRAM back to BAM #73
Description
I am getting an error when I try to convert any CRAM file back to BAM format. I am using the exact same version of cramtools (3.0) and same genome reference fasta file to do BAM -> CRAM conversion and CRAM -> BAM conversion. I created a test file to confirm that the problem is reproducible.
To convert BAM to CRAM, I run:
java -jar ~/Tools/cramtools/cramtools-3.0.jar cram -I test.bam -R /data/projectdata/htt/genomes/hg38/hg38.fa -O test.cram
That works without issue, but then I run CRAM back to BAM and get:
java -jar ~/Tools/cramtools/cramtools-3.0.jar bam -I test.cram -R /data/projectdata/htt/genomes/hg38/hg38.fa -O test_uncram.bam Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.sf.cram.CramTools.invoke(CramTools.java:91) at net.sf.cram.CramTools.main(CramTools.java:121) Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: http://www.ebi.ac.uk/ena/cram/md5/2648ae1bacce4ec4b6cf337dcae37816 at net.sf.cram.ref.ReferenceSource.getRegion(ReferenceSource.java:198) at net.sf.cram.Cram2Bam.main(Cram2Bam.java:218) ... 6 more Caused by: java.io.FileNotFoundException: http://www.ebi.ac.uk/ena/cram/md5/2648ae1bacce4ec4b6cf337dcae37816 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1872) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474) at java.net.URL.openStream(URL.java:1045) at net.sf.cram.ref.ReferenceSource.loadFromPath(ReferenceSource.java:317) at net.sf.cram.ref.ReferenceSource.findBasesByMD5(ReferenceSource.java:363) at net.sf.cram.ref.ReferenceSource.getRegion(ReferenceSource.java:194) ... 7 more
As best I can tell, it's checking the ENA CRAM reference registry, even though I provided a local copy of the reference file. The --skip-md5-check option doesn't seem to help, just gets to this error faster. I also tried cloning and recompiling the latest version (3.0-b203) from github, that did not help either.