diff --git a/Cargo.toml b/Cargo.toml index f12beee..b8f9de8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,10 +8,10 @@ crate-type = ["cdylib"] name = "biobear" [dependencies] -arrow = { version = "52.1.0", features = ["pyarrow"] } -datafusion = "41" +arrow = { version = "53.3.0", features = ["pyarrow"] } +datafusion = "43" exon = { version = "0.32.4", features = ["default"] } -pyo3 = "0.23.3" +pyo3 = "0.22.2" tokio = { version = "1", features = ["rt"] } noodles = { version = "0.86", features = ["core"] } diff --git a/pyproject.toml b/pyproject.toml index 8ee6a5d..0182683 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] build-backend = "maturin" -requires = ["maturin==1.5.1"] +requires = ["maturin==1.7.8"] [project] authors = [{ name = "WHERE TRUE devs", email = "thauck+biobear@wheretrue.com" }] diff --git a/src/bam_reader.rs b/src/bam_reader.rs index 90c2087..bf8ff5a 100644 --- a/src/bam_reader.rs +++ b/src/bam_reader.rs @@ -57,6 +57,7 @@ impl BamIndexedReader { #[pymethods] impl BamIndexedReader { #[new] + #[pyo3(signature = (path, batch_size=None))] fn new(path: &str, batch_size: Option) -> PyResult { Self::open(path, batch_size).map_err(|e| { PyErr::new::(format!( diff --git a/src/bcf_reader.rs b/src/bcf_reader.rs index f9287dc..7ab3207 100644 --- a/src/bcf_reader.rs +++ b/src/bcf_reader.rs @@ -58,6 +58,7 @@ impl BCFIndexedReader { #[pymethods] impl BCFIndexedReader { #[new] + #[pyo3(signature = (path, batch_size=None))] fn new(path: &str, batch_size: Option) -> PyResult { Self::open(path, batch_size).map_err(PyErr::new::) } diff --git a/src/datasources/bam.rs b/src/datasources/bam.rs index 8ff00f7..86c956b 100644 --- a/src/datasources/bam.rs +++ b/src/datasources/bam.rs @@ -27,6 +27,7 @@ pub struct BAMReadOptions { #[pymethods] impl BAMReadOptions { #[new] + #[pyo3(signature = (region=None))] pub fn try_new(region: Option) -> PyResult { let region = parse_region(region)?; diff --git a/src/datasources/cram.rs b/src/datasources/cram.rs index ecbba56..6096475 100644 --- a/src/datasources/cram.rs +++ b/src/datasources/cram.rs @@ -28,6 +28,7 @@ pub struct CRAMReadOptions { #[pymethods] impl CRAMReadOptions { #[new] + #[pyo3(signature = (region=None, fasta_reference=None))] pub fn try_new(region: Option, fasta_reference: Option) -> PyResult { let region = parse_region(region)?; diff --git a/src/datasources/fasta.rs b/src/datasources/fasta.rs index eb3964c..5eb4753 100644 --- a/src/datasources/fasta.rs +++ b/src/datasources/fasta.rs @@ -20,8 +20,8 @@ use pyo3::{pyclass, pymethods}; const DEFAULT_FASTA_FILE_EXTENSION: &str = "fasta"; -#[derive(Debug, Clone)] -#[pyclass] +#[derive(Debug, Clone, PartialEq, Eq)] +#[pyclass(eq, eq_int)] pub enum FastaSequenceDataType { UTF8, #[allow(non_camel_case_types)] diff --git a/src/datasources/fcs.rs b/src/datasources/fcs.rs index 4278da6..4bcf4cf 100644 --- a/src/datasources/fcs.rs +++ b/src/datasources/fcs.rs @@ -27,6 +27,7 @@ pub struct FCSReadOptions { #[pymethods] impl FCSReadOptions { #[new] + #[pyo3(signature = (file_compression_type=None))] pub fn new(file_compression_type: Option) -> Self { Self { file_compression_type: file_compression_type.unwrap_or_default(), diff --git a/src/datasources/genbank.rs b/src/datasources/genbank.rs index 13715c9..6564b38 100644 --- a/src/datasources/genbank.rs +++ b/src/datasources/genbank.rs @@ -32,6 +32,7 @@ impl_settable_from_file_options!(GenBankReadOptions); #[pymethods] impl GenBankReadOptions { #[new] + #[pyo3(signature = (file_compression_type=None))] fn new(file_compression_type: Option) -> Self { Self { file_compression_type, diff --git a/src/datasources/gtf.rs b/src/datasources/gtf.rs index 44cd83a..dd7f956 100644 --- a/src/datasources/gtf.rs +++ b/src/datasources/gtf.rs @@ -38,6 +38,7 @@ impl_settable_from_file_options!(GTFReadOptions); #[pymethods] impl GTFReadOptions { #[new] + #[pyo3(signature = (file_compression_type=None))] pub fn new(file_compression_type: Option) -> Self { Self { file_compression_type, diff --git a/src/datasources/hmm_dom_tab.rs b/src/datasources/hmm_dom_tab.rs index 49ecf84..bad8ade 100644 --- a/src/datasources/hmm_dom_tab.rs +++ b/src/datasources/hmm_dom_tab.rs @@ -39,6 +39,7 @@ impl SettableFromFileOptions for HMMDomTabReadOptions { #[pymethods] impl HMMDomTabReadOptions { #[new] + #[pyo3(signature = (file_extension=None, file_compression_type=None))] fn new( file_extension: Option, file_compression_type: Option, diff --git a/src/datasources/mzml.rs b/src/datasources/mzml.rs index 4ebb742..33a00dc 100644 --- a/src/datasources/mzml.rs +++ b/src/datasources/mzml.rs @@ -39,6 +39,7 @@ impl Default for MzMLReadOptions { #[pymethods] impl MzMLReadOptions { #[new] + #[pyo3(signature = (file_compression_type=None))] fn new(file_compression_type: Option) -> Self { Self { file_compression_type: Some( diff --git a/src/exon_reader.rs b/src/exon_reader.rs index e31480e..5f986a4 100644 --- a/src/exon_reader.rs +++ b/src/exon_reader.rs @@ -76,6 +76,7 @@ impl ExonReader { #[pymethods] impl ExonReader { #[new] + #[pyo3(signature = (path, file_type, compression=None, batch_size=None))] fn new( path: &str, file_type: &str, diff --git a/src/file_compression_type.rs b/src/file_compression_type.rs index 34d02f9..784eda4 100644 --- a/src/file_compression_type.rs +++ b/src/file_compression_type.rs @@ -22,8 +22,8 @@ use pyo3::prelude::*; use crate::error::BioBearError; -#[pyclass] #[derive(Debug, Clone, PartialEq)] +#[pyclass(eq, eq_int)] pub enum FileCompressionType { GZIP, ZSTD, diff --git a/src/session_context.rs b/src/session_context.rs index 0c64ba0..d79c182 100644 --- a/src/session_context.rs +++ b/src/session_context.rs @@ -44,6 +44,7 @@ impl BioBearSessionContext { } /// Read one or more VCF files from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_vcf_file( &mut self, file_path: &str, @@ -62,6 +63,7 @@ impl BioBearSessionContext { } /// Read a HMM Dom Tab file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_hmm_dom_tab_file( &mut self, file_path: &str, @@ -80,6 +82,7 @@ impl BioBearSessionContext { } /// Read an SDF file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_sdf_file( &mut self, file_path: &str, @@ -98,6 +101,7 @@ impl BioBearSessionContext { } /// Read a bigwig file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_bigwig_file( &mut self, file_path: &str, @@ -126,6 +130,7 @@ impl BioBearSessionContext { } /// Read a gff file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_gff_file( &mut self, file_path: &str, @@ -143,6 +148,7 @@ impl BioBearSessionContext { } /// Read a fastq file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_fastq_file( &mut self, file_path: &str, @@ -161,6 +167,7 @@ impl BioBearSessionContext { } /// Read a genbank file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_genbank_file( &mut self, file_path: &str, @@ -179,6 +186,7 @@ impl BioBearSessionContext { } /// Read a CRAM file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_cram_file( &mut self, file_path: &str, @@ -194,6 +202,7 @@ impl BioBearSessionContext { } /// Read a mzml file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_mzml_file( &mut self, file_path: &str, @@ -212,6 +221,7 @@ impl BioBearSessionContext { } /// Read a GTF file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_gtf_file( &mut self, file_path: &str, @@ -230,6 +240,7 @@ impl BioBearSessionContext { } /// Read a BCF file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_bcf_file( &mut self, file_path: &str, @@ -245,6 +256,7 @@ impl BioBearSessionContext { } /// Read a fasta file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_fasta_file( &mut self, file_path: &str, @@ -263,6 +275,7 @@ impl BioBearSessionContext { } /// Read a BED file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_bed_file( &mut self, file_path: &str, @@ -281,6 +294,7 @@ impl BioBearSessionContext { } /// Read a BAM file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_bam_file( &mut self, file_path: &str, @@ -296,6 +310,7 @@ impl BioBearSessionContext { } /// Read a SAM file from the given path. + #[pyo3(signature = (file_path, options=None))] fn read_sam_file( &mut self, file_path: &str, diff --git a/src/vcf_reader.rs b/src/vcf_reader.rs index f41f7a1..0fb5b24 100644 --- a/src/vcf_reader.rs +++ b/src/vcf_reader.rs @@ -59,6 +59,7 @@ impl VCFIndexedReader { #[pymethods] impl VCFIndexedReader { #[new] + #[pyo3(signature = (path, batch_size=None))] fn new(path: &str, batch_size: Option) -> PyResult { Self::open(path, batch_size).map_err(PyErr::new::) }