/usr/include/ncbi-vdb/align/align-access.h is in libncbi-vdb-dev 2.8.1+dfsg-2.
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 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | /*===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government Work" under the
* terms of the United States Copyright Act. It was written as part of
* the author's official duties as a United States Government employee and
* thus cannot be copyrighted. This software/database is freely available
* to the public for use. The National Library of Medicine and the U.S.
* Government have not placed any restriction on its use or reproduction.
*
* Although all reasonable efforts have been taken to ensure the accuracy
* and reliability of the software and data, the NLM and the U.S.
* Government do not and cannot warrant the performance or results that
* may be obtained by using this software or data. The NLM and the U.S.
* Government disclaim all warranties, express or implied, including
* warranties of performance, merchantability or fitness for any particular
* purpose.
*
* Please cite the author in any work or product based on this material.
*
* ===========================================================================
*
*/
#ifndef _h_align_align_access_
#define _h_align_align_access_
#ifndef _h_align_extern_
#include <align/extern.h>
#endif
#ifndef _h_klib_defs_
#include <klib/defs.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*--------------------------------------------------------------------------
* forwards
*/
struct VPath;
/*--------------------------------------------------------------------------
* constants
*/
typedef uint8_t AlignmentStrandDirection;
enum
{
asd_Unknown, /* e.g. an error occurred */
asd_Forward = 'F',
asd_Reverse = 'R'
};
/*--------------------------------------------------------------------------
* AlignAccessMgr
* opaque handle to library
*/
typedef struct AlignAccessMgr AlignAccessMgr;
/* Make
* make a manager for read-only access
*/
ALIGN_EXTERN rc_t CC AlignAccessMgrMake ( const AlignAccessMgr **mgr );
/* AddRef
* Release
*/
ALIGN_EXTERN rc_t CC AlignAccessMgrAddRef ( const AlignAccessMgr *self );
ALIGN_EXTERN rc_t CC AlignAccessMgrRelease ( const AlignAccessMgr *self );
/*--------------------------------------------------------------------------
* AlignAccessDB
* opaque handle to database
*/
typedef struct AlignAccessDB AlignAccessDB;
/* Make
* make a read-only database handle from BAM file
* where the BAM file is treated as the entire database
*
* "bam" [ IN ] - NUL terminated POSIX path in UTF-8 character set
* designating BAM file
*
* "bam_index" [ IN ] - NUL terminated POSIX path in UTF-8 character
* set designating BAM index file
*
* NB - on Windows, these paths should be converted POSIX-style
*/
ALIGN_EXTERN rc_t CC AlignAccessMgrMakeBAMDB ( const AlignAccessMgr *self,
const AlignAccessDB **db, struct VPath const *bam );
ALIGN_EXTERN rc_t CC AlignAccessMgrMakeIndexBAMDB ( const AlignAccessMgr *self,
const AlignAccessDB **db, struct VPath const *bam, struct VPath const *bam_index );
/* AddRef
* Release
*/
ALIGN_EXTERN rc_t CC AlignAccessDBAddRef ( const AlignAccessDB *self );
ALIGN_EXTERN rc_t CC AlignAccessDBRelease ( const AlignAccessDB *self );
/*--------------------------------------------------------------------------
* AlignAccessRefSeqEnumerator
* an enumerator onto available reference sequences
*/
typedef struct AlignAccessRefSeqEnumerator AlignAccessRefSeqEnumerator;
#define AlignAccessRefSeqEnumeratorEOFCode (RC(rcAlign, rcTable, rcReading, rcRow, rcNotFound))
#define AlignAccessRefSeqEnumeratorIsEOF(RESULT_CODE) (GetRCObject(RESULT_CODE) == rcRow && GetRCState(RESULT_CODE) == rcNotFound)
/* EnumerateRefSequences
* make an enumerator of reference sequences visible in database
*
* "refseq_enum" [ OUT ] - return parameter for enumerator
*
* return codes:
* object: rcRow, state: rcNotFound - if the index is empty
*/
ALIGN_EXTERN rc_t CC AlignAccessDBEnumerateRefSequences ( const AlignAccessDB *self,
AlignAccessRefSeqEnumerator **refseq_enum );
/* AddRef
* Release
*/
ALIGN_EXTERN rc_t CC AlignAccessRefSeqEnumeratorAddRef ( const AlignAccessRefSeqEnumerator *self );
ALIGN_EXTERN rc_t CC AlignAccessRefSeqEnumeratorRelease ( const AlignAccessRefSeqEnumerator *self );
/* advance the enumerator to the next element
*
* return codes:
* object: rcRow, state: rcNotFound - if there is no next element
*/
ALIGN_EXTERN rc_t CC AlignAccessRefSeqEnumeratorNext(const AlignAccessRefSeqEnumerator *cself);
/* GetID
* get text id of reference sequence
*
* "id_buffer" [ IN ] and "buffer_size" [ IN ] - return buffer for
* NUL terminated ASCII id
*
* "id_size" [ OUT, NULL OKAY ] - optional return parameter for length
*/
ALIGN_EXTERN rc_t CC AlignAccessRefSeqEnumeratorGetID ( const AlignAccessRefSeqEnumerator *self,
char *id_buffer, size_t buffer_size, size_t *id_size );
/* GetLength
* get text id of reference sequence
*/
ALIGN_EXTERN rc_t CC AlignAccessRefSeqEnumeratorGetLength
( const AlignAccessRefSeqEnumerator *self, uint64_t *length );
/*--------------------------------------------------------------------------
* AlignAccessAlignmentEnumerator
* an enumerator onto alignments
*/
typedef struct AlignAccessAlignmentEnumerator AlignAccessAlignmentEnumerator;
#define AlignAccessAlignmentEnumeratorEOFCode (RC(rcAlign, rcTable, rcReading, rcRow, rcNotFound))
#define AlignAccessAlignmentEnumeratorIsEOF(RESULT_CODE) (GetRCObject(RESULT_CODE) == rcRow && GetRCState(RESULT_CODE) == rcNotFound)
/* EnumerateAlignments
* make an enumerator of all alignments in database
*
* "align_enum" [ OUT ] - return parameter for enumerator
*
* return codes:
* object: rcRow, state: rcNotFound - if there is no first element
*
* NB - this is a BAD interface, here only to support dumping a BAM file
* it may not be available under all circumstances
*/
ALIGN_EXTERN rc_t CC AlignAccessDBEnumerateAlignments ( const AlignAccessDB *self,
AlignAccessAlignmentEnumerator **align_enum );
/* WindowedAlignments
* make an enumerator of alignments within a window of a reference sequence
*
* "align_enum" [ OUT ] - return parameter for enumerator
*
* "refseq_id" [ IN ] - NUL terminated ASCII string giving reference sequence id
*
* "pos" [ IN ] and "wsize" [ IN ] - starting position and size of window
* on reference sequence
*
* return codes:
* object: rcRow, state: rcNotFound - if there is no first element
*/
ALIGN_EXTERN rc_t CC AlignAccessDBWindowedAlignments ( const AlignAccessDB *self,
AlignAccessAlignmentEnumerator **align_enum, const char *refseq_id,
uint64_t pos, uint64_t wsize );
/* AddRef
* Release
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorAddRef ( const AlignAccessAlignmentEnumerator *self );
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorRelease ( const AlignAccessAlignmentEnumerator *self );
/* Next
* advance the enumerator to the next element
*
* return codes:
* object: rcRow, state: rcNotFound - if there is no next element
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorNext ( const AlignAccessAlignmentEnumerator *self );
/* GetRefSeqID
* return id of reference sequence
*
* "id_buffer" [ IN ] and "buffer_size" [ IN ] - return buffer for
* NUL terminated ASCII id
*
* "id_size" [ OUT, NULL OKAY ] - optional return parameter for length
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetRefSeqID ( const AlignAccessAlignmentEnumerator *self,
char *id_buffer, size_t buffer_size, size_t *id_size );
/* GetRefSeqPos
* return starting position of alignment on reference sequence
*
* "start_pos" [ OUT ] - return parameter for starting position
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetRefSeqPos ( const AlignAccessAlignmentEnumerator *self,
uint64_t *start_pos );
/* GetRefSeqPos
* return starting position of alignment on reference sequence
*
* "start_pos" [ OUT ] - return parameter for starting position
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetRefSeqLen ( const AlignAccessAlignmentEnumerator *self,
uint32_t *ref_len );
/* GetShortSeqID
* return accession id of aligned short sequence
*
* "id_buffer" [ IN ] and "buffer_size" [ IN ] - return buffer for
* NUL terminated ASCII id
*
* "id_size" [ OUT, NULL OKAY ] - optional return parameter for length
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetShortSeqAccessionID
( const AlignAccessAlignmentEnumerator *self, char *id_buffer, size_t buffer_size, size_t *id_size );
/* GetShortSeqID
* return id of aligned short sequence
*
* "id_buffer" [ IN ] and "buffer_size" [ IN ] - return buffer for
* NUL terminated ASCII id
*
* "id_size" [ OUT, NULL OKAY ] - optional return parameter for length
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetShortSeqID
( const AlignAccessAlignmentEnumerator *self, char *id_buffer, size_t buffer_size, size_t *id_size );
/* GetMapQuality
* return sequence alignment mapping quality score
*
* "score" [ OUT ] - return parameter for mapping quality score (phred-like)
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetMapQuality ( const AlignAccessAlignmentEnumerator *self,
uint8_t *score );
/* GetCIGAR
* return sequence alignment information
*
* "start_pos" [ OUT, NULL OKAY ] - return parameter for starting position
*
* "cigar_buffer" [ IN, NULL OKAY ] and "buffer_size" [ IN ] - return buffer for CIGAR NUL-terminated
* alignment description; null okay if cigar_size not null
*
* "cigar_size" [ OUT, NULL OKAY ] - optional return parameter for CIGAR string length; null ok
* if cigar_buffer not null
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetCIGAR ( const AlignAccessAlignmentEnumerator *self,
uint64_t *start_pos, char *cigar_buffer, size_t buffer_size, size_t *cigar_size );
/* GetShortSequence
* return short sequence
*
* "seq_buffer" [ IN ] and "buffer_size" [ IN ] - return buffer for short sequence
*
* "seq_size" [ OUT ] - return parameter for sequence length
*
* NB - BAM states that the sequence will be bases in FASTA.
* we will be extending this interface to provide type information
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetShortSequence ( const AlignAccessAlignmentEnumerator *self,
char *seq_buffer, size_t buffer_size, size_t *seq_size );
/* GetStrandDirection
* returns property
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetStrandDirection
( const AlignAccessAlignmentEnumerator *self, AlignmentStrandDirection *result );
/* GetIsPaired
* returns paired property
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetIsPaired
( const AlignAccessAlignmentEnumerator *self, bool *result );
/* GetIsFirstInPair
* get property
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetIsFirstInPair
( const AlignAccessAlignmentEnumerator *self, bool *result );
/* GetIsSecondInPair
* get property
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetIsSecondInPair
( const AlignAccessAlignmentEnumerator *self, bool *result );
/* GetRecordID
* get property
*
* A locally unique identifier for each record. When enumerators from the same
* AlignAccessDB object fetch the same record, they will return the same ID.
*/
ALIGN_EXTERN rc_t CC AlignAccessAlignmentEnumeratorGetRecordID
( const AlignAccessAlignmentEnumerator *self, uint64_t *result );
#ifdef __cplusplus
}
#endif
#endif /* _h_align_align_access_ */
|