#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (C) 2010 - 2012, A. Murat Eren
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.

import sys

import Oligotyping.lib.fastalib as u


alignment = u.SequenceSource(sys.argv[1])
quals = u.SequenceSource(sys.argv[2])

alignment.next()
quals.next()

qual = [int(q) for q in quals.seq.split()]
qual_aligned = []
for i in range(0, len(alignment.seq)):
    if alignment.seq[i] != '-':
        qual_aligned.append(qual.pop(0))
    else:
        qual_aligned.append(None)
print alignment.seq
print qual_aligned
