public class ImportUtilities extends Object
PluginUtilities such as
PluginUtilities.importDocuments| Modifier and Type | Class and Description |
|---|---|
static class |
ImportUtilities.ActionWhenInvalid
Specifies what to do when a sequence with invalid bases/residues is encountered during import
|
static class |
ImportUtilities.ImportDocumentType
whether to import ambiguous files as alignments of sequence lists.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
importDocuments(File file,
DocumentFileImporter.ImportCallback callback,
ImportUtilities.ActionWhenInvalid actionWhenInvalid,
ImportUtilities.ImportDocumentType importDocumentType,
ProgressListener progressListener)
Imports the given file, using any available importer.
|
static void |
importDocuments(File file,
DocumentFileImporter.ImportCallback callback,
ImportUtilities.ActionWhenInvalid actionWhenInvalid,
ImportUtilities.ImportDocumentType importDocumentType,
SequenceDocument.Alphabet alphabet,
ProgressListener progressListener)
Imports the given file, using any available importer.
|
static void |
importDocuments(File file,
DocumentFileImporter.ImportCallback callback,
ImportUtilities.ActionWhenInvalid actionWhenInvalid,
ProgressListener progressListener)
|
static List<AnnotatedPluginDocument> |
importDocuments(File file,
DocumentFileImporter importer,
ImportUtilities.ActionWhenInvalid actionWhenInvalid,
ProgressListener progressListener)
Imports the given file with a specific importer and default options.
|
static SequenceAlignmentDocument |
importFastaAlignment(File fastaFile,
SequenceDocument.Alphabet alphabet,
ProgressListener progressListener)
Imports the given fasta file as a list of aligned sequences, padding the sequences with trailing gaps if necessary.
|
static List<SequenceDocument> |
importFastaSequences(File fastaFile,
SequenceDocument.Alphabet alphabet,
ProgressListener progressListener)
Imports the given fasta file as a list of unaligned sequences.
|
public static List<SequenceDocument> importFastaSequences(File fastaFile, SequenceDocument.Alphabet alphabet, ProgressListener progressListener) throws IOException, DocumentImportException
fastaFile - the fasta file to importalphabet - the alphabet (either nucleotide or protein) of the file to import. May be null to automatically guess the correct type.progressListener - a progress listener for reporting progress and allowing the import to be cancelled.IOException - if there is a problem reading the fileDocumentImportException - if there is a problem importing the alignment or if the progress listener requests the import be cancelled.public static SequenceAlignmentDocument importFastaAlignment(File fastaFile, SequenceDocument.Alphabet alphabet, ProgressListener progressListener) throws IOException, DocumentImportException
fastaFile - the fasta file to importalphabet - the alphabet (either nucleotide or protein) of the file to import. May be null to automatically guess the correct type.progressListener - a progress listener for reporting progress and allowing the import to be cancelled.IOException - if there is a problem reading the fileDocumentImportException - if there is a problem importing the alignment or if the progress listener requests the import be cancelled.public static List<AnnotatedPluginDocument> importDocuments(File file, DocumentFileImporter importer, ImportUtilities.ActionWhenInvalid actionWhenInvalid, ProgressListener progressListener) throws IOException, DocumentImportException
file - the file to importimporter - importer to useactionWhenInvalid - action to take when a sequence with invalid bases/residues is encountered. Note that using ImportUtilities.ActionWhenInvalid.ImportWithInvalidBases will cause this method to throw a DocumentImportException on invalid documentsprogressListener - a progress listener for reporting progress and allowing the import to be cancelled.IOException - if there is a problem reading the fileDocumentImportException - if there is a problem importing the documents or if the progress listener requests the import be cancelled.public static void importDocuments(File file, DocumentFileImporter.ImportCallback callback, ImportUtilities.ActionWhenInvalid actionWhenInvalid, ProgressListener progressListener) throws IOException, DocumentImportException
importDocuments(file, callback, actionWhenInvalid, ImportDocumentType.AskUser, progressListener)IOExceptionDocumentImportExceptionpublic static void importDocuments(File file, DocumentFileImporter.ImportCallback callback, ImportUtilities.ActionWhenInvalid actionWhenInvalid, ImportUtilities.ImportDocumentType importDocumentType, ProgressListener progressListener) throws IOException, DocumentImportException
file - the file to importcallback - callback to pass imported documents back toactionWhenInvalid - action to take when a sequence with invalid bases/residues is encounteredprogressListener - a progress listener for reporting progress and allowing the import to be cancelled.importDocumentType - whether to import ambiguous files as alignments of sequence lists. For example fasta format that contains ungapped sequences all of which are the same lengthIOException - if there is a problem reading the fileDocumentImportException - if there is a problem importing the documents or if the progress listener requests the import be cancelled.public static void importDocuments(File file, DocumentFileImporter.ImportCallback callback, ImportUtilities.ActionWhenInvalid actionWhenInvalid, ImportUtilities.ImportDocumentType importDocumentType, SequenceDocument.Alphabet alphabet, ProgressListener progressListener) throws IOException, DocumentImportException
file - the file to importcallback - callback to pass imported documents back toactionWhenInvalid - action to take when a sequence with invalid bases/residues is encounteredprogressListener - a progress listener for reporting progress and allowing the import to be cancelled.importDocumentType - whether to import ambiguous files as alignments of sequence lists. For example fasta format that contains ungapped sequences all of which are the same lengthalphabet - the alphabet to use when the file format is ambiguous (for example fasta format). null indicates auto-detect the format (and potentially prompt the user)IOException - if there is a problem reading the fileDocumentImportException - if there is a problem importing the documents or if the progress listener requests the import be cancelled.