Skip to content

Instantly share code, notes, and snippets.

View mr-eyes's full-sized avatar
🦆

Mohamed Abuelanin mr-eyes

🦆
View GitHub Profile
@mr-eyes
mr-eyes / code.gs
Last active February 7, 2024 23:16
Google Slides Agenda Tracking Bar Script
function addOrUpdateAgendaBarImproved() {
var presentation = SlidesApp.getActivePresentation();
var slides = presentation.getSlides();
var sections = [
{ name: 'Motivation', slides: [2, 3] },
{ name: 'Scientific Background', slides: [4, 5] },
{ name: 'Methods', slides: [6, 7] },
{ name: 'Use case 1', slides: [8, 11] },
{ name: 'Use Case 2', slides: [12, 15] },
{ name: 'Future Directions', slides: [16, 17] },
@mr-eyes
mr-eyes / environment.yml
Last active January 19, 2023 08:27
kSpider Demo
name: kspider
channels:
- conda-forge
- bioconda
dependencies:
- python=3.9
- pip
- sourmash
- pip:
- kSpider
@mr-eyes
mr-eyes / sourmash_ani.cpp
Created September 23, 2022 23:26
Call sourmash ani in C++
#include <Python.h>
#include <iostream>
using namespace std;
class toANI {
public:
PyObject* moduleMainString, * moduleMain, * func;
toANI() {
@mr-eyes
mr-eyes / prefetch_clustering.py
Created July 23, 2022 10:22
Clustering prefetch comparisons
import retworkx as rx
from tqdm import tqdm
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--csv', type=str, required=True, help="pairwise csv file")
parser.add_argument('--cutoff', type=int, required=True,
help="clustering threshold (0:100)")
parser.add_argument('--mode', type=str, required=True, choices=['ani', 'cont'],
@mr-eyes
mr-eyes / nearest_genomes.py
Last active February 6, 2022 14:56
Using the new NCBI's datasets API to get the nearest available reference genomes for a given taxon or organism name.
"""
Using the new NCBI's datasets API to get the nearest available reference genomes for a given taxon or organism name.
Input: TAX_ID or Name
Output:
1- The nearest organism with available reference genomes
2- Accessions of the reference genomes
Requirements:
@mr-eyes
mr-eyes / annotations.txt
Last active April 20, 2021 16:23
kSpider 2 DBRetina test
parent metadata
p1 DB_A
p2 DB_B
p3 DB_C
p4 DB_A
p5 DB_A
p6 DB_A
p7 DB_B
p8 DB_C
p9 DB_C
@mr-eyes
mr-eyes / kProcessor_index_validator.py
Created March 27, 2021 10:34
kProcessor index validator
# Validate kProcessor 1 index
from itertools import groupby
import os
import kProcessor as kp
import hashlib
class IntegralHasher:
"""
Input: Unitigs Fasta file generated from BCALM.
Output: CSV File with the following format
A. Column(1): Connected Component ID
B. Column(2:): Unitigs ID(s)
Run:
python unitigs_to_connected_components.py <unitigs_path>
"""
@mr-eyes
mr-eyes / clusters.tsv
Last active October 6, 2020 02:28
Merge and process tables (special)
1 2 2 1 3
1 2 3 4 5
@mr-eyes
mr-eyes / kseq_chunks.cpp
Created May 12, 2020 15:39
Kseq Paired End Fastx reader in chunks
// to compile: gcc this_prog.c -lz
#include <zlib.h>
#include <cstdio>
#include "kseq.h"
#include <iostream>
#include <vector>
KSEQ_INIT(gzFile, gzread)
using namespace std;