Thank you. I tried the command and I got this
file1.bam: gzip compressed data, extra field
file2.bam: data
Does this mean my file2 is a SAM file ?
I tried to run a simple mergesam using picard on two bam files using the following command
java -jar /opt/picard/picard.jar MergeSamFiles I=file1.bam I=file2.bam O=merged_output.bam USE_THREADING=TRUE
This is giving me the following error
Exception in thread "main" java.lang.RuntimeException: **Cannot use index file with textual SAM file**
at htsjdk.samtools.SamReaderFactory$SamReaderFactoryImpl.open(SamReaderFactory.java:317)
at htsjdk.samtools.SamReaderFactory$SamReaderFactoryImpl.open(SamReaderFactory.java:145)
at picard.sam.MergeSamFiles.doWork(MergeSamFiles.java:142)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:208)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:95)
What does it mean and how do I fix it ?
Thanks
can your please run the following command:
file file1.bam file2.bam
it should return:
gzip compressed data, extra field
if not (eg: ASCII text) your files are SAM but not BAM.
if not, I suggest your update your version of picard because there is no such method SamReaderFactoryImpl.openat line 317. https://github.com/samtools/htsjdk/blob/master/src/main/java/htsjdk/samtools/SamReaderFactory.java#L317
Log in to answer this question.
Figured it out. I only had a partial bam file. Once i downloaded it again, MergeSam ran perfectly. Easy solution to a very silly problem.
Thanks for your time Pierre.
if it answered your question, click on the green mark near my answer to close the post.