diff --git a/Cargo.lock b/Cargo.lock index 2e66ddeb9..e7931e746 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -445,7 +445,6 @@ dependencies = [ "amino", "ansi_escape", "anyhow", - "attohttpc", "bio_edit", "debruijn", "enclone_proto", diff --git a/enclone/src/UNDOC_OPTIONS b/enclone/src/UNDOC_OPTIONS index 4f7e4909d..9f4489ebc 100644 --- a/enclone/src/UNDOC_OPTIONS +++ b/enclone/src/UNDOC_OPTIONS @@ -99,8 +99,6 @@ CURRENT_REF: temp option to force CR 4.0 reference H5_SLICE: read GEX data slice by slice rather than preloading -FORCE_EXTERNAL: do not test for internal run - STABLE_DOC: print documentation in a way that it won't change when the git version changes LVARS entries @@ -299,8 +297,6 @@ barcode, and fb1_n is the number of UMIs for that feature barcode SIM_MAT_PLOT=filename,v1,...,vn generate a plot of the all-vs-all per cell cosine similarity for the variables vi -NO_BUG_REPORTS: don't automatically report bugs - SUBSAMPLE: subsample barcodes at the indicated fraction; at present this is deliberately randomly seeded and so nonreproducible diff --git a/enclone/src/bin/update_enclone_binary.rs b/enclone/src/bin/update_enclone_binary.rs deleted file mode 100644 index 0f85d9ae2..000000000 --- a/enclone/src/bin/update_enclone_binary.rs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2021 10X Genomics, Inc. All rights reserved. - -// Update the internally public enclone binary. This is also done by start_release, but sometimes -// one wants to update the binary without making a release. - -use enclone_core::defs::get_config; -use io_utils::path_exists; - -use std::collections::HashMap; -use std::env; - -#[cfg(not(target_os = "windows"))] -use std::os::unix::fs::PermissionsExt; - -fn main() { - let mut config = HashMap::::new(); - let mut config_file = String::new(); - for (key, value) in env::vars() { - if key == "ENCLONE_CONFIG" { - config_file = value.to_string(); - } - } - if get_config(&config_file, &mut config) { - let bin = &config["enclone_linux_bin"]; - if !path_exists(bin) { - std::fs::create_dir_all(bin).unwrap(); - } - let current = format!("{bin}/enclone"); - let last = format!("{bin}/enclone_last"); - if path_exists(&last) { - std::fs::remove_file(&last).unwrap(); - } - if path_exists(¤t) { - std::fs::rename(¤t, &last).unwrap(); - } - std::fs::copy("target/debug/enclone", ¤t).unwrap(); - #[cfg(not(target_os = "windows"))] - { - let perms = std::fs::Permissions::from_mode(0o775); - std::fs::set_permissions(¤t, perms).unwrap(); - } - } -} diff --git a/enclone_args/src/proc_args.rs b/enclone_args/src/proc_args.rs index 783523371..fadd910c8 100644 --- a/enclone_args/src/proc_args.rs +++ b/enclone_args/src/proc_args.rs @@ -226,7 +226,7 @@ pub fn proc_args(ctl: &mut EncloneControl, args: &[String]) -> Result<(), String for i in 1..args.len() { if args[i].starts_with("BI=") || args[i].starts_with("BIB=") || args[i].starts_with("BIP") { let bix = format!("{}=", args[i].before("=")); - if !ctl.gen_opt.internal_run && !args[i].starts_with("BIP=") { + if !args[i].starts_with("BIP=") { return Err(format!("\nUnrecognized argument {}.\n", args[i])); } let x = args[i].after(&bix).split(',').collect::>(); @@ -429,7 +429,6 @@ pub fn proc_args(ctl: &mut EncloneControl, args: &[String]) -> Result<(), String ("INDELS", &mut ctl.gen_opt.indels), ("INFO_RESOLVE", &mut ctl.gen_opt.info_resolve), ("INKT", &mut ctl.clono_filt_opt.inkt), - ("INTERNAL", &mut ctl.gen_opt.internal_run), ("JC1", &mut ctl.gen_opt.jc1), ("JOIN_FULL_DIFF", &mut ctl.join_alg_opt.join_full_diff), ("MAIT", &mut ctl.clono_filt_opt.mait), @@ -591,7 +590,6 @@ pub fn proc_args(ctl: &mut EncloneControl, args: &[String]) -> Result<(), String ), ("CLUSTAL_AA", &mut ctl.gen_opt.clustal_aa), ("CLUSTAL_DNA", &mut ctl.gen_opt.clustal_dna), - ("CONFIG", &mut ctl.gen_opt.config_file), ("EXT", &mut ctl.gen_opt.ext), ("GROUP_CDR3", &mut ctl.clono_group_opt.cdr3), ("PCHAINS", &mut ctl.parseable_opt.pchains), @@ -646,7 +644,6 @@ pub fn proc_args(ctl: &mut EncloneControl, args: &[String]) -> Result<(), String "CELLRANGER", "DUMP_INTERNAL_IDS", "EVIL_EYE", - "FORCE_EXTERNAL", "LONG_HELP", "MARKED_B", "MARK_STATS", @@ -674,7 +671,6 @@ pub fn proc_args(ctl: &mut EncloneControl, args: &[String]) -> Result<(), String "GEX", "HTML", "INTERNAL", - "BUG_REPORTS", "PRE", "PREPOST", "SOURCE", @@ -935,11 +931,6 @@ pub fn proc_args(ctl: &mut EncloneControl, args: &[String]) -> Result<(), String // Do residual argument processing. - if ctl.gen_opt.internal_run && ctl.gen_opt.config.is_empty() { - return Err( - "\nYou need to set up your configuration file, please ask for help.\n".to_string(), - ); - } if ctl.gen_opt.gamma_delta && !have_tcrgd || !ctl.gen_opt.gamma_delta && have_tcrgd { return Err( "\n. GAMMA_DELTA flag has to be enabled for using TCRGD= and vice versa.\n".to_string(), diff --git a/enclone_args/src/proc_args2.rs b/enclone_args/src/proc_args2.rs index 2280522a6..e0c0ecd09 100644 --- a/enclone_args/src/proc_args2.rs +++ b/enclone_args/src/proc_args2.rs @@ -199,7 +199,7 @@ pub fn proc_args_tail(ctl: &mut EncloneControl, args: &[String]) -> Result<(), S // Get origin descriptions. Flaky and particularly flaky when internal origin args are paths, // since it will look in outs for the file. - if ctl.gen_opt.internal_run || ctl.gen_opt.descrip || ctl.gen_opt.vis_dump { + if ctl.gen_opt.descrip || ctl.gen_opt.vis_dump { ctl.origin_info.descrips.clear(); let mut results = vec![(0, String::new()); ctl.origin_info.n()]; for i in 0..ctl.origin_info.n() { diff --git a/enclone_args/src/proc_args3.rs b/enclone_args/src/proc_args3.rs index b4ad6ba62..12aeb1fb6 100644 --- a/enclone_args/src/proc_args3.rs +++ b/enclone_args/src/proc_args3.rs @@ -3,25 +3,21 @@ // This file contains the two functions proc_xcr and proc_meta. use enclone_core::defs::{EncloneControl, OriginInfo}; -use enclone_core::{expand_integer_ranges, fetch_url, tilde_expand_me}; -use io_utils::{dir_list, open_for_read, open_for_write_new, open_userfile_for_read, path_exists}; +use enclone_core::{expand_integer_ranges, tilde_expand_me}; +use io_utils::{dir_list, open_for_read, open_userfile_for_read, path_exists}; use itertools::Itertools; use rayon::prelude::*; use std::collections::HashMap; use std::fmt::Write as _; use std::fs::File; -use std::io::{BufRead, BufReader, Read, Write}; -use std::sync::atomic::{AtomicUsize, Ordering}; -use std::sync::Arc; -use std::thread; -use std::time; +use std::io::{BufRead, BufReader, Read}; use string_utils::TextUtils; use vector_utils::unique_sort; // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -fn expand_analysis_sets(x: &str, ctl: &EncloneControl) -> Result { +fn expand_analysis_sets(x: &str) -> Result { let mut tokens = Vec::::new(); let mut token = String::new(); for c in x.chars() { @@ -41,63 +37,7 @@ fn expand_analysis_sets(x: &str, ctl: &EncloneControl) -> Result let mut tokens2 = Vec::::new(); for token in tokens { if let Some(setid) = token.strip_prefix('S') { - if ctl.gen_opt.internal_run { - let url = format!("{}/{setid}", ctl.gen_opt.config["sets"]); - let m = fetch_url(&url)?; - if m.contains("\"analysis_ids\":[") { - let ids = m.between("\"analysis_ids\":[", "]"); - let mut ids = ids.replace(' ', ""); - ids = ids.replace('\n', ""); - let ids = ids.split(','); - let mut ids2 = Vec::<&str>::new(); - - // Remove wiped analysis IDs. - - for id in ids { - let url = format!("{}/{id}", ctl.gen_opt.config["ones"]); - let m = fetch_url(&url)?; - if m.contains("502 Bad Gateway") { - return Err(format!( - "\nWell, this is sad. The URL \ - {url} returned a 502 Bad Gateway \ - message. Please try again later or ask someone for help.\n" - )); - } - if !m.contains("\"wiped\"") { - ids2.push(id); - } - } - let mut enclone = "~/enclone".to_string(); - tilde_expand_me(&mut enclone); - if path_exists(&enclone) { - let mut sets = "~/enclone/sets".to_string(); - tilde_expand_me(&mut sets); - if !path_exists(&sets) { - std::fs::create_dir(&sets).unwrap(); - let mut setid = format!("~/enclone/sets/{setid}"); - tilde_expand_me(&mut setid); - if !path_exists(&setid) { - let mut f = open_for_write_new![&setid]; - let s = format!("{}\n", ids2.iter().format(",")); - f.write_all(s.as_bytes()).unwrap(); - } - } - } - - // Proceed. - - for (j, id) in ids2.into_iter().enumerate() { - if j > 0 { - tokens2.push(",".to_string()); - } - tokens2.push(id.to_string()); - } - continue; - } - return Err(format!( - "\nIt looks like you've provided an incorrect analysis set ID {setid}.\n" - )); - } else if setid.parse::().is_ok() { + if setid.parse::().is_ok() { let mut set_file = format!("~/enclone/sets/{setid}"); tilde_expand_me(&mut set_file); if path_exists(&set_file) { @@ -187,104 +127,14 @@ fn get_path(p: &str, ctl: &EncloneControl, ok: &mut bool) -> String { pp } -fn get_path_or_internal_id( - p: &str, - ctl: &EncloneControl, - source: &str, - spinlock: &Arc, -) -> Result { +fn get_path_or_internal_id(p: &str, ctl: &EncloneControl, source: &str) -> Result { if ctl.gen_opt.evil_eye { println!("getting path for {p}"); } let mut ok = false; let mut pp = get_path(p, ctl, &mut ok); if !ok { - if !ctl.gen_opt.internal_run { - get_path_fail(&pp, ctl, source)?; - } else { - // For internal runs, try much harder. This is so that internal users can - // just type an internal numerical id for a dataset and have it always - // work. The code that's used here should be placed somewhere else. - - let mut q = p.to_string(); - if q.contains('/') { - q = q.before("/").to_string(); - } - if q.parse::().is_ok() { - if !ctl.gen_opt.config.contains_key("ones") { - let mut msg = "\nSomething is wrong. This is an internal run, but \ - the configuration\nvariable \"ones\" is undefined.\n" - .to_string(); - if ctl.gen_opt.config.is_empty() { - msg += "In fact, there are no configuration variables.\n"; - } else { - msg += "Here are the configuration variables that are defined:\n\n"; - for (key, value) in &ctl.gen_opt.config { - write!(msg, "{key} = {value}").unwrap(); - } - msg += "\n"; - } - return Err(msg); - } - let url = format!("{}/{q}", ctl.gen_opt.config["ones"]); - // We force single threading around the https access because we observed - // intermittently very slow access without it. - while spinlock.load(Ordering::SeqCst) != 0 {} - spinlock.store(1, Ordering::SeqCst); - let m = fetch_url(&url)?; - spinlock.store(0, Ordering::SeqCst); - if m.contains("502 Bad Gateway") { - return Err(format!( - "\nWell this is sad. The URL \ - {url} yielded a 502 Bad Gateway \ - message. Please try again later or ask someone for help.\n" - )); - } - if m.contains("\"path\":\"") { - let path = m.between("\"path\":\"", "\""); - if !p.contains('/') { - pp = format!("{path}/outs"); - } else { - pp = format!("{path}/{}", p.after("/")); - } - if !path_exists(&pp) { - thread::sleep(time::Duration::from_millis(100)); - if path_exists(&pp) { - return Err(format!( - "\nYou are experiencing unstable filesystem access: \ - 100 milliseconds ago, \ - the path\n\ - {pp}\nwas not visible, but now it is. You might consider posting \ - this problem on an appropriate \ - the slack channel.\nOr retry again. enclone is \ - giving up because \ - if filesystem access blinks in and out of existence,\n\ - other more cryptic events are likely to occur.\n" - )); - } - return Err(format!( - "\nIt looks like you've provided an analysis ID for \ - which the pipeline outs folder\n{p}\nhas not yet been generated.\n\ - This path did not exist:\n{pp}\n\n\ - Here is the stdout:\n{m}\n" - )); - } - } else { - return Err(format!( - "\nIt looks like you've provided either an incorrect \ - analysis ID {p} or else one for which\n\ - the pipeline outs folder has not yet been generated.\n\ - This URL\n{url}\ndid not provide a path.\n" - )); - } - } else { - return Err(format!( - "\nAfter searching high and low, your path\n{p}\nfor {source} \ - cannot be found.\nPlease check its value and also the value \ - for PRE if you provided that.\n" - )); - } - } + get_path_fail(&pp, ctl, source)?; } if !pp.ends_with("/outs") && path_exists(format!("{pp}/outs")) { pp = format!("{pp}/outs"); @@ -314,9 +164,8 @@ fn parse_bc(mut bc: String, ctl: &mut EncloneControl, call_type: &str) -> Result let mut tag = HashMap::::new(); let mut barcode_color = HashMap::::new(); let mut alt_bc_fields = Vec::<(String, HashMap)>::new(); - let spinlock: Arc = Arc::new(AtomicUsize::new(0)); if !bc.is_empty() { - bc = get_path_or_internal_id(&bc, ctl, call_type, &spinlock)?; + bc = get_path_or_internal_id(&bc, ctl, call_type)?; let f = open_userfile_for_read(&bc); let mut first = true; let mut fieldnames = Vec::::new(); @@ -464,14 +313,14 @@ pub fn proc_xcr( )); } let val = expand_integer_ranges(val); - let val = expand_analysis_sets(&val, ctl)?; + let val = expand_analysis_sets(&val)?; let donor_groups = if ctl.gen_opt.cellranger { vec![&val[..]] } else { val.split(';').collect::>() }; let mut gex2 = expand_integer_ranges(gex); - gex2 = expand_analysis_sets(&gex2, ctl)?; + gex2 = expand_analysis_sets(&gex2)?; let donor_groups_gex = if ctl.gen_opt.cellranger { vec![&gex2[..]] } else { @@ -634,10 +483,9 @@ pub fn proc_xcr( } } - let spinlock: Arc = Arc::new(AtomicUsize::new(0)); results.par_iter_mut().for_each(|res| { let (p, pg) = (&mut res.0, &mut res.1); - let resx = get_path_or_internal_id(p, ctl, source, &spinlock); + let resx = get_path_or_internal_id(p, ctl, source); match resx { Err(resx) => res.3 = resx, Ok(resx) => { @@ -655,7 +503,7 @@ pub fn proc_xcr( *p = format!("{p}/multi/vdj_t"); } if have_gex { - let resx = get_path_or_internal_id(pg, ctl, "GEX", &spinlock); + let resx = get_path_or_internal_id(pg, ctl, "GEX"); match resx { Err(resx) => res.3 = resx, Ok(resx) => { @@ -800,8 +648,7 @@ pub fn proc_meta_core(lines: &[String], ctl: &mut EncloneControl) -> Result<(), parse_bc(bc.clone(), ctl, "META")?; let current_ref = false; - let spinlock: Arc = Arc::new(AtomicUsize::new(0)); - path = get_path_or_internal_id(&path, ctl, "META", &spinlock)?; + path = get_path_or_internal_id(&path, ctl, "META")?; if ctl.gen_opt.bcr && path_exists(format!("{path}/vdj_b")) { path = format!("{path}/vdj_b"); } @@ -821,7 +668,7 @@ pub fn proc_meta_core(lines: &[String], ctl: &mut EncloneControl) -> Result<(), path = format!("{path}/multi/vdj_t_gd"); } if !gpath.is_empty() { - gpath = get_path_or_internal_id(&gpath, ctl, "META", &spinlock)?; + gpath = get_path_or_internal_id(&gpath, ctl, "META")?; if path_exists(format!("{gpath}/count")) { gpath = format!("{gpath}/count"); } diff --git a/enclone_args/src/proc_args_check.rs b/enclone_args/src/proc_args_check.rs index 00a9fb83f..d76462048 100644 --- a/enclone_args/src/proc_args_check.rs +++ b/enclone_args/src/proc_args_check.rs @@ -577,7 +577,7 @@ pub fn check_one_lvar( specified = true; } } - if !ctl.gen_opt.internal_run && !x.is_empty() { + if !x.is_empty() { return Err(format!( "\nUnrecognized variable {x} for LVARS or PCOLS. Please type \ \"enclone help lvars\".\n" diff --git a/enclone_args/src/proc_args_post.rs b/enclone_args/src/proc_args_post.rs index 2f250da15..714037f7d 100644 --- a/enclone_args/src/proc_args_post.rs +++ b/enclone_args/src/proc_args_post.rs @@ -8,7 +8,7 @@ use enclone_core::tilde_expand_me; use enclone_vars::encode_arith; use evalexpr::build_operator_tree; use expr_tools::vars_of_node; -use io_utils::{open_for_read, open_userfile_for_read, path_exists}; +use io_utils::{open_for_read, open_userfile_for_read}; use std::collections::HashMap; use std::io::BufRead; @@ -557,56 +557,6 @@ pub fn proc_args_post( } // Proceed. - - for i in 0..ctl.origin_info.n() { - let (mut cells_cr, mut rpc_cr) = (None, None); - if ctl.gen_opt.internal_run { - let p = &ctl.origin_info.dataset_path[i]; - let mut f = format!("{p}/metrics_summary_csv.csv"); - if !path_exists(&f) { - f = format!("{p}/metrics_summary.csv"); - } - if path_exists(&f) { - let f = open_userfile_for_read(&f); - let mut count = 0; - let (mut cells_field, mut rpc_field) = (None, None); - for line in f.lines() { - count += 1; - let s = line.unwrap(); - let fields = parse_csv(&s); - for (i, x) in fields.iter().enumerate() { - if count == 1 { - if *x == "Estimated Number of Cells" { - cells_field = Some(i); - } else if *x == "Mean Read Pairs per Cell" { - rpc_field = Some(i); - } - } else if count == 2 { - if Some(i) == cells_field { - let mut n = x.to_string(); - if n.contains('\"') { - n = n.between("\"", "\"").to_string(); - } - n = n.replace(',', ""); - cells_cr = Some(n.force_usize()); - } else if Some(i) == rpc_field { - let mut n = x.to_string(); - if n.contains('\"') { - n = n.between("\"", "\"").to_string(); - } - n = n.replace(',', ""); - rpc_cr = Some(n.force_usize()); - } - } - } - } - } - } - ctl.origin_info.cells_cellranger.push(cells_cr); - ctl.origin_info - .mean_read_pairs_per_cell_cellranger - .push(rpc_cr); - } if ctl.plot_opt.plot_by_isotype { if using_plot || ctl.plot_opt.use_legend { return Err("\nPLOT_BY_ISOTYPE cannot be used with PLOT or LEGEND.\n".to_string()); diff --git a/enclone_args/src/read_json.rs b/enclone_args/src/read_json.rs index cd7bd2bdf..3fb875359 100644 --- a/enclone_args/src/read_json.rs +++ b/enclone_args/src/read_json.rs @@ -23,7 +23,7 @@ use vector_utils::{bin_position, erase_if, unique_sort}; // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ -fn json_error(json: Option<&str>, internal_run: bool, msg: &str) -> String { +fn json_error(json: Option<&str>, msg: &str) -> String { let mut msgx = "There is something wrong with the contig annotations in the cellranger output file" .to_string(); @@ -32,16 +32,8 @@ fn json_error(json: Option<&str>, internal_run: bool, msg: &str) -> String { } else { msgx += "."; } - if internal_run { - writeln!(msgx, "\n\npossibly relevant internal data: {msg}").unwrap(); - - msgx += "\n\nATTENTION INTERNAL 10X USERS!\n\ - Quite possibly you are using data from a cellranger run carried out using a \ - version\n\ - between 3.1 and 4.0. For certain of these versions, it is necessary to add the\n\ - argument CURRENT_REF to your command line. If that doesn't work, \ - please see below.\n"; - } + msgx += "\n\n"; + msgx += msg; msgx += "\n\nHere is what you should do:\n\n\ 1. If you used cellranger version ≥ 4.0, the problem is very likely\n\ that the directory outs/vdj_reference was not retained, so enclone\n\ @@ -395,7 +387,7 @@ fn process_json_annotation( let rt = &refdata.refs[v_ref_id]; if annv.len() == 2 && annv[0].match_len as usize > rt.len() { let msg = format!("annv[0].1 = {}, rt.len() = {}", annv[0].match_len, rt.len()); - return Err(json_error(None, ctl.gen_opt.internal_run, &msg)); + return Err(json_error(None, &msg)); } // Check to see if the CDR3 sequence has changed. This could happen if the cellranger @@ -447,7 +439,7 @@ fn process_json_annotation( if tig_start < 0 || tig_stop < 0 { let msg = format!("tig_start = {tig_start}, tig_stop = {tig_stop}"); - return Err(json_error(Some(json), ctl.gen_opt.internal_run, &msg)); + return Err(json_error(Some(json), &msg)); } let (tig_start, tig_stop) = (tig_start as usize, tig_stop as usize); let mut quals = ann.quals.as_bytes().to_vec(); diff --git a/enclone_core/Cargo.toml b/enclone_core/Cargo.toml index e6780d8a3..e4195e36f 100644 --- a/enclone_core/Cargo.toml +++ b/enclone_core/Cargo.toml @@ -23,7 +23,6 @@ include = ["src/*.rs", "LICENSE.txt", "src/mammalian_fixed_len.table"] [dependencies] amino = { path = "../amino" } ansi_escape = { path = "../ansi_escape" } -attohttpc = { version = ">=0.19, <0.27", default-features = false, features = ["compress", "tls-rustls"] } bio_edit = { path = "../bio_edit" } debruijn = "0.3" enclone_proto = { path = "../enclone_proto" } diff --git a/enclone_core/src/defs.rs b/enclone_core/src/defs.rs index 43af1bb75..f3833704c 100644 --- a/enclone_core/src/defs.rs +++ b/enclone_core/src/defs.rs @@ -6,16 +6,12 @@ use debruijn::dna_string::DnaString; use evalexpr::Node; use hdf5::Dataset; -use io_utils::{open_for_read, path_exists}; - use regex::Regex; use std::cmp::max; use std::collections::HashMap; -use std::io::BufRead; use std::sync::atomic::AtomicBool; use std::time::{Instant, SystemTime}; -use string_utils::TextUtils; use vdj_ann::annotate::Annotation; use vector_utils::unique_sort; @@ -84,8 +80,6 @@ pub struct OriginInfo { // map dataset index to map of barcode to color: pub barcode_color: Vec>, pub alt_bc_fields: Vec)>>, - pub cells_cellranger: Vec>, - pub mean_read_pairs_per_cell_cellranger: Vec>, // map dataset index to a map of barcode to (secreted, membrane) UMI counts: pub secmem: Vec>, } @@ -164,7 +158,6 @@ pub struct GeneralOpt { pub origin_color_map: HashMap, pub accept_inconsistent: bool, // TEMPORARY! pub current_ref: bool, // TEMPORARY! - pub internal_run: bool, pub full_counts: bool, pub html: bool, pub html_title: String, @@ -206,10 +199,7 @@ pub struct GeneralOpt { pub info_fields: Vec, pub info_data: HashMap>, pub info_resolve: bool, - pub internal_data_dir: String, pub row_fill_verbose: bool, - pub config_file: String, - pub config: HashMap, pub chains_to_align: Vec, pub chains_to_align2: Vec, pub chains_to_jun_align: Vec, @@ -899,21 +889,3 @@ pub struct PotentialJoin<'a> { pub d: isize, pub n: usize, } - -pub fn get_config(config_file: &str, config: &mut HashMap) -> bool { - if !config_file.is_empty() { - let mut cf = config_file.to_string(); - if cf.contains(':') { - cf = cf.after(":").to_string(); - } - if path_exists(&cf) { - let f = open_for_read![&cf]; - for line in f.lines() { - let s = line.unwrap(); - config.insert(s.before("=").to_string(), s.after("=").to_string()); - } - return true; - } - } - false -} diff --git a/enclone_core/src/lib.rs b/enclone_core/src/lib.rs index aefbd8d12..5c4747731 100644 --- a/enclone_core/src/lib.rs +++ b/enclone_core/src/lib.rs @@ -22,12 +22,9 @@ pub mod stringulate; pub mod test_def; pub mod var_reg; -use lazy_static::lazy_static; use std::cmp::max; use std::fmt::Write; use std::io::BufRead; -use std::sync::Mutex; -use std::time::Duration; #[cfg(not(target_os = "windows"))] use string_utils::stringme; @@ -107,10 +104,6 @@ pub fn expand_integer_ranges(x: &str) -> String { tokens2 } -lazy_static! { - pub static ref REMOTE_HOST: Mutex> = Mutex::new(Vec::::new()); -} - // Parse a line, breaking at blanks, but not if they're in quotes. And strip the quotes. // Ridiculously similar to parse_csv, probably should refactor. pub fn parse_bsv(x: &str) -> Vec<&str> { @@ -142,34 +135,6 @@ pub fn parse_bsv(x: &str) -> Vec<&str> { args } -pub fn fetch_url(url: &str) -> Result { - const TIMEOUT: u64 = 120; // timeout in seconds - let req = attohttpc::get(url).read_timeout(Duration::new(TIMEOUT, 0)); - let response = req.send(); - if response.is_err() { - return Err(format!( - "\nFailed to access URL {url},\ntimeout after two minutes. There are a few ways that \ - you might have arrived at this state:\n• The server for that URL is down.\n\ - • The server for that URL is overloaded and responding very slowly.\n\ - • Same thing as last, and your process is slamming the server. Please inspect \ - your command!\n\ - • There is a bug in this program. This is relatively unlikely but possible.\n" - )); - } - let response = response.unwrap(); - if !response.is_success() { - let msg = response.text().unwrap(); - if msg.contains("Not found") { - return Err(format!( - "\nAttempt to access the URL\n{url}\nfailed with \"Not found\". Could there \ - be something wrong with the id?\n" - )); - } - return Err(format!("Failed to access URL {url}: {msg}.")); - } - Ok(response.text().unwrap()) -} - // Test to see if a line can be read from the given file f. If not, return an error message // the references arg, which is supposed to be the name of a command line argument from which // f originated. diff --git a/enclone_ranger/src/main_enclone.rs b/enclone_ranger/src/main_enclone.rs index 94bade58e..8acf4c657 100644 --- a/enclone_ranger/src/main_enclone.rs +++ b/enclone_ranger/src/main_enclone.rs @@ -22,10 +22,9 @@ use string_utils::TextUtils; use vdj_ann::refx; pub fn main_enclone_ranger(args: &[String]) -> Result<(), String> { - const REQUIRED_ARGS: [&str; 9] = [ + const REQUIRED_ARGS: [&str; 8] = [ "CELLRANGER", "DONOR_REF_FILE", - "FORCE_EXTERNAL", "MAX_CORES", "NOPAGER", "NOPRINT", @@ -87,7 +86,6 @@ pub fn main_enclone_setup_ranger(args: &[String]) -> Result