gnFileContig.cpp Source File

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

# gnFileContig.cpp

Go to the documentation of this file.

    00001 /////////////////////////////////////////////////////////////////////////////
    00002 // File:            gnFileContig.h
    00003 // Purpose:         File Position holder.
    00004 // Description:
    00005 // Changes:
    00006 // Version:         libGenome 0.5.1
    00007 // Author:          Aaron Darling
    00008 // Modified by:
    00009 // Copyright:       (c) Aaron Darling
    00010 // Licenses:        See COPYING file for details
    00011 /////////////////////////////////////////////////////////////////////////////
    00012 #include "gn/gnFileContig.h"
    00013 #include <iostream>
    00014
    00015 gnFileContig::gnFileContig()
    00016 {
    00017         Clear();
    00018 }
    00019 gnFileContig::gnFileContig( string nameStr, const uint64 s, const uint64 e )
    00020 {
    00021         Clear();
    00022         m_name = nameStr;
    00023         m_fileStartEnd.first = s;
    00024         m_fileStartEnd.second = e;
    00025 }
    00026 gnFileContig::gnFileContig( const gnFileContig& fc )
    00027 {
    00028         m_name = fc.m_name;
    00029         m_seqLength = fc.m_seqLength;
    00030         m_fileStartEnd = fc.m_fileStartEnd;
    00031         for( uint32 i=0; i < CONTIG_SECTION_SIZE; ++i )
    00032                 m_startEndArray[i] = fc.m_startEndArray[i];
    00033         m_repeatSeqGap = fc.m_repeatSeqGap;
    00034         m_repeatSeqGapSize = fc.m_repeatSeqGapSize;
    00035 }
    00036 gnFileContig::~gnFileContig()
    00037 {
    00038 }
    00039 void gnFileContig::Clear()
    00040 {
    00041         m_name = "";
    00042         m_seqLength = 0;
    00043         m_fileStartEnd = pair<uint64,uint64>(0,0);
    00044         for( uint32 i=0; i < CONTIG_SECTION_SIZE; ++i )
    00045                 m_startEndArray[i] = pair<uint64,uint64>(0,0);
    00046         m_repeatSeqGap = false;
    00047         m_repeatSeqGapSize = pair<uint64,uint64>(0,0);
    00048 }
    00049
    00050 boolean gnFileContig::SetRepeatSeqSize( const uint64 seqSize )
    00051 {
    00052         if( !m_repeatSeqGap )
    00053                 return false;
    00054         if( m_repeatSeqGapSize.first == seqSize )
    00055                 return true;
    00056         if( m_repeatSeqGapSize.first == 0 )
    00057         {
    00058                 m_repeatSeqGapSize.first = seqSize;
    00059                 return true;
    00060         }
    00061         m_repeatSeqGap = false;
    00062         return false;
    00063 }
    00064 boolean gnFileContig::SetRepeatGapSize( const uint64 gapSize )
    00065 {
    00066         if( !m_repeatSeqGap )
    00067                 return false;
    00068         if( m_repeatSeqGapSize.second == gapSize )
    00069                 return true;
    00070         if( m_repeatSeqGapSize.second == 0 )
    00071         {
    00072                 m_repeatSeqGapSize.second = gapSize;
    00073                 return true;
    00074         }
    00075         m_repeatSeqGap = false;
    00076         return false;
    00077 }