Skip to content
Snippets Groups Projects
Commit a536813c authored by tjc's avatar tjc
Browse files

test for BCF file format

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@15132 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent b1245134
No related branches found
No related tags found
No related merge requests found
...@@ -604,11 +604,20 @@ public class VCFview extends JPanel ...@@ -604,11 +604,20 @@ public class VCFview extends JPanel
buff.append(fileName+"\n"); buff.append(fileName+"\n");
try try
{ {
FileInputStream fileStream = new FileInputStream(fileName); if(IOUtils.isBCF(fileName))
BlockCompressedInputStream inputStrean = new BlockCompressedInputStream(fileStream); {
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; String line;
while( (line = TabixReader.readLine(inputStrean) ) != null ) while( (line = TabixReader.readLine(is) ) != null )
{ {
if(!line.startsWith("##")) if(!line.startsWith("##"))
break; break;
...@@ -1495,7 +1504,7 @@ public class VCFview extends JPanel ...@@ -1495,7 +1504,7 @@ public class VCFview extends JPanel
System.setProperty("default_directory", System.getProperty("user.dir")); System.setProperty("default_directory", System.getProperty("user.dir"));
FileSelectionDialog fileSelection = new FileSelectionDialog( FileSelectionDialog fileSelection = new FileSelectionDialog(
null, true, "VCFview", "VCF"); null, true, "VCFview", "VCF");
vcfFileList = fileSelection.getFiles(".vcf"); vcfFileList = fileSelection.getFiles(".*\\.[bv]{1}cf(\\.gz)*$");
reference = fileSelection.getReferenceFile(); reference = fileSelection.getReferenceFile();
if(reference.equals("")) if(reference.equals(""))
reference = null; reference = null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment