Beispiel #1
0
 def __add__(self, other):
     if hasattr(other, "seq") and hasattr(other.seq, "watson"):
         other = _copy.deepcopy(other)
         for f in other.features:
             f.location = f.location + other.seq.ovhg
         answer = Dseqrecord(_SeqRecord.__add__(self, other))
         answer.n = min(self.n, other.n)
     else:
         answer = Dseqrecord(_SeqRecord.__add__(self, Dseqrecord(other)))
         answer.n = self.n
     return answer
Beispiel #2
0
    def __add__(self, other):
        if hasattr(other, "seq") and hasattr(other.seq, "watson"):
            other = _copy.deepcopy(other)
            other_five_prime = other.seq.five_prime_end()
            if other_five_prime[0] == "5'":
                # add other.seq.ovhg
                for f in other.features:
                    f.location = f.location + other.seq.ovhg
            elif other_five_prime[0] == "3'":
                # subtract other.seq.ovhg (sign change)
                for f in other.features:
                    f.location = f.location + (-other.seq.ovhg)

            answer = Dseqrecord(_SeqRecord.__add__(self, other))
            answer.n = min(self.n, other.n)
        else:
            answer = Dseqrecord(_SeqRecord.__add__(self, Dseqrecord(other)))
            answer.n = self.n
        return answer