This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bootstraps_mann_whitney <- function(bootstraps_number, sample_1, sample_2) { | |
differences <- numeric() | |
for (i in sample_1) { | |
for (j in sample_2) { | |
differences[1 + length(differences)] <- i - j | |
} | |
} | |
bootstraps_statistic <- numeric(bootstraps_number) | |
hodges_lehmann_estimator <- median(differences) | |
sample_1_delta <- sample_1 - hodges_lehmann_estimator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Changes: python3, argparse, gff3 | |
# check if python >= 3.6 | |
import argparse | |
import sys | |
def main(input_file, output_file): | |
"""Converts a file from the BED (Browser Extensible Data) format to the GFF3 (General Feature Format version 3) format.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires jupytext (https://github.com/mwouts/jupytext) and Glow (https://github.com/charmbracelet/glow) | |
ipynb-view () { | |
if [ -z "$1" ]; then | |
echo "Usage: ipynb-view <notebook.ipynb>"; | |
return 1; | |
fi; | |
jupytext --from ipynb --to markdown --output - "$1" | glow --preserve-new-lines --pager | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bz2 | |
import gzip | |
import lzma | |
from contextlib import contextmanager | |
from enum import Enum, auto | |
from pathlib import Path | |
from typing import TextIO | |
class Compression(Enum): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bz2 | |
import gzip | |
import lzma | |
import textwrap | |
from contextlib import contextmanager | |
from enum import Enum, auto | |
from pathlib import Path | |
class Compression(Enum): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# hhblits -v 0 -cpu 1 -n 1 -p 90 -z 0 -Z 5000 -b 0 -B 5000 -M 50 -d busco_db/busco -i msa.faa -o msa.hhr | |
from collections import namedtuple | |
from pathlib import Path | |
import argparse | |
parser = argparse.ArgumentParser(description='Parse hhsearch hhr output file.') | |
parser.add_argument('-i', help='input hrr path', dest='input_file',type=str, required=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
def get_assembly_accession(genbank_accession): | |
p1 = subprocess.Popen( | |
["elink", "-db", "nuccore", "-target", "assembly", "-id", genbank_accession], | |
stdout=subprocess.PIPE, | |
stderr=subprocess.PIPE, | |
) | |
p2 = subprocess.Popen( | |
["efetch", "-format", "docsum"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from coloraide import Color | |
def lighten( | |
color: Color, | |
amount: float, | |
) -> Color: | |
""" | |
Lighten a color by a given amount. | |
""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import math | |
import re | |
import click | |
from scipy.cluster.hierarchy import fcluster, linkage | |
from skbio import DistanceMatrix, Protein, TabularMSA, io | |
from skbio.sequence.distance import hamming |
OlderNewer