Skip to content

Instantly share code, notes, and snippets.

View jodyphelan's full-sized avatar

Jody Phelan jodyphelan

  • London, UK
View GitHub Profile
gyrB p.Arg446Cys 6575
gyrB p.Arg446His 6576
gyrB p.Arg446Leu 6576
gyrB p.Ser447Phe 6579
gyrB p.Asp461Asn 6620
gyrB p.Asp461His 6620
gyrB p.Asp461Ala 6621
gyrB p.Gly470Cys 6647
gyrB p.Ile486Leu 6695
gyrB p.Asp494Ala 6720
wget ftp://ftp.ensemblgenomes.org/pub/release-32/bacteria//fasta/bacteria_0_collection/mycobacterium_tuberculosis_h37rv/dna/Mycobacterium_tuberculosis_h37rv.ASM19595v2.dna.toplevel.fa.gz
gunzip Mycobacterium_tuberculosis_h37rv.ASM19595v2.dna.toplevel.fa.gz
mv Mycobacterium_tuberculosis_h37rv.ASM19595v2.dna.toplevel.fa H37Rv.fa
printf "Chromosome\t5\tX\tT\n" > snp.txt
printf "Chromosome\t50000\tX\tT\n" >> snp.txt
seqtk mutfa H37Rv.fa snp.txt >mutant.fa
# My current command
minimap2 H37Rv.fa mutant.fa --cs | sort -k6,6 -k8,8 | paftools.js call -l 100 -L 100 -f H37Rv.fa -s test -
TBProfiler report
=================
The following report has been generated by TBProfiler.
Summary
-------
ID: SRR6824414
Date: Mon Oct 12 17:33:42 2020
Strain: lineage4.5;lineage3
###################
#### Create DB ####
###################
# This is just a simple in-memory sqlite database for this example.
# It will obviously not be necessary in your case as you already created the database.
from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey
from sqlalchemy import create_engine
import sys
import argparse
import re
import subprocess as sp
def main(args):
IN = sys.stdin if args.vcf=="-" else sp.Popen("bcftools view %(vcf)s" % vars(args),shell=True,stdout=sp.PIPE).stdout
for l in IN:
try:
name: tb-profiler-dev
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=1_gnu
- attrs=21.2.0=pyhd8ed1ab_0
- bcftools=1.12=h45bccc9_1
# Use the yml file to create the tb-profiler conda env
wget https://gist.githubusercontent.com/jodyphelan/92ec9b18f5b929bd1637d56568abbd0a/raw/ae52641f56cfa982c0a2febade10b2b7b882b6fa/tb-profiler-env.yaml
conda env create -f tb-profiler-env.yaml
# Activate env
conda activate tb-profiler-dev

Install latest tb-profiler

  1. Use the yml file to create the tb-profiler conda env
wget https://gist.githubusercontent.com/jodyphelan/92ec9b18f5b929bd1637d56568abbd0a/raw/ae52641f56cfa982c0a2febade10b2b7b882b6fa/tb-profiler-env.yaml
conda env create -f tb-profiler-env.yaml
  1. Activate env
 conda activate tb-profiler-dev
import sys
import argparse
import csv
def main(args):
with open(args.db) as IN:
reader = csv.DictReader(IN,delimiter="\t")
if args.debug:
sys.stderr.write(str(reader.fieldnames)+"\n")
for c in args.columns:
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64
@EXPLICIT
https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2022.9.24-ha878542_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.36.1-hea4e1c9_2.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-11.2.0-h5c6108e_11.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-12.1.0-ha89aaad_16.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/openjdk-8.0.302-h7f98852_0.tar.bz2