samtools / htsjdk

A Java API for high-throughput sequencing data (HTS) formats.
http://samtools.github.io/htsjdk/
283 stars 242 forks source link

Improve error message "An index is required, but none found" #1512

Closed juhawilppu closed 3 years ago

juhawilppu commented 4 years ago

I was trying to run RenameSampleInVcf with files called

and it was failing with error message "An index is required, but none found".

After looking at the source code, it turns out the index file needs to be named as "file.vcf.idx". I'm not sure if this was obvious to others, but the error message could be improved and mention the specific file ending.

Your environment:

Steps to reproduce

java -Xms3000m -jar /usr/gitc/picard.jar RenameSampleInVcf \
    INPUT=file.vcf \
    OUTPUT=output.vcf \
    NEW_SAMPLE_NAME=test

Expected behaviour

Command fails with message "An index is required, but none found with file ending .idx".

Actual behaviour

Command fails with message "An index is required, but none found".

yfarjoun commented 4 years ago

tbi is an index for the block-gzipped version of vcf. you'll need to generate an index off of the vcf itself using IndexFeatureFile (GATK) or igvtools

On Wed, Sep 23, 2020 at 7:09 AM Juha Wilppu notifications@github.com wrote:

I was trying to run RenameSampleInVcf with files called

  • file.vcf
  • file.vcf.tbi (index) and it was failing with error message "An index is required, but none found".

After looking at the source code, it turns out the index file needs to be named as "file.vcf.idx". I'm not sure if this was obvious to others, but the error message could be improved and mention the specific file ending. Your environment:

  • Picard version: 2.16.0-SNAPSHOT

Steps to reproduce

java -Xms3000m -jar /usr/gitc/picard.jar RenameSampleInVcf \ INPUT=file.vcf \ OUTPUT=output.vcf \ NEW_SAMPLE_NAME=test

Expected behaviour

Command fails with message ""An index is required, but none found with file ending .idx". Actual behaviour

Command fails with message ""An index is required, but none found".

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/samtools/htsjdk/issues/1512, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAU6JUWUA6HD25SBJYNM2OTSHHJNLANCNFSM4RW4UDNQ .

lbergelson commented 4 years ago

It does seem reasonable to state which index it's looking for though to prevent tbi / idx confusion.