Mercurial > repos > dawe > srf2fastq
comparison srf2fastq/io_lib-1.12.2/io_lib/translate.h @ 0:d901c9f41a6a default tip
Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
author | dawe |
---|---|
date | Tue, 07 Jun 2011 17:48:05 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:d901c9f41a6a |
---|---|
1 /* | |
2 * Copyright (c) Medical Research Council 1994. All rights reserved. | |
3 * | |
4 * Permission to use, copy, modify and distribute this software and its | |
5 * documentation for any purpose is hereby granted without fee, provided that | |
6 * this copyright and notice appears in all copies. | |
7 * | |
8 * This file was written by James Bonfield, Simon Dear, Rodger Staden, | |
9 * as part of the Staden Package at the MRC Laboratory of Molecular | |
10 * Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom. | |
11 * | |
12 * MRC disclaims all warranties with regard to this software. | |
13 */ | |
14 | |
15 #ifndef _TRANSLATE_H_ | |
16 #define _TRANSLATE_H_ | |
17 | |
18 #include "io_lib/scf.h" | |
19 #include "io_lib/Read.h" | |
20 #include "io_lib/expFileIO.h" | |
21 | |
22 #ifdef __cplusplus | |
23 extern "C" { | |
24 #endif | |
25 | |
26 /* | |
27 * Translates an Scf structure into a Read structure. | |
28 * The Scf structure is left unchanged. | |
29 * | |
30 * Returns: | |
31 * A pointer to an allocated Read structure upon success. | |
32 * NULLRead upon failure. | |
33 */ | |
34 Read *scf2read(Scf *scf); | |
35 | |
36 /* | |
37 * Translates a Read structure into a Scf structure. | |
38 * The Read structure is left unchanged. | |
39 * | |
40 * Returns: | |
41 * A pointer to an allocated Scf structure upon success. | |
42 * NULL upon failure. | |
43 */ | |
44 Scf *read2scf(Read *read); | |
45 | |
46 /* | |
47 * Translates a Read structure and an Experiment file. | |
48 * The Read structure is left unchanged. | |
49 * | |
50 * Returns: | |
51 * A pointer to an allocated Exp_info structure upon success. | |
52 * NULL upon failure (FIXME: need to free memory here) | |
53 */ | |
54 Exp_info *read2exp(Read *read, char *EN); | |
55 | |
56 /* | |
57 * Controls the use of the SQ and ON lines when loading an experiment file. | |
58 * The default (value&1 == 1) is to load these into the Read structure. | |
59 * With value&1 == 0 we load the sequence directly from the trace file | |
60 * (LT line). | |
61 * value&2 controls whether to use the SL/SR fields when setting the cutoff. | |
62 * value&2 == 0 implies to do so, and value&2 == 2 implies to not. | |
63 * | |
64 * Returns: | |
65 * The old value. | |
66 */ | |
67 int read_experiment_redirect(int value); | |
68 | |
69 /* | |
70 * Takes an original read structure and a set of edit change arrays and | |
71 * produces a new base position array incorporating all the edits. For | |
72 * insertions, interpolation is used to derive a suitable sample position. | |
73 * | |
74 * INPUTS: | |
75 * | |
76 * Read *r = The original unedited read structure | |
77 * int Comp = 0=Normal sequence, 1=Complemented sequence | |
78 * int Ned = Length of edited arrays to follow | |
79 * char *edBases = Sequence of base characters incorporating ins/del edits | |
80 * uint_2 *edPos = Corresponding original base numbers, 0 indicates an | |
81 * insertion. Base numbers start at 1. | |
82 * | |
83 * OUTPUTS: | |
84 * | |
85 * This array is assumed to be empty with an allocated length of Ned elements. | |
86 * | |
87 * uint_2* basePos = Base positions in samples | |
88 */ | |
89 | |
90 void read_update_base_positions( Read *r, int Comp, int Ned, char *edBases, | |
91 int_2 *edPos, uint_2 *basePos ); | |
92 | |
93 /* | |
94 * Takes a set of edit change arrays and produces a new set of confidence | |
95 * arrays incorporating all the edits. | |
96 * | |
97 * INPUTS: | |
98 * | |
99 * int Ned = Length of edited arrays to follow | |
100 * char* edBases = Sequence of base characters incorporating ins/del edits | |
101 * int1* edConf = Corresponding confidence values, 100 for insertions | |
102 * | |
103 * | |
104 * OUTPUTS: | |
105 * | |
106 * These output arrays are assumed to be empty with an allocated length | |
107 * of Ned elements each. The names and types are identical to the same | |
108 * elements in the Read structure. | |
109 * | |
110 * char* prob_A = Base confidence A | |
111 * char* prob_C = Base confidence C | |
112 * char* prob_G = Base confidence G | |
113 * char* prob_T = Base confidence T | |
114 * | |
115 */ | |
116 | |
117 void read_update_confidence_values( int Ned, char* edBases, int1* edConf, | |
118 char* prob_A, char* prob_C, char* prob_G, char* prob_T ); | |
119 | |
120 | |
121 /* | |
122 * Translates an experiment file to a Read structure. | |
123 * The Exp_Info structure is left unchanged. | |
124 * | |
125 * Returns: | |
126 * A pointer to an allocated Read structure upon success. | |
127 * NULLRead upon failure. | |
128 */ | |
129 Read *exp2read(Exp_info *e, char *fn); | |
130 | |
131 #ifdef __cplusplus | |
132 } | |
133 #endif | |
134 | |
135 #endif |