gnABISource.h Source File

Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# gnABISource.h

Go to the documentation of this file.

    00001
    00002 // File:            gnABISource.h
    00003 // Purpose:         Implements gnBaseSource for ABI files
    00004 // Description:
    00005 // Changes:
    00006 // Version:         libGenome 0.1.0
    00007 // Author:          Aaron Darling
    00008 // Last Edited:     April 15, 2001, 10:34:50pm
    00009 // Modified by:
    00010 // Copyright:       (c) Aaron Darling
    00011 // Licenses:        Proprietary
    00013 #ifndef _gnABISource_h_
    00014 #define _gnABISource_h_
    00015
    00016 #include "gn/gnDefs.h"
    00017
    00018 #include <string>
    00019 #include "gn/gnFileSource.h"
    00020 #include "gn/gnFileContig.h"
    00021 #include "gn/gnSourceSpec.h"
    00022 #include "gn/gnFilter.h"
    00023
    00027 class GNDLLEXPORT gnABISource : public gnFileSource
    00028 {
    00029 public:
    00030         gnABISource();
    00035         gnABISource( const gnABISource& s );
    00036         ~gnABISource();
    00037         gnABISource* Clone() const;
    00038
    00039         uint32 GetContigListLength() const;
    00040         boolean HasContig( const string& name ) const;
    00041         uint32 GetContigID( const string& name ) const;
    00042         string GetContigName( uint32 i ) const;
    00043         gnSeqI GetContigSeqLength( uint32 i ) const;
    00044         gnFileContig* GetContig( const uint32 i ) const;
    00045
    00046         boolean SeqRead( const gnSeqI start, char* buf, uint32& bufLen, const uint32 contigI=ALL_CONTIGS );
    00047
    00054         static boolean Write(gnSequence& sequence, const string& filename);
    00055         gnGenomeSpec *GetSpec() const;
    00056
    00057         gnFileContig* GetFileContig( const uint32 contigI ) const;
    00058 private:
    00059         boolean SeqSeek( const gnSeqI start, const uint32& contigI, uint64& startPos, uint64& readableBytes );
    00060         boolean SeqStartPos( const gnSeqI start, gnFileContig& contig, uint64& startPos, uint64& readableBytes );
    00061         boolean ParseStream( istream& fin );
    00062
    00063         gnGenomeSpec *m_spec;
    00064         vector< gnFileContig* > m_contigList;
    00065
    00066 };// class gnABISource
    00067
    00068 inline
    00069 gnABISource* gnABISource::Clone() const
    00070 {
    00071         return new gnABISource( *this );
    00072 }
    00073 inline
    00074 uint32 gnABISource::GetContigListLength() const
    00075 {
    00076         return m_contigList.size();
    00077 }
    00078 inline
    00079 gnGenomeSpec *gnABISource::GetSpec() const
    00080 {
    00081         return m_spec->Clone();
    00082 }
    00083
    00084 #endif
    00085         // _gnABISource_h_