Skip to content

Instantly share code, notes, and snippets.

View mbhall88's full-sized avatar

Michael Hall mbhall88

View GitHub Profile
@mbhall88
mbhall88 / argsort.rs
Created December 8, 2022 21:49
Argsort and sort by indices in Rust
use rayon::prelude::*;
/// Returns the indices that would sort a vector in parallel
fn par_argsort<T: Ord + Sync>(data: &[T]) -> Vec<usize> {
let mut indices = (0..data.len()).collect::<Vec<_>>();
indices.par_sort_unstable_by_key(|&i| &data[i]);
indices
}
@mbhall88
mbhall88 / revcomp.rs
Last active July 7, 2024 12:48
Reverse complement DNA sequences in Rust
/// Reverse complement a DNA sequence with bit-twiddling
///
/// # Example
///
/// ```rust
/// let seq = b"ATGCTTCCAGAA";
///
/// let actual = revcomp(seq);
/// let expected = b"TTCTGGAAGCAT";///
/// assert_eq!(actual, expected)
@mbhall88
mbhall88 / .hyper.js
Last active October 29, 2019 15:31
Sync hyper.js config file
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@mbhall88
mbhall88 / README.md
Last active October 23, 2019 09:13
Running Deepbinner on the EBI GPU cluster

Deepbinner on the EBI cluster

At the moment, the best solution for running deepbinner (GPU) on the EBI cluster is using a Singularity container and requesting a whole GPU to yourself. The reason for needing to request a whole GPU is a horrible mess of tensorflow, cuda, memory sharing, and my lack of proper GPU architecture understanding.

The image I have been using to run deepbinner (v0.2.0) can be pulled with

@mbhall88
mbhall88 / LICENSE
Last active April 22, 2024 01:26
Zoomable Volcano Plot with tooltips in D3 v4
MIT License
Copyright (c) 2017 Michael Hall
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE O
@mbhall88
mbhall88 / .gitignore
Last active April 11, 2021 06:17
Collapsible tree in reusable format using D3 v4
.idea/
@mbhall88
mbhall88 / .gitignore
Last active October 25, 2022 19:46
A dynamic, reusable donut chart for D3.js v4
.DS_Store
.idea
@mbhall88
mbhall88 / LICENSE
Last active May 7, 2019 14:14
A static, reusable donut chart for D3.js v4.
MIT License
Copyright (c) 2017 Michael Hall
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE O