001 /* 002 * Copyright 2007, 2012 Stephen Fisher and Junhyong Kim, University of 003 * Pennsylvania. 004 * 005 * This file is part of Glo-DB. 006 * 007 * Glo-DB is free software: you can redistribute it and/or modify it 008 * under the terms of the GNU General Public License as published by 009 * the Free Software Foundation, either version 3 of the License, or 010 * (at your option) any later version. 011 * 012 * Glo-DB is distributed in the hope that it will be useful, but 013 * WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * General Public License for more details. 016 * 017 * You should have received a copy of the GNU General Public License 018 * along with Glo-DB. If not, see <http://www.gnu.org/licenses/>. 019 * 020 * @(#)SequenceFile.java 021 */ 022 023 package edu.upenn.gloDB.io; 024 025 import edu.upenn.gloDB.Sequence; 026 import java.util.HashSet; 027 028 /** 029 * Interface for files that contain Sequences (ie. FASTA). 030 * 031 * @author Stephen Fisher 032 * @version $Id: SequenceFile.java,v 1.1.2.5 2005/01/07 19:56:59 fisher Exp $ 033 */ 034 035 public interface SequenceFile extends DataFile { 036 037 //-------------------------------------------------------------------------- 038 // Miscellaneous Methods 039 040 /** 041 * Load the first sequence in the data file and return the 042 * resulting Sequence object. 043 */ 044 public Sequence load(String filename); 045 046 /** 047 * Load the first sequence in the data file and return the 048 * resulting Sequence object. 049 */ 050 public Sequence load(String filename, String id); 051 052 /** 053 * Load the first Sequence in the data file and return the 054 * resulting Sequence object. 055 */ 056 public Sequence load(String filename, String id, FASTAParser parser); 057 058 /** 059 * Load all Sequences in the data file and return a HashSet 060 * containing the resulting Sequence objects. 061 */ 062 public HashSet loadAll(String filename); 063 064 /** 065 * Load all Sequences in the data file and return a HashSet 066 * containing the resulting Sequence objects. 067 */ 068 public HashSet loadAll(String filename, FASTAParser parser); 069 070 /** 071 * Save the Sequence object to a file based on it's ID. This 072 * should use the ID as the filename and set the overwrite flag to 073 * 'true'. 074 */ 075 public void save(String id); 076 077 /** Save the Sequence object data. */ 078 public void save(String id, String filename, boolean overwrite); 079 080 } // SequenceFile.java 081 082