11//! Provide Rust-based chainfile wrapping classes.
2- use chain:: core:: { Coordinate , Interval , Strand } ;
32use chainfile as chain;
3+ use omics:: coordinate:: { interbase:: Coordinate , interval:: interbase:: Interval , Strand } ;
44use pyo3:: create_exception;
55use pyo3:: exceptions:: { PyException , PyFileNotFoundError , PyValueError } ;
66use pyo3:: prelude:: * ;
@@ -40,7 +40,7 @@ impl Converter {
4040 }
4141
4242 /// Perform liftover
43- pub fn lift ( & self , chrom : & str , pos : usize , strand : & str ) -> PyResult < Vec < Vec < String > > > {
43+ pub fn lift ( & self , chrom : & str , pos : u64 , strand : & str ) -> PyResult < Vec < Vec < String > > > {
4444 let parsed_strand = if strand == "+" {
4545 Strand :: Positive
4646 } else if strand == "-" {
@@ -52,8 +52,8 @@ impl Converter {
5252 ) ) ) ;
5353 } ;
5454 // safe to unwrap coordinates because `pos` is always an int
55- let start = Coordinate :: try_new ( chrom, pos , parsed_strand. clone ( ) ) . unwrap ( ) ;
56- let end = Coordinate :: try_new ( chrom, pos + 1 , parsed_strand. clone ( ) ) . unwrap ( ) ;
55+ let start = Coordinate :: new ( chrom, parsed_strand. clone ( ) , pos ) ;
56+ let end = Coordinate :: new ( chrom, parsed_strand. clone ( ) , pos + 1 ) ;
5757
5858 let Ok ( interval) = Interval :: try_new ( start, end) else {
5959 return Err ( ChainfileError :: new_err ( format ! (
@@ -63,7 +63,7 @@ impl Converter {
6363 pos + 1
6464 ) ) ) ;
6565 } ;
66- if let Some ( liftover_result) = self . machine . liftover ( & interval) {
66+ if let Some ( liftover_result) = self . machine . liftover ( interval. clone ( ) ) {
6767 Ok ( liftover_result
6868 . iter ( )
6969 . map ( |r| {
0 commit comments