Skip to content
Commits on Source (7)
......@@ -22,13 +22,14 @@
#define PATHSEP "/"
#endif
static char *Usage = "[-vfd] <path:db|dam> <track:name>";
static char *Usage = "[-vfd] <path:db|dam> <track:name> ...";
int main(int argc, char *argv[])
{ char *prefix;
FILE *aout, *dout;
int nblocks;
int nfiles;
FILE *aout, *dout;
int c;
int VERBOSE;
int FORCE;
int DELETE;
......@@ -52,7 +53,7 @@ int main(int argc, char *argv[])
FORCE = flags['f'];
DELETE = flags['d'];
if (argc != 3)
if (argc < 3)
{ fprintf(stderr,"Usage: %s %s\n",Prog_Name,Usage);
fprintf(stderr,"\n");
fprintf(stderr," -v: verbose\n");
......@@ -62,6 +63,8 @@ int main(int argc, char *argv[])
}
}
// Open DB stub and get number of blocks
{ char *pwd, *root;
int i, plen, index, isdam;
FILE *dstub;
......@@ -103,26 +106,13 @@ int main(int argc, char *argv[])
free(dstub_name);
free(pwd);
free(root);
aout = fopen(Catenate(prefix,argv[2],".","anno"),"r");
if (aout != NULL && !FORCE)
{ fprintf(stderr,"%s: Track file %s%s.anno already exists!\n",Prog_Name,prefix,argv[2]);
exit (1);
}
dout = fopen(Catenate(prefix,argv[2],".","data"),"r");
if (dout != NULL && !FORCE)
{ fprintf(stderr,"%s: Track file %s%s.data already exists!\n",Prog_Name,prefix,argv[2]);
exit (1);
}
// For each track do
aout = Fopen(Catenate(prefix,argv[2],".","anno"),"w");
if (aout == NULL)
exit (1);
dout = NULL;
}
{ int tracktot, tracksiz;
for (c = 2; c < argc; c++)
{ int nfiles;
int tracktot, tracksiz;
int64 trackoff;
char data[1024];
void *anno;
......@@ -131,6 +121,36 @@ int main(int argc, char *argv[])
int nextra;
int64 extail;
// Open the output .anno for writing, and output header stub
if (VERBOSE)
{ fprintf(stderr,"\nConstructing %s%s:\n",prefix,argv[c]);
fflush(stderr);
}
aout = fopen(Catenate(prefix,argv[c],".","anno"),"r");
if (aout != NULL)
{ if (!FORCE)
{ fprintf(stderr,"%s: Track file %s%s.anno already exists!\n",Prog_Name,prefix,argv[c]);
exit (1);
}
fclose(aout);
}
dout = fopen(Catenate(prefix,argv[c],".","data"),"r");
if (dout != NULL)
{ if (!FORCE)
{ fprintf(stderr,"%s: Track file %s%s.data already exists!\n",Prog_Name,prefix,argv[c]);
exit (1);
}
fclose(dout);
}
aout = Fopen(Catenate(prefix,argv[c],".","anno"),"w");
if (aout == NULL)
exit (1);
dout = NULL;
extra = NULL;
anno = NULL;
trackoff = 0;
......@@ -140,6 +160,8 @@ int main(int argc, char *argv[])
if (fwrite(&tracksiz,sizeof(int),1,aout) != 1)
SYSTEM_WRITE_ERROR
// OPen and catenate in each block .anno and .data file
nextra = 0;
nfiles = 0;
while (1)
......@@ -147,9 +169,9 @@ int main(int argc, char *argv[])
char *dfile_name, *afile_name;
int i, apos, size, esize, tracklen;
afile_name = Strdup(Numbered_Suffix(prefix,nfiles+1,Catenate(".",argv[2],".","anno")),
afile_name = Strdup(Numbered_Suffix(prefix,nfiles+1,Catenate(".",argv[c],".","anno")),
"Allocating .anno file name");
dfile_name = Strdup(Numbered_Suffix(prefix,nfiles+1,Catenate(".",argv[2],".","data")),
dfile_name = Strdup(Numbered_Suffix(prefix,nfiles+1,Catenate(".",argv[c],".","data")),
"Allocating .data file name");
if (afile_name == NULL || dfile_name == NULL)
goto error;
......@@ -158,7 +180,7 @@ int main(int argc, char *argv[])
afile = fopen(afile_name,"r");
if (afile == NULL)
break;
dfile = fopen(Numbered_Suffix(prefix,nfiles+1,Catenate(".",argv[2],".","data")),"r");
dfile = fopen(Numbered_Suffix(prefix,nfiles+1,Catenate(".",argv[c],".","data")),"r");
if (dfile == NULL && errno != ENOENT)
{ fprintf(stderr,"%s: The file %s is corrupted\n",Prog_Name,dfile_name);
goto error;
......@@ -169,12 +191,12 @@ int main(int argc, char *argv[])
lfile = afile;
if (VERBOSE)
{ fprintf(stderr,"Concatenating %s%d.%s ...\n",prefix,nfiles+1,argv[2]);
{ fprintf(stderr," Concatenating %s%d.%s ...\n",prefix,nfiles+1,argv[c]);
fflush(stderr);
}
FREAD(&tracklen,sizeof(int),1,afile)
FREAD(&size,sizeof(int),1,afile)
FFREAD(&tracklen,sizeof(int),1,afile)
FFREAD(&size,sizeof(int),1,afile)
if (size == 0)
esize = 8;
else
......@@ -183,7 +205,7 @@ int main(int argc, char *argv[])
if (nfiles == 0)
{ tracksiz = size;
if (dfile != NULL)
{ dout = Fopen(Catenate(prefix,argv[2],".","data"),"w");
{ dout = Fopen(Catenate(prefix,argv[c],".","data"),"w");
if (dout == NULL)
goto error;
}
......@@ -213,46 +235,46 @@ int main(int argc, char *argv[])
}
if (dfile != NULL)
{ int64 dlen;
{ int64 dlen, d;
if (esize == 4)
{ int anno4;
for (i = 0; i < tracklen; i++)
{ FREAD(&anno4,sizeof(int),1,afile)
{ FFREAD(&anno4,sizeof(int),1,afile)
anno4 += trackoff;
FWRITE(&anno4,sizeof(int),1,aout)
FFWRITE(&anno4,sizeof(int),1,aout)
}
FREAD(&anno4,sizeof(int),1,afile)
FFREAD(&anno4,sizeof(int),1,afile)
dlen = anno4;
}
else
{ int64 anno8;
for (i = 0; i < tracklen; i++)
{ FREAD(&anno8,sizeof(int64),1,afile)
{ FFREAD(&anno8,sizeof(int64),1,afile)
anno8 += trackoff;
FWRITE(&anno8,sizeof(int64),1,aout)
FFWRITE(&anno8,sizeof(int64),1,aout)
}
FREAD(&anno8,sizeof(int64),1,afile)
FFREAD(&anno8,sizeof(int64),1,afile)
dlen = anno8;
}
trackoff += dlen;
for (i = 1024; i < dlen; i += 1024)
{ FREAD(data,1024,1,dfile)
FWRITE(data,1024,1,dout)
for (d = 1024; d < dlen; d += 1024)
{ FFREAD(data,1024,1,dfile)
FFWRITE(data,1024,1,dout)
}
i -= 1024;
if (i < dlen)
{ FREAD(data,dlen-i,1,dfile)
FWRITE(data,dlen-i,1,dout)
d -= 1024;
if (d < dlen)
{ FFREAD(data,dlen-d,1,dfile)
FFWRITE(data,dlen-d,1,dout)
}
}
else
{ for (i = 0; i < tracklen; i++)
{ FREAD(anno,esize,1,afile)
FWRITE(anno,esize,1,aout)
{ FFREAD(anno,esize,1,afile)
FFWRITE(anno,esize,1,aout)
}
}
......@@ -307,7 +329,7 @@ int main(int argc, char *argv[])
if (nfiles == 0)
{ fprintf(stderr,"%s: Couldn't find first track block %s1.%s.anno\n",
Prog_Name,prefix,argv[2]);
Prog_Name,prefix,argv[c]);
goto error;
}
else
......@@ -316,17 +338,17 @@ int main(int argc, char *argv[])
if (dout != NULL)
{ if (tracksiz == 4)
{ int anno4 = trackoff;
FWRITE(&anno4,sizeof(int),1,aout)
FFWRITE(&anno4,sizeof(int),1,aout)
}
else
{ int64 anno8 = trackoff;
FWRITE(&anno8,sizeof(int64),1,aout)
FFWRITE(&anno8,sizeof(int64),1,aout)
}
}
if (nextra == 0)
{ while (fread(&byte,1,1,lfile) == 1)
FWRITE(&byte,1,1,aout)
FFWRITE(&byte,1,1,aout)
}
else
{ int i;
......@@ -336,9 +358,8 @@ int main(int argc, char *argv[])
fclose(lfile);
FSEEKO(aout,0,SEEK_SET)
FWRITE(&tracktot,sizeof(int),1,aout)
FWRITE(&tracksiz,sizeof(int),1,aout)
}
FFWRITE(&tracktot,sizeof(int),1,aout)
FFWRITE(&tracksiz,sizeof(int),1,aout)
}
if (nfiles != nblocks)
......@@ -356,17 +377,19 @@ int main(int argc, char *argv[])
char *name;
for (i = 1; i <= nblocks ;i++)
{ name = Numbered_Suffix(prefix,i,Catenate(".",argv[2],".","anno"));
{ name = Numbered_Suffix(prefix,i,Catenate(".",argv[c],".","anno"));
if (unlink(name) != 0)
fprintf(stderr,"%s: [WARNING] Couldn't delete file %s\n",Prog_Name,name);
if (dout != NULL)
{ name = Numbered_Suffix(prefix,i,Catenate(".",argv[2],".","data"));
{ name = Numbered_Suffix(prefix,i,Catenate(".",argv[c],".","data"));
if (unlink(name) != 0)
fprintf(stderr,"%s: [WARNING] Couldn't delete file %s\n",Prog_Name,name);
}
}
}
}
free(prefix);
exit (0);
......@@ -374,17 +397,17 @@ error:
{ char *name;
fclose(aout);
name = Catenate(prefix,argv[2],".","anno");
name = Catenate(prefix,argv[c],".","anno");
if (unlink(name) != 0)
fprintf(stderr,"%s: [WARNING] Couldn't delete file %s during abort\n",Prog_Name,name);
if (dout != NULL)
{ fclose(dout);
name = Catenate(prefix,argv[2],".","data");
name = Catenate(prefix,argv[c],".","data");
if (unlink(name) != 0)
fprintf(stderr,"%s: [WARNING] Couldn't delete file %s during abort\n",Prog_Name,name);
}
free(prefix);
}
free(prefix);
exit (1);
}
This diff is collapsed.
......@@ -150,7 +150,7 @@ int Count_Args(char *arg);
// Output
#define FWRITE(v,s,n,file) \
#define FFWRITE(v,s,n,file) \
{ if (fwrite(v,s,n,file) != (size_t) n) \
SYSTEM_WRITE_ERROR \
}
......@@ -179,7 +179,7 @@ int Count_Args(char *arg);
// Input
#define FREAD(v,s,n,file) \
#define FFREAD(v,s,n,file) \
{ if (fread(v,s,n,file) != (size_t) n) \
{ if (ferror(file)) \
SYSTEM_READ_ERROR \
......@@ -261,6 +261,7 @@ void Print_Read(char *s, int width);
void Lower_Read(char *s); // Convert read from numbers to lowercase letters (0-3 to acgt)
void Upper_Read(char *s); // Convert read from numbers to uppercase letters (0-3 to ACGT)
void Number_Read(char *s); // Convert read from letters to numbers
void Change_Read(char *s); // Convert read from one case to the other
void Letter_Arrow(char *s); // Convert arrow pw's from numbers to uppercase letters (0-3 to 1234)
void Number_Arrow(char *s); // Convert arrow pw string from letters to numbers
......@@ -273,8 +274,8 @@ void Number_Arrow(char *s); // Convert arrow pw string from letters to number
********************************************************************************************/
#define DB_QV 0x03ff // Mask for 3-digit quality value
#define DB_CSS 0x0400 // This is the second or later of a group of reads from a given insert
#define DB_BEST 0x0800 // This is the longest read of a given insert (may be the only 1)
#define DB_CSS 0x0400 // This is the second or later of a group of subreads from a given insert
#define DB_BEST 0x0800 // This is the "best" subread of a given insert (may be the only 1)
#define DB_ARROW 0x2 // DB is an arrow DB
#define DB_ALL 0x1 // all wells are in the trimmed DB
......@@ -299,13 +300,19 @@ typedef struct
// contains the variable length data
// data != NULL && size == 8: anno is an array of nreads+1 int64's and data[anno[i]..anno[i+1])
// contains the variable length data
// if open is set then the data is not loaded if present, rather data is an open file pointer
// set for reading.
typedef struct _track
{ struct _track *next; // Link to next track
char *name; // Symbolic name of track
int size; // Size in bytes of anno records
int nreads; // Number of reads in track
void *anno; // over [0,nreads]: read i annotation: int, int64, or 'size' records
void *data; // data[anno[i] .. anno[i+1]-1] is data if data != NULL
int *alen; // length of track data for read i (if data != NULL)
void *data; // data[anno[i] .. anno[i]+alen[i[) is data for read i (if data != NULL)
int loaded; // Is track data loaded in memory?
int64 dmax; // Largest read data segment in bytes
} DAZZ_TRACK;
// The tailing part of a .anno track file can contain meta-information produced by the
......@@ -345,6 +352,19 @@ typedef struct
FILE *quiva; // the open file pointer to the .qvs file
} DAZZ_QV;
// The information for accessing Arrow streams is in a DAZZ_ARW record that is a "pseudo-track"
// named ".@arw" and is always the first track record in the list (if present).
// Since normal track names cannot begin with a . (this is enforced), this pseudo-track
// is never confused with a normal track.
typedef struct
{ struct _track *next;
char *name;
int64 *aoff; // offset in file or memory of arrow vector for read i
void *arrow; // FILE * to the .arw file if not loaded, memory block otherwise
int loaded; // Are arrow vectors loaded in memory?
} DAZZ_ARROW;
// The DB record holds all information about the current state of an active DB including an
// array of DAZZ_READS, one per read, and a linked list of DAZZ_TRACKs the first of which
// is always a DAZZ_QV pseudo-track (if the QVs have been loaded).
......@@ -393,7 +413,7 @@ typedef struct
#define DB_NFILE "files = %9d\n" // number of files
#define DB_FDATA " %9d %s %s\n" // last read index + 1, fasta prolog, file name
#define DB_NBLOCK "blocks = %9d\n" // number of blocks
#define DB_PARAMS "size = %10lld cutoff = %9d all = %1d\n" // block size, len cutoff, all in well
#define DB_PARAMS "size = %11lld cutoff = %9d all = %1d\n" // block size, len cutoff, all in well
#define DB_BDATA " %9d %9d\n" // First read index (untrimmed), first read index (trimmed)
......@@ -430,26 +450,104 @@ int Open_DB(char *path, DAZZ_DB *db);
void Trim_DB(DAZZ_DB *db);
// Return the size in bytes of the given DB
int64 sizeof_DB(DAZZ_DB *db);
// For the DB or DAM "path" = "prefix/root.[db|dam]", find all the files for that DB, i.e. all
// those of the form "prefix/[.]root.part" and call actor with the complete path to each file
// pointed at by path, and the suffix of the path by extension. The . proceeds the root
// name if the defined constant HIDE_FILES is set. Always the first call is with the
// path "prefix/root.[db|dam]" and extension "db" or "dam". There will always be calls for
// "prefix/[.]root.idx" and "prefix/[.]root.bps". All other calls are for *tracks* and
// so this routine gives one a way to know all the tracks associated with a given DB.
// -1 is returned if the path could not be found, and 1 is returned if an error (reported
// to EPLACE) occured and INTERACTIVE is defined. Otherwise a 0 is returned.
int List_DB_Files(char *path, void actor(char *path, char *extension));
// Shut down an open 'db' by freeing all associated space, including tracks and QV structures,
// and any open file pointers. The record pointed at by db however remains (the user
// supplied it and so should free it).
void Close_DB(DAZZ_DB *db);
// Return the size in bytes of the given DB
int64 sizeof_DB(DAZZ_DB *db);
/*******************************************************************************************
*
* READ ROUTINES
*
********************************************************************************************/
// If QV pseudo track is not already in db's track list, then load it and set it up.
// The database must not have been trimmed yet. -1 is returned if a .qvs file is not
// present, and 1 is returned if an error (reported to EPLACE) occured and INTERACTIVE
// is defined. Otherwise a 0 is returned.
// Allocate and return a buffer big enough for the largest read in 'db'.
// **NB** free(x-1) if x is the value returned as *prefix* and suffix '\0'(4)-byte
// are needed by the alignment algorithms. If cannot allocate memory then return NULL
// if INTERACTIVE is defined, or print error to stderr and exit otherwise.
char *New_Read_Buffer(DAZZ_DB *db);
int Load_QVs(DAZZ_DB *db);
// Load into 'read' the i'th read in 'db'. As a lower case ascii string if ascii is 1, an
// upper case ascii string if ascii is 2, and a numeric string over 0(A), 1(C), 2(G), and 3(T)
// otherwise. A '\0' (or 4) is prepended and appended to the string so it has a delimeter
// for traversals in either direction. A non-zero value is returned if an error occured
// and INTERACTIVE is defined.
// Remove the QV pseudo track, all space associated with it, and close the .qvs file.
int Load_Read(DAZZ_DB *db, int i, char *read, int ascii);
void Close_QVs(DAZZ_DB *db);
// Load into 'read' the subread [beg,end] of the i'th read in 'db' and return a pointer to the
// the start of the subinterval (not necessarily = to read !!! ). As a lower case ascii
// string if ascii is 1, an upper case ascii string if ascii is 2, and a numeric string
// over 0(A), 1(C), 2(G), and 3(T) otherwise. A '\0' (or 4) is prepended and appended to
// the string holding the substring so it has a delimeter for traversals in either direction.
// A NULL pointer is returned if an error occured and INTERACTIVE is defined.
char *Load_Subread(DAZZ_DB *db, int i, int beg, int end, char *read, int ascii);
// Allocate a block big enough for all the uncompressed read sequences and read and uncompress
// the reads into it, reset the 'boff' in each read record to be its in-memory offset,
// and set the bases pointer to point at the block after closing the bases file. Return
// with a zero, except when an error occurs and INTERACTIVE is defined in which
// case return wtih 1.
int Load_All_Reads(DAZZ_DB *db, int ascii);
/*******************************************************************************************
*
* ARROW ROUTINES
*
********************************************************************************************/
// If the Arrow pseudo track is not already in db's track list, then load it and set it up.
// The database reads must not have been loaded with Load_All_Reads yet.
// -1 is returned if a .arw file is not present, and 1 is returned if an error (reported
// to EPLACE) occured and INTERACTIVE is defined. Otherwise a 0 is returned.
int Open_Arrow(DAZZ_DB *db);
// Exactly the same as Load_Read, save the arrow information is loaded, not the DNA sequence,
// and there is only a choice between numeric (0) or ascii (1);
int Load_Arrow(DAZZ_DB *db, int i, char *read, int ascii);
// Allocate a block big enough for all the uncompressed Arrow vectors, read them into it,
// reset the 'off' in each arrow record to be its in-memory offset, and set the
// arrow pointer to point at the block after closing the arrow file. If ascii is
// non-zero then the arrows are converted to 0123 ascii, otherwise the arrows are left
// as numeric strings over [0-3].
int Load_All_Arrows(DAZZ_DB *db, int ascii);
// Remove the Arrow pseudo track, all space associated with it, and close the .arw file.
void Close_Arrow(DAZZ_DB *);
/*******************************************************************************************
*
* TRACK ROUTINES
*
********************************************************************************************/
// Look up the file and header in the file of the indicated track. Return:
// 1: Track is for trimmed DB
......@@ -466,30 +564,50 @@ void Close_QVs(DAZZ_DB *db);
int Check_Track(DAZZ_DB *db, char *track, int *kind);
// If track is not already in the db's track list, then allocate all the storage for it,
// read it in from the appropriate file, add it to the track list, and return a pointer
// If track is not already in the db's track list, then allocate all the storage for the anno
// index, read it in from the appropriate file, add it to the track list, and return a pointer
// to the newly created DAZZ_TRACK record. If the track does not exist or cannot be
// opened for some reason, then NULL is returned if INTERACTIVE is defined. Otherwise
// the routine prints an error message to stderr and exits if an error occurs, and returns
// with NULL only if the track does not exist.
DAZZ_TRACK *Load_Track(DAZZ_DB *db, char *track);
DAZZ_TRACK *Open_Track(DAZZ_DB *db, char *track);
// Allocate a data buffer large enough to hold the longest read data block that will occur
// in the track. If cannot allocate memory then return NULL if INTERACTIVE is defined,
// or print error to stderr and exit otherwise.
void *New_Track_Buffer(DAZZ_TRACK *track);
// Load into 'data' the read data block for read i's "track" data. Return the length of
// the data in bytes, unless an error occurs and INTERACTIVE is defined in which case
// return wtih -1.
// Assumming file pointer for afile is correctly positioned at the start of a extra item,
// and aname is the name of the .anno file, decode the value present and places it in
int Load_Track_Data(DAZZ_TRACK *track, int i, void *data);
// Allocate a block big enough for all the track data and read the data into it,
// reset the 'off' in each anno pointer to be its in-memory offset, and set the
// data pointer to point at the block after closing the data file. Return with a
// zero, except when an error occurs and INTERACTIVE is defined in which
// case return wtih 1.
int Load_All_Track_Data(DAZZ_TRACK *track);
// Assumming file pointer for afile is correctly positioned at the start of an extra item,
// and aname is the name of the .anno file, decode the value present and place it in
// extra if extra->nelem == 0, otherwise reduce the value just read into extra according
// according the to the directive given by 'accum'. Leave the read poinrt at the next
// according to the directive given by 'accum'. Leave the read pointer at the next
// extra or end-of-file.
// Returns:
// 1 if at the end of file,
// 0 if item was read and folded correctly,
// -1 if there was a system IO or allocation error (if interactive), and
// -2 if the new value could not be reduced into the currenct value of extra (interactive)
// -2 if the new value could not be reduced into the current value of extra (interactive)
int Read_Extra(FILE *afile, char *aname, DAZZ_EXTRA *extra);
// Write extra record to end of file afile and advance write pointer
// If interactive, then return non-zero on error, if bash, then print
// If interactive, then return non-zero on error, if batch, then print
// and halt if an error
int Write_Extra(FILE *afile, DAZZ_EXTRA *extra);
......@@ -497,36 +615,21 @@ int Write_Extra(FILE *afile, DAZZ_EXTRA *extra);
// If track is on the db's track list, then it is removed and all storage associated with it
// is freed.
void Close_Track(DAZZ_DB *db, char *track);
// Allocate and return a buffer big enough for the largest read in 'db'.
// **NB** free(x-1) if x is the value returned as *prefix* and suffix '\0'(4)-byte
// are needed by the alignment algorithms. If cannot allocate memory then return NULL
// if INTERACTIVE is defined, or print error to stderr and exit otherwise.
char *New_Read_Buffer(DAZZ_DB *db);
// Load into 'read' the i'th read in 'db'. As a lower case ascii string if ascii is 1, an
// upper case ascii string if ascii is 2, and a numeric string over 0(A), 1(C), 2(G), and 3(T)
// otherwise. A '\0' (or 4) is prepended and appended to the string so it has a delimeter
// for traversals in either direction. A non-zero value is returned if an error occured
// and INTERACTIVE is defined.
int Load_Read(DAZZ_DB *db, int i, char *read, int ascii);
void Close_Track(DAZZ_DB *db, DAZZ_TRACK *track);
// Exactly the same as Load_Read, save the arrow information is loaded, not the DNA sequence,
// and there is only a choice between numeric (0) or ascii (1);
int Load_Arrow(DAZZ_DB *db, int i, char *read, int ascii);
/*******************************************************************************************
*
* QV ROUTINES
*
********************************************************************************************/
// Load into 'read' the subread [beg,end] of the i'th read in 'db' and return a pointer to the
// the start of the subinterval (not necessarily = to read !!! ). As a lower case ascii
// string if ascii is 1, an upper case ascii string if ascii is 2, and a numeric string
// over 0(A), 1(C), 2(G), and 3(T) otherwise. A '\0' (or 4) is prepended and appended to
// the string holding the substring so it has a delimeter for traversals in either direction.
// A NULL pointer is returned if an error occured and INTERACTIVE is defined.
// If QV pseudo track is not already in db's track list, then load it and set it up.
// The database must not have been trimmed yet. -1 is returned if a .qvs file is not
// present, and 1 is returned if an error (reported to EPLACE) occured and INTERACTIVE
// is defined. Otherwise a 0 is returned.
char *Load_Subread(DAZZ_DB *db, int i, int beg, int end, char *read, int ascii);
int Open_QVs(DAZZ_DB *db);
// Allocate a set of 5 vectors large enough to hold the longest QV stream that will occur
// in the database. If cannot allocate memory then return NULL if INTERACTIVE is defined,
......@@ -546,47 +649,38 @@ char **New_QV_Buffer(DAZZ_DB *db);
int Load_QVentry(DAZZ_DB *db, int i, char **entry, int ascii);
// Allocate a block big enough for all the uncompressed sequences, read them into it,
// reset the 'off' in each read record to be its in-memory offset, and set the
// bases pointer to point at the block after closing the bases file. If ascii is
// 1 then the reads are converted to lowercase ascii, if 2 then uppercase ascii, and
// otherwise the reads are left as numeric strings over 0(A), 1(C), 2(G), and 3(T).
// Return with a zero, except when an error occurs and INTERACTIVE is defined in which
// case return wtih 1.
// Remove the QV pseudo track, all space associated with it, and close the .qvs file.
int Read_All_Sequences(DAZZ_DB *db, int ascii);
void Close_QVs(DAZZ_DB *db);
// For the DB or DAM "path" = "prefix/root.[db|dam]", find all the files for that DB, i.e. all
// those of the form "prefix/[.]root.part" and call actor with the complete path to each file
// pointed at by path, and the suffix of the path by extension. The . proceeds the root
// name if the defined constant HIDE_FILES is set. Always the first call is with the
// path "prefix/root.[db|dam]" and extension "db" or "dam". There will always be calls for
// "prefix/[.]root.idx" and "prefix/[.]root.bps". All other calls are for *tracks* and
// so this routine gives one a way to know all the tracks associated with a given DB.
// -1 is returned if the path could not be found, and 1 is returned if an error (reported
// to EPLACE) occured and INTERACTIVE is defined. Otherwise a 0 is returned.
int List_DB_Files(char *path, void actor(char *path, char *extension));
/*******************************************************************************************
*
* @-SIGN EXPANSION ROUTINES
*
********************************************************************************************/
// Take a command line argument and interpret the '@' block number ranges.
// Parse_Block_Arg produces a Block_Looper iterator object that can then
// be invoked multiple times to iterate through all the files implied by
// Parse_Block_[LAS,DB]_Arg produces a Block_Looper iterator object that can then
// be invoked multiple times to iterate through all the file names implied by
// the @ pattern/range. Next_Block_Slice returns a string encoing the next
// slice files represented by an @-notation, and advances the iterator by
// that many files.
typedef void Block_Looper;
Block_Looper *Parse_Block_Arg(char *arg);
Block_Looper *Parse_Block_LAS_Arg(char *arg);
Block_Looper *Parse_Block_DB_Arg(char *arg);
FILE *Next_Block_Arg(Block_Looper *e_parse);
int Next_Block_Exists(Block_Looper *e_parse);
FILE *Next_Block_Arg(Block_Looper *e_parse);
void Reset_Block_Arg(Block_Looper *e_parse); // Reset iterator to first file
int Advance_Block_Arg(Block_Looper *e_parse); // Advance iterator to next file, 0 if none
void Free_Block_Arg(Block_Looper *e_parse); // Free the iterator
char *Next_Block_Slice(Block_Looper *e_parse,int slice);
void Reset_Block_Arg(Block_Looper *e_parse); // Reset iterator to first file
char *Block_Arg_Path(Block_Looper *e_parse); // Path of current file
char *Block_Arg_Root(Block_Looper *e_parse); // Root name of current file
void Free_Block_Arg(Block_Looper *e_parse); // Free the iterator
char *Block_Arg_Path(Block_Looper *e_parse); // Path of current file, must free
char *Block_Arg_Root(Block_Looper *e_parse); // Root name of current file, must free
#endif // _DAZZ_DB
#include <stdlib.h>
#include <stdio.h>
#include "DB.h"
int main(int argc, char *argv[])
{ char code, which;
int64 total;
int len, rno, mno, qual;
int vec[4];
char *buffer[256];
char **mname;
int **masks;
(void) argv;
if (argc > 1)
{ fprintf(stderr,"Usage: DBa2b <(ascii) >(binary)\n");
exit (1);
}
while (scanf(" %c",&code) == 1) // Header lines
if (code == '@' || code == '+')
{ scanf(" %c",&which);
fwrite(&code,sizeof(char),1,stdout);
fwrite(&which,sizeof(char),1,stdout);
if (which == 'T')
{ scanf("%d %lld",&mno,&total);
fwrite(&mno,sizeof(int),1,stdout);
fwrite(&total,sizeof(int64),1,stdout);
if (code == '@')
{ masks[mno] = (int *) malloc(sizeof(int)*2*total);
scanf(" %d",&len);
mname[mno] = (char *) malloc(sizeof(char)*(len+1));
scanf(" %s",mname[mno]);
fwrite(&len,sizeof(int),1,stdout);
fwrite(mname[mno],sizeof(char),len,stdout);
}
}
else
{ scanf(" %lld",&total);
if (which == 'M')
{ masks = (int **) malloc(sizeof(int *)*total);
mname = (char **) malloc(sizeof(char *)*total);
}
else if (code == '@')
buffer[(int) which] = malloc(total+1);
fwrite(&total,sizeof(int64),1,stdout);
}
}
else
{ ungetc(code,stdin);
break;
}
buffer['A'] = buffer['c'] = buffer['d'] =
buffer['i'] = buffer['m'] = buffer['s'] = buffer['S'];
while (scanf(" %c",&code) == 1) // For each data line do
{ fwrite(&code,sizeof(char),1,stdout);
switch (code)
{ case 'R': // Read
scanf(" %d",&rno);
fwrite(&rno,sizeof(int),1,stdout);
break;
case 'Q': // Read
scanf(" %d",&qual);
fwrite(&qual,sizeof(int),1,stdout);
break;
case 'L': // Well, Pulse range
scanf(" %d %d %d",vec,vec+1,vec+2);
fwrite(vec,sizeof(int),3,stdout);
break;
case 'N': // SNR values
scanf(" %d %d %d %d",vec,vec+1,vec+2,vec+3);
fwrite(vec,sizeof(int),4,stdout);
break;
case 'S': case 'A': case 'c': // DNA strings (2-bit compressible)
scanf(" %d",&len);
scanf(" %s",buffer[(int) code]);
if (code == 'A')
Number_Arrow(buffer[(int) code]);
else
Number_Read(buffer[(int) code]);
Compress_Read(len,buffer[(int) code]);
fwrite(&len,sizeof(int),1,stdout);
fwrite(buffer[(int) code],sizeof(char),COMPRESSED_LEN(len),stdout);
break;
case 'H': case 'I': case 'F': // All other string fields
case 'd': case 'i':
case 'm': case 's':
scanf(" %d",&len);
scanf(" %s",buffer[(int) code]);
fwrite(&len,sizeof(int),1,stdout);
fwrite(buffer[(int) code],sizeof(char),len,stdout);
break;
case 'T': // Mask
scanf("%d %d",&mno,&len);
for (int i = 0; i < len; i++)
scanf(" %d %d",masks[mno]+2*i,masks[mno]+2*i+1);
fwrite(&mno,sizeof(int),1,stdout);
fwrite(&len,sizeof(int),1,stdout);
fwrite(masks[mno],sizeof(int),2*len,stdout);
}
}
exit (0);
}
#include <stdlib.h>
#include <stdio.h>
#include "DB.h"
int main(int argc, char *argv[])
{ char code, which;
int64 total;
int len, rno, mno, qual;
int vec[4];
char *buffer[256];
char **mname;
int **masks;
(void) argv;
if (argc > 1)
{ fprintf(stderr,"Usage: DBb2a <(binary) >(ascii)\n");
exit (1);
}
if (fread(&code,sizeof(char),1,stdin) == 0)
code = 0;
while (code == '@' || code == '+')
{ fread(&which,sizeof(char),1,stdin);
printf("%c %c",code,which);
if (which == 'T')
{ fread(&mno,sizeof(int),1,stdin);
fread(&total,sizeof(int64),1,stdin);
printf("%d %lld",mno,total);
if (code == '@')
{ masks[mno] = (int *) malloc(sizeof(int)*2*total);
fread(&len,sizeof(int),1,stdin);
mname[mno] = (char *) malloc(sizeof(char)*(len+1));
fread(mname[mno],sizeof(char),len,stdin);
printf(" %d %.*s",len,len,mname[mno]);
}
printf("\n");
}
else
{ fread(&total,sizeof(int64),1,stdin);
if (which == 'M')
{ masks = (int **) malloc(sizeof(int *)*total);
mname = (char **) malloc(sizeof(char *)*total);
}
else if (code == '@')
buffer[(int) which] = malloc(total+1);
printf(" %lld\n",total);
}
if (fread(&code,sizeof(char),1,stdin) == 0)
code = 0;
}
buffer['A'] = buffer['c'] = buffer['d'] =
buffer['i'] = buffer['m'] = buffer['s'] = buffer['S'];
while (code != 0) // For each data line do
{ switch (code)
{ case 'R': // Read
fread(&rno,sizeof(int),1,stdin);
printf("R %d\n",rno);
break;
case 'Q': // Qual Value
fread(&qual,sizeof(int),1,stdin);
printf("Q %d\n",qual);
break;
case 'L': // Well, Pulse range
fread(vec,sizeof(int),3,stdin);
printf("L %d %d %d\n",vec[0],vec[1],vec[2]);
break;
case 'N': // SNR values
fread(vec,sizeof(int),4,stdin);
printf("N %d %d %d %d\n",vec[0],vec[1],vec[2],vec[3]);
break;
case 'S': case 'A': case 'c': // DNA strings (2-bit compressible)
fread(&len,sizeof(int),1,stdin);
fread(buffer[(int) code],sizeof(char),COMPRESSED_LEN(len),stdin);
Uncompress_Read(len,buffer[(int) code]);
if (code == 'A')
Letter_Arrow(buffer[(int) code]);
else
Lower_Read(buffer[(int) code]);
printf("%c %d %.*s\n",code,len,len,buffer[(int) code]);
break;
case 'H': case 'I': case 'F': // All other string fields
case 'd': case 'i':
case 'm': case 's':
fread(&len,sizeof(int),1,stdin);
fread(buffer[(int) code],sizeof(char),len,stdin);
printf("%c %d %.*s\n",code,len,len,buffer[(int) code]);
break;
case 'T': // Mask
fread(&mno,sizeof(int),1,stdin);
fread(&len,sizeof(int),1,stdin);
fread(masks[mno],sizeof(int),2*len,stdin);
printf("T%d %d",mno,len);
for (int i = 0; i < len; i++)
printf(" %d %d",masks[mno][2*i],masks[mno][2*i+1]);
printf("\n");
}
if (fread(&code,sizeof(char),1,stdin) == 0)
code = 0;
}
exit (0);
}
......@@ -21,7 +21,7 @@
#endif
static char *Usage[] =
{ "[-rhsaiqp] [-uU] [-m<mask>]+",
{ "[-rhsaiqf] [-uU] [-m<mask>]+",
" <path:db|dam> [ <reads:FILE> | <reads:range> ... ]"
};
......@@ -83,28 +83,18 @@ static int qv_map[51] =
'Y'
};
static int prof_map[41] =
{ '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C',
'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N',
};
int main(int argc, char *argv[])
{ DAZZ_DB _db, *db = &_db;
int Quiva_DB, Arrow_DB;
int FirstRead;
FILE *hdrs = NULL;
char *hdrs_name = NULL;
int64 *qv_idx = NULL;
uint8 *qv_val = NULL;
int64 *pf_idx = NULL;
uint8 *pf_val = NULL;
int nfiles;
char **flist = NULL;
char **fhead = NULL;
char **ffile = NULL;
int *findx = NULL;
char *empty = "";
int input_pts;
int reps = 0;
......@@ -113,11 +103,15 @@ int main(int argc, char *argv[])
FILE *input = NULL;
int TRIM, UPPER;
int DORED, DOSEQ, DOARW, DOQVS, DOHDR, DOIQV, DOPRF, DAM;
int DORED, DOSEQ, DOARW, DOQVS, DOHDR, DOIQV, DOFLN, DAM;
int MMAX, MTOP;
char **MASK;
DAZZ_TRACK **MTRACK;
int **MDATA;
DAZZ_TRACK *qv_track;
uint8 *qv_data = NULL;
// Process arguments
......@@ -137,7 +131,7 @@ int main(int argc, char *argv[])
if (argv[i][0] == '-')
switch (argv[i][1])
{ default:
ARG_FLAGS("hpqrsaiuU")
ARG_FLAGS("hfqrsaiuU")
break;
case 'm':
if (MTOP >= MMAX)
......@@ -161,15 +155,15 @@ int main(int argc, char *argv[])
DOSEQ = flags['s'];
DOARW = flags['a'];
DOHDR = flags['h'];
DOFLN = flags['f'];
DOIQV = flags['i'];
DOPRF = flags['p'];
if (argc <= 1)
{ fprintf(stderr,"Usage: %s %s\n",Prog_Name,Usage[0]);
fprintf(stderr," %*s %s\n",(int) strlen(Prog_Name),"",Usage[1]);
fprintf(stderr,"\n");
fprintf(stderr," -r: R # - read number\n");
fprintf(stderr," -h: H # string - original file name string (header)\n");
fprintf(stderr," -h: H # string - fasta header prefix\n");
fprintf(stderr," L # # # - location: well, pulse start, pulse end\n");
fprintf(stderr," Q # - quality of read (#/1000)\n");
fprintf(stderr," -s: S # string - sequence string\n");
......@@ -182,7 +176,7 @@ int main(int argc, char *argv[])
fprintf(stderr," i # string - Quiva insertion value string\n");
fprintf(stderr," m # string - Quiva merge value string\n");
fprintf(stderr," s # string - Quiva substitution value string\n");
fprintf(stderr," -p: P # string - repeat profile vector (as an ASCII string)\n");
fprintf(stderr," -f: F # string - file name for all until next F\n");
fprintf(stderr," -m: Tx #n (#b #e)^#n ");
fprintf(stderr,"- x'th track on command line, #n intervals all on same line\n");
fprintf(stderr,"\n");
......@@ -195,10 +189,6 @@ int main(int argc, char *argv[])
{ fprintf(stderr,"%s: -i and -u are incompatible\n",Prog_Name);
exit (1);
}
if ( ! TRIM && DOPRF)
{ fprintf(stderr,"%s: -p and -u are incompatible\n",Prog_Name);
exit (1);
}
}
// Open DB or DAM, and if a DAM open also .hdr file
......@@ -252,18 +242,25 @@ int main(int argc, char *argv[])
// Load QVs if requested
if (DOQVS)
{ if (Load_QVs(db) < 0)
{ if (Open_QVs(db) < 0)
{ fprintf(stderr,"%s: QVs requested, but no .qvs for data base\n",Prog_Name);
exit (1);
}
}
if (DOARW)
{ if (Open_Arrow(db) < 0)
{ fprintf(stderr,"%s: Arrow requested, but no .arr for data base\n",Prog_Name);
exit (1);
}
}
// Check tracks and load tracks for untrimmed DB
{ int i, status, kind;
MTRACK = Malloc(sizeof(DAZZ_TRACK *)*MTOP,"Allocation of track pointer vector");
if (MTRACK == NULL)
MDATA = Malloc(sizeof(int *)*MTOP,"Allocation of track data buffer pointers");
if (MTRACK == NULL || MDATA == NULL)
exit (1);
for (i = 0; i < MTOP; i++)
......@@ -282,7 +279,7 @@ int main(int argc, char *argv[])
exit (1);
}
else if (status == 0)
MTRACK[i] = Load_Track(db,MASK[i]);
MTRACK[i] = Open_Track(db,MASK[i]);
else if (status == 1 && !TRIM)
{ fprintf(stderr,"%s: Warning: %s track is for a trimmed db but -u is set.\n",
Prog_Name,MASK[i]);
......@@ -291,18 +288,23 @@ int main(int argc, char *argv[])
}
}
// If not a DAM then get prolog names and index ranges from the .db file
// If get prolog and file names and index ranges from the .db or .dam file
if (!DAM)
{ char *pwd, *root;
FILE *dstub;
char *dstub_name;
int i;
if (DAM)
root = Root(argv[1],".dam");
else
root = Root(argv[1],".db");
pwd = PathTo(argv[1]);
if (db->part > 0)
*rindex(root,'.') = '\0';
if (DAM)
dstub_name = Strdup(Catenate(pwd,"/",root,".dam"),"Allocating dam file name");
else
dstub_name = Strdup(Catenate(pwd,"/",root,".db"),"Allocating db file name");
dstub = Fopen(dstub_name,"r");
if (dstub_name == NULL || dstub == NULL)
......@@ -312,19 +314,24 @@ int main(int argc, char *argv[])
FSCANF(dstub,DB_NFILE,&nfiles)
flist = (char **) Malloc(sizeof(char *)*nfiles,"Allocating file list");
fhead = (char **) Malloc(sizeof(char *)*nfiles,"Allocating file list");
ffile = (char **) Malloc(sizeof(char *)*(nfiles+1),"Allocating file list");
findx = (int *) Malloc(sizeof(int *)*(nfiles+1),"Allocating file index");
if (flist == NULL || findx == NULL)
if (fhead == NULL || ffile == NULL || findx == NULL)
exit (1);
findx += 1;
findx[-1] = 0;
ffile += 1;
ffile[-1] = empty;
for (i = 0; i < nfiles; i++)
{ char prolog[MAX_NAME], fname[MAX_NAME];
FSCANF(dstub,DB_FDATA,findx+i,fname,prolog)
if ((flist[i] = Strdup(prolog,"Adding to file list")) == NULL)
if ((fhead[i] = Strdup(prolog,"Adding to file list")) == NULL)
exit (1);
if ((ffile[i] = Strdup(fname,"Adding to file list")) == NULL)
exit (1);
}
......@@ -373,19 +380,22 @@ int main(int argc, char *argv[])
for (i = 0; i < MTOP; i++)
{ status = Check_Track(db,MASK[i],&kind);
if (status < 0)
continue;
else if (status == 1)
MTRACK[i] = Load_Track(db,MASK[i]);
if (status > 0)
MTRACK[i] = Open_Track(db,MASK[i]);
}
FirstRead = db->tfirst;
}
else
FirstRead = db->ufirst;
{ int c;
for (c = 0; c < MTOP; c++)
MDATA[c] = (int *) New_Track_Buffer(MTRACK[c]);
}
if (DOIQV)
{ int status, kind;
DAZZ_TRACK *track;
status = Check_Track(db,"qual",&kind);
if (status == -2)
......@@ -396,27 +406,8 @@ int main(int argc, char *argv[])
{ fprintf(stderr,"%s: .qual-track not sync'd with db.\n",Prog_Name);
exit (1);
}
track = Load_Track(db,"qual");
qv_idx = (int64 *) track->anno;
qv_val = (uint8 *) track->data;
}
if (DOPRF)
{ int status, kind;
DAZZ_TRACK *track;
status = Check_Track(db,"prof",&kind);
if (status == -2)
{ fprintf(stderr,"%s: .prof-track does not exist for this db.\n",Prog_Name);
exit (1);
}
if (status == -1)
{ fprintf(stderr,"%s: .prof-track not sync'd with db.\n",Prog_Name);
exit (1);
}
track = Load_Track(db,"prof");
pf_idx = (int64 *) track->anno;
pf_val = (uint8 *) track->data;
qv_track = Open_Track(db,"qual");
qv_data = (uint8 *) New_Track_Buffer(qv_track);
}
// Process read index arguments into a list of read ranges
......@@ -509,25 +500,26 @@ int main(int argc, char *argv[])
{ DAZZ_READ *reads;
int c, b, e, i, m;
int map, substr;
int map, substr, last;
int64 noreads;
int64 seqmax, seqtot;
int64 iqvmax, iqvtot;
int64 prfmax, prftot;
int64 flnmax, flntot;
int64 hdrmax, hdrtot;
int64 trkmax[MTOP], trktot[MTOP];
map = 0;
reads = db->reads;
substr = 0;
last = -1;
noreads = 0;
seqmax = 0;
seqtot = 0;
iqvmax = 0;
iqvtot = 0;
prfmax = 0;
prftot = 0;
flnmax = 0;
flntot = 0;
hdrmax = 0;
hdrmax = 0;
hdrtot = 0;
......@@ -555,6 +547,15 @@ int main(int argc, char *argv[])
c += 2;
}
if (map > 0 && findx[map-1] <= b+FirstRead && b+FirstRead < findx[map])
;
else
{ map = 0;
while (b + FirstRead >= findx[map])
map += 1;
map -= 1;
}
for (i = b; i < e; i++)
{ int len, ten;
int fst, lst;
......@@ -565,6 +566,20 @@ int main(int argc, char *argv[])
noreads += 1;
if (DOFLN && i+FirstRead >= findx[map])
{ int ten;
if (strcmp(ffile[map+1],ffile[last]) != 0)
{ ten = strlen(ffile[map+1]);
if (flnmax < ten)
flnmax = ten;
flntot += ten;
last = map+1;
}
if (!DOHDR || DAM)
map += 1;
}
if (DOHDR)
{ int ten;
......@@ -575,24 +590,23 @@ int main(int argc, char *argv[])
FGETS(header,MAX_NAME,hdrs)
header[strlen(header)-1] = '\0';
ten = strlen(header);
if (hdrmax < ten)
hdrmax = ten;
hdrtot += ten;
}
else
{ while (i < findx[map-1])
map -= 1;
while (i >= findx[map])
map += 1;
ten = strlen(flist[map]);
}
else if (i+FirstRead >= findx[map])
{ map += 1;
ten = strlen(fhead[map]);
if (hdrmax < ten)
hdrmax = ten;
hdrtot += ten;
}
}
for (m = 0; m < MTOP; m++)
{ int64 *anno;
anno = (int64 *) MTRACK[m]->anno;
ten = ((anno[i+1]-anno[i]) >> 3);
{ ten = MTRACK[m]->alen[i];
if (ten > trkmax[m])
trkmax[m] = ten;
trktot[m] += ten;
......@@ -605,10 +619,6 @@ int main(int argc, char *argv[])
{ fprintf(stderr,"%s: Cannot select subreads when -i is requested\n",Prog_Name);
exit (1);
}
if (DOPRF)
{ fprintf(stderr,"%s: Cannot select subreads when -p is requested\n",Prog_Name);
exit (1);
}
}
else
{ fst = 0;
......@@ -622,17 +632,11 @@ int main(int argc, char *argv[])
seqtot += ten;
}
if (DOIQV)
{ int ten = qv_idx[i+1] - qv_idx[i];
{ int ten = qv_track->alen[i];
if (ten > iqvmax)
iqvmax = ten;
iqvtot += ten;
}
if (DOPRF)
{ int ten = pf_idx[i+1] - pf_idx[i];
if (ten > prfmax)
prfmax = ten;
prftot += ten;
}
}
}
......@@ -644,7 +648,7 @@ int main(int argc, char *argv[])
}
for (m = 0; m < MTOP; m++)
{ PRINTF("+ T%d %lld\n",m,trktot[m])
PRINTF("@ T%d %lld\n",m,trkmax[m])
PRINTF("@ T%d %lld %ld %s\n",m,trkmax[m],strlen(MASK[m]),MASK[m])
}
if (DOSEQ | DOQVS | DOARW)
{ PRINTF("+ S %lld\n",seqtot)
......@@ -654,9 +658,9 @@ int main(int argc, char *argv[])
{ PRINTF("+ I %lld\n",iqvtot)
PRINTF("@ I %lld\n",iqvmax)
}
if (DOPRF)
{ PRINTF("+ P %lld\n",prftot)
PRINTF("@ P %lld\n",prfmax)
if (DOFLN)
{ PRINTF("+ F %lld\n",flntot)
PRINTF("@ F %lld\n",flnmax)
}
}
......@@ -667,7 +671,7 @@ int main(int argc, char *argv[])
char *read, *arrow, **entry;
int c, b, e, i, m;
int substr;
int map;
int map, last;
char qvname[5] = { 'd', 'c', 'i', 'm', 's' };
read = New_Read_Buffer(db);
......@@ -683,6 +687,7 @@ int main(int argc, char *argv[])
map = 0;
reads = db->reads;
substr = 0;
last = -1;
if (input_pts)
iter = init_file_iterator(input);
......@@ -708,6 +713,15 @@ int main(int argc, char *argv[])
c += 2;
}
if (map > 0 && findx[map-1] <= b+FirstRead && b+FirstRead < findx[map])
;
else
{ map = 0;
while (b + FirstRead >= findx[map])
map += 1;
map -= 1;
}
for (i = b; i < e; i++)
{ int len;
int fst, lst;
......@@ -721,6 +735,16 @@ int main(int argc, char *argv[])
flags = r->flags;
qv = (flags & DB_QV);
if (DOFLN && i+FirstRead >= findx[map])
{ if (strcmp(ffile[map+1],ffile[last]) != 0)
{ PRINTF("F %ld %s\n",strlen(ffile[map+1]),ffile[map+1])
last = map+1;
}
if (!DOHDR || DAM)
map += 1;
}
if (DOHDR)
{ if (DAM)
{ char header[MAX_NAME];
......@@ -732,11 +756,10 @@ int main(int argc, char *argv[])
PRINTF("L %d %d %d\n",r->origin,r->fpulse,r->fpulse+len)
}
else
{ while (i < findx[map-1])
map -= 1;
while (i >= findx[map])
map += 1;
PRINTF("H %ld %s\n",strlen(flist[map]),flist[map])
{ if (i+FirstRead >= findx[map])
{ map += 1;
PRINTF("H %ld %s\n",strlen(fhead[map]),fhead[map])
}
PRINTF("L %d %d %d\n",r->origin,r->fpulse,r->fpulse+len)
if (Quiva_DB && qv > 0)
PRINTF("Q %d\n",qv)
......@@ -762,19 +785,16 @@ int main(int argc, char *argv[])
Load_Arrow(db,i,arrow,1);
for (m = 0; m < MTOP; m++)
{ int64 *anno;
int *data;
int64 s, f, j;
{ int *d;
int64 f, j;
anno = (int64 *) MTRACK[m]->anno;
data = (int *) MTRACK[m]->data;
d = MDATA[m];
f = (Load_Track_Data(MTRACK[m],i,d) >> 2);
s = (anno[i] >> 2);
f = (anno[i+1] >> 2);
PRINTF("T%d %lld ",m,(f-s)/2)
if (s < f)
{ for (j = s; j < f; j += 2)
PRINTF(" %d %d",data[j],data[j+1])
PRINTF("T%d %lld",m,f/2)
if (f > 0)
{ for (j = 0; j < f; j += 2)
PRINTF(" %d %d",d[j],d[j+1])
}
PRINTF("\n")
}
......@@ -799,26 +819,12 @@ int main(int argc, char *argv[])
}
if (DOIQV)
{ int64 k, e;
{ int j, f;
k = qv_idx[i];
e = qv_idx[i+1];
PRINTF("I %lld ",e-k)
while (k < e)
{ if (putchar(qv_map[qv_val[k++]]) == EOF)
SYSTEM_WRITE_ERROR
}
PRINTF("\n")
}
if (DOPRF)
{ int64 k, e;
k = pf_idx[i];
e = pf_idx[i+1];
PRINTF("P %lld ",e-k)
while (k < e)
{ if (putchar(prof_map[pf_val[k++]]) == EOF)
f = Load_Track_Data(qv_track,i,qv_data);
PRINTF("I %d ",f)
for (j = 0; j < f; j++)
{ if (putchar(qv_map[qv_data[j]]) == EOF)
SYSTEM_WRITE_ERROR
}
PRINTF("\n")
......@@ -851,8 +857,11 @@ int main(int argc, char *argv[])
{ int i;
for (i = 0; i < nfiles; i++)
free(flist[i]);
free(flist);
{ free(fhead[i]);
free(ffile[i]);
}
free(fhead);
free(ffile-1);
free(findx-1);
}
Close_DB(db);
......
......@@ -133,11 +133,11 @@ int main(int argc, char *argv[])
dfile = Fopen(Catenate(pwd,PATHSEP,root,".dust.data"),"w");
if (dfile == NULL || afile == NULL)
exit (1);
FWRITE(&(db->nreads),sizeof(int),1,afile)
FWRITE(&size,sizeof(int),1,afile)
FFWRITE(&(db->nreads),sizeof(int),1,afile)
FFWRITE(&size,sizeof(int),1,afile)
nreads = 0;
indx = 0;
FWRITE(&indx,sizeof(int64),1,afile)
FFWRITE(&indx,sizeof(int64),1,afile)
}
else
{ dfile = Fopen(Catenate(pwd,PATHSEP,root,".dust.data"),"r+");
......@@ -151,8 +151,8 @@ int main(int argc, char *argv[])
exit(0);
}
FSEEKO(afile,0,SEEK_SET)
FWRITE(&(db->nreads),sizeof(int),1,afile)
FWRITE(&size,sizeof(int),1,afile)
FFWRITE(&(db->nreads),sizeof(int),1,afile)
FFWRITE(&size,sizeof(int),1,afile)
FSEEKO(afile,0,SEEK_END)
FSEEKO(dfile,0,SEEK_END)
FTELLO(indx,dfile)
......@@ -435,8 +435,8 @@ int main(int argc, char *argv[])
}
mtop = mask + ntop;
indx += ntop*sizeof(int);
FWRITE(&indx,sizeof(int64),1,afile)
FWRITE(mask1,sizeof(int),ntop,dfile)
FFWRITE(&indx,sizeof(int64),1,afile)
FFWRITE(mask1,sizeof(int),ntop,dfile)
}
#ifdef DEBUG
......
......@@ -226,14 +226,20 @@ int main(int argc, char *argv[])
}
}
// Load QVs if requested
// Load QVs or Arrows if requested
if (DOQVS)
{ if (Load_QVs(db) < 0)
{ if (Open_QVs(db) < 0)
{ fprintf(stderr,"%s: QVs requested, but no .qvs for data base\n",Prog_Name);
exit (1);
}
}
if (DOARR)
{ if (Open_Arrow(db) < 0)
{ fprintf(stderr,"%s: Arrow requested, but no .arr for data base\n",Prog_Name);
exit (1);
}
}
// Check tracks and load tracks for untrimmed DB
......@@ -248,7 +254,7 @@ int main(int argc, char *argv[])
else if (kind != MASK_TRACK)
printf("%s: Warning: %s track is not a mask track.\n",Prog_Name,MASK[i]);
else if (status == 0)
Load_Track(db,MASK[i]);
Open_Track(db,MASK[i]);
else if (status == 1 && !TRIM)
printf("%s: Warning: %s track is for a trimmed db but -u is set.\n",Prog_Name,MASK[i]);
}
......@@ -336,10 +342,8 @@ int main(int argc, char *argv[])
for (i = 0; i < MTOP; i++)
{ status = Check_Track(db,MASK[i],&kind);
if (status < 0)
continue;
else if (status == 1 && kind == MASK_TRACK)
Load_Track(db,MASK[i]);
if (status == 1 && kind == MASK_TRACK)
Open_Track(db,MASK[i]);
}
}
......@@ -432,26 +436,35 @@ int main(int argc, char *argv[])
// range pairs in pts[0..reps) and according to the display options.
{ DAZZ_READ *reads;
DAZZ_TRACK *first;
DAZZ_TRACK *first, *track;
char *read, *arrow, **entry;
int *data[MTOP];
int c, b, e, i;
int hilight, substr;
int map;
int (*iscase)(int);
read = New_Read_Buffer(db);
if (DOQVS)
{ entry = New_QV_Buffer(db);
arrow = NULL;
first = db->tracks->next;
}
else
else if (DOARR)
{ entry = NULL;
first = db->tracks;
}
if (DOARR)
arrow = New_Read_Buffer(db);
first = db->tracks->next;
}
else
{ entry = NULL;
arrow = NULL;
first = db->tracks;
}
c = 0;
for (track = first; track != NULL; track = track->next)
data[c++] = (int *) New_Track_Buffer(track);
if (UPPER == 1)
{ hilight = 'A'-'a';
......@@ -491,7 +504,6 @@ int main(int argc, char *argv[])
int flags, qv;
float snr[4];
DAZZ_READ *r;
DAZZ_TRACK *track;
r = reads + i;
len = r->rlen;
......@@ -549,32 +561,30 @@ int main(int argc, char *argv[])
if (DOARR)
Load_Arrow(db,i,arrow,1);
for (track = first; track != NULL; track = track->next)
{ int64 *anno;
int *data;
int64 s, f, j;
int bd, ed, m;
{ int t;
anno = (int64 *) track->anno;
data = (int *) track->data;
for (t = 0, track = first; track != NULL; track = track->next, t += 1)
{ int *d;
int64 j, v;
int bd, ed, m;
s = (anno[i] >> 2);
f = (anno[i+1] >> 2);
if (s < f)
{ for (j = s; j < f; j += 2)
{ bd = data[j];
ed = data[j+1];
d = data[t];
v = (Load_Track_Data(track,i,d) >> 2);
if (v > 0)
{ PRINTF("> %s:",track->name)
for (j = 0; j < v; j += 2)
{ bd = d[j];
ed = d[j+1];
if (DOSEQ)
for (m = bd; m < ed; m++)
if (iscase(read[m]))
read[m] = (char) (read[m] + hilight);
if (j == s)
PRINTF("> %s:",track->name)
PRINTF(" [%d,%d]",bd,ed)
}
PRINTF("\n")
}
}
}
if (QUIVA)
{ int k;
......
......@@ -158,7 +158,7 @@ int main(int argc, char *argv[])
for (i = 0; i < nfiles; i++)
FGETS(buffer,2*MAX_NAME+100,dbfile)
FREAD(&dbs,sizeof(DAZZ_DB),1,ixfile)
FFREAD(&dbs,sizeof(DAZZ_DB),1,ixfile)
if (dbs.cutoff >= 0 && !FORCE)
{ printf("You are about to overwrite the current partition settings. This\n");
......@@ -286,9 +286,9 @@ int main(int argc, char *argv[])
dbs.allarr &= ~DB_ALL;
dbs.treads = treads;
FSEEKO(ixfile,0,SEEK_SET)
FWRITE(&dbs,sizeof(DAZZ_DB),1,ixfile)
FFWRITE(&dbs,sizeof(DAZZ_DB),1,ixfile)
if (SELECT >= 0)
FWRITE(reads,sizeof(DAZZ_READ),nreads,ixfile)
FFWRITE(reads,sizeof(DAZZ_READ),nreads,ixfile)
}
FCLOSE(ixfile)
......
......@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
else if (kind != MASK_TRACK)
fprintf(stderr,"%s: Warning: %s track is not a mask track.\n",Prog_Name,MASK[i]);
else if (status == 0)
Load_Track(db,MASK[i]);
Open_Track(db,MASK[i]);
else if (status == 1 && !TRIM)
fprintf(stderr,"%s: Warning: %s track is for a trimmed db but -u is set.\n",
Prog_Name,MASK[i]);
......@@ -124,7 +124,7 @@ int main(int argc, char *argv[])
if (status < 0)
continue;
else if (status == 1)
Load_Track(db,MASK[i]);
Open_Track(db,MASK[i]);
}
}
}
......@@ -267,12 +267,17 @@ int main(int argc, char *argv[])
DAZZ_TRACK *track;
for (track = db->tracks; track != NULL; track = track->next)
{ char *data = track->data;
int64 *anno = (int64 *) track->anno;
{ char *data;
int64 *anno;
int *idata, *edata;
int64 ave, dev, btot;
int k, rlen, cum;
Load_All_Track_Data(track);
data = track->data;
anno = (int64 *) track->anno;
totlen = 0;
numint = 0;
maxlen = 0;
......@@ -341,6 +346,8 @@ int main(int argc, char *argv[])
}
}
printf("\n");
Close_Track(db,track);
}
}
......
......@@ -139,7 +139,7 @@ int main(int argc, char *argv[])
for (i = 0; i < nfiles; i++)
FGETS(buffer,2*MAX_NAME+100,dbfile)
FREAD(&dbs,sizeof(DAZZ_DB),1,ixfile)
FFREAD(&dbs,sizeof(DAZZ_DB),1,ixfile)
if (dbs.cutoff >= 0)
{ if (!FORCE)
......@@ -248,9 +248,9 @@ int main(int argc, char *argv[])
dbs.allarr &= ~DB_ALL;
dbs.treads = t;
FSEEKO(ixfile,0,SEEK_SET)
FWRITE(&dbs,sizeof(DAZZ_DB),1,ixfile)
FFWRITE(&dbs,sizeof(DAZZ_DB),1,ixfile)
if (SELECT >= 0)
FWRITE(reads,sizeof(DAZZ_READ),nreads,ixfile)
FFWRITE(reads,sizeof(DAZZ_READ),nreads,ixfile)
}
FCLOSE(ixfile)
......
......@@ -89,8 +89,8 @@ int main(int argc, char *argv[])
if (index_name == NULL || index == NULL)
exit (1);
FWRITE(&db,sizeof(DAZZ_DB),1,index)
FWRITE(db.reads,sizeof(DAZZ_READ),db.nreads,index)
FFWRITE(&db,sizeof(DAZZ_DB),1,index)
FFWRITE(db.reads,sizeof(DAZZ_READ),db.nreads,index)
FCLOSE(index);
}
......
......@@ -3,7 +3,7 @@ DEST_DIR = ~/bin
CFLAGS = -O3 -Wall -Wextra -Wno-unused-result -fno-strict-aliasing
ALL = fasta2DB DB2fasta quiva2DB DB2quiva DBsplit DBdust Catrack DBshow DBstats DBrm DBmv \
simulator fasta2DAM DAM2fasta DBdump rangen arrow2DB DB2arrow DBwipe DBtrim
simulator fasta2DAM DAM2fasta DBdump rangen arrow2DB DB2arrow DBwipe DBtrim DBa2b DBb2a
all: $(ALL)
......@@ -67,6 +67,11 @@ DAM2fasta: DAM2fasta.c DB.c DB.h QV.c QV.h
DBwipe: DBwipe.c DB.c DB.h QV.c QV.h
gcc $(CFLAGS) -o DBwipe DBwipe.c DB.c QV.c -lm
DBa2b: DBa2b.c DB.c DB.h QV.c QV.h
gcc $(CFLAGS) -o DBa2b DBa2b.c DB.c QV.c -lm
DBb2a: DBb2a.c DB.c DB.h QV.c QV.h
gcc $(CFLAGS) -o DBb2a DBb2a.c DB.c QV.c -lm
clean:
rm -f $(ALL)
......
......@@ -2,6 +2,7 @@
## _Author: Gene Myers_
## _First: July 17, 2013_
## _Current: April 19, 2019_
For typeset documentation, examples of use, and design philosophy please go to
my [blog](https://dazzlerblog.wordpress.com/command-guides/dazz_db-command-guide).
......@@ -157,7 +158,9 @@ in a given named input (i.e. all sources other than -i without a name) can only
added consecutively to the DB (this is checked by the command). The .fasta headers must
be in the "Pacbio" format (i.e. the output of the Pacbio tools or our dextract program)
and the well, pulse interval, and read quality are extracted from the header and kept
with each read record. If the files are being added to an existing database, and the
with each read record. The headers may now also be those Pacbio outputs for CCS data
wherein the pulse range is replaced by the string "ccs" and in which case only the
well number is recorded. If the files are being added to an existing database, and the
partition settings of the DB have already been set (see DBsplit below), then the
partitioning of the database is updated to include the new data. A file may contain
the data from multiple SMRT cells provided the reads for each SMRT cell are consecutive
......@@ -314,11 +317,12 @@ This permits job parallelism in block-sized chunks, and the resulting sequence o
block tracks can then be merged into a track for the entire untrimmed DB with Catrack.
```
12. Catrack [-vfd] <path:db|dam> <track:name>
12. Catrack [-vfd] <path:db|dam> <track:name> ...
```
Find all block tracks of the form .\<path\>.#.\<track\>... and concatenate them into a single
track, .\<path\>.\<track\>..., for the given DB or DAM. The block track files must all
track, .\<path\>.\<track\>..., for the given DB or DAM. Do so for each track name present on
the command line. The block track files must all
encode the same kind of track data (this is checked), and the files must exist for
block 1, 2, 3, ... up to the last block number. If the -f option is set, then the
concatenation takes place regardless of whether or not the single, combined track
......@@ -365,7 +369,7 @@ fasta2DB, quiva2D, and arrow2DB, giving one a simple way to make a DB of a subse
the reads for testing purposes.
```
14. DBdump [-rhsaqip] [-uU] [-m<mask>]+
14. DBdump [-rhsaqif] [-uU] [-m<mask>]+
<path:db|dam> [ <reads:FILE> | <reads:range> ... ]
```
......@@ -390,7 +394,7 @@ the 4 SNR channel values on an N-line,
* -i requests that the intrinsic quality values be output on an I-line.
* -p requests the repeat profile be output (if available) on a P-line, on a P-line
* -f requests the source file name is output just before the first read data in the file on a F-line.
* -m\<track\> requests that mask \<track\> be output on a T-line.
......@@ -404,9 +408,8 @@ separated by a single blank space. Strings are output as first an integer givin
length of the string, a blank space, and then the string terminated by a new-line.
Intrinsic quality values are between 0 and 50, inclusive, and a vector of said are
displayed as an alphabetic string where 'a' is 0, 'b' is '1', ... 'z' is 25, 'A' is
26, 'B' is 27, ... and 'Y' is 50. Repeat profiles are also displayed as string where
'_' denotes 0 repetitions, and then 'a' through 'N' denote the values 1 through 40,
respectively. The set of all possible lines is as follows:
26, 'B' is 27, ... and 'Y' is 50.
The set of all possible lines is as follows:
```
R # - read number
......@@ -418,28 +421,38 @@ respectively. The set of all possible lines is as follows:
S # string - sequence string
A # string - arrow pulse-width string
I # string - intrinsic quality vector (as an ASCII string)
P # string - repeat profile vector (as an ASCII string)
F # string - name of source file of following data
d # string - Quiva deletion values (as an ASCII string)
c # string - Quiva deletion character string
i # string - Quiva insertion value string
m # string - Quiva merge value string
s # string - Quiva substitution value string
+ X # - Total amount of X (X = H or S or I or P or R or M or T#)
@ X # - Maximum amount of X (X = H or S or I or P or T#)
+ X # - Total amount of X (X = H or S or I or F or R or M or T#)
@ X # - Maximum amount of X (X = H or S or I or F or T#)
```
1-code lines that begin with + or @ are always the first lines in the output. They
give size information about what is contained in the output. That is '+ X #' gives
the number of reads (X=R), the number of masks (X=M), or the total number of
characters in all headers (X=H), sequences (X=S), intrinsic quality vectors (X=I),
read profile vector (X=P), or track (X=T#). And '@ X #' gives the maximum number of
characters in any header (X=H), sequence (X=S), intrincic quality vector (X=I), read
profile vector (X=P), or track (X=T#). The size numbers for the Quiva strings and
file names (X=F), or track (X=T#). And '@ X #' gives the maximum number of
characters in any header (X=H), sequence (X=S), intrincic quality vector (X=I),
names (X=F), or track (X=T#). The size numbers for the Quiva strings and
Arrow pulse width strings are identical to that for the sequence as they are all of
the same length for any given entry.
```
15. DBstats [-nu] [-b<int(1000)] [-m<mask>]+ <path:db|dam>
15a. DBa2b
15b. DBb2a
```
Pipes (stdin to stdout) that convert an ASCII output produced by DBdump into a compressed
binary representation (DBa2b) and vice verse (DBb2a). The idea is to save disk space by
keeping the dumps in a more compessed format.
```
16. DBstats [-nu] [-b<int(1000)] [-m<mask>]+ <path:db|dam>
```
Show overview statistics for all the reads in the trimmed data base \<path\>.db or
......@@ -451,7 +464,7 @@ intervals along the read can be specified with the -m option in which case a sum
and a histogram of the interval lengths is displayed.
```
16. DBrm [-v] <path:db|dam> ...
17. DBrm [-v] <path:db|dam> ...
```
Delete all the files for the given data bases. Do not use rm to remove a database, as
......@@ -460,14 +473,14 @@ files, and all of these are removed by DBrm.
If the -v option is set then every file deleted is listed.
```
17. DBmv [-v] <old:db|dam> <new:db|dam>
18. DBmv [-v] <old:db|dam> <new:db|dam>
```
Rename all the files for the data base old to use the new root.
If the -v option is set then every file move is displayed.
```
18. DBwipe <path:db|dam> ...
19. DBwipe <path:db|dam>
```
Delete any Arrow or Quiver data from the given databases. This removes the .arw or
......@@ -475,7 +488,7 @@ Delete any Arrow or Quiver data from the given databases. This removes the .arw
or Quiver. Basically, converts an A-DB or Q-DB back to a simple S-DB.
```
19. simulator <genome:dam> [-CU] [-m<int(10000)>] [-s<int(2000)>] [-e<double(.15)]
20. simulator <genome:dam> [-CU] [-m<int(10000)>] [-s<int(2000)>] [-e<double(.15)]
[-c<double(50.)>] [-f<double(.5)>] [-x<int(4000)>]
[-w<int(80)>] [-r<int>] [-M<file>]
```
......@@ -510,7 +523,7 @@ a read is say 's b e' then if b \< e the read is a perturbed copy of s[b,e] in t
forward direction, and a perturbed copy s[e,b] in the reverse direction otherwise.
```
20. rangen <genlen:double> [-U] [-b<double(.5)>] [-w<int(80)>] [-r<int>]
21. rangen <genlen:double> [-U] [-b<double(.5)>] [-w<int(80)>] [-r<int>]
```
Generate a random DNA sequence of length genlen*1Mbp that has an AT-bias of -b.
......
dazzdb (1.0+git20190616.034f1ab-1) unstable; urgency=medium
* Afif removed himself from Uploaders
* Add myself to Uploaders
* New upstream version
* debhelper-compat 12
* Standards-Version: 4.4.0
-- Andreas Tille <tille@debian.org> Tue, 20 Aug 2019 12:37:09 +0200
dazzdb (1.0+git20180908.0bd5e07-1) unstable; urgency=medium
* Team upload.
......
Source: dazzdb
Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
Uploaders: Andreas Tille <tille@debian.org>
Section: science
Priority: optional
Build-Depends: debhelper (>= 11~),
Build-Depends: debhelper-compat (= 12),
zlib1g-dev
Standards-Version: 4.2.1
Standards-Version: 4.4.0
Vcs-Browser: https://salsa.debian.org/med-team/dazzdb
Vcs-Git: https://salsa.debian.org/med-team/dazzdb.git
Homepage: https://github.com/thegenemyers/DAZZ_DB
......
......@@ -2,8 +2,8 @@ Description: Make upstream build system append to CFLAGS
Author: Afif Elghraoui <afif@ghraoui.name>
Forwarded: no
Last-Update: 2015-09-13
--- dazzdb.orig/Makefile
+++ dazzdb/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
DEST_DIR = ~/bin
......@@ -11,4 +11,4 @@ Last-Update: 2015-09-13
+CFLAGS += -O3 -Wall -Wextra -Wno-unused-result -fno-strict-aliasing
ALL = fasta2DB DB2fasta quiva2DB DB2quiva DBsplit DBdust Catrack DBshow DBstats DBrm DBmv \
simulator fasta2DAM DAM2fasta DBdump rangen arrow2DB DB2arrow DBwipe DBtrim
simulator fasta2DAM DAM2fasta DBdump rangen arrow2DB DB2arrow DBwipe DBtrim DBa2b DBb2a
......@@ -2,8 +2,8 @@ Description: Honor LDFLAGS in upstream Makefile
Author: Afif Elghraoui <afif@debian.org>
Forwarded: https://github.com/thegenemyers/DAZZ_DB/pull/26
Last-Update: 2017-01-18
--- dazzdb.orig/Makefile
+++ dazzdb/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
DEST_DIR = ~/bin
......@@ -11,8 +11,8 @@ Last-Update: 2017-01-18
+LDLIBS = -lm
ALL = fasta2DB DB2fasta quiva2DB DB2quiva DBsplit DBdust Catrack DBshow DBstats DBrm DBmv \
simulator fasta2DAM DAM2fasta DBdump rangen arrow2DB DB2arrow DBwipe DBtrim
@@ -8,64 +9,48 @@
simulator fasta2DAM DAM2fasta DBdump rangen arrow2DB DB2arrow DBwipe DBtrim DBa2b DBb2a
@@ -8,64 +9,48 @@ ALL = fasta2DB DB2fasta quiva2DB DB2quiv
all: $(ALL)
fasta2DB: fasta2DB.c DB.c DB.h QV.c QV.h
......@@ -79,5 +79,5 @@ Last-Update: 2017-01-18
DBwipe: DBwipe.c DB.c DB.h QV.c QV.h
- gcc $(CFLAGS) -o DBwipe DBwipe.c DB.c QV.c -lm
clean:
DBa2b: DBa2b.c DB.c DB.h QV.c QV.h
gcc $(CFLAGS) -o DBa2b DBa2b.c DB.c QV.c -lm
......@@ -3,9 +3,9 @@ Description: Set destination directory in upstream Makefile
Author: Afif Elghraoui <afif@ghraoui.name>
Forwarded: no
Last-Update: 2015-09-13
--- dazzdb.orig/Makefile
+++ dazzdb/Makefile
@@ -59,7 +59,8 @@
--- a/Makefile
+++ b/Makefile
@@ -64,7 +64,8 @@ clean:
rm -f dazz.db.tar.gz
install:
......