diff --git a/uk/ac/sanger/artemis/components/variant/VCFview.java b/uk/ac/sanger/artemis/components/variant/VCFview.java index e27a8534f15647c8e84b2454d3f3b1d563dd08b5..7d679d1624e14f8e916bb6e210a727ee1a9bb287 100644 --- a/uk/ac/sanger/artemis/components/variant/VCFview.java +++ b/uk/ac/sanger/artemis/components/variant/VCFview.java @@ -604,11 +604,20 @@ public class VCFview extends JPanel buff.append(fileName+"\n"); try { - FileInputStream fileStream = new FileInputStream(fileName); - BlockCompressedInputStream inputStrean = new BlockCompressedInputStream(fileStream); + if(IOUtils.isBCF(fileName)) + { + JOptionPane.showMessageDialog(null, + "Looks like a BCF formated file.\n"+ + "Convert to VCF and use bgzip and tabix\n"+ + "to compress and index respectively.", + "Unsupported Format", + JOptionPane.WARNING_MESSAGE); + } + BlockCompressedInputStream is = + new BlockCompressedInputStream(new FileInputStream(fileName)); String line; - while( (line = TabixReader.readLine(inputStrean) ) != null ) + while( (line = TabixReader.readLine(is) ) != null ) { if(!line.startsWith("##")) break; @@ -1495,7 +1504,7 @@ public class VCFview extends JPanel System.setProperty("default_directory", System.getProperty("user.dir")); FileSelectionDialog fileSelection = new FileSelectionDialog( null, true, "VCFview", "VCF"); - vcfFileList = fileSelection.getFiles(".vcf"); + vcfFileList = fileSelection.getFiles(".*\\.[bv]{1}cf(\\.gz)*$"); reference = fileSelection.getReferenceFile(); if(reference.equals("")) reference = null;