mkpath
mkpath(directory)
directory
Have to use system mkdir here because python2.7's mkpath is currently faulty!
class
Environment
Environment()
StdoutCapturer
StdoutCapturer(iterable=()) :: list
iterable
()
list
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
stdoutRedirect
stdoutRedirect(to='/dev/null')
to
'/dev/null'
import os
with stdoutRedirect(to=filename): print("from Python") os.system("echo non-Python applications are also supported")
cd
cd(newPath)
newPath
Context manager for changing the current working directory
runCommand
runCommand(cmd, instream=None, msg='', upon_succ=None, show_stderr=False, return_zero=True)
cmd
instream
None
msg
''
upon_succ
show_stderr
False
return_zero
True
CMDWorker
CMDWorker(queue) :: Process
queue
Process
Process objects represent activity that is run in a separate process
The class is analogous to threading.Thread
threading.Thread
runCommands
runCommands(cmds, ncpu)
cmds
ncpu
parmap
parmap(f, X, nprocs=32)
f
X
nprocs
32
downloadURL
downloadURL(URL, dest_dir, quiet=True, mode=None, force=False)
URL
dest_dir
quiet
mode
force
calculateFileMD5
calculateFileMD5(filename)
filename
zipdir
zipdir(path, zipfile, arcroot='/')
path
zipfile
arcroot
'/'
removeFiles
removeFiles(dest, exclude=[], hidden=False)
dest
exclude
[]
hidden
removeEmptyDir
removeEmptyDir(directory)
copyFiles
copyFiles(pattern, dist, ignore_hidden=True)
pattern
dist
ignore_hidden
downloadResources
downloadResources(fromto)
fromto
getColumn
getColumn(fn, num, delim=None, exclude=None)
fn
num
delim
wordCount
wordCount(filename)
Returns a word/count dict for this filename.
fileLinesCount
fileLinesCount(fname)
fname
connected_components
connected_components(lists)
lists
listit
listit(t)
t
parseVCFline
parseVCFline(line, exclude=[])
line
indexVCF
indexVCF(vcf, verbose=True)
vcf
verbose
extractSamplenames
extractSamplenames(vcf)
checkVCFBundle
checkVCFBundle(vcf)
VCF bundle should have a .gz file and a tabix file
rewriteFamfile
rewriteFamfile(tfam, samples, keys)
tfam
samples
keys
checkSamples
checkSamples(samp1, samp2)
samp1
samp2
check if two sample lists agree
NoCache
NoCache()
Cache
Cache(cache_dir, cache_name, params)
cache_dir
cache_name
params
PseudoAutoRegion
PseudoAutoRegion(chrom, build)
chrom
build
TFAMParser
TFAMParser(tfam=None)
isnotebook
isnotebook()