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
//! BED Types and Functionality
//!
//! The BED (Browser Extensible Format) is a TSV format in bioinformatics.
//! It has a fairly strict [specification](https://samtools.github.io/hts-specs/BEDv1.pdf),
//! but in practice it is quite permissive, and in bioinformatics one encounters lots
//! of "BED-like" files.
//!
//! # Design
//!
//! Since BED files can be thought of BED3 + an optional *addition*, the type
//! returned by these parsing iterators is [`GenomicRangeRecord<U>`] where
//! `U` is some sort of addition type like [`Bed5Addition`].
//!
//! # ⚠️ Stability
//!
//! This module defines core BED types, but is under active development.
//!
pub use Bed3Iterator;
pub use ;
pub use ;
pub use ;
use Error as DeError;
use ;
use FromStr;
/// [`serde`] deserializer for a BED column with a possibly missing value. Note that the [BED
/// specification](https://samtools.github.io/hts-specs/BEDv1.pdf) only technically allows `'.'` to
/// be used for missing strands, but in practice it can be found to represent
/// missing scores, etc too.
/// Nucleotide strand enum type.
/// Deserializes some value of type `t` with some possible missing
/// character `missing_chars` into [`Option<T>`].
// TODO
///// Parses a BED6 format line into the three columns defining the range, and additional
///// columns
/////
//pub fn parse_bed6(line: &str) -> Result<GenomicRangeRecord<Bed5Addition>, GRangesError> {
// let columns: Vec<&str> = line.splitn(4, '\t').collect();
// if columns.len() < 3 {
// return Err(GRangesError::BedlikeTooFewColumns(line.to_string()));
// }
//
// let seqname = parse_column(columns[0], line)?;
// let start: Position = parse_column(columns[1], line)?;
// let end: Position = parse_column(columns[2], line)?;
//
// let name = parse_column(columns[3], line)?;
// // let strand: Option<Strand> = parse_strand(parse_column(columns[3], line)?)?;
//
// let data = Bed5Addition { name, score };
//
// Ok(GenomicRangeRecord {
// seqname,
// start,
// end,
// data,
// })
//}