From 3c52fe00c88591fd1a2f730ece1629d308965a03 Mon Sep 17 00:00:00 2001 From: Philipp Benner Date: Thu, 24 Oct 2024 10:59:43 +0200 Subject: [PATCH] 2024/10/24-10:59:43 (Linux cray unknown) --- README.md | 6 ++++++ src/genes_ucsc.rs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5647641..d053fe9 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,12 @@ Please find the API documentation [here](https://docs.rs/rustynetics/latest/rust ```rust use crate::genes::Genes; +// Import from local file +if let Ok(genes) = Genes::import_genes("data/hg19.knownGene.txt.gz") { + + println!("{}", genes); +} +// Retrieve from USCS server if let Ok(genes) = Genes::import_genes_from_ucsc("hg19", "knownGene") { println!("{}", genes); diff --git a/src/genes_ucsc.rs b/src/genes_ucsc.rs index d188044..6f3b75e 100644 --- a/src/genes_ucsc.rs +++ b/src/genes_ucsc.rs @@ -29,7 +29,7 @@ use crate::utility::is_gzip; impl Genes { - pub fn read_ucsc_genes(filename: &str) -> Result> { + pub fn import_genes(filename: &str) -> Result> { let mut names = vec![]; let mut seqnames = vec![]; let mut tx_from = vec![];