Beispiel #1
0
 def _write(self, arr, start, end, strand, value):
     if strand == NEG_STRAND:
         value = dna_reverse_complement(value)
     # encode to bitarray
     b = bitarray()
     b.encode(_encoders[self.bpb], value)        
     # write
     BitArrayTrack._write(self, arr, start, end, b)
Beispiel #2
0
 def _read(self, arr, start, end, strand):
     # get bitarray
     b = BitArrayTrack._read(self, arr, start, end)
     # decode to sequence
     codec_dict = _decoders[self.bpb]
     seq = ''.join(b.decode(codec_dict))
     if strand == NEG_STRAND:
         seq = dna_reverse_complement(seq)
     return seq