edu.upenn.gloDB.io
Class GFFTrack

java.lang.Object
  extended by edu.upenn.gloDB.io.GFFTrack
All Implemented Interfaces:
DataFile, TrackFile

public class GFFTrack
extends java.lang.Object
implements TrackFile

Import/Export Track data from/to GFF files.

File format (each column is separated by a tab character '\t'):

seqnamesourcefeaturestartendscorestrandframe[attributes]

Examples:
SEQ1EMBLsplice5172173.+. 
SEQ1netgenesplice51721730.94+. 
SEQ1geniesp5-201631822.3+. 
SEQ2grailATG17192.1-0 
seq1BLASTXsimilarity10123587.1+0Target "HBA_HUMAN" 11 55 ; E_value 0.0003
dJ102G20GD_mRNAcoding_exon71057201.-2Sequence "dJ102G20.C1.1"
Xgadflyexon31183280.-.genegrp=CG3038; transgrp=CG3038-RB; name=CG3038:1
Xgadflyexon28503016.-.genegrp=CG3038; transgrp=CG3038-RB; name=CG3038:2

Version:
$Id: GFFTrack.java,v 1.1.2.23 2007/02/22 21:10:27 fisher Exp $

Nested Class Summary
private  class GFFTrack.GFFFilter
          GFF 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
GFFTrack()
           
 
Method Summary
 java.lang.String format(java.lang.String id)
          Format all Features into a GFF like string.
 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 GFF 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 GFF 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 GFF file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

private final int ID
See Also:
Constant Field Values

DESC

private final java.lang.String DESC
See Also:
Constant Field Values

EXT

private final java.lang.String[] EXT

fileFilter

private final javax.swing.filechooser.FileFilter fileFilter
Constructor Detail

GFFTrack

public GFFTrack()
Method Detail

getID

public int getID()
Description copied from interface: DataFile
Get the file ID. FileIO contains constant values and string equivalents for built-in DataFiles.

Specified by:
getID in interface DataFile

getDesc

public java.lang.String getDesc()
Description copied from interface: DataFile
Get a description of the file type. This description will be used in the file chooser.

Specified by:
getDesc in interface DataFile

getExt

public java.lang.String[] getExt()
Description copied from interface: DataFile
Get an array of file extensions. These extensions will be used by the file chooser.

Specified by:
getExt in interface DataFile

getFileFilter

public javax.swing.filechooser.FileFilter getFileFilter()
Description copied from interface: DataFile
Get a FileFilter for use in the GUI.

Specified by:
getFileFilter in interface DataFile

load

public Track load(java.lang.String filename)
Load all Features in the GFF file into a single Track and return the resulting Track object.

Specified by:
load in interface TrackFile

load

public Track load(java.lang.String filename,
                  java.lang.String sourceID)
Load all Features in the GFF file into a single Track and return the resulting Track object.

Specified by:
load in interface TrackFile
Notes:
need to throw FileIO exceptions, rather than just print errors.

save

public void save(java.lang.String id)
Save the Track to a file based on it's ID. This will overwrite any existing file. This will append ".gff" to the filename.

Specified by:
save in interface TrackFile

save

public void save(java.lang.String id,
                 java.lang.String filename,
                 boolean overwrite)
Save all Features in a GFF file.

Specified by:
save in interface TrackFile
Notes:
need to throw FileIO exceptions, rather than just print errors., Should offer option to include Sequence data.

format

public java.lang.String format(java.lang.String id)
Format all Features into a GFF like string.




Copyright 2012 Stephen Fisher and Junhyong Kim, University of Pennsylvania. All Rights Reserved.