Debian Codegraph @

interfaces/sra/illumina.h

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 /*===========================================================================
2 *
3 * PUBLIC DOMAIN NOTICE
4 * National Center for Biotechnology Information
5 *
6 * This software/database is a "United States Government Work" under the
7 * terms of the United States Copyright Act. It was written as part of
8 * the author's official duties as a United States Government employee and
9 * thus cannot be copyrighted. This software/database is freely available
10 * to the public for use. The National Library of Medicine and the U.S.
11 * Government have not placed any restriction on its use or reproduction.
12 *
13 * Although all reasonable efforts have been taken to ensure the accuracy
14 * and reliability of the software and data, the NLM and the U.S.
15 * Government do not and cannot warrant the performance or results that
16 * may be obtained by using this software or data. The NLM and the U.S.
17 * Government disclaim all warranties, express or implied, including
18 * warranties of performance, merchantability or fitness for any particular
19 * purpose.
20 *
21 * Please cite the author in any work or product based on this material.
22 *
23 * ===========================================================================
24 *
25 */
26 #ifndef _h_sra_illumina_
27 #define _h_sra_illumina_
28
29 #ifndef _h_sra_rd_extern_
30 #include <sra/rd-extern.h>
31 #endif
32
33 #ifndef _h_sra_sradb_
34 #include <sra/sradb.h>
35 #endif
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 /*--------------------------------------------------------------------------
42 * IlluminaReader
43 */
44 typedef struct IlluminaReader IlluminaReader;
45
46 /* Make
47 * create IlluminaReader reference based
48 * on opened table and properties:
49 * table - SRATable
50 * accession - accession
51 * read - output reads
52 * qual1 - output quality1
53 * qual4 - output quality4
54 * intensity - output intensity
55 * noise - output noise
56 * signal - output signal
57 * qseq - output QSEQ format
58 * minSpotId - starting spot id, 0 - ignored (run information used)
59 * maxSpotId - ending spot id, 0 - ignored (run information used)
60 * you cannot seek out of range of [minSpotId:maxSpotId]
61 */
62 SRA_RD_EXTERN rc_t CC IlluminaReaderMake(const IlluminaReader** self, const SRATable* table, const char* accession,
63 bool read, bool qual1, bool qual4,
64 bool intensity, bool noise, bool signal, bool qseq,
65 spotid_t minSpotId, spotid_t maxSpotId);
66 /* Whack
67 * releases object obtained from IlluminaReaderMake
68 */
69 SRA_RD_EXTERN rc_t CC IlluminaReaderWhack(const IlluminaReader* self);
70
71 /* FirstSpot
72 * set current spot to first in the run
73 */
74 SRA_RD_EXTERN rc_t CC IlluminaReaderFirstSpot(const IlluminaReader* self);
75
76 /* SeekSpot
77 * set current spot
78 * if error occured current spot position becomes 0
79 */
80 SRA_RD_EXTERN rc_t CC IlluminaReaderSeekSpot(const IlluminaReader* self, spotid_t spot);
81
82 /* NextSpot
83 * Seek to next spot from current
84 */
85 SRA_RD_EXTERN rc_t CC IlluminaReaderNextSpot(const IlluminaReader* self);
86
87 /* CurrentSpot
88 * Get current spot
89 * sopt [OUT] - pointer to assign value of the current spot
90 * returns GetRCState(rc) == rcExhausted when out of spots
91 */
92 SRA_RD_EXTERN rc_t CC IlluminaReaderCurrentSpot(const IlluminaReader* self, spotid_t *spot);
93
94 /* SpotInfo
95 * Get current spot information
96 * spotname [OUT] - pointer to assign value of the current spot name (can be NULL)
97 * spot_len [OUT] - pointer to assign value of the current spot length (can be NULL)
98 * num_reads[OUT] - pointer to assign value of the number of reads in current spot (can be NULL)
99 */
100 SRA_RD_EXTERN rc_t CC IlluminaReader_SpotInfo(const IlluminaReader* self,
101 const char** spotname, size_t* spotname_sz,
102 INSDC_coord_val* lane, INSDC_coord_val* tile,
103 INSDC_coord_val* x, INSDC_coord_val* y,
104 uint32_t* spot_len, uint32_t* num_reads);
105 /* SpotReadInfo
106 * Get read information for current spot
107 * readid [IN] - 1-based read id
108 * read_label[OUT] - pointer to assign value of the read label (can be NULL)
109 * read_type [OUT] - pointer to assign value of the read type (can be NULL)
110 * read_start[OUT] - pointer to assign value of the read start in spot (can be NULL)
111 * read_len [OUT] - pointer to assign value of the read length (can be NULL)
112 * cskey [OUT] - pointer to assign value of the read color space key (can be NULL)
113 * if start and len is == 0 read is empty
114 */
115 SRA_RD_EXTERN rc_t CC IlluminaReader_SpotReadInfo(const IlluminaReader* self, uint32_t readId, SRAReadTypes* read_type,
116 const char** read_label, INSDC_coord_len* read_label_sz,
117 INSDC_coord_zero* read_start, INSDC_coord_len* read_len);
118
119 /* Base
120 * retrieve bases for the spot, result always has '\0' at the and (asciiz string)
121 * data [IN] - pointer to buffer for printing
122 * dsize [IN] - data buffer size
123 * written [IN,OUT] - optional number of bytes occupied by string
124 * (not including the trailing '\0' used to end output), may by more than dsize
125 */
126 SRA_RD_EXTERN rc_t CC IlluminaReaderBase(const IlluminaReader* self, char* data, size_t dsize, size_t* written);
127
128 /* Noise
129 * retrieve noise in 4 floats per base format
130 * other parameters see description for IlluminaReaderBase above
131 */
132 SRA_RD_EXTERN rc_t CC IlluminaReaderNoise(const IlluminaReader* self, char* data, size_t dsize, size_t* written);
133
134 /* Intensity
135 * retrieve intensity in 4 floats per base format
136 * other parameters see description for IlluminaReaderBase above
137 */
138 SRA_RD_EXTERN rc_t CC IlluminaReaderIntensity(const IlluminaReader* self, char* data, size_t dsize, size_t* written);
139
140 /* Signal
141 * retrieve signal in 4 floats per base format
142 * other parameters see description for IlluminaReaderBase above
143 */
144 SRA_RD_EXTERN rc_t CC IlluminaReaderSignal(const IlluminaReader* self, char* data, size_t dsize, size_t* written);
145
146 /* Quality (BINARY)
147 * retrieve quality as single bytes per bases
148 * readid [IN] - 1-based, if <= 0 than the whole spot, otherwise particular read
149 * other parameters see description for IlluminaReaderBase above
150 */
151 SRA_RD_EXTERN rc_t CC IlluminaReaderQuality1(const IlluminaReader* self, uint32_t readId, char* data, size_t dsize, size_t* written);
152
153 /* Quality
154 * retrieve quality in 4 integers per base format
155 * other parameters see description for IlluminaReaderBase above
156 */
157 SRA_RD_EXTERN rc_t CC IlluminaReaderQuality4(const IlluminaReader* self, char* data, size_t dsize, size_t* written);
158
159 /* QSeq
160 * spot information as in QSEQ format
161 * other parameters see description for IlluminaReaderBase above
162 */
163 SRA_RD_EXTERN rc_t CC IlluminaReaderQSeq(const IlluminaReader* self, uint32_t readId, bool spot_group,
164 char* data, size_t dsize, size_t* written);
165
166 #ifdef __cplusplus
167 }
168 #endif
169
170 #endif /* _h_sra_illumina_ */