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
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.