BioHDF version 0.3 alpha
Scalable NGS Data Storage Based on HDF5

bioh5g_reads.h

00001 /*****************************************************************************
00002  * Copyright by The HDF Group                                                *
00003  * All rights reserved.                                                      *
00004  *                                                                           *
00005  * This file is part of BioHDF.  The full BioHDF copyright notice, including *
00006  * terms governing use, modification, and redistribution, is contained in    *
00007  * the file COPYING.  COPYING can be found at the root of the source code    *
00008  * distribution tree.  If you do not have access to this file, you may       *
00009  * request a copy from help@hdfgroup.org.                                    *
00010  *****************************************************************************/
00011  
00019 #ifndef _BIOH5G_READS_H
00020 #define _BIOH5G_READS_H
00021 
00022 #include <stdio.h>
00023 
00024 #include "biohdf_api.h"
00025 #include "biohdf_error.h"
00026 
00027 
00028 
00029 
00030 /*****************************************************************************
00031  * Type definitions                                                          *
00032  *****************************************************************************/
00033 
00034 
00035 
00037 typedef struct _bioh5g_reads *bioh5g_reads;
00038 
00039 
00040 
00042 typedef struct _bioh5g_reads_iterator *bioh5g_reads_iterator;
00043 
00044 
00045 
00047 typedef struct _bioh5g_reads_properties *bioh5g_reads_properties;
00048 
00049 
00050 
00051 /*****************************************************************************
00052  * Common structs and enums                                                  *
00053  *****************************************************************************/
00054 
00055 
00056 
00061 typedef enum
00062 {
00063     BASE_SPACE,       
00064     COLOR_SPACE       
00065 } bioh5g_reads_type;
00066 
00067 
00068 
00075 typedef enum
00076 {
00077     FASTQ_FORMAT,      
00078     FASTA_FORMAT       
00079 } bioh5g_reads_format;
00080 
00081 
00082 
00083 /*****************************************************************************
00084  * Data container                                                            *
00085  *****************************************************************************/
00086 
00087 
00088 
00095 typedef struct
00096 {
00097     char *sequence;          
00098     char *quality_values;    
00099     char *identifier;        
00100 } bioh5g_read_data;
00101 
00102 
00103 
00104 /*****************************************************************************
00105  * Create, open, close                                                       *
00106  *****************************************************************************/
00107 
00108 
00109 
00125 BIOHDF_API biohdf_error
00126 BIOH5Gcheck_reads_presence(biohdf_file file,
00127                            const char *path,
00128                            /*OUT*/ biohdf_bool *presence);
00129 
00130 
00131 
00144 BIOHDF_API biohdf_error 
00145 BIOH5Gcreate_reads_storage(biohdf_file file,
00146                            bioh5g_reads_properties properties,
00147                            const char *path,
00148                            /*OUT*/ bioh5g_reads *reads);
00149 
00150 
00151 
00161 BIOHDF_API biohdf_error 
00162 BIOH5Gopen_reads_storage(biohdf_file file,
00163                          const char *path,
00164                          biohdf_open_mode mode,
00165                          /*OUT*/ bioh5g_reads *reads);
00166 
00167 
00168 
00177 BIOHDF_API biohdf_error 
00178 BIOH5Gclose_reads_storage(/*IN-OUT*/ bioh5g_reads *reads);
00179 
00180 
00181 
00182 /*****************************************************************************
00183  * Append and read data                                                      *
00184  *****************************************************************************/
00185 
00186 
00187 
00195 BIOHDF_API biohdf_error
00196 BIOH5Gget_reads_count(const bioh5g_reads reads,
00197                       /*OUT*/ biohdf_int64 *count);
00198 
00199 
00200 
00208 BIOHDF_API biohdf_error
00209 BIOH5Gcreate_reads_iterator(const bioh5g_reads reads,
00210                             /*OUT*/ bioh5g_reads_iterator *iter);
00211 
00212 
00213 
00222 BIOHDF_API biohdf_error
00223 BIOH5Gdestroy_reads_iterator(/*OUT*/ bioh5g_reads_iterator *iter);
00224 
00225 
00226 
00234 BIOHDF_API biohdf_error
00235 BIOH5Gadd_read(const bioh5g_reads reads,
00236                const bioh5g_read_data *data);
00237 
00238 
00239 
00250 BIOHDF_API biohdf_error
00251 BIOH5Gget_index_of_last_added_read(const bioh5g_reads reads,
00252                                    /*OUT*/ biohdf_int64 *index);
00253 
00254 
00255 
00264 BIOHDF_API biohdf_error
00265 BIOH5Gget_next_read(bioh5g_reads_iterator iter,
00266                     /*OUT*/ biohdf_int64 *index,
00267                     /*OUT*/ bioh5g_read_data **data);
00268 
00269 
00270 
00279 BIOHDF_API biohdf_error
00280 BIOH5Gget_read(const bioh5g_reads reads,
00281                biohdf_int64 index,
00282                /*OUT*/ bioh5g_read_data **data);
00283 
00284 
00285 
00294 BIOHDF_API biohdf_error
00295 BIOH5Gfree_read(/*OUT*/ bioh5g_read_data **data);
00296 
00297 
00298 
00299 /*****************************************************************************
00300  * Data formats                                                              *
00301  *****************************************************************************/
00302 
00303 
00316 BIOHDF_API biohdf_error
00317 BIOH5Gcreate_read_string(const bioh5g_read_data *read,
00318                          bioh5g_reads_format format,
00319                          /*OUT*/ char **read_string);
00320 
00321 
00337 BIOHDF_API biohdf_error
00338 BIOH5Gwrite_read_to_stream(const bioh5g_read_data *read,
00339                            bioh5g_reads_format format,
00340                            FILE *stream);
00341 
00342 
00343 
00344 /*****************************************************************************
00345  * Accessor functions (needed for higher-language interoperation)            *
00346  *****************************************************************************/
00347 
00352 BIOHDF_API biohdf_error
00353 BIOH5Gcreate_read_data(/*OUT*/ bioh5g_read_data **data);
00354 
00355 
00356 
00358 BIOHDF_API biohdf_error
00359 BIOH5Gget_read_identifier(bioh5g_read_data *data, /*OUT*/ char **identifier);
00360 
00361 
00362 
00364 BIOHDF_API biohdf_error
00365 BIOH5Gset_read_identifier(bioh5g_read_data *data, char *identifier);
00366 
00367 
00368 
00370 BIOHDF_API biohdf_error
00371 BIOH5Gget_read_sequence(bioh5g_read_data *data, /*OUT*/ char **sequence);
00372 
00373 
00374 
00376 BIOHDF_API biohdf_error
00377 BIOH5Gset_read_sequence(bioh5g_read_data *data, char *sequence);
00378 
00379 
00380 
00382 BIOHDF_API biohdf_error
00383 BIOH5Gget_read_quality_values(bioh5g_read_data *data, /*OUT*/ char **quality_values);
00384 
00385 
00386 
00388 BIOHDF_API biohdf_error
00389 BIOH5Gset_read_quality_values(bioh5g_read_data *data, char *quality_values);
00390 
00395 /*****************************************************************************
00396  * Reads properties - create, destroy, access                                *
00397  *****************************************************************************/
00398 
00405 BIOHDF_API biohdf_error
00406 BIOH5Gcreate_reads_properties(/*OUT*/ bioh5g_reads_properties *props);
00407 
00408 
00409 
00411 BIOHDF_API biohdf_error
00412 BIOH5Gdestroy_reads_properties(/*OUT*/ bioh5g_reads_properties *props);
00413 
00414 
00415 
00417 BIOHDF_API biohdf_error
00418 BIOH5Gset_reads_properties_reads_type(bioh5g_reads_properties props,
00419                                       bioh5g_reads_type reads_type);
00420 
00421 
00422 
00424 BIOHDF_API biohdf_error
00425 BIOH5Gset_reads_properties_chunk_size(bioh5g_reads_properties props,
00426                                       biohdf_int64 chunk_size);
00427 
00428 
00429 
00431 BIOHDF_API biohdf_error
00432 BIOH5Gset_reads_properties_compression_level(bioh5g_reads_properties props,
00433                                              compression_level level);
00434 
00435 
00436 
00438 BIOHDF_API biohdf_error
00439 BIOH5Gset_reads_properties_sequences_scheme(bioh5g_reads_properties props,
00440                                             biohdf_string_storage_scheme scheme);
00441 
00442 
00443 
00445 BIOHDF_API biohdf_error
00446 BIOH5Gset_reads_properties_identifiers_scheme(bioh5g_reads_properties props,
00447                                               biohdf_string_storage_scheme scheme);
00448 
00449 
00450 
00452 BIOHDF_API biohdf_error
00453 BIOH5Gset_reads_properties_sequences_length(bioh5g_reads_properties props,
00454                                             size_t length);
00455 
00456 
00457 
00459 BIOHDF_API biohdf_error
00460 BIOH5Gset_reads_properties_identifiers_length(bioh5g_reads_properties props,
00461                                               size_t length);
00462 
00466 #endif
 All Data Structures Variables