public class GFFTools
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_FRAME
Flag to indicate that there is no frame info.
|
static double |
NO_SCORE
Flag to indicate that there is no score info.
|
| Constructor and Description |
|---|
GFFTools() |
| Modifier and Type | Method and Description |
|---|---|
static Sequence |
annotateSequence(Sequence seq,
GFFEntrySet ents)
Annotates a sequence with the features from a GFF entry set with sequence
name matching this sequence.
|
static Sequence |
annotateSequence(Sequence seq,
GFFEntrySet ents,
boolean checkSeqName)
Annotates a sequence with the features from a GFF entry set.
|
static SequenceDB |
annotateSequences(SequenceDB seqs,
GFFEntrySet ents)
Annotates all sequences in a sequence DB with features from a GFF entry set.
|
static GFFEntrySet |
gffFromSeqDB(SequenceDB seqDB)
Creates a GFFEntrySet containing one entry for each feature on each
sequence of a SequenceDB.
|
static GFFEntrySet |
gffFromSequence(Sequence seq)
Creates a GFFEntrySet containing one entry for each feature on a sequence.
|
static GFFEntrySet |
readGFF(java.io.BufferedReader gffIn)
Read all GFF entries from a buffered reader.
|
static GFFEntrySet |
readGFF(java.io.BufferedReader gffIn,
GFFRecordFilter recFilt)
Read all GFF entries matching a filter from a buffered reader.
|
static GFFEntrySet |
readGFF(java.io.File inFile)
Reads a
GFFEntrySet from a file with no filtering. |
static GFFEntrySet |
readGFF(java.io.File inFile,
GFFRecordFilter recFilt)
Reads a GFFEntrySet from a file with the specified filter.
|
static GFFEntrySet |
readGFF(java.lang.String fileName)
Deprecated.
use: readGff(File)
|
static GFFEntrySet |
readGFF(java.lang.String fileName,
GFFRecordFilter recFilt)
Deprecated.
use: readGff(File,GFFRecordFilter)
|
static void |
writeGFF(java.io.File outFile,
GFFEntrySet ents)
Writes a GFFEntrySet to a file.
|
static void |
writeGFF(java.io.PrintWriter pw,
GFFEntrySet ents)
Writes a GFFEntrySet to a PrintWriter.
|
static void |
writeGFF(java.lang.String fileName,
GFFEntrySet ents)
Writes a GFFEntrySet to a file.
|
public static double NO_SCORE
public static int NO_FRAME
public static GFFEntrySet readGFF(java.lang.String fileName) throws java.io.FileNotFoundException, ParserException, BioException, java.io.IOException
GFFEntrySet from a file with no filtering.fileName - the file containing the GFFGFFEntrySet encapsulating the records read from the filejava.io.FileNotFoundException - if file is not foundParserException - if format is wrongBioException - if format is wrongjava.io.IOException - if file reading error occurspublic static GFFEntrySet readGFF(java.lang.String fileName, GFFRecordFilter recFilt) throws java.io.FileNotFoundException, ParserException, BioException, java.io.IOException
fileName - the file containing the GFFrecFilt - the filter to useGFFEntrySet encapsulating the records read from the filejava.io.FileNotFoundException - if file is not foundParserException - if format is wrongBioException - if format is wrongjava.io.IOException - if file reading error occurspublic static GFFEntrySet readGFF(java.io.File inFile) throws java.io.FileNotFoundException, ParserException, BioException, java.io.IOException
GFFEntrySet from a file with no filtering.inFile - the File containing the GFFGFFEntrySet encapsulating the records read from the filejava.io.FileNotFoundException - if file is not foundParserException - if format is wrongBioException - if format is wrongjava.io.IOException - if file reading error occurspublic static GFFEntrySet readGFF(java.io.File inFile, GFFRecordFilter recFilt) throws java.io.FileNotFoundException, ParserException, BioException, java.io.IOException
inFile - the File containing the GFFrecFilt - the filter to useGFFEntrySet encapsulating the records read from the filejava.io.FileNotFoundException - if file is not foundParserException - if format is wrongBioException - if format is wrongjava.io.IOException - if file reading error occurspublic static GFFEntrySet readGFF(java.io.BufferedReader gffIn) throws ParserException, BioException, java.io.IOException
gffIn - the BufferedReader to read text fromparserException - if the text could not be parsed as GFFBioException - if there was some error reading the GFFjava.io.IOException - if there was an error with the readerParserExceptionpublic static GFFEntrySet readGFF(java.io.BufferedReader gffIn, GFFRecordFilter recFilt) throws ParserException, BioException, java.io.IOException
gffIn - the BufferedReader to read text fromparserException - if the text could not be parsed as GFFBioException - if there was some error reading the GFFjava.io.IOException - if there was an error with the readerParserExceptionpublic static void writeGFF(java.lang.String fileName,
GFFEntrySet ents)
throws java.io.IOException
fileName - the file to write toents - the entries to writejava.io.IOException - if file writing failspublic static void writeGFF(java.io.File outFile,
GFFEntrySet ents)
throws java.io.IOException
outFile - the file to write toents - the entry set to writejava.io.IOException - if writing to the file failspublic static void writeGFF(java.io.PrintWriter pw,
GFFEntrySet ents)
throws java.io.IOException
pw - the PrintWriter to write toents - the entries to writejava.io.IOException - if file writing failspublic static Sequence annotateSequence(Sequence seq, GFFEntrySet ents)
seq - the Sequence to annotate.ents - the the GFF features to annotate it with.public static Sequence annotateSequence(Sequence seq, GFFEntrySet ents, boolean checkSeqName)
seq - the Sequence to annotate.ents - the the GFF features to annotate it with.checkSeqName - boolean flat, if true only annotate sequence with
features that have matching sequence names, otherwise annotate
all featurespublic static SequenceDB annotateSequences(SequenceDB seqs, GFFEntrySet ents) throws IllegalIDException, BioException
seqs - the SequenceDB to annotateents - the GFFEntrySet to annote withIllegalIDExceptionBioExceptionpublic static GFFEntrySet gffFromSequence(Sequence seq) throws BioException
seq - the Sequence to create features forBioException - if something went wrong GFF-ifying the sequences
featurespublic static GFFEntrySet gffFromSeqDB(SequenceDB seqDB) throws BioException
Note: This converts all features in the whole database to in-memorey GFFRecord instances. This will take up considerable memory for large databases.
seqDB - the SequenceDB to create features forBioException - if something went wrong GFF-ifying the sequences
features