本文整理汇总了Python中utils.runCommand函数的典型用法代码示例。如果您正苦于以下问题:Python runCommand函数的具体用法?Python runCommand怎么用?Python runCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了runCommand函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: zipFasta
def zipFasta(self):
"""
Compress the fasta file
"""
utils.log("zipping {} ...".format(self.fastaFileName))
cmd = "bgzip -f {}".format(self.fastaFileName)
utils.runCommand(cmd)
开发者ID:malisas,项目名称:server,代码行数:7,代码来源:generate_fasta.py
示例2: fastqc
def fastqc(command, sequences, fastq_metadata, output_dir):
'''
Run FastQC on each fastq file.
'''
for fastq_file in sequences:
command = command % {'outdir': output_dir, 'seq': fastq_file}
runCommand('Checking fastq quality', command)
开发者ID:marcelcaraciolo,项目名称:nextgen-pipeline,代码行数:7,代码来源:commands.py
示例3: patchLibs
def patchLibs(libdir):
"""Make sure that libraries can by dynamically loaded. This is a brute force approach"""
saveDir = os.getcwd()
# fix libVitaCFilters.dylib
dir = os.path.join(
libdir,
"python%s/site-packages/vitamind/analyticsLib/pipelineElements" %
pythonVersion)
os.chdir(dir)
# Fix up library references in libVitaCFilters.dylib
lib = "libVitaCFilters.dylib"
utils.runCommand(["install_name_tool", "-change", "/tmp/external.buildaccount/lib/libcv.1.dylib", "./libcv.1.dylib", lib])
utils.runCommand(["install_name_tool", "-change", "/tmp/external.buildaccount/lib/libcxcore.1.dylib", "./libcxcore.1.dylib", lib])
for lib in ["libcv.1.dylib", "libcxcore.1.dylib"]:
try:
os.remove(lib)
except:
pass
os.symlink("../../../opencv/%s" % lib, lib)
os.chdir(saveDir)
开发者ID:AndreCAndersen,项目名称:nupic,代码行数:25,代码来源:build_people_tracking_demo.py
示例4: runPlayer
def runPlayer(path):
#runCommand("export DISPLAY=:0;sudo -u dima vlc -f \"%s\" &" % path)
#runCommand("sudo -u dima totem --fullscreen --display=:0 \"%s\"" % path)
#runCommand("export DISPLAY=:0; sudo -u dima mplayer --fs \"%s\"" % path)
#runCommand(r'"c:\Program Files (x86)\vlc-2.2.0\vlc.exe" -f "%s"' % path)
runCommand(
r'"c:\Program Files (x86)\K-Lite Codec Pack\MPC-HC64\mpc-hc64.exe" /fullscreen "%s"' % path)
开发者ID:avida,项目名称:webguy,代码行数:7,代码来源:mpc.py
示例5: _downloadFasta
def _downloadFasta(self, chromosome):
accession = self.accessions[chromosome]
fileName = '{}.fa'.format(chromosome)
minPos = 0
if self.excludeReferenceMin:
minPos = self.chromMinMax.getMinPos(chromosome)
maxPos = self.chromMinMax.getMaxPos(chromosome)
with open(fileName, "w") as outFasta:
print(">{}".format(chromosome), file=outFasta)
sequence = _fetchSequence(accession, minPos, maxPos)
for line in sequence:
print(line, file=outFasta)
utils.log("Compressing {}".format(fileName))
utils.runCommand("bgzip -f {}".format(fileName))
compressedFileName = fileName + '.gz'
utils.log("Indexing {}".format(compressedFileName))
utils.runCommand("samtools faidx {}".format(compressedFileName))
# Assemble the metadata.
metadata = {
"md5checksum": getReferenceChecksum(compressedFileName),
"sourceUri": None,
"ncbiTaxonId": 9606,
"isDerived": False,
"sourceDivergence": None,
"sourceAccessions": [accession + ".subset"],
}
metadataFilename = "{}.json".format(chromosome)
dumpDictToFileAsJson(metadata, metadataFilename)
开发者ID:bjea,项目名称:server,代码行数:28,代码来源:download_data.py
示例6: build_win32
def build_win32(srcdir, builddir, installdir, assertions, customerRelease):
log.info("build_win32: srcdir = '%s'", srcdir)
log.info("build_win32: builddir = '%s'", builddir)
log.info("build_win32: installdir = '%s'", installdir)
# deprecated
os.environ["NTA"] = installdir
# These are what I would like to use. Currently only used by the test project
os.environ["NTAX_INSTALL_DIR"] = installdir
os.environ["NTAX_BUILD_DIR"] = builddir
log.debug("build_win32: srcdir: '%s'", srcdir)
log.debug("build_win32: installdir: '%s'", installdir)
log.debug("build_win32: builddir: '%s'", builddir)
# how to quote "Release|Win32" so that it doesn't cause an error?
# command = ["vcbuild", "/logcommands", "/showenv", "/time", os.path.join(srcdir, "trunk.sln")]
utils.changeDir(srcdir)
if customerRelease:
import glob
solutionFiles = glob.glob("*.sln")
if len(solutionFiles) == 0:
raise Exception("Unable to find any solution files in customer source release")
elif len(solutionFiles) > 1:
raise Exception("More than one solution file found in customer source release: %s" % solutionFiles)
command = 'vcbuild /logcommands /showenv /time %s "Release|Win32"' % solutionFiles[0]
else:
command = 'vcbuild /logcommands /showenv /time trunk.sln "Release|Win32"'
utils.runCommand(command)
postbuild_win32(srcdir, installdir)
开发者ID:JimAllanson,项目名称:nupic,代码行数:32,代码来源:build.py
示例7: createMovie
def createMovie(encoder='ffmpeg'):
"""Create a movie from a saved sequence of images.
encoder is one of: 'ffmpeg, mencoder, convert'
"""
if not multisave:
pf.warning('You need to start multisave mode first!')
return
names,format,quality,window,border,hotkey,autosave,rootcrop = multisave
glob = names.glob()
## if glob.split('.')[-1] != 'jpg':
## pf.warning("Currently you need to save in 'jpg' format to create movies")
## return
if encoder == 'convert':
cmd = "convert -delay 1 -colors 256 %s output.gif" % names.glob()
elif encoder == 'mencoder':
cmd = "mencoder -ovc lavc -fps 5 -o output.avi %s" % names.glob()
elif encoder == 'mencoder1':
cmd = "mencoder \"mf://%s\" -mf fps=10 -o output1.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800" % names.glob()
else:
cmd = "ffmpeg -qscale 1 -r 1 -i %s output.mp4" % names.glob()
pf.debug(cmd)
utils.runCommand(cmd)
开发者ID:BackupTheBerlios,项目名称:pyformex-svn,代码行数:25,代码来源:image.py
示例8: align2sam
def align2sam(command, reference, fastq_file, sai_fastq_file, fastq_metadata, output_dir):
"""
Convert alignments to SAM format. Turn bwa sai alignments into a sam file.
It uses bwa samse commandline.
"""
(path, name, ext) = splitPath(sai_fastq_file)
if ext != '.sai':
sys.exit('align2Sam: alignment file %s does not have .sai extension' % sai_fastq_file)
sam_file = os.path.join(output_dir, os.path.splitext(os.path.basename(fastq_file))[0]) + '.sam'
sample = fastq_metadata[os.path.basename(fastq_file)]['sample']
run_id = fastq_metadata[os.path.basename(fastq_file)]['run_id']
lane = fastq_metadata[os.path.basename(fastq_file)]['lane']
identifier = fastq_metadata[os.path.basename(fastq_file)]['identifier']
readgroup_metadata = {'PL': 'ILLUMINA', 'SM': sample,
'LB': '%s_%s_%s_Lane%s' % (identifier, sample, run_id, lane),
'ID': '%s_%s_%s_Lane%s' % (identifier, sample, run_id, lane) }
metadata_str = make_metadata_string(readgroup_metadata)
command = command % {'out': sam_file, 'ref': reference, 'align': sai_fastq_file,
'seq': fastq_file, 'meta': metadata_str}
runCommand('bwa samse alignment from fastq: %s' % sample, command)
return sam_file
开发者ID:marcelcaraciolo,项目名称:nextgen-pipeline,代码行数:25,代码来源:commands.py
示例9: create_executable
def create_executable(trunk_dir, script_dir, work_dir, target):
# Go to target dir and verify there is no executable yet
os.chdir(work_dir)
if os.path.exists('VisionDemo.exe'):
os.remove('VisionDemo.exe')
nsis = os.path.join(trunk_dir,
'external/win32/lib/buildtools/NSIS/makensis.exe')
# Copy the NSIS script to work_dir because that's where it will execute
shutil.copy(os.path.join(script_dir, 'demo.nsi'), 'demo.nsi')
assert os.path.isfile(nsis)
# Build the NSIS command line
cmd = [nsis, 'demo.nsi']
#print ' '.join(cmd)
# Launch NSIS and verify that the final executable has been created
#subprocess.call(cmd)
import utils
import logging
# log level was earlier set to info. We want all output from this command
logging.getLogger('').setLevel(logging.DEBUG)
utils.runCommand(cmd)
assert os.path.isfile('VisionDemo.exe')
# Rename to target name
try:
shutil.move('VisionDemo.exe', target)
except Exception, e:
print e
print
开发者ID:AndreCAndersen,项目名称:nupic,代码行数:32,代码来源:create_demo.py
示例10: align_with_mem
def align_with_mem(command, threads, reference, fastq_file, pair_file, fastq_metadata, output_dir):
'''
Perform alignment on two paired-end fastq files to a reference genome to produce a sam file.
'''
(path, name, ext) = splitPath(fastq_file)
(pathP, nameP, extP) = splitPath(pair_file)
if ext != '.fastq' or extP != '.fastq':
sys.exit('align: one of the fastq file %s or %s does not have .fastq extension' % (fastq_file, pair_file))
sam_file = os.path.join(output_dir, os.path.splitext(os.path.basename(fastq_file))[0]) + '.sam'
sample = fastq_metadata[os.path.basename(fastq_file)]['sample']
run_id = fastq_metadata[os.path.basename(fastq_file)]['run_id']
lane = fastq_metadata[os.path.basename(fastq_file)]['lane']
identifier = fastq_metadata[os.path.basename(fastq_file)]['identifier']
readgroup_metadata = {'PL': 'ILLUMINA', 'SM': sample,
'LB': '%s_%s_%s_Lane%s' % (identifier, sample, run_id, lane),
'ID': '%s_%s_%s_Lane%s' % (identifier, sample, run_id, lane) }
metadata_str = make_metadata_string(readgroup_metadata)
command = command % {'threads': threads, 'meta': metadata_str, 'ref': reference,
'seq': fastq_file , 'pair': pair_file, 'out': sam_file}
runCommand('bwa mem alignment from fastq: %s' % sample, command)
return sam_file
开发者ID:marcelcaraciolo,项目名称:nextgen-pipeline,代码行数:25,代码来源:commands.py
示例11: cleanNoPysvn
def cleanNoPysvn(dir, doCleanup=True):
if doCleanup == False:
utils.runCommand("svn status --no-ignore %s" % dir)
else:
# Delete everythiung svn doesn't know about *except* for the top level directory, since svn can
# reports the top level directory as "!" (missing") if a sub-directory is missing.
# Use the xml format to avoid problems with spaces in filenames
utils.runCommand("svn status --no-ignore --xml %s | grep -A1 entry | grep path= | awk -F= '{print $2}' | sed 's/>//' | grep -v \\\"%s\\\" | xargs rm -rvf" % (dir, dir), logOutputOnlyOnFailure=False)
开发者ID:Halfnhav4,项目名称:nupic,代码行数:8,代码来源:svn.py
示例12: indexFasta
def indexFasta(self):
"""
Create index on the fasta file
"""
zipFileName = "{}.gz".format(self.fastaFileName)
utils.log("indexing {} ...".format(zipFileName))
cmd = "samtools faidx {}".format(zipFileName)
utils.runCommand(cmd)
开发者ID:malisas,项目名称:server,代码行数:8,代码来源:generate_fasta.py
示例13: compressSplits
def compressSplits(splitFileNames):
compressedFileNames = []
for splitFileName in splitFileNames:
utils.log("Compressing {}".format(splitFileName))
cmd = "bgzip {}".format(splitFileName)
utils.runCommand(cmd)
compressedFileName = "{}.gz".format(splitFileName)
compressedFileNames.append(compressedFileName)
return compressedFileNames
开发者ID:david4096,项目名称:server-1,代码行数:9,代码来源:split_fasta.py
示例14: decompressFasta
def decompressFasta(args):
fastaFileName = args.fastaFile
filename, extension = os.path.splitext(fastaFileName)
if extension == '.gz':
utils.log("Decompressing {}".format(fastaFileName))
cmd = "gunzip {}".format(fastaFileName)
utils.runCommand(cmd)
fastaFileName = filename
return fastaFileName
开发者ID:david4096,项目名称:server-1,代码行数:9,代码来源:split_fasta.py
示例15: ZipDir
def ZipDir(zipFile, directory):
if HOST_OS == 'win':
cmd = os.path.normpath(os.path.join(
os.path.dirname(__file__),
'../../../third_party/lzma_sdk/Executable/7za.exe'))
options = ['a', '-r', '-tzip']
else:
cmd = 'zip'
options = ['-yr']
utils.runCommand([cmd] + options + [zipFile, directory])
开发者ID:FaisalAbid,项目名称:sdk,代码行数:10,代码来源:archive.py
示例16: applyRules
def applyRules(rule):
print 'applying rule %s' % rule
if runCommand(rule):
print 'command <%s> execute failed' % rule
return False
rule = 'iptables-save > /etc/sysconfig/iptables'
if runCommand(rule):
print 'command <%s> execute failed' % rule
return False
return True
开发者ID:1060351485,项目名称:Gateway_django,代码行数:10,代码来源:iptables.py
示例17: installVitamind
def installVitamind(trunkDir, installDir):
"""Run the installVitamind.py script
Installs ffmpeg, scipy and vitamind obfuscated pipeline
to the install dir
"""
print 'installVitamind()'
saveDir = os.getcwd()
os.chdir(os.path.join(trunkDir, 'external/src/python_modules/vitamind'))
utils.runCommand(['python', 'install_vitamind.py', "--force", installDir])
os.chdir(saveDir)
开发者ID:AndreCAndersen,项目名称:nupic,代码行数:11,代码来源:build_people_tracking_demo.py
示例18: install_vitamind
def install_vitamind(target_dir):
"""Run the install_vitamind.py script
Installs ffmpeg, scipy and vitamind obfuscated pipeline
to the target dir
"""
print 'install_vitamind() into', target_dir
save_dir = os.getcwd()
os.chdir(os.path.join(trunk_dir, 'external/src/python_modules/vitamind'))
utils.runCommand(['python', 'install_vitamind.py', target_dir])
os.chdir(save_dir)
开发者ID:AndreCAndersen,项目名称:nupic,代码行数:11,代码来源:create_people_tracker.py
示例19: runTests
def runTests(self):
testCommands = self.parseTestCommands()
for command in testCommands:
expandedCommand = self.expandCommand(command)
self.log('Running: "{0}"'.format(expandedCommand))
try:
utils.runCommand(expandedCommand)
except subprocess.CalledProcessError:
self.log('ERROR')
return
self.log('SUCCESS')
开发者ID:Brentbin,项目名称:schemas,代码行数:11,代码来源:run_tests.py
示例20: annotate
def annotate(command, annovar_dir, annovar_file, output_dir):
'''
Annotate vcf using Annovar variant caller.
'''
(path, name, ext) = splitPath(annovar_file)
if ext != '.avinput':
sys.exit('Annotating vcf: vcf file %s does not have .avinput extension' % annovar_file)
out_prefix = os.path.join(output_dir, name)
command = command % {'out': out_prefix, 'annovarfile': annovar_file, 'annovardir': annovar_dir}
runCommand('Annotating with Annovar', command)
return out_prefix
开发者ID:marcelcaraciolo,项目名称:nextgen-pipeline,代码行数:12,代码来源:commands.py
注:本文中的utils.runCommand函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论