""" Problem 5: Unique trimming DNA sequences."""

import MapReduce
import sys

mr = MapReduce.MapReduce()

def mapper(record):
    # record[0]: seq id
    # record[1]: string of nucleotides
    nucleo = record[1][:-10]
    mr.emit_intermediate(nucleo, record[0])

def reducer(key, list_of_values):
    # key: trimmed nucleotide
    # value: 
    mr.emit(key)

if __name__ == '__main__':
    inputdata = open(sys.argv[1])
    mr.execute(inputdata, mapper, reducer)

e157656f241327329f841dc30f476c9a66fde617
<mask token>


def mapper(record):
    nucleo = record[1][:-10]
    mr.emit_intermediate(nucleo, record[0])


def reducer(key, list_of_values):
    mr.emit(key)


<mask token>

<mask token>


def mapper(record):
    nucleo = record[1][:-10]
    mr.emit_intermediate(nucleo, record[0])


def reducer(key, list_of_values):
    mr.emit(key)


if __name__ == '__main__':
    inputdata = open(sys.argv[1])
    mr.execute(inputdata, mapper, reducer)

<mask token>
mr = MapReduce.MapReduce()


def mapper(record):
    nucleo = record[1][:-10]
    mr.emit_intermediate(nucleo, record[0])


def reducer(key, list_of_values):
    mr.emit(key)


if __name__ == '__main__':
    inputdata = open(sys.argv[1])
    mr.execute(inputdata, mapper, reducer)

<mask token>
import MapReduce
import sys
mr = MapReduce.MapReduce()


def mapper(record):
    nucleo = record[1][:-10]
    mr.emit_intermediate(nucleo, record[0])


def reducer(key, list_of_values):
    mr.emit(key)


if __name__ == '__main__':
    inputdata = open(sys.argv[1])
    mr.execute(inputdata, mapper, reducer)

""" Problem 5: Unique trimming DNA sequences."""

import MapReduce
import sys

mr = MapReduce.MapReduce()

def mapper(record):
    # record[0]: seq id
    # record[1]: string of nucleotides
    nucleo = record[1][:-10]
    mr.emit_intermediate(nucleo, record[0])

def reducer(key, list_of_values):
    # key: trimmed nucleotide
    # value: 
    mr.emit(key)

if __name__ == '__main__':
    inputdata = open(sys.argv[1])
    mr.execute(inputdata, mapper, reducer)
