1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
from pysam.utils import PysamDispatcher
# samtools command line options to export in python
#
# import is a python reserved word.
SAMTOOLS_DISPATCH = {
# samtools 'documented' commands
"view": ("view", None),
"sort": ("sort", None),
"mpileup": ("mpileup", None),
"depth": ("depth", None),
"faidx": ("faidx", None),
"tview": ("tview", None),
"index": ("index", None),
"idxstats": ("idxstats", None),
"fixmate": ("fixmate", None),
"flagstat": ("flagstat", None),
"calmd": ("calmd", None),
"merge": ("merge", None),
"rmdup": ("rmdup", None),
"reheader": ("reheader", None),
"cat": ("cat", None),
"targetcut": ("targetcut", None),
"phase": ("phase", None),
"samimport": ("import", None),
"bam2fq": ("bam2fq", None),
"dict": ("dict", None),
"addreplacerg": ("addreplacerg", None),
"pad2unpad": ("pad2unpad", None),
"depad": ("pad2unpad", None),
"bedcov": ("bedcov", None),
"bamshuf": ("bamshuf", None),
"collate": ("collate", None),
"stats": ("stats", None),
"fasta": ("fasta", None),
"fastq": ("fastq", None),
"quickcheck": ("quickcheck", None),
"split": ("split", None),
}
# instantiate samtools commands as python functions
for key, options in SAMTOOLS_DISPATCH.items():
cmd, parser = options
globals()[key] = PysamDispatcher("samtools", cmd, parser)
__all__ = list(SAMTOOLS_DISPATCH)
|