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

catch errors

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@14772 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 4cc4b990
No related branches found
No related tags found
No related merge requests found
...@@ -27,9 +27,12 @@ import java.io.IOException; ...@@ -27,9 +27,12 @@ import java.io.IOException;
import java.io.Writer; import java.io.Writer;
import java.util.Iterator; import java.util.Iterator;
import javax.swing.JOptionPane;
import net.sf.picard.reference.FastaSequenceIndex; import net.sf.picard.reference.FastaSequenceIndex;
import net.sf.picard.reference.IndexedFastaSequenceFile; import net.sf.picard.reference.IndexedFastaSequenceFile;
import net.sf.picard.reference.ReferenceSequence; import net.sf.picard.reference.ReferenceSequence;
import net.sf.picard.reference.ReferenceSequenceFileFactory;
import uk.ac.sanger.artemis.io.Entry; import uk.ac.sanger.artemis.io.Entry;
import uk.ac.sanger.artemis.Options; import uk.ac.sanger.artemis.Options;
...@@ -57,7 +60,19 @@ public class IndexFastaStream extends StreamSequence ...@@ -57,7 +60,19 @@ public class IndexFastaStream extends StreamSequence
File fasta = ((FileDocument)doc.getDocument()).getFile(); File fasta = ((FileDocument)doc.getDocument()).getFile();
File fastaIndexFile = new File(fasta.getParentFile().getAbsolutePath(), fasta.getName()+".fai"); File fastaIndexFile = new File(fasta.getParentFile().getAbsolutePath(), fasta.getName()+".fai");
fastaIndex = new FastaSequenceIndex(fastaIndexFile); fastaIndex = new FastaSequenceIndex(fastaIndexFile);
indexSeqFile = new IndexedFastaSequenceFile(fasta, fastaIndex);
try
{
indexSeqFile = new IndexedFastaSequenceFile(fasta, fastaIndex);
}
catch(IllegalArgumentException ie)
{
JOptionPane.showConfirmDialog(null,
"Expecting fasta extensions:\n"+
ReferenceSequenceFileFactory.FASTA_EXTENSIONS.toString()+
"\n"+ie.getMessage(),
"Error", JOptionPane.ERROR_MESSAGE);
}
} }
setContigByIndex(0); setContigByIndex(0);
......
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