This file contains 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 python3 | |
import click | |
import tifffile | |
import numpy as np | |
def convert_npz_to_tiff(input_file, output_file, pixelsize=0.05): | |
data = np.load(input_file) |
This file contains 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
#!/bin/bash | |
set -e | |
rsync \ | |
-a \ | |
-m \ | |
--copy-links \ | |
--recursive \ | |
--times \ |
This file contains 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 python3 | |
import click | |
import os | |
import pandas as pd | |
# Set up the command line processor | |
@click.command() | |
@click.option("--details-hdf5", help="Provide the path to the geneshot output file containing all gene abundances (*.details.hdf5)") | |
@click.option("--gene-name", help="Name of the gene to extract", prompt="Gene Name") |
This file contains 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 python3 | |
import click | |
import os | |
import pandas as pd | |
# Set up the command line processor | |
@click.command() | |
@click.option("--input_fp", help="Provide the path to the geneshot output file containing all gene abundances (*.results.hdf5)") | |
def geneshot_extract_gene_annot(input_fp): |
This file contains 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
#!/bin/bash | |
set -euo pipefail | |
WORK_DIR="${1}" | |
# Input is the short task id prefix | |
TASK_PREFIX="${2}" | |
# Get the complete suffix |
This file contains 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 python3 | |
import os | |
import pandas as pd | |
import sys | |
def read_metaphlan(fp): | |
"""Function to read a single file with metaphlan2 results encoded as a TSV.""" |
This file contains 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 python3 | |
import requests | |
from random import shuffle | |
# Argument parsing code courtesy of @wasade | |
import click | |
# Function to fetch the amino acid sequence for a single gene |
This file contains 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 functools import lru_cache | |
import os | |
import pandas as pd | |
@lru_cache(maxsize=16) | |
def read_fasta(fasta_fp): | |
assert os.path.exists(fasta_fp) | |
fasta = {} | |
header = None |
This file contains 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 functools import lru_cache | |
import pandas as pd | |
@lru_cache(maxsize=128) | |
def parse_gff(gff_fp): | |
df = pd.read_csv( | |
gff_fp, | |
sep="\t", | |
comment="#", | |
header=None, |
This file contains 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 python3 | |
import boto3 | |
import argparse | |
from datetime import datetime | |
parser = argparse.ArgumentParser() | |
parser.add_argument("job_id") | |
# Add the arguments |
NewerOlder