Commit 7415864a authored by New Tbgl User's avatar New Tbgl User
Browse files

Updated sequence assignment

parent 51d8dde5
......@@ -934,10 +934,10 @@ class Strand(Group):
self.add( s )
self.num_nts += s.num_nts
def set_sequence(self,sequence, set_complement=True):
def set_sequence(self,sequence): # , set_complement=True):
## validate input
assert( np.all( [i in ('A','T','C','G') for i in sequence] ) )
assert( len(sequence) >= self.num_nts )
assert( np.all( [i in ('A','T','C','G') for i in sequence] ) )
seq_idx = 0
## set sequence on each segment
......@@ -946,11 +946,14 @@ class Strand(Group):
if seg.sequence is None:
seg.sequence = [None for i in range(seg.num_nts)]
if self.is_fwd:
seg.sequence[nt] = sequence[seq_idx]
if s.is_fwd:
for nt in s._nucleotide_ids():
seg.sequence[nt] = sequence[seq_idx]
seq_idx += 1
else:
seg.sequence[nt] = seqComplement[sequence[seq_idx]]
seq_idx += 1
for nt in s._nucleotide_ids():
seg.sequence[nt] = seqComplement[sequence[seq_idx]]
seq_idx += 1
# def get_sequence(self):
# sequence = []
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment