@@ -141,17 +141,17 @@ pub mod vcf_header {
141
141
use crate :: ped:: { Disease , PedigreeByName , Sex } ;
142
142
143
143
/// Major VCF version to use.
144
- static FILE_FORMAT_MAJOR : u32 = 4 ;
144
+ pub ( crate ) const FILE_FORMAT_MAJOR : u32 = 4 ;
145
145
/// Minor VCF version to use.
146
- static FILE_FORMAT_MINOR : u32 = 3 ;
146
+ pub ( crate ) const FILE_FORMAT_MINOR : u32 = 3 ;
147
147
/// The string to write out as the source.
148
- static SOURCE : & str = "mehari" ;
148
+ pub ( crate ) const SOURCE : & str = "mehari" ;
149
149
150
150
/// Construct VCF header.
151
151
///
152
152
/// # Arguments
153
153
///
154
- /// * `assembly` - Genome assembly to use. The canonical contigs will be taken from here.
154
+ /// * `assembly` - Genome assembly to use. The canonical contigs will be taken from here.
155
155
/// * `pedigree` - Pedigree to use. Will write out appropriate `META`, `SAMPLE`, and
156
156
/// `PEDIGREE` header lines.
157
157
/// * `date` - Date to use for the `fileDate` header line.
@@ -514,6 +514,8 @@ pub mod vcf_header {
514
514
}
515
515
}
516
516
517
+ use crate :: annotate:: strucvars:: vcf_header:: { FILE_FORMAT_MAJOR , FILE_FORMAT_MINOR } ;
518
+
517
519
/// Writing of structural variants to VarFish TSV files.
518
520
struct VarFishStrucvarTsvWriter {
519
521
/// The actual (compressed) text output writer.
@@ -864,8 +866,10 @@ impl AsyncAnnotatedVariantWriter for VarFishStrucvarTsvWriter {
864
866
entry. gt = Some ( gt. clone ( ) ) ;
865
867
}
866
868
( "GT" , Some ( sample:: Value :: Genotype ( gt) ) ) => {
867
- // FIXME get file format version from header
868
- let gt = genotype_string ( gt, FileFormat :: new ( 4 , 0 ) ) ;
869
+ let gt = genotype_string (
870
+ gt,
871
+ FileFormat :: new ( FILE_FORMAT_MAJOR , FILE_FORMAT_MINOR ) ,
872
+ ) ;
869
873
entry. gt = Some ( gt) ;
870
874
}
871
875
( "FT" , Some ( sample:: Value :: String ( ft) ) ) => {
@@ -2018,6 +2022,8 @@ mod conv {
2018
2022
use super :: VarFishStrucvarTsvRecord ;
2019
2023
use super :: VcfRecordConverter ;
2020
2024
2025
+ use super :: vcf_header:: { FILE_FORMAT_MAJOR , FILE_FORMAT_MINOR } ;
2026
+
2021
2027
/// Helper function that extract the CIPOS and CIEND fields from `vcf_record` into `tsv_record`.
2022
2028
pub fn extract_standard_cis (
2023
2029
vcf_record : & VcfRecord ,
@@ -2097,8 +2103,10 @@ mod conv {
2097
2103
process_gt ( & mut entries, sample_no, gt, pedigree, tsv_record) ;
2098
2104
}
2099
2105
( "GT" , Some ( sample:: Value :: Genotype ( gt) ) ) => {
2100
- // FIXME get file format version from header
2101
- let gt = genotype_string ( gt, FileFormat :: new ( 4 , 0 ) ) ;
2106
+ let gt = genotype_string (
2107
+ gt,
2108
+ FileFormat :: new ( FILE_FORMAT_MAJOR , FILE_FORMAT_MINOR ) ,
2109
+ ) ;
2102
2110
process_gt ( & mut entries, sample_no, & gt, pedigree, tsv_record) ;
2103
2111
}
2104
2112
// Obtain `GenotypeInfo::cn` from `FORMAT/CN`.
@@ -2183,8 +2191,10 @@ mod conv {
2183
2191
process_gt ( & mut entries, sample_no, gt, pedigree, tsv_record) ;
2184
2192
}
2185
2193
( "GT" , Some ( sample:: Value :: Genotype ( gt) ) ) => {
2186
- // FIXME get file format version from header
2187
- let gt = genotype_string ( gt, FileFormat :: new ( 4 , 0 ) ) ;
2194
+ let gt = genotype_string (
2195
+ gt,
2196
+ FileFormat :: new ( FILE_FORMAT_MAJOR , FILE_FORMAT_MINOR ) ,
2197
+ ) ;
2188
2198
process_gt ( & mut entries, sample_no, & gt, pedigree, tsv_record) ;
2189
2199
}
2190
2200
// Obtain `GenotypeInfo::gq` from `FORMAT/GQ`.
@@ -2281,8 +2291,10 @@ mod conv {
2281
2291
process_gt ( & mut entries, sample_no, gt, pedigree, tsv_record) ;
2282
2292
}
2283
2293
( "GT" , Some ( sample:: Value :: Genotype ( gt) ) ) => {
2284
- // FIXME get file format version from header
2285
- let gt = genotype_string ( gt, FileFormat :: new ( 4 , 0 ) ) ;
2294
+ let gt = genotype_string (
2295
+ gt,
2296
+ FileFormat :: new ( FILE_FORMAT_MAJOR , FILE_FORMAT_MINOR ) ,
2297
+ ) ;
2286
2298
process_gt ( & mut entries, sample_no, & gt, pedigree, tsv_record) ;
2287
2299
}
2288
2300
// Obtain `GenotypeInfo::pev` from `FORMAT/PE`; no pec is computed.
@@ -2403,8 +2415,10 @@ mod conv {
2403
2415
process_gt ( & mut entries, sample_no, gt, pedigree, tsv_record) ;
2404
2416
}
2405
2417
( "GT" , Some ( sample:: Value :: Genotype ( gt) ) ) => {
2406
- // FIXME get file format version from header
2407
- let gt = genotype_string ( gt, FileFormat :: new ( 4 , 0 ) ) ;
2418
+ let gt = genotype_string (
2419
+ gt,
2420
+ FileFormat :: new ( FILE_FORMAT_MAJOR , FILE_FORMAT_MINOR ) ,
2421
+ ) ;
2408
2422
process_gt ( & mut entries, sample_no, & gt, pedigree, tsv_record) ;
2409
2423
}
2410
2424
// Obtain `GenotypeInfo::cn` from `FORMAT/CN`.
@@ -2471,8 +2485,10 @@ mod conv {
2471
2485
process_gt ( & mut entries, sample_no, gt, pedigree, tsv_record) ;
2472
2486
}
2473
2487
( "GT" , Some ( sample:: Value :: Genotype ( gt) ) ) => {
2474
- // FIXME get file format version from header
2475
- let gt = genotype_string ( gt, FileFormat :: new ( 4 , 0 ) ) ;
2488
+ let gt = genotype_string (
2489
+ gt,
2490
+ FileFormat :: new ( FILE_FORMAT_MAJOR , FILE_FORMAT_MINOR ) ,
2491
+ ) ;
2476
2492
process_gt ( & mut entries, sample_no, & gt, pedigree, tsv_record) ;
2477
2493
}
2478
2494
// Obtain `GenotypeInfo::gq` from `FORMAT/GQ`.
@@ -2572,8 +2588,10 @@ mod conv {
2572
2588
process_gt ( & mut entries, sample_no, gt, pedigree, tsv_record) ;
2573
2589
}
2574
2590
( "GT" , Some ( sample:: Value :: Genotype ( gt) ) ) => {
2575
- // FIXME get file format version from header
2576
- let gt = genotype_string ( gt, FileFormat :: new ( 4 , 0 ) ) ;
2591
+ let gt = genotype_string (
2592
+ gt,
2593
+ FileFormat :: new ( FILE_FORMAT_MAJOR , FILE_FORMAT_MINOR ) ,
2594
+ ) ;
2577
2595
process_gt ( & mut entries, sample_no, & gt, pedigree, tsv_record) ;
2578
2596
}
2579
2597
// Obtain `GenotypeInfo::gq` from `FORMAT/GL`.
@@ -2678,8 +2696,10 @@ mod conv {
2678
2696
process_gt ( & mut entries, sample_no, gt, pedigree, tsv_record) ;
2679
2697
}
2680
2698
( "GT" , Some ( sample:: Value :: Genotype ( gt) ) ) => {
2681
- // FIXME get file format version from header
2682
- let gt = genotype_string ( gt, FileFormat :: new ( 4 , 0 ) ) ;
2699
+ let gt = genotype_string (
2700
+ gt,
2701
+ FileFormat :: new ( FILE_FORMAT_MAJOR , FILE_FORMAT_MINOR ) ,
2702
+ ) ;
2683
2703
process_gt ( & mut entries, sample_no, & gt, pedigree, tsv_record) ;
2684
2704
}
2685
2705
// Obtain `GenotypeInfo::gq` from `FORMAT/GQ`.
@@ -2876,8 +2896,10 @@ mod conv {
2876
2896
process_gt ( & mut entries, sample_no, gt, pedigree, tsv_record) ;
2877
2897
}
2878
2898
( "GT" , Some ( sample:: Value :: Genotype ( gt) ) ) => {
2879
- // FIXME get file format version from header
2880
- let gt = genotype_string ( gt, FileFormat :: new ( 4 , 0 ) ) ;
2899
+ let gt = genotype_string (
2900
+ gt,
2901
+ FileFormat :: new ( FILE_FORMAT_MAJOR , FILE_FORMAT_MINOR ) ,
2902
+ ) ;
2881
2903
process_gt ( & mut entries, sample_no, & gt, pedigree, tsv_record) ;
2882
2904
}
2883
2905
// Obtain `GenotypeInfo::gq` from `FORMAT/GQ`.
0 commit comments