comparison srf2fastq/io_lib-1.12.2/progs/trace_dump.c @ 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 2002. 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 * Mark Jordan as part of the Staden Package at the MRC Laboratory of
10 * Molecular Biology, Hills Road, Cambridge, CB2 2QH, United Kingdom.
11 *
12 * MRC disclaims all warranties with regard to this software.
13 */
14
15 #include <stdio.h>
16 #include <io_lib/Read.h>
17
18 int main(int argc, char **argv)
19 {
20 Read* read;
21 int i;
22
23 if (argc != 2) {
24 fprintf(stderr, "Usage: trace_dump <trace file>\n");
25 return 1;
26 }
27
28
29 read = read_reading( argv[1], TT_ANY );
30
31
32 if (read == NULL) {
33 fprintf(stderr, "Tracedump was unable to open file %s\n", argv[1] );
34 return 1;
35 }
36
37 printf("[Trace]\n");
38 printf("%s\n", read->trace_name );
39
40 printf("\n[Header]\n");
41 printf("%d\t\t# format\n", read->format);
42 printf("%d\t\t# NPoints\n", read->NPoints);
43 printf("%d\t\t# NBases\n", read->NBases);
44 printf("%d\t\t# NFlows\n", read->nflows);
45 printf("%d\t\t# maxTraceVal\n", (int)read->maxTraceVal-read->baseline);
46 printf("%d\t\t# baseline\n", read->baseline);
47 printf("%d\t\t# leftCutoff\n", read->leftCutoff);
48 printf("%d\t\t# rightCutoff\n", read->rightCutoff);
49
50 puts("\n[Bases]");
51 for (i = 0; i < read->NBases; i++) {
52 printf("%c %05d %+03d %+03d %+03d %+03d #%3d\n",
53 read->base[i],
54 read->basePos ? read->basePos[i] : 0,
55 (int)read->prob_A[i],
56 (int)read->prob_C[i],
57 (int)read->prob_G[i],
58 (int)read->prob_T[i],
59 i);
60 }
61
62 if (read->NPoints) {
63 puts("\n[A_Trace]");
64 for(i = 0; i < read->NPoints; i++)
65 printf("%d\t#%5d\n", (int)read->traceA[i] - read->baseline, i);
66
67 puts("\n[C_Trace]");
68 for(i = 0; i < read->NPoints; i++)
69 printf("%d\t#%5d\n", (int)read->traceC[i] - read->baseline, i);
70
71 puts("\n[G_Trace]");
72 for(i = 0; i < read->NPoints; i++)
73 printf("%d\t#%5d\n", (int)read->traceG[i] - read->baseline, i);
74
75 puts("\n[T_Trace]");
76 for(i = 0; i < read->NPoints; i++)
77 printf("%d\t#%5d\n", (int)read->traceT[i] - read->baseline, i);
78 }
79
80 if (read->flow_order) {
81 puts("\n[Flows]");
82 for (i = 0; i < read->nflows; i++) {
83 printf("%c %5.2f %u\t#%5d\n",
84 read->flow_order[i],
85 read->flow ? read->flow[i] : 0,
86 read->flow_raw ? read->flow_raw[i] : 0,
87 i);
88 }
89 }
90
91 if (read->info) {
92 puts("\n[Info]");
93 printf("%s\n", read->info);
94 }
95
96 read_deallocate(read);
97
98 return 0;
99 }