/usr/include/io_lib/Read.h is in libstaden-read-dev 1.14.9-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | /*
* Copyright (c) 2003, 2005-2007, 2010, 2013 Genome Research Ltd.
* Author(s): James Bonfield
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* 3. Neither the names Genome Research Ltd and Wellcome Trust Sanger
* Institute nor the names of its contributors may be used to endorse
* or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY GENOME RESEARCH LTD AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENOME RESEARCH
* LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Author(s): James Bonfield, Simon Dear, Rodger Staden
*
* Copyright (c) 1995, 1997-1998, 2000-2001 MEDICAL RESEARCH COUNCIL
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1 Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2 Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3 Neither the name of the MEDICAL RESEARCH COUNCIL, THE LABORATORY OF
* MOLECULAR BIOLOGY nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Copyright (c) Medical Research Council 1994. All rights reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation for any purpose is hereby granted without fee, provided that
* this copyright and notice appears in all copies.
*
* This file was written by James Bonfield, Simon Dear, Rodger Staden,
* as part of the Staden Package at the MRC Laboratory of Molecular
* Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
*
* MRC disclaims all warranties with regard to this software.
*/
#ifndef _Read_h_
#define _Read_h_
/*
* Title: Read
*
* File: Read.h
* Purpose: Read data type
* Last update: June 14 1994
*/
/*
* This module encodes the `Read' sequence data structure.
*
* A `Read' contains information about bases and traces which are laid
* out along a single dimension of points. The number of points in a
* paricular sequence is given by `getNPoints', and these are numbered
* 0..getNPoints-1. At each point there are four trace readings, one
* for each base.
*
* The number of bases is `getNBases' which are numbered 0..N-1.
* Bases are represented by `char's. Every base is located at a
* particular point.
*
* The behaviour of these routines is undefined if given NULLRead or
* an undefined sequence.
*/
#include "io_lib/os.h"
#include "io_lib/scf.h"
#include "io_lib/mFILE.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
*-----------------------------------------------------------------------------
* Macros
*-----------------------------------------------------------------------------
*/
#define NULLRead ((Read *)NULL)
/* Trace file formats */
#define TT_ERR -1
#define TT_UNK 0
#define TT_SCF 1
#define TT_ABI 2
#define TT_ALF 3
#define TT_PLN 4
#define TT_EXP 5
#define TT_ZTR 7
#define TT_ZTR1 8
#define TT_ZTR2 9
#define TT_ZTR3 10
#define TT_BIO 11
#define TT_SFF 12
#define TT_ANY TT_UNK
/* ANYTR is specifically any *trace* type and not EXP or PLN format */
#define TT_ANYTR 13
#define READ_BASES (1<<0)
#define READ_SAMPLES (1<<1)
#define READ_COMMENTS (1<<2)
#define READ_ALL (READ_BASES | READ_SAMPLES | READ_COMMENTS)
/*
*-----------------------------------------------------------------------------
* Structures and typedefs
*-----------------------------------------------------------------------------
*/
typedef uint_2 TRACE; /* for trace heights */
typedef struct
{
int format; /* Trace file format */
char *trace_name; /* Trace file name */
int NPoints; /* No. of points of data */
int NBases; /* No. of bases */
/* Traces */
TRACE *traceA; /* Array of length `NPoints' */
TRACE *traceC; /* Array of length `NPoints' */
TRACE *traceG; /* Array of length `NPoints' */
TRACE *traceT; /* Array of length `NPoints' */
TRACE maxTraceVal; /* The maximal value in any trace */
int baseline; /* The zero offset for TRACE values */
/* Bases */
char *base; /* Array of length `NBases' */
uint_2 *basePos; /* Array of length `NBases' */
/* Cutoffs */
int leftCutoff; /* Number of unwanted bases */
int rightCutoff; /* First unwanted base at right end */
/* Miscellaneous Sequence Information */
char *info; /* misc seq info, eg comments */
/* Probability information */
char *prob_A; /* Array of length 'NBases' */
char *prob_C; /* Array of length 'NBases' */
char *prob_G; /* Array of length 'NBases' */
char *prob_T; /* Array of length 'NBases' */
/* The original input format data, or NULL if inapplicable */
int orig_trace_format;
void (*orig_trace_free)(void *ptr);
void *orig_trace;
char *ident; /* Seq id, NULL for unknown. Malloced data.
Owned and freed by io_lib. */
/* Pyrosequencing "peaks" (more like spikes). NULL if not used */
int nflows; /* Number of "flows" */
char *flow_order; /* Bases flowed across */
float *flow; /* Processed to be 1 base unit oriented */
unsigned int*flow_raw; /* Unprocessed data */
void *private_data; /* The 'private data' block and size from SCF, */
int private_size; /* NULL & 0 if not present. */
} Read;
/*
*-----------------------------------------------------------------------------
* Function prototypes
*-----------------------------------------------------------------------------
*/
/* ----- Main I/O routines ----- */
/*
* Read a sequence from a file "fn" of format "format". If "format" is 0
* (TT_ANY), we automatically determine the correct format.
*
* Returns:
* Read * for success
* NULLRead for failure
*/
Read *read_reading(char *fn, int format);
Read *fread_reading(FILE *fp, char *fn, int format);
Read *mfread_reading(mFILE *fp, char *fn, int format);
/*
* Write a sequence to a file "fn" of format "format". If "format" is 0,
* we choose our favourite - SCF.
*
* Returns:
* 0 for success
* -1 for failure
*/
int write_reading(char *fn, Read *read, int format);
int fwrite_reading(FILE *fp, Read *read, int format);
int mfwrite_reading(mFILE *fp, Read *read, int format);
/* ----- Utility routines ----- */
/*
* Allocate a new sequence, with the given sizes.
* Returns:
* "Read *" for success
* "NULLRead" for failure
*/
Read *read_allocate(int num_points, int num_bases);
/*
* Duplicates the read structure and optionally gives it a new filename.
* The following fields are not duplicated:
*
* int orig_trace_format;
* void (*orig_trace_free)(void *ptr);
* void *orig_trace;
* char *ident;
*
* Returns:
* "Read *" for success
* "NULLRead" for failure
*/
Read* read_dup( Read* src, const char* new_name );
/*
* Free memory allocated to a sequence by read_allocate().
*/
void read_deallocate(Read *read);
/* unix specific file deletion routine */
int remove_file(char *fn);
Read *read_abi(char *fn);
Read *fread_abi(FILE *fp);
Read *mfread_abi(mFILE *fp);
int write_abi(char *fn, Read *read);
int fwrite_abi(FILE *fp, Read *read);
int mfwrite_abi(mFILE *fp, Read *read);
int write_alf(char *fn, Read *read);
int fwrite_alf(FILE *fp, Read *read);
int mfwrite_alf(mFILE *fp, Read *read);
Read *read_alf(char *fn);
Read *fread_alf(FILE *fp);
Read *mfread_alf(mFILE *fp);
int write_pln(char *fn, Read *read);
int fwrite_pln(FILE *fp, Read *read);
int mfwrite_pln(mFILE *fp, Read *read);
Read *read_pln(char *fn);
Read *fread_pln(FILE *fp);
Read *mfread_pln(mFILE *fp);
int read_sections(int sec);
#include "io_lib/translate.h"
#include "io_lib/compress.h"
#ifdef __cplusplus
}
#endif
#endif /* _Read_h_ */
|