org.utgenome.format.fasta
Class CompactFASTA

java.lang.Object
  extended by org.utgenome.format.fasta.CompactFASTA

public class CompactFASTA
extends Object

CompactFASTA is a packed FASTA file, supporting random accesses to sub sequences of a specified chromosome.

Author:
leo

Nested Class Summary
 class CompactFASTA.OnDiskAccess
           
 class CompactFASTA.OnMemoryBuffer
           
static interface CompactFASTA.PacFileAccess
           
 
Field Summary
static String PAC_FILE_SUFFIX
           
static String PAC_INDEX_FILE_SUFFIX
           
static String PAC_N_FILE_SUFFIX
           
 
Constructor Summary
CompactFASTA(String fastaFile)
           
 
Method Summary
 void close()
           
 boolean containsChr(String chr)
          Test the specified chromosome name is in this FASTA
 Set<String> getChrSet()
          Get the set of chromosome names
 GenomeSequence getSequence(String chr)
           
 GenomeSequence getSequence(String chr, int start)
           
 CompactACGT getSequence(String chr, int start, int end)
          Retrieves a genome sequence of the specified range [start, end)
static CompactFASTA loadIntoMemory(String fastaFilePrefix)
           
static String pickSequenceName(String descriptionLine)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAC_FILE_SUFFIX

public static final String PAC_FILE_SUFFIX
See Also:
Constant Field Values

PAC_N_FILE_SUFFIX

public static final String PAC_N_FILE_SUFFIX
See Also:
Constant Field Values

PAC_INDEX_FILE_SUFFIX

public static final String PAC_INDEX_FILE_SUFFIX
See Also:
Constant Field Values
Constructor Detail

CompactFASTA

public CompactFASTA(String fastaFile)
             throws org.xerial.core.XerialException,
                    IOException
Parameters:
fastaFilePrefix -
Throws:
org.xerial.core.XerialException
IOException
Method Detail

getChrSet

public Set<String> getChrSet()
Get the set of chromosome names

Returns:

containsChr

public boolean containsChr(String chr)
Test the specified chromosome name is in this FASTA

Parameters:
chr -
Returns:

loadIntoMemory

public static CompactFASTA loadIntoMemory(String fastaFilePrefix)
                                   throws org.xerial.core.XerialException,
                                          IOException
Throws:
org.xerial.core.XerialException
IOException

close

public void close()
           throws IOException
Throws:
IOException

getSequence

public CompactACGT getSequence(String chr,
                               int start,
                               int end)
                        throws IOException,
                               UTGBException
Retrieves a genome sequence of the specified range [start, end)

Parameters:
chr - sequence name
start - start position on the genome (0-origin)
end - end position on genome (0-origin, exclusive)
Returns:
genome sequence of the specified range, or null if no entry found for the given sequence name
Throws:
IOException
UTGBException

getSequence

public GenomeSequence getSequence(String chr,
                                  int start)
                           throws IOException,
                                  UTGBException
Throws:
IOException
UTGBException

getSequence

public GenomeSequence getSequence(String chr)
                           throws IOException,
                                  UTGBException
Throws:
IOException
UTGBException

pickSequenceName

public static String pickSequenceName(String descriptionLine)


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.