def seguid(self): """Returns the SEGUID for the Dseq. The definition varies with the amount of stagger between the sequences.""" rc_ovhg = len(self.watson) - len(self.crick) + self._ovhg if self._ovhg == rc_ovhg == 0: return _seg(min(self.watson, self.crick)) if self._ovhg < rc_ovhg: w = self.watson c = self.crick o = self._ovhg elif self._ovhg > rc_ovhg: w = self.crick c = self.watson o = rc_ovhg elif self._ovhg == rc_ovhg: w, c = sorted((self.watson, self.crick)) o = self._ovhg return _seg(_pretty_str(o) + w + "|" + c)
def seguid(self): '''Returns the url safe SEGUID [#]_ for the sequence. This checksum is the same as seguid but with base64.urlsafe encoding [#]_ instead of the normal base 64. This means that the characters + and / are replaced with - and _ so that the checksum can be a part of and URL or a filename. Examples -------- >>> from pydna.seqrecord import SeqRecord >>> a=SeqRecord("aaaaaaa") >>> a.seguid() # original seguid is +bKGnebMkia5kNg/gF7IORXMnIU '-bKGnebMkia5kNg_gF7IORXMnIU' References ---------- .. [#] http://wiki.christophchamp.com/index.php/SEGUID''' return _seg(str(self.seq))