Class TwoBitFacade


  • public class TwoBitFacade
    extends java.lang.Object
    A facade that makes it easier to work with a 2bit file. Created by yana on 3/27/17.
    • Constructor Summary

      Constructors 
      Constructor Description
      TwoBitFacade​(java.io.File file)
      Reads a genome from a locally stored .2bit file.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes .2bit file twoBitParser.
      java.lang.String getSequence​(java.lang.String chromosomeName, int start, int end)
      Extract a sequence from a chromosome, using chromosomal coordinates
      void setChromosome​(java.lang.String chr)
      Sets a chromosome for TwoBitParser.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TwoBitFacade

        public TwoBitFacade​(java.io.File file)
                     throws java.lang.Exception
        Reads a genome from a locally stored .2bit file.
        Parameters:
        file - the File to a .2bit file.
        Throws:
        java.lang.Exception
    • Method Detail

      • close

        public void close()
                   throws java.lang.Exception
        Closes .2bit file twoBitParser.
        Throws:
        java.lang.Exception
      • setChromosome

        public void setChromosome​(java.lang.String chr)
                           throws java.lang.Exception
        Sets a chromosome for TwoBitParser.
        Parameters:
        chr - The chromosome name (e.g. chr21)
        Throws:
        java.lang.Exception
      • getSequence

        public java.lang.String getSequence​(java.lang.String chromosomeName,
                                            int start,
                                            int end)
                                     throws java.lang.Exception
        Extract a sequence from a chromosome, using chromosomal coordinates
        Parameters:
        chromosomeName -
        start -
        end -
        Returns:
        the DNASequence from the requested coordinates.
        Throws:
        java.lang.Exception