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.1.0
    00007 // Author:          Aaron Darling
    00008 // Last Edited:     April 15, 2001, 11:13:00pm
    00009 // Modified by:
    00010 // Copyright:       (c) Aaron Darling
    00011 // Licenses:        Proprietary
    00013 #include "gn/gnFileContig.h"
    00014 #include <iostream>
    00015
    00016 gnFileContig::gnFileContig()
    00017 {
    00018         Clear();
    00019 }
    00020 gnFileContig::gnFileContig( string nameStr, const uint64 s, const uint64 e )
    00021 {
    00022         Clear();
    00023         m_name = nameStr;
    00024         m_fileStartEnd.first = s;
    00025         m_fileStartEnd.second = e;
    00026 }
    00027 gnFileContig::gnFileContig( const gnFileContig& fc )
    00028 {
    00029         m_name = fc.m_name;
    00030         m_seqLength = fc.m_seqLength;
    00031         m_fileStartEnd = fc.m_fileStartEnd;
    00032         for( uint32 i=0; i < CONTIG_SECTION_SIZE; ++i )
    00033                 m_startEndArray[i] = fc.m_startEndArray[i];
    00034         m_repeatSeqGap = fc.m_repeatSeqGap;
    00035         m_repeatSeqGapSize = fc.m_repeatSeqGapSize;
    00036 }
    00037 gnFileContig::~gnFileContig()
    00038 {
    00039 }
    00040 void gnFileContig::Clear()
    00041 {
    00042         m_name = "";
    00043         m_seqLength = 0;
    00044         m_fileStartEnd = pair<uint64,uint64>(0,0);
    00045         for( uint32 i=0; i < CONTIG_SECTION_SIZE; ++i )
    00046                 m_startEndArray[i] = pair<uint64,uint64>(0,0);
    00047         m_repeatSeqGap = false;
    00048         m_repeatSeqGapSize = pair<uint64,uint64>(0,0);
    00049 }
    00050
    00051 boolean gnFileContig::SetRepeatSeqSize( const uint64 seqSize )
    00052 {
    00053         if( !m_repeatSeqGap )
    00054                 return false;
    00055         if( m_repeatSeqGapSize.first == seqSize )
    00056                 return true;
    00057         if( m_repeatSeqGapSize.first == 0 )
    00058         {
    00059                 m_repeatSeqGapSize.first = seqSize;
    00060                 return true;
    00061         }
    00062         m_repeatSeqGap = false;
    00063         return false;
    00064 }
    00065 boolean gnFileContig::SetRepeatGapSize( const uint64 gapSize )
    00066 {
    00067         if( !m_repeatSeqGap )
    00068                 return false;
    00069         if( m_repeatSeqGapSize.second == gapSize )
    00070                 return true;
    00071         if( m_repeatSeqGapSize.second == 0 )
    00072         {
    00073                 m_repeatSeqGapSize.second = gapSize;
    00074                 return true;
    00075         }
    00076         m_repeatSeqGap = false;
    00077         return false;
    00078 }