00001 /***************************************************************************** 00002 * Copyright (C) 2000 Jim Kent. This source code may be freely used * 00003 * for personal, academic, and non-profit purposes. Commercial use * 00004 * permitted only by explicit agreement with Jim Kent (jim_kent@pacbell.net) * 00005 *****************************************************************************/ 00006 #ifndef NT4_H 00007 #define NT4_H 00008 00009 #ifndef DNAUTIL_H 00010 #include "dnautil.h" 00011 #endif 00012 00013 struct nt4Seq 00014 /* A packed (2 bits per nucleotide) sequence. 'N's are 00015 * converted to 'T's. */ 00016 { 00017 struct nt4Seq *next; /* Next in list. */ 00018 bits32 *bases; /* Packed bases. */ 00019 int baseCount; /* Number of bases. */ 00020 char *name; /* Name of sequence. */ 00021 }; 00022 00023 struct nt4Seq *newNt4(DNA *dna, int size, char *name); 00024 /* Create a new DNA seq with 2 bits per base pair. */ 00025 00026 void freeNt4(struct nt4Seq **pSeq); 00027 /* Free up DNA seq with 2 bits per base pair */ 00028 00029 struct nt4Seq *loadNt4(char *fileName, char *seqName); 00030 /* Load up an nt4 sequence from a file. */ 00031 00032 void saveNt4(char *fileName, DNA *dna, bits32 dnaSize); 00033 /* Save dna in an NT4 file. */ 00034 00035 int nt4BaseCount(char *fileName); 00036 /* Return number of bases in NT4 file. */ 00037 00038 DNA *nt4Unpack(struct nt4Seq *n, int start, int size); 00039 /* Create an unpacked section of nt4 sequence. */ 00040 00041 DNA *nt4LoadPart(char *nt4FileName, int start, int size); 00042 /* Load part of an nt4 file. */ 00043 00044 #endif /* _4NT_H */ 00045
1.5.2