| 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 |
|
| 27 |
/*========================================================================== |
| 28 |
* NCBI Sequence Read Archive schema |
| 29 |
*/ |
| 30 |
version 1; |
| 31 |
|
| 32 |
include 'vdb/vdb.vschema'; |
| 33 |
include 'ncbi/seq.vschema'; |
| 34 |
include 'ncbi/spotname.vschema'; |
| 35 |
include 'insdc/sra.vschema'; |
| 36 |
include 'ncbi/stats.vschema'; |
| 37 |
|
| 38 |
|
| 39 |
/*-------------------------------------------------------------------------- |
| 40 |
* types |
| 41 |
*/ |
| 42 |
|
| 43 |
|
| 44 |
/* Segment - DEPRECATED |
| 45 |
* a ( start, len ) pair where start is a zero-based, unsigned coordinate |
| 46 |
*/ |
| 47 |
typedef U16 NCBI:SRA:Segment [ 2 ]; |
| 48 |
|
| 49 |
|
| 50 |
/* SpotDesc - DEPRECATED |
| 51 |
* uint16_t spot_len; |
| 52 |
* uint16_t fixed_len; |
| 53 |
* uint16_t signal_len; |
| 54 |
* uint16_t clip_qual_right; |
| 55 |
* uint8_t num_reads; |
| 56 |
* uint8_t align [ 7 ]; |
| 57 |
*/ |
| 58 |
typedef B8 NCBI:SRA:SpotDesc [ 16 ]; |
| 59 |
|
| 60 |
|
| 61 |
/* ReadDesc - DEPRECATED |
| 62 |
* SRASegment { uint16_t start, len; } seg; |
| 63 |
* uint8_t type; |
| 64 |
* char cs_key; |
| 65 |
* char label [ 74 ]; |
| 66 |
*/ |
| 67 |
typedef B8 NCBI:SRA:ReadDesc [ 80 ]; |
| 68 |
|
| 69 |
|
| 70 |
// some types have been moved to INSDC |
| 71 |
alias INSDC:SRA:platform_id NCBI:SRA:platform_id; |
| 72 |
alias INSDC:SRA:read_type NCBI:SRA:read_type; |
| 73 |
alias INSDC:SRA:read_filter NCBI:SRA:read_filter; |
| 74 |
|
| 75 |
typedef NCBI:fsamp4 NCBI:SRA:rotated_fsamp4, NCBI:SRA:swapped_fsamp4; |
| 76 |
|
| 77 |
// 16-bit POSITION type |
| 78 |
typedef U16 NCBI:SRA:pos16; |
| 79 |
|
| 80 |
|
| 81 |
/*-------------------------------------------------------------------------- |
| 82 |
* functions |
| 83 |
*/ |
| 84 |
|
| 85 |
/* bio_start |
| 86 |
* searches through read_type vector |
| 87 |
* returns the 0-based starting coordinate of first biological read |
| 88 |
* |
| 89 |
* "read_start" [ DATA ] - vector of read start coordinates |
| 90 |
* |
| 91 |
* "read_type" [ DATA ] - vector of read types |
| 92 |
*/ |
| 93 |
extern function INSDC:coord:zero |
| 94 |
NCBI:SRA:bio_start #1 ( INSDC:coord:zero read_start, INSDC:SRA:xread_type read_type ); |
| 95 |
|
| 96 |
|
| 97 |
/* bio_end |
| 98 |
* searcehes through read_type vector |
| 99 |
* returns the 0 based ending coording (either inclusive or exclusive) of last |
| 100 |
* biological read |
| 101 |
* |
| 102 |
* "read_start" [ DATA ] - vector of read start coordinates |
| 103 |
* |
| 104 |
* "read_type" [ DATA ] - vector of read types |
| 105 |
* |
| 106 |
* "read_len" [ DATA ] - vector of read lengths |
| 107 |
*/ |
| 108 |
extern function INSDC:coord:zero |
| 109 |
NCBI:SRA:bio_end #1 < bool inclusive > ( INSDC:coord:zero read_start, INSDC:SRA:xread_type read_type, INSDC:coord:len read_len ); |
| 110 |
|
| 111 |
|
| 112 |
/* fix_read_seg |
| 113 |
*/ |
| 114 |
extern function INSDC:coord:len [ 2 ] |
| 115 |
NCBI:SRA:fix_read_seg #1 ( U16 [ 2 ] rd_seg, INSDC:coord:len spot_len ); |
| 116 |
|
| 117 |
|
| 118 |
/* make_spot_desc |
| 119 |
* assembles several bits of information together into a "C" structure |
| 120 |
* |
| 121 |
* "spot_len" [ DATA ] - computed spot length value |
| 122 |
* |
| 123 |
* "fixed_len" [ DATA, DFLT ZERO ] - the stated fixed length of all spots |
| 124 |
* or zero if not fixed length |
| 125 |
* |
| 126 |
* "sig_len" [ DATA, DFLT ZERO ] - the length of signal/intensity data |
| 127 |
* or zero if not present |
| 128 |
* |
| 129 |
* "trim_start" [ DATA ] - the first base included in the trim segment |
| 130 |
* |
| 131 |
* "trim_len" [ DATA ] - the length of the trim segment |
| 132 |
* |
| 133 |
* "num_reads" [ DATA ] - 1..n value |
| 134 |
*/ |
| 135 |
extern function NCBI:SRA:SpotDesc NCBI:SRA:make_spot_desc #1 ( INSDC:coord:len spot_len, |
| 136 |
INSDC:coord:len fixed_len, INSDC:coord:len sig_len, INSDC:coord:zero trim_start, |
| 137 |
INSDC:coord:len trim_len, U8 num_reads ); |
| 138 |
|
| 139 |
|
| 140 |
/* make_read_desc |
| 141 |
* assembles several bits of information together into a "C" structure |
| 142 |
* in theory resultant segments may intersect other read segments or leave holes in spot. |
| 143 |
* |
| 144 |
* "num_reads" [ DATA ] - value indicating the resulting row-length of output |
| 145 |
* |
| 146 |
* "read_start" [ DATA ] - ordered starting coordinates for each read |
| 147 |
* not required to be sequential. |
| 148 |
* |
| 149 |
* "read_len" [ DATA ] - ordered lengths of each read. may be zero when |
| 150 |
* read has been described but is not identified in spot. |
| 151 |
* |
| 152 |
* "read_type" [ DATA ] - ordered type id describing each read |
| 153 |
* |
| 154 |
* "read_filt" [ DATA ] - ordered read filters |
| 155 |
* |
| 156 |
* "cs_key" [ DATA ] - ordered color-space keys |
| 157 |
* |
| 158 |
* "label_start" [ DATA ] - ordered starting coordinates for each label |
| 159 |
* "label_len" [ DATA ] - ordered lengths of each label |
| 160 |
* |
| 161 |
* "label" [ DATA ] - complete sequence of label characters, possibly empty |
| 162 |
* individual read labels are identified as {start,len} pairs |
| 163 |
*/ |
| 164 |
extern function NCBI:SRA:ReadDesc NCBI:SRA:make_read_desc #1 ( U8 num_reads, |
| 165 |
INSDC:coord:zero read_start, INSDC:coord:len read_len, INSDC:SRA:xread_type read_type, |
| 166 |
INSDC:SRA:read_filter read_filt, INSDC:dna:text cs_key, |
| 167 |
INSDC:coord:zero label_start, INSDC:coord:len label_len, ascii label ); |
| 168 |
|
| 169 |
|
| 170 |
/* rotate |
| 171 |
* rotate a quadruple by called base |
| 172 |
* now normally replaced by swap |
| 173 |
* |
| 174 |
* "T" [ TYPE ] - element type of quadruple to be rotated |
| 175 |
* |
| 176 |
* "encoding" [ CONST ] - when true, rotate input left until corresponding |
| 177 |
* element is in slot 0. when false, rotate input right to restore original |
| 178 |
* order. |
| 179 |
* |
| 180 |
* "in" [ DATA ] - data to be rotated, qualities, signal, intensities... |
| 181 |
* |
| 182 |
* "called" [ DATA ] - {0..3} or {0..4} binary representation of called bases or colors |
| 183 |
*/ |
| 184 |
extern function < type T > |
| 185 |
T NCBI:SRA:rotate #1 < bool encoding > ( T in, U8 called ); |
| 186 |
|
| 187 |
|
| 188 |
/* swap |
| 189 |
* swap element 0 and the called element |
| 190 |
* used to ensure that the called element is in slot 0 |
| 191 |
* |
| 192 |
* "T" [ TYPE ] - element type of quadruple to be swapped |
| 193 |
* |
| 194 |
* "in" [ DATA ] - data to be swapped, qualities, signal, intensities... |
| 195 |
* |
| 196 |
* "called" [ DATA ] - {0..3} or {0..4} binary representation of called bases or colors |
| 197 |
*/ |
| 198 |
extern function < type T > |
| 199 |
T NCBI:SRA:swap #1 ( T in, U8 called ); |
| 200 |
|
| 201 |
|
| 202 |
/* normalize |
| 203 |
* denormalize |
| 204 |
* |
| 205 |
* "T" [ TYPE ] - element type of quadruple to be [de]normalized |
| 206 |
* |
| 207 |
* "intensity" [ DATA ] - intensity data |
| 208 |
* |
| 209 |
* "called" [ DATA ] - {0..3} or {0..4} binary representation of called bases or colors |
| 210 |
*/ |
| 211 |
extern function < type T > |
| 212 |
T NCBI:SRA:normalize #1 ( T intensity, U8 called ); |
| 213 |
|
| 214 |
extern function < type T > |
| 215 |
T NCBI:SRA:denormalize #1 ( T intensity, U8 called ); |
| 216 |
|
| 217 |
|
| 218 |
/* make_position |
| 219 |
* return a synthesized position row with 1-1 correspondence |
| 220 |
* |
| 221 |
* "T" [ TYPE ] - position type being generated |
| 222 |
* |
| 223 |
* "start" [ CONST ] - either 0 or 1, depending upon the coordinate system |
| 224 |
* |
| 225 |
* "bases" [ DATA ] - the actual row of bases. the output row |
| 226 |
* will be the same length, but with synthesized data |
| 227 |
*/ |
| 228 |
extern function < type T > |
| 229 |
T NCBI:SRA:make_position #1 < T start > ( any bases ); |
| 230 |
|
| 231 |
/* fsamp4 compression |
| 232 |
* performs compression individually |
| 233 |
* on called channel and alternate channels |
| 234 |
*/ |
| 235 |
function NCBI:SRA:swapped_fsamp4 NCBI:SRA:fsamp4:decode #2 ( merged_fmt in ) |
| 236 |
{ |
| 237 |
fzip_fmt cmp0 = split < 0 > ( in ); |
| 238 |
fzip_fmt cmp123 = split < 1 > ( in ); |
| 239 |
F32 ch0 = funzip ( cmp0 ); |
| 240 |
F32 ch123a = funzip ( cmp123 ); |
| 241 |
F32[3] ch123 = redimension ( ch123a ); |
| 242 |
return ( NCBI:SRA:swapped_fsamp4 ) < F32 > paste ( ch0, ch123 ); |
| 243 |
} |
| 244 |
|
| 245 |
function merged_fmt NCBI:SRA:fsamp4:encode #2 < U32 called, U32 alt > ( NCBI:SRA:swapped_fsamp4 in ) |
| 246 |
{ |
| 247 |
F32 ch0 = < F32 > cut < 0 > ( in ); |
| 248 |
F32[3] ch123 = < F32 > cut < 1, 2, 3 > ( in ); |
| 249 |
fzip_fmt cmp0 = fzip < called > ( ch0 ); |
| 250 |
F32 ch123a = redimension ( ch123 ); |
| 251 |
fzip_fmt cmp123 = fzip < alt > ( ch123a ); |
| 252 |
return merge ( cmp0, cmp123 ); |
| 253 |
} |
| 254 |
|
| 255 |
|
| 256 |
/*-------------------------------------------------------------------------- |
| 257 |
* spotdesc |
| 258 |
* NCBI implementation productions |
| 259 |
*/ |
| 260 |
|
| 261 |
/* history: |
| 262 |
* 1.0.1 - base explicitly upon sequence #1.0.1, spotdesc #1.0.1 |
| 263 |
* 1.0.2 - spotdesc #1.0.2 |
| 264 |
*/ |
| 265 |
table NCBI:SRA:tbl:spotdesc_nocol #1.1 = INSDC:tbl:sequence #1.0.1, INSDC:SRA:tbl:spotdesc #1.0.2 |
| 266 |
{ |
| 267 |
/* LABEL_SEG |
| 268 |
*/ |
| 269 |
readonly column NCBI:SRA:Segment LABEL_SEG |
| 270 |
= out_label_seg |
| 271 |
| cast ( out_label_seg32 ) |
| 272 |
| cast ( _out_label_seg32 ); |
| 273 |
U32 _out_label_startU32 = ( U32 ) out_label_start; |
| 274 |
U32 [ 2 ] _out_label_seg32 = < U32 > paste ( _out_label_startU32, out_label_len ); |
| 275 |
|
| 276 |
|
| 277 |
/* READ_SEG |
| 278 |
*/ |
| 279 |
readonly column NCBI:SRA:Segment READ_SEG |
| 280 |
= out_read_seg |
| 281 |
| cast ( out_read_seg32 ) |
| 282 |
| cast ( _out_read_seg32 ); |
| 283 |
U32 _out_read_startU32 = ( U32 ) out_read_start; |
| 284 |
U32 [ 2 ] _out_read_seg32 = < U32 > paste ( _out_read_startU32, out_read_len ); |
| 285 |
|
| 286 |
|
| 287 |
/* READ_DESC |
| 288 |
*/ |
| 289 |
readonly column NCBI:SRA:ReadDesc READ_DESC |
| 290 |
= NCBI:SRA:make_read_desc ( out_nreads, out_read_start, out_read_len, |
| 291 |
out_read_type, _out_rd_filter, out_cs_key, _out_label_start, _out_label_len, _out_label ); |
| 292 |
INSDC:SRA:read_filter _out_rd_filter |
| 293 |
= out_rd_filter |
| 294 |
| < INSDC:SRA:read_filter > echo < SRA_READ_FILTER_PASS > ( out_read_start ); |
| 295 |
ascii _out_label |
| 296 |
= out_label |
| 297 |
| < ascii > echo < '' > (); |
| 298 |
INSDC:coord:zero _out_label_start |
| 299 |
= out_label_start |
| 300 |
| < INSDC:coord:zero > echo < 0 > ( out_read_start ); |
| 301 |
INSDC:coord:len _out_label_len |
| 302 |
= out_label_len |
| 303 |
| < INSDC:coord:len > echo < 0 > ( out_read_start ); |
| 304 |
|
| 305 |
/* SPOT_DESC |
| 306 |
*/ |
| 307 |
readonly column NCBI:SRA:SpotDesc SPOT_DESC |
| 308 |
= NCBI:SRA:make_spot_desc ( spot_len, fixed_spot_len, signal_len, |
| 309 |
trim_start, trim_len, out_nreads ); |
| 310 |
|
| 311 |
/* SIGNAL_LEN |
| 312 |
* normally the same as spot length when present, |
| 313 |
* but in some cases ( e.g. 454 ) it may be different |
| 314 |
*/ |
| 315 |
readonly column INSDC:coord:len SIGNAL_LEN |
| 316 |
= signal_len; |
| 317 |
readonly column U16 SIGNAL_LEN |
| 318 |
= cast ( signal_len ); |
| 319 |
|
| 320 |
|
| 321 |
/* INSDC:SRA:tbl:spotdesc inherited productions |
| 322 |
* trim_len |
| 323 |
* out_label |
| 324 |
* out_nreads |
| 325 |
* trim_start |
| 326 |
* out_read_len |
| 327 |
* out_label_len |
| 328 |
* out_rd_filter |
| 329 |
* out_read_type |
| 330 |
* out_read_start |
| 331 |
* out_label_start |
| 332 |
* static_fixed_spot_len |
| 333 |
*/ |
| 334 |
|
| 335 |
/* NCBI:SRA:tbl:spotdesc_nocol productions |
| 336 |
* out_read_seg |
| 337 |
* out_label_seg |
| 338 |
* out_read_seg32 |
| 339 |
* out_label_seg32 |
| 340 |
*/ |
| 341 |
}; |
| 342 |
|
| 343 |
/* history: |
| 344 |
* 1.0.1 - base explicitly upon spotdesc_nocol #1.0.1 |
| 345 |
* 1.0.2 - base explicitly upon spotdesc_nocol #1.0.2 |
| 346 |
* 1.1 - base explicitly upon spotdesc_nocol #1.1 |
| 347 |
*/ |
| 348 |
table NCBI:SRA:tbl:spotdesc_nophys #1.1 = NCBI:SRA:tbl:spotdesc_nocol #1.1 |
| 349 |
{ |
| 350 |
// resolve virtual productions |
| 351 |
U8 out_nreads = .NREADS; |
| 352 |
ascii out_label = .LABEL; |
| 353 |
INSDC:SRA:xread_type out_read_type = .READ_TYPE; |
| 354 |
INSDC:SRA:read_filter out_rd_filter = .RD_FILTER; |
| 355 |
INSDC:SRA:spot_filter out_spot_filter = .SPOT_FILTER; |
| 356 |
|
| 357 |
INSDC:coord:zero out_label_start |
| 358 |
= .LABEL_START |
| 359 |
| ( INSDC:coord:zero ) < U32 > cut < 0 > ( out_label_seg32 ); |
| 360 |
INSDC:coord:len out_label_len |
| 361 |
= .LABEL_LEN |
| 362 |
| ( INSDC:coord:len ) < U32 > cut < 1 > ( out_label_seg32 ); |
| 363 |
U32 [ 2 ] out_label_seg32 |
| 364 |
= cast ( .LABEL_SEG ); |
| 365 |
|
| 366 |
INSDC:coord:zero out_read_start |
| 367 |
= .READ_START |
| 368 |
| ( INSDC:coord:zero ) < U32 > cut < 0 > ( out_read_seg32 ); |
| 369 |
INSDC:coord:len out_read_len |
| 370 |
= .READ_LEN |
| 371 |
| ( INSDC:coord:len ) < U32 > cut < 1 > ( out_read_seg32 ); |
| 372 |
U32 [ 2 ] out_read_seg32 |
| 373 |
= NCBI:SRA:fix_read_seg ( .READ_SEG, spot_len ); |
| 374 |
|
| 375 |
|
| 376 |
/* INSDC:SRA:tbl:spotdesc inherited productions |
| 377 |
* trim_len |
| 378 |
* trim_start |
| 379 |
* out_read_type |
| 380 |
* static_fixed_spot_len |
| 381 |
*/ |
| 382 |
|
| 383 |
/* NCBI:SRA:tbl:spotdesc_nocol inherited productions |
| 384 |
* out_read_seg |
| 385 |
* out_label_seg |
| 386 |
*/ |
| 387 |
|
| 388 |
/* NCBI:SRA:tbl:spotdesc_nophys productions |
| 389 |
* .LABEL |
| 390 |
* .NREADS |
| 391 |
* .READ_LEN |
| 392 |
* .READ_SEG |
| 393 |
* .LABEL_LEN |
| 394 |
* .LABEL_SEG |
| 395 |
* .RD_FILTER |
| 396 |
* .READ_TYPE |
| 397 |
* .READ_START |
| 398 |
* .LABEL_START |
| 399 |
*/ |
| 400 |
} |
| 401 |
|
| 402 |
/* history: |
| 403 |
* 1.0.1 - base explicitly upon spotdesc_nophys #1.0.1 |
| 404 |
* 1.0.2 - base explicitly upon spotdesc_nophys #1.0.2 |
| 405 |
* 1.1 - base explicitly upon spotdesc_nophys #1.1 |
| 406 |
*/ |
| 407 |
table NCBI:SRA:tbl:spotdesc #1.1 = NCBI:SRA:tbl:spotdesc_nophys #1.1 |
| 408 |
{ |
| 409 |
// physical column encodings |
| 410 |
// TBD - this has to be looked at, where dynamic segmentation is involved |
| 411 |
physical column < U8 > zip_encoding .NREADS = NREADS; |
| 412 |
physical column < ascii > zip_encoding .LABEL = LABEL; |
| 413 |
physical column < INSDC:coord:zero > izip_encoding .LABEL_START = LABEL_START; |
| 414 |
physical column < INSDC:coord:len > izip_encoding .LABEL_LEN = LABEL_LEN; |
| 415 |
physical column < INSDC:coord:zero > izip_encoding .READ_START = in_read_start; |
| 416 |
physical column < INSDC:coord:len > izip_encoding .READ_LEN = in_read_len; |
| 417 |
physical column < INSDC:SRA:xread_type > zip_encoding .READ_TYPE = in_read_type; |
| 418 |
physical column < INSDC:SRA:read_filter > zip_encoding .RD_FILTER = in_read_filter; |
| 419 |
physical column < INSDC:SRA:spot_filter > zip_encoding .SPOT_FILTER = in_spot_filter; |
| 420 |
|
| 421 |
|
| 422 |
/* INSDC:SRA:tbl:spotdesc inherited productions |
| 423 |
* trim_len |
| 424 |
* trim_start |
| 425 |
* out_read_type |
| 426 |
* static_fixed_spot_len |
| 427 |
*/ |
| 428 |
|
| 429 |
/* NCBI:SRA:tbl:spotdesc_nocol inherited productions |
| 430 |
* out_read_seg |
| 431 |
* out_label_seg |
| 432 |
*/ |
| 433 |
}; |
| 434 |
|
| 435 |
|
| 436 |
/*-------------------------------------------------------------------------- |
| 437 |
* pos |
| 438 |
* synthetic POSITION column on read |
| 439 |
* |
| 440 |
* history: |
| 441 |
* 1.0.1 - base explicitly upon sequence #1.0.1 |
| 442 |
*/ |
| 443 |
|
| 444 |
table NCBI:SRA:tbl:pos #1.0.1 = INSDC:tbl:sequence #1.0.1 |
| 445 |
{ |
| 446 |
INSDC:position:one out_position |
| 447 |
= < INSDC:position:one > NCBI:SRA:make_position < 1 > ( out_2na_packed ) |
| 448 |
| < INSDC:position:one > NCBI:SRA:make_position < 1 > ( out_2cs_packed ); |
| 449 |
NCBI:SRA:pos16 out_position16 |
| 450 |
= < NCBI:SRA:pos16 > NCBI:SRA:make_position < 1 > ( out_2na_packed ) |
| 451 |
| < NCBI:SRA:pos16 > NCBI:SRA:make_position < 1 > ( out_2cs_packed ); |
| 452 |
}; |
| 453 |
|
| 454 |
|
| 455 |
/*-------------------------------------------------------------------------- |
| 456 |
* sra |
| 457 |
* the NCBI SRA table |
| 458 |
*/ |
| 459 |
|
| 460 |
/* history: |
| 461 |
* 1.0.1 - base explicitly upon sra #1.0.1 |
| 462 |
* 1.0.2 - base explicitly upon sra #1.0.2, spotdesc_nocol #1.0.1 |
| 463 |
* 1.0.3 - base explicitly upon sra #1.0.3, spotdesc_nocol #1.0.2 |
| 464 |
* 1.0.4 - base explicitly upon sra #1.0.4 |
| 465 |
*/ |
| 466 |
table NCBI:SRA:tbl:sra_nopos #1.0.4 |
| 467 |
= INSDC:SRA:tbl:sra #1.0.4 |
| 468 |
, NCBI:SRA:tbl:spotdesc_nocol #1.1 |
| 469 |
{ |
| 470 |
// v1 declares the POSITION column for all tables |
| 471 |
// but leaves all physical columns unstated |
| 472 |
|
| 473 |
/* POSITION |
| 474 |
* 1-based coordinates |
| 475 |
* describes a base's position on signal |
| 476 |
*/ |
| 477 |
column INSDC:position:one POSITION = out_position; |
| 478 |
readonly column NCBI:SRA:pos16 POSITION = out_position16; |
| 479 |
|
| 480 |
// zero-based coordinates available upon request |
| 481 |
readonly column INSDC:position:zero POSITION |
| 482 |
= ( INSDC:position:zero ) < I32 > diff < 1 > ( out_position ); |
| 483 |
|
| 484 |
// statistics |
| 485 |
U64 base_count |
| 486 |
= < U64 > meta:value < "BASE_COUNT" > (); |
| 487 |
U64 spot_count |
| 488 |
= < U64 > meta:value < ".seq/spot" > () |
| 489 |
| < U64 > meta:value < ".seq" > () ; |
| 490 |
|
| 491 |
|
| 492 |
/* INSDC:tbl:sequence inherited productions |
| 493 |
* cs_native |
| 494 |
* in_cs_key |
| 495 |
* out_cs_key |
| 496 |
* out_signal |
| 497 |
* in_dna_text |
| 498 |
* out_2cs_bin |
| 499 |
* out_2na_bin |
| 500 |
* out_4na_bin |
| 501 |
* out_dna_text |
| 502 |
* out_x2cs_bin |
| 503 |
* out_x2na_bin |
| 504 |
* in_color_text |
| 505 |
* out_2cs_packed |
| 506 |
* out_2na_packed |
| 507 |
* out_4na_packed |
| 508 |
* out_color_text |
| 509 |
* out_qual_phred |
| 510 |
* out_color_matrix |
| 511 |
*/ |
| 512 |
|
| 513 |
/* INSDC:SRA:tbl:spotname inherited productions |
| 514 |
* out_x_coord |
| 515 |
* out_y_coord |
| 516 |
* out_name_fmt |
| 517 |
* out_spot_name |
| 518 |
* spot_ids_found |
| 519 |
*/ |
| 520 |
|
| 521 |
/* INSDC:SRA:tbl:spotdesc inherited productions |
| 522 |
* trim_len |
| 523 |
* out_label |
| 524 |
* out_nreads |
| 525 |
* trim_start |
| 526 |
* out_read_len |
| 527 |
* out_label_len |
| 528 |
* out_rd_filter |
| 529 |
* out_read_type |
| 530 |
* out_read_start |
| 531 |
* out_label_start |
| 532 |
* static_fixed_spot_len |
| 533 |
*/ |
| 534 |
|
| 535 |
/* INSDC:SRA:tbl:stats inherited productions |
| 536 |
* max_spot_id |
| 537 |
* min_spot_id |
| 538 |
* in_stats_bin |
| 539 |
* bio_base_count |
| 540 |
*/ |
| 541 |
|
| 542 |
/* INSDC:SRA:tbl:sra inherited productions |
| 543 |
* out_platform |
| 544 |
* platform_name |
| 545 |
*/ |
| 546 |
|
| 547 |
/* NCBI:SRA:tbl:spotdesc_nocol inherited productions |
| 548 |
* out_read_seg |
| 549 |
* out_label_seg |
| 550 |
* out_read_seg32 |
| 551 |
* out_label_seg32 |
| 552 |
*/ |
| 553 |
|
| 554 |
/* NCBI:SRA:tbl:sra_nopos productions |
| 555 |
* out_position |
| 556 |
* out_position16 |
| 557 |
*/ |
| 558 |
}; |
| 559 |
|
| 560 |
/* history: |
| 561 |
* 1.0.1 - base explicitly upon sra #1.0.1 |
| 562 |
* 1.0.2 - base explicitly upon sra_nopos #1.0.2, pos #1.0.1 |
| 563 |
* 1.0.3 - base explicitly upon sra_nopos #1.0.3 |
| 564 |
* 1.0.4 - base explicitly upon sra_nopos #1.0.4 |
| 565 |
*/ |
| 566 |
table NCBI:SRA:tbl:sra #1.0.4 = NCBI:SRA:tbl:sra_nopos #1.0.4, NCBI:SRA:tbl:pos #1.0.1 |
| 567 |
{ |
| 568 |
// the POSITION column is synthesized for all contemporary platforms but 454 |
| 569 |
|
| 570 |
/* INSDC:tbl:sequence inherited productions |
| 571 |
* cs_native |
| 572 |
* in_cs_key |
| 573 |
* out_cs_key |
| 574 |
* out_signal |
| 575 |
* in_dna_text |
| 576 |
* out_2cs_bin |
| 577 |
* out_2na_bin |
| 578 |
* out_4na_bin |
| 579 |
* out_dna_text |
| 580 |
* out_x2cs_bin |
| 581 |
* out_x2na_bin |
| 582 |
* in_color_text |
| 583 |
* out_2cs_packed |
| 584 |
* out_2na_packed |
| 585 |
* out_4na_packed |
| 586 |
* out_color_text |
| 587 |
* out_qual_phred |
| 588 |
* out_color_matrix |
| 589 |
*/ |
| 590 |
|
| 591 |
/* INSDC:SRA:tbl:spotname inherited productions |
| 592 |
* out_x_coord |
| 593 |
* out_y_coord |
| 594 |
* out_name_fmt |
| 595 |
* out_spot_name |
| 596 |
* spot_ids_found |
| 597 |
*/ |
| 598 |
|
| 599 |
/* INSDC:SRA:tbl:spotdesc inherited productions |
| 600 |
* trim_len |
| 601 |
* out_label |
| 602 |
* out_nreads |
| 603 |
* trim_start |
| 604 |
* out_read_len |
| 605 |
* out_label_len |
| 606 |
* out_rd_filter |
| 607 |
* out_read_type |
| 608 |
* out_read_start |
| 609 |
* out_label_start |
| 610 |
* static_fixed_spot_len |
| 611 |
*/ |
| 612 |
|
| 613 |
/* INSDC:SRA:tbl:stats inherited productions |
| 614 |
* max_spot_id |
| 615 |
* min_spot_id |
| 616 |
* in_stats_bin |
| 617 |
* bio_base_count |
| 618 |
*/ |
| 619 |
|
| 620 |
/* INSDC:SRA:tbl:sra inherited productions |
| 621 |
* out_platform |
| 622 |
* platform_name |
| 623 |
*/ |
| 624 |
|
| 625 |
/* NCBI:SRA:tbl:spotdesc_nocol inherited productions |
| 626 |
* out_read_seg |
| 627 |
* out_label_seg |
| 628 |
* out_read_seg32 |
| 629 |
* out_label_seg32 |
| 630 |
*/ |
| 631 |
}; |
| 632 |
|
| 633 |
|
| 634 |
/* v2 consolidates many of the auxiliary columns into a single treatment |
| 635 |
* left out are reads, qualities and platform-specific columns |
| 636 |
* |
| 637 |
* history: |
| 638 |
* 2.1.2 - base upon sra #1.0.3, spotdesc #1.0.2, stats #1.1.2 |
| 639 |
* 2.1.4 - base upon sra #1.0.4, skeyname #3.0.2, stats #1.2.1 |
| 640 |
*/ |
| 641 |
table NCBI:SRA:tbl:sra_nopos #2.1.4 |
| 642 |
= INSDC:SRA:tbl:sra #1.0.4 |
| 643 |
, NCBI:SRA:tbl:skeyname #3.1 |
| 644 |
, NCBI:SRA:tbl:spotdesc #1.1 |
| 645 |
, NCBI:SRA:tbl:stats #1.2.1 |
| 646 |
{ |
| 647 |
// this is already specified in INSDC:SRA:tbl:sra #1 |
| 648 |
// but putting it here will quiet down outputs |
| 649 |
INSDC:SRA:platform_id out_platform = .PLATFORM; |
| 650 |
|
| 651 |
column INSDC:position:one POSITION |
| 652 |
= out_position; |
| 653 |
readonly column NCBI:SRA:pos16 POSITION |
| 654 |
= cast ( _clip_position ); |
| 655 |
INSDC:position:one _clip_position |
| 656 |
= < INSDC:position:one > clip < 0, 0xFFFF > ( out_position ); |
| 657 |
readonly column INSDC:position:zero POSITION |
| 658 |
= ( INSDC:position:zero ) < I32 > diff < 1 > ( out_position ); |
| 659 |
|
| 660 |
|
| 661 |
/* INSDC:tbl:sequence inherited productions |
| 662 |
* cs_native |
| 663 |
* in_cs_key |
| 664 |
* out_cs_key |
| 665 |
* out_signal |
| 666 |
* in_dna_text |
| 667 |
* out_2cs_bin |
| 668 |
* out_2na_bin |
| 669 |
* out_4na_bin |
| 670 |
* out_dna_text |
| 671 |
* out_x2cs_bin |
| 672 |
* out_x2na_bin |
| 673 |
* in_color_text |
| 674 |
* out_2cs_packed |
| 675 |
* out_2na_packed |
| 676 |
* out_4na_packed |
| 677 |
* out_color_text |
| 678 |
* out_qual_phred |
| 679 |
* out_color_matrix |
| 680 |
*/ |
| 681 |
|
| 682 |
/* INSDC:SRA:tbl:spotdesc inherited productions |
| 683 |
* trim_len |
| 684 |
* trim_start |
| 685 |
* out_read_type |
| 686 |
* static_fixed_spot_len |
| 687 |
*/ |
| 688 |
|
| 689 |
/* INSDC:SRA:tbl:stats inherited productions |
| 690 |
* in_stats_bin |
| 691 |
*/ |
| 692 |
|
| 693 |
/* INSDC:SRA:tbl:sra inherited productions |
| 694 |
* out_platform |
| 695 |
* platform_name |
| 696 |
*/ |
| 697 |
|
| 698 |
/* NCBI:SRA:tbl:skeyname inherited productions |
| 699 |
* in_spot_name_tok |
| 700 |
*/ |
| 701 |
|
| 702 |
/* NCBI:SRA:tbl:spotdesc_nocol inherited productions |
| 703 |
* out_read_seg |
| 704 |
* out_label_seg |
| 705 |
*/ |
| 706 |
|
| 707 |
/* NCBI:SRA:tbl:sra_nopos productions |
| 708 |
* out_position |
| 709 |
*/ |
| 710 |
}; |
| 711 |
|
| 712 |
/* most platforms don't have a native POSITION |
| 713 |
* mix in "pos" table to synthesize it |
| 714 |
* |
| 715 |
* history: |
| 716 |
* 2.1.2 - base upon sra#1.0.3, spotdesc #1.0.2, stats #1.1.2 |
| 717 |
* 2.1.4 - base upon sra #1.0.4, skeyname #3.0.2, stats #1.2.1 |
| 718 |
*/ |
| 719 |
table NCBI:SRA:tbl:sra #2.1.4 |
| 720 |
= INSDC:SRA:tbl:sra #1.0.4 |
| 721 |
, NCBI:SRA:tbl:skeyname #3.1 |
| 722 |
, NCBI:SRA:tbl:spotdesc #1.1 |
| 723 |
, NCBI:SRA:tbl:stats #1.2.1 |
| 724 |
, NCBI:SRA:tbl:pos #1.0.1 |
| 725 |
{ |
| 726 |
readonly column INSDC:position:one POSITION |
| 727 |
= out_position; |
| 728 |
readonly column NCBI:SRA:pos16 POSITION |
| 729 |
= out_position16; |
| 730 |
readonly column INSDC:position:zero POSITION |
| 731 |
= ( INSDC:position:zero ) < I32 > diff < 1 > ( out_position ); |
| 732 |
|
| 733 |
|
| 734 |
/* INSDC:tbl:sequence inherited productions |
| 735 |
* cs_native |
| 736 |
* in_cs_key |
| 737 |
* out_cs_key |
| 738 |
* out_signal |
| 739 |
* in_dna_text |
| 740 |
* out_2cs_bin |
| 741 |
* out_2na_bin |
| 742 |
* out_4na_bin |
| 743 |
* out_dna_text |
| 744 |
* out_x2cs_bin |
| 745 |
* out_x2na_bin |
| 746 |
* in_color_text |
| 747 |
* out_2cs_packed |
| 748 |
* out_2na_packed |
| 749 |
* out_4na_packed |
| 750 |
* out_color_text |
| 751 |
* out_qual_phred |
| 752 |
* out_color_matrix |
| 753 |
*/ |
| 754 |
|
| 755 |
/* INSDC:SRA:tbl:spotdesc inherited productions |
| 756 |
* trim_len |
| 757 |
* trim_start |
| 758 |
* out_read_type |
| 759 |
* static_fixed_spot_len |
| 760 |
*/ |
| 761 |
|
| 762 |
/* INSDC:SRA:tbl:stats inherited productions |
| 763 |
* in_stats_bin |
| 764 |
*/ |
| 765 |
|
| 766 |
/* INSDC:SRA:tbl:sra inherited productions |
| 767 |
* out_platform |
| 768 |
* platform_name |
| 769 |
*/ |
| 770 |
|
| 771 |
/* NCBI:SRA:tbl:skeyname inherited productions |
| 772 |
* in_spot_name_tok |
| 773 |
*/ |
| 774 |
}; |