|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.upenn.gloDB.io.FASTATrack
public class FASTATrack
Import Track data from a FASTA file. The basic file format dictates a header line at the beginning of each Feature. There are no standards as to what the header line should contain or how it should be formatted, other than to stipulate that it begins with a ">". Thus this format sufficient for coding Sequence objects but not ideal for sequence annotations (Tracks). Since some sites, such as www.fruitfly.org, release annotations as FASTA files, some attempt has been made to parse the headers from specific sites. Users can use the FASTAParser interface to create their own header parsers as well. Here the default is FASTAParserFly.
Nested Class Summary | |
---|---|
private class |
FASTATrack.FASTAFilter
FASTA specific FileFilter. |
Field Summary | |
---|---|
private java.lang.String |
DESC
|
private java.lang.String[] |
EXT
|
private javax.swing.filechooser.FileFilter |
fileFilter
|
private int |
ID
|
Constructor Summary | |
---|---|
FASTATrack()
|
Method Summary | |
---|---|
java.lang.String |
getDesc()
Get a description of the file type. |
java.lang.String[] |
getExt()
Get an array of file extensions. |
javax.swing.filechooser.FileFilter |
getFileFilter()
Get a FileFilter for use in the GUI. |
int |
getID()
Get the file ID. |
Track |
load(java.lang.String filename)
Load all Features in the FASTA file into a single Track and return the resulting Track object. |
Track |
load(java.lang.String filename,
java.lang.String sourceID)
Load all Features in the FASTA file into a single Track and return the resulting Track object. |
void |
save(java.lang.String id)
Save the Track to a file based on it's ID. |
void |
save(java.lang.String id,
java.lang.String filename,
boolean overwrite)
Save all Features in a FASTA file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final int ID
private final java.lang.String DESC
private final java.lang.String[] EXT
private final javax.swing.filechooser.FileFilter fileFilter
Constructor Detail |
---|
public FASTATrack()
Method Detail |
---|
public int getID()
DataFile
getID
in interface DataFile
public java.lang.String getDesc()
DataFile
getDesc
in interface DataFile
public java.lang.String[] getExt()
DataFile
getExt
in interface DataFile
public javax.swing.filechooser.FileFilter getFileFilter()
DataFile
getFileFilter
in interface DataFile
public Track load(java.lang.String filename)
load
in interface TrackFile
public Track load(java.lang.String filename, java.lang.String sourceID)
FASTAParserFly
. An ExactFeature
object
is created with the start and stop positions taken from the
"boundaries" key:value pair. The parsed header is stored in
the AbstractFeature.attributes
field of the ExactFeature
object.
If the file is empty then returns 'null'.
If this can't get a valid Sequence ID from the user or the
Feature's header, then can't be associated with any existing
Sequence and so this will create a Sequence with it's best
guess at the Sequence ID. However, this isn't very useful
because it's not likely that other Features will share this
Sequence. There's also no capacity to load this Sequence data
later, so the Sequence data is load here as well, which is very
inefficient.
load
in interface TrackFile
public void save(java.lang.String id)
save
in interface TrackFile
public void save(java.lang.String id, java.lang.String filename, boolean overwrite)
save
in interface TrackFile
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |