本文整理汇总了Python中common.Common.initialize方法的典型用法代码示例。如果您正苦于以下问题:Python Common.initialize方法的具体用法?Python Common.initialize怎么用?Python Common.initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.Common
的用法示例。
在下文中一共展示了Common.initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate_coverage_map
# 需要导入模块: from common import Common [as 别名]
# 或者: from common.Common import initialize [as 别名]
See the License for the specific language governing permissions and
limitations under the License.
Example Genomics Map Reduce
"""
import cloudstorage as gcs
import logging
import os
from common import Common
from genomicsapi import GenomicsAPI
from mapreduce import base_handler
from mapreduce import mapreduce_pipeline
Common.initialize()
def generate_coverage_map(data):
"""Generate coverage map function."""
(content, sequenceStart, sequenceEnd) = data
reads = content['reads'] if 'reads' in content else []
coverage = GenomicsAPI.compute_coverage(reads, sequenceStart,
sequenceEnd)
for key, value in coverage.iteritems():
yield (key, value)
def generate_coverage_reduce(key, values):
"""Generate coverage reduce function."""
yield "%d: %d\n" % (int(key), sum(int(value) for value in values))