Skip to content
Browse files

Updates all unchanged Bio.Seq.tostring() to str(Bio.Seq)

  • Loading branch information...
1 parent 97b6aea commit 79842f4ba0d90edf830a8ab16fead97ba7b8a8bc @bow bow committed with peterjc
View
2 Bio/Align/AlignInfo.py
@@ -697,7 +697,7 @@ def print_info_content(summary_info,fout=None,rep_record=0):
alignment = AlignIO.read(open(filename), format)
for record in alignment:
- print record.seq.tostring()
+ print str(record.seq)
print "="*alignment.get_alignment_length()
summary = SummaryInfo(alignment)
View
6 Bio/AlignIO/ClustalIO.py
@@ -63,7 +63,7 @@ def write_alignment(self, alignment):
#identifier when output in the file by replacing
#them with underscores:
line = record.id[0:30].replace(" ","_").ljust(36)
- line += record.seq[cur_char:(cur_char + show_num)].tostring()
+ line += str(record.seq[cur_char:(cur_char + show_num)])
output += line + "\n"
# now we need to print out the star info, if we've got it
@@ -349,7 +349,7 @@ def next(self):
assert 2 == len(alignment)
assert alignment[0].id == "gi|4959044|gb|AAD34209.1|AF069"
assert alignment[1].id == "gi|671626|emb|CAA85685.1|"
- assert alignment[0].seq.tostring() == \
+ assert str(alignment[0].seq) == \
"MENSDSNDKGSDQSAAQRRSQMDRLDREEAFYQFVNNLSEEDYRLMRDNN" + \
"LLGTPGESTEEELLRRLQQIKEGPPPQSPDENRAGESSDDVTNSDSIIDW" + \
"LNSVRQTGNTTRSRQRGNQSWRAVSRTNPNSGDFRFSLEINVNRNNGSQT" + \
@@ -362,7 +362,7 @@ def next(self):
alignment = alignments[0]
assert 9 == len(alignment)
assert alignment[-1].id == "HISJ_E_COLI"
- assert alignment[-1].seq.tostring() == \
+ assert str(alignment[-1].seq) == \
"MKKLVLSLSLVLAFSSATAAF-------------------AAIPQNIRIG" + \
"TDPTYAPFESKNS-QGELVGFDIDLAKELCKRINTQCTFVENPLDALIPS" + \
"LKAKKIDAIMSSLSITEKRQQEIAFTDKLYAADSRLV"
View
2 Bio/AlignIO/NexusIO.py
@@ -106,7 +106,7 @@ def write_alignment(self, alignment):
n = Nexus.Nexus(minimal_record)
n.alphabet = alignment._alphabet
for record in alignment:
- n.add_sequence(record.id, record.seq.tostring())
+ n.add_sequence(record.id, str(record.seq))
n.write_nexus_data(self.handle)
def _classify_alphabet_for_nexus(self, alphabet):
View
8 Bio/AlignIO/PhylipIO.py
@@ -504,7 +504,7 @@ def next(self):
for record in alignment:
count=count+1
print record.id
- #print record.seq.tostring()
+ #print str(record.seq)
assert count == 8
expected="""mkklvlslsl vlafssataa faaipqniri gtdptyapfe sknsqgelvg
@@ -512,7 +512,7 @@ def next(self):
aadsrlvvak nsdiqptves lkgkrvgvlq gttqetfgne hwapkgieiv syqgqdniys
dltagridaafqdevaaseg flkqpvgkdy kfggpsvkde klfgvgtgmg lrkednelre
alnkafaemradgtyeklak kyfdfdvygg""".replace(" ","").replace("\n","").upper()
- assert record.seq.tostring().replace("-","") == expected
+ assert str(record.seq).replace("-","") == expected
#From here:
#http://atgc.lirmm.fr/phyml/usersguide.html
@@ -550,7 +550,7 @@ def next(self):
for i in range(0,5):
list2[0][i].id == list3[0][i].id
- list2[0][i].seq.tostring() == list3[0][i].seq.tostring()
+ str(list2[0][i].seq) == str(list3[0][i].seq)
#From here:
#http://evolution.genetics.washington.edu/phylip/doc/sequence.html
@@ -630,5 +630,5 @@ def next(self):
assert len(a1) == len(a2)
for r1, r2 in zip(a1, a2):
assert r1.id == r2.id
- assert r1.seq.tostring() == r2.seq.tostring()
+ assert str(r1.seq) == str(r2.seq)
print "Done"
View
2 Bio/AlignIO/StockholmIO.py
@@ -205,7 +205,7 @@ def _write_record(self, record):
if seq_name in self._ids_written:
raise ValueError("Duplicate record identifier: %s" % seq_name)
self._ids_written.append(seq_name)
- self.handle.write("%s %s\n" % (seq_name, record.seq.tostring()))
+ self.handle.write("%s %s\n" % (seq_name, str(record.seq)))
#The recommended placement for GS lines (per sequence annotation)
#is above the alignment (as a header block) or just below the
View
2 Bio/GA/Organism.py
@@ -123,7 +123,7 @@ def __init__(self, genome, fitness_calculator, start_fitness = None):
def __str__(self):
"""Provide a string output for debugging.
"""
- return "Genome: %s; Fitness %s" % (self.genome.tostring(), self.fitness)
+ return "Genome: %s; Fitness %s" % (str(self.genome), self.fitness)
def __eq__(self, other):
"""Compare organisms by their genomes (as strings of letters).
View
2 Bio/GA/Repair/Stabilizing.py
@@ -44,7 +44,7 @@ def repair(self, organism):
while 1:
# first find all of the ambigous items
seq_genome = new_org.genome.toseq()
- all_ambiguous = self._ambig_finder.find_ambiguous(seq_genome.tostring())
+ all_ambiguous = self._ambig_finder.find_ambiguous(str(seq_genome))
# if we have less then the number of ambiguous allowed, stop
if len(all_ambiguous) <= self._num_ambiguous:
View
4 Bio/NeuralNetwork/Gene/Motif.py
@@ -71,7 +71,7 @@ def _get_motif_dict(self, seq_records, motif_size):
# now start finding motifs in the sequence
for start in range(len(seq_record.seq) - (motif_size - 1)):
- motif = seq_record.seq[start:start + motif_size].tostring()
+ motif = str(seq_record.seq[start:start + motif_size])
# if we are being alphabet strict, make sure the motif
# falls within the specified alphabet
@@ -187,7 +187,7 @@ def representation(self, sequence):
# count all of the motifs we are looking for in the sequence
for start in range(len(sequence) - (self._motif_size - 1)):
- motif = sequence[start:start + self._motif_size].tostring()
+ motif = str(sequence[start:start + self._motif_size])
if motif in seq_motifs:
seq_motifs[motif] += 1
View
4 Bio/NeuralNetwork/Gene/Pattern.py
@@ -63,9 +63,9 @@ def write_seq(self, seq_pattern_list, output_handle):
for seq_pattern in seq_pattern_list:
if isinstance(seq_pattern, MutableSeq):
seq = seq_pattern.toseq()
- all_patterns.append(seq.tostring())
+ all_patterns.append(str(seq))
elif isinstance(seq_pattern, Seq):
- all_patterns.append(seq_pattern.tostring())
+ all_patterns.append(str(seq_pattern))
else:
raise ValueError("Unexpected pattern type %r" % seq_pattern)
View
14 Bio/NeuralNetwork/Gene/Schema.py
@@ -248,7 +248,7 @@ def find_schemas(self, fitness, num_schemas):
# convert the Genome from a MutableSeq to a Seq so that
# the schemas are just strings (and not array("c")s)
seq_genome = org.genome.toseq()
- schema_info[seq_genome.tostring()] = org.fitness
+ schema_info[str(seq_genome)] = org.fitness
return PatternRepository(schema_info)
@@ -289,20 +289,20 @@ def calculate_fitness(self, genome):
"""
# convert the genome into a string
seq_motif = genome.toseq()
- motif = seq_motif.tostring()
+ motif = str(seq_motif)
# get the counts in the positive examples
num_pos = 0
for seq_record in self._pos_seqs:
cur_counts = self._schema_eval.num_matches(motif,
- seq_record.seq.tostring())
+ str(seq_record.seq))
num_pos += cur_counts
# get the counts in the negative examples
num_neg = 0
for seq_record in self._neg_seqs:
cur_counts = self._schema_eval.num_matches(motif,
- seq_record.seq.tostring())
+ str(seq_record.seq))
num_neg += cur_counts
@@ -349,13 +349,13 @@ def calculate_fitness(self, genome):
"""
# convert the genome into a string
seq_motif = genome.toseq()
- motif = seq_motif.tostring()
+ motif = str(seq_motif)
# find the number of times the genome matches
num_times = 0
for seq_record in self._records:
cur_counts = self._evaluator.num_matches(motif,
- seq_record.seq.tostring())
+ str(seq_record.seq))
num_times += cur_counts
return num_times
@@ -510,7 +510,7 @@ def representation(self, sequence):
schema_counts = []
for schema in self._schemas:
- num_counts = self._converter.num_matches(schema, sequence.tostring())
+ num_counts = self._converter.num_matches(schema, str(sequence))
schema_counts.append(num_counts)
# normalize the counts to go between zero and one
View
8 Bio/NeuralNetwork/Gene/Signature.py
@@ -75,11 +75,11 @@ def _get_signature_dict(self, seq_records, sig_size, max_gap):
largest_sig_size = sig_size * 2 + max_gap
for start in range(len(seq_record.seq) - (largest_sig_size - 1)):
# find the first part of the signature
- first_sig = seq_record.seq[start:start + sig_size].tostring()
+ first_sig = str(seq_record.seq[start:start + sig_size])
# now find all of the second parts of the signature
for second in range(start + 1, (start + 1) + max_gap):
- second_sig = seq_record.seq[second: second + sig_size].tostring()
+ second_sig = str(seq_record.seq[second: second + sig_size])
# if we are being alphabet strict, make sure both parts
# of the sig fall within the specified alphabet
@@ -188,11 +188,11 @@ def representation(self, sequence):
for start in range(len(sequence) - (smallest_sig_size - 1)):
# if the first part matches any of the signatures we are looking
# for, then expand out to look for the second part
- first_sig = sequence[start:start + sig_size].tostring()
+ first_sig = str(sequence[start:start + sig_size])
if first_sig in all_first_sigs:
for second in range(start + sig_size,
(start + sig_size + 1) + self._max_gap):
- second_sig = sequence[second:second + sig_size].tostring()
+ second_sig = str(sequence[second:second + sig_size])
# if we find the motif, increase the counts for it
if (first_sig, second_sig) in sequence_sigs:
View
31 Bio/Nexus/Nexus.py
@@ -262,7 +262,7 @@ def _unique_label(previous_labels,label):
def _seqmatrix2strmatrix(matrix):
"""Converts a Seq-object matrix to a plain sequence-string matrix."""
- return dict([(t,matrix[t].tostring()) for t in matrix])
+ return dict([(t, str(matrix[t])) for t in matrix])
def _compact4nexus(orig_list):
"""Transform [1 2 3 5 6 7 8 12 15 18 20] (baseindex 0, used in the Nexus class)
@@ -335,13 +335,13 @@ def combine(matrices):
m_only=[t for t in m.taxlabels if t not in both]
for t in both:
# concatenate sequences and unify gap and missing character symbols
- combined.matrix[t]+=Seq(m.matrix[t].tostring().replace(m.gap,combined.gap).replace(m.missing,combined.missing),combined.alphabet)
+ combined.matrix[t]+=Seq(str(m.matrix[t]).replace(m.gap,combined.gap).replace(m.missing,combined.missing),combined.alphabet)
# replace date of missing taxa with symbol for missing data
for t in combined_only:
combined.matrix[t]+=Seq(combined.missing*m.nchar,combined.alphabet)
for t in m_only:
combined.matrix[t]=Seq(combined.missing*combined.nchar,combined.alphabet)+\
- Seq(m.matrix[t].tostring().replace(m.gap,combined.gap).replace(m.missing,combined.missing),combined.alphabet)
+ Seq(str(m.matrix[t]).replace(m.gap,combined.gap).replace(m.missing,combined.missing),combined.alphabet)
combined.taxlabels.extend(m_only) # new taxon list
for cn,cs in m.charsets.iteritems(): # adjust character sets for new matrix
combined.charsets['%s.%s' % (n,cn)]=[x+combined.nchar for x in cs]
@@ -854,12 +854,12 @@ def _matrix(self,options):
else:
if self.matchchar:
while 1:
- p=iupac_seq.tostring().find(self.matchchar)
+ p=str(iupac_seq).find(self.matchchar)
if p==-1:
break
- iupac_seq=Seq(iupac_seq.tostring()[:p]+refseq[p]+iupac_seq.tostring()[p+1:],self.alphabet)
+ iupac_seq=Seq(str(iupac_seq)[:p]+refseq[p]+str(iupac_seq)[p+1:],self.alphabet)
#check for invalid characters
- for i,c in enumerate(iupac_seq.tostring()):
+ for i,c in enumerate(str(iupac_seq)):
if c not in self.valid_characters and c!=self.gap and c!=self.missing:
raise NexusError( \
('Taxon %s: Illegal character %s in sequence %s ' + \
@@ -1425,8 +1425,8 @@ def export_fasta(self, filename=None, width=70):
fh=open(filename,'w')
for taxon in self.taxlabels:
fh.write('>'+safename(taxon)+'\n')
- for i in range(0, len(self.matrix[taxon].tostring()), width):
- fh.write(self.matrix[taxon].tostring()[i:i+width] + '\n')
+ for i in range(0, len(str(self.matrix[taxon])), width):
+ fh.write(str(self.matrix[taxon])[i:i+width] + '\n')
fh.close()
return filename
@@ -1443,7 +1443,7 @@ def export_phylip(self, filename=None):
fh=open(filename,'w')
fh.write('%d %d\n' % (self.ntax,self.nchar))
for taxon in self.taxlabels:
- fh.write('%s %s\n' % (safename(taxon),self.matrix[taxon].tostring()))
+ fh.write('%s %s\n' % (safename(taxon), str(self.matrix[taxon])))
fh.close()
return filename
@@ -1458,7 +1458,8 @@ def constant(self,matrix=None,delete=[],exclude=[]):
return [x for x in range(len(matrix[undelete[0]])) if x not in exclude]
# get the first sequence and expand all ambiguous values
constant=[(x,self.ambiguous_values.get(n.upper(),n.upper())) for
- x,n in enumerate(matrix[undelete[0]].tostring()) if x not in exclude]
+ x,n in enumerate(str(matrix[undelete[0]])) if x not in exclude]
+
for taxon in undelete[1:]:
newconstant=[]
for site in constant:
@@ -1533,7 +1534,7 @@ def crop_matrix(self,matrix=None, delete=[], exclude=[]):
undelete=[t for t in self.taxlabels if t in matrix and t not in delete]
if not undelete:
return {}
- m=[matrix[k].tostring() for k in undelete]
+ m=[str(matrix[k]) for k in undelete]
zipped_m=zip(*m)
sitesm=[s for i,s in enumerate(zipped_m) if i not in exclude]
if sitesm==[]:
@@ -1557,7 +1558,7 @@ def bootstrap(self,matrix=None,delete=[],exclude=[]):
return cm
undelete=[t for t in self.taxlabels if t in cm]
if seqobjects:
- sitesm=zip(*[cm[t].tostring() for t in undelete])
+ sitesm=zip(*[str(cm[t]) for t in undelete])
alphabet=matrix[matrix.keys()[0]].alphabet
else:
sitesm=zip(*[cm[t] for t in undelete])
@@ -1624,7 +1625,7 @@ def _adjust(set,x,d,leftgreedy=False):
return
if self.taxlabels:
#python 2.3 does not support zip(*[])
- sitesm=zip(*[self.matrix[t].tostring() for t in self.taxlabels])
+ sitesm=zip(*[str(self.matrix[t]) for t in self.taxlabels])
else:
sitesm=[]
sitesm[pos:pos]=[['-']*len(self.taxlabels)]*n
@@ -1683,7 +1684,7 @@ def gaponly(self,include_missing=False):
gap=set(self.gap)
if include_missing:
gap.add(self.missing)
- sitesm=zip(*[self.matrix[t].tostring() for t in self.taxlabels])
+ sitesm=zip(*[str(self.matrix[t]) for t in self.taxlabels])
gaponly=[i for i,site in enumerate(sitesm) if set(site).issubset(gap)]
return gaponly
@@ -1698,7 +1699,7 @@ def terminal_gap_to_missing(self,missing=None,skip_n=True):
if not skip_n:
replace.extend(['n','N'])
for taxon in self.taxlabels:
- sequence=self.matrix[taxon].tostring()
+ sequence=str(self.matrix[taxon])
length=len(sequence)
start,end=get_start_end(sequence,skiplist=replace)
if start==-1 and end==-1:
View
4 Bio/Restriction/PrintFormat.py
@@ -320,8 +320,8 @@ def _make_map_only(self, ls, title, nc = [], s1 = ''):
break
cutloc[x] = l
cutloc[x] = mapping
- sequence = self.sequence.tostring()
- revsequence = self.sequence.complement().tostring()
+ sequence = str(self.sequence)
+ revsequence = str(self.sequence.complement())
a = '|'
base, counter = 0, 0
emptyline = ' ' * 60
View
2 Bio/Restriction/Restriction.py
@@ -144,7 +144,7 @@ def __init__(self, seq, linear = True):
if seq is a FormattedSeq, linear will have no effect on the
shape of the sequence."""
if isinstance(seq, Seq) or isinstance(seq, MutableSeq):
- stringy = seq.tostring()
+ stringy = str(seq)
self.lower = stringy.islower()
#Note this adds a leading space to the sequence (!)
self.data = _check_bases(stringy)
View
6 Bio/Restriction/_Update/RestrictionCompiler.py
@@ -119,7 +119,7 @@ def Antiparallel(sequence):
returns a string which represents the reverse complementary strand of
a DNA sequence."""
- return antiparallel(sequence.tostring())
+ return antiparallel(str(sequence))
def is_palindrom(sequence):
"""is_palindrom(sequence) -> bool.
@@ -949,10 +949,10 @@ def information_mixer(self, file1, file2, file3):
print name, 'has two different sites.\n'
other = line[0].replace("-","_")
dna = DNA(line[1])
- sense1 = regex(dna.tostring())
+ sense1 = regex(str(dna))
antisense1 = regex(Antiparallel(dna))
dna = DNA(enzymedict[other][0])
- sense2 = regex(dna.tostring())
+ sense2 = regex(str(dna))
antisense2 = regex(Antiparallel(dna))
sense = '(?P<'+other+'>'+sense1+'|'+sense2+')'
antisense = '(?P<'+other+'_as>'+antisense1+'|'+antisense2 + ')'
View
2 Bio/SeqIO/SeqXmlIO.py
@@ -334,7 +334,7 @@ def _write_seq(self,record):
if isinstance(record.seq,UnknownSeq):
raise TypeError("Sequence type is UnknownSeq but SeqXML requires sequence")
- seq = record.seq.tostring()
+ seq = str(record.seq)
if not len(seq) > 0:
raise ValueError("The sequence length should be greater than 0")
View
2 Bio/SeqIO/SwissIO.py
@@ -153,7 +153,7 @@ def SwissIterator(handle):
print record.id
print record.annotations['keywords']
print repr(record.annotations['organism'])
- print record.seq.tostring()[:20] + "..."
+ print str(record.seq)[:20] + "..."
for f in record.features: print f
handle.close()
View
6 Bio/SeqUtils/CheckSum.py
@@ -20,7 +20,7 @@ def crc32(seq):
#TODO - Should we return crc32(x) & 0xffffffff here?
try:
#Assume its a Seq object
- return _crc32(_as_bytes(seq.tostring()))
+ return _crc32(_as_bytes(str(seq)))
except AttributeError:
#Assume its a string/unicode
return _crc32(_as_bytes(seq))
@@ -68,7 +68,7 @@ def gcg(seq):
All sequences are converted to uppercase """
try:
#Assume its a Seq object
- seq = seq.tostring()
+ seq = str(seq)
except AttributeError:
#Assume its a string
pass
@@ -99,7 +99,7 @@ def seguid(seq):
import base64
try:
#Assume its a Seq object
- seq = seq.tostring()
+ seq = str(seq)
except AttributeError:
#Assume its a string
pass
View
4 Bio/SeqUtils/lcc.py
@@ -25,7 +25,7 @@ def lcc_mult(seq,wsize):
upper = seq.upper()
except AttributeError:
#Should be a Seq object then
- upper = seq.tostring().upper()
+ upper = str(seq).upper()
compone = [0]
lccsal = [0]
for i in range(wsize):
@@ -135,7 +135,7 @@ def lcc_simp(seq):
upper = seq.upper()
except AttributeError:
#Should be a Seq object then
- upper = seq.tostring().upper()
+ upper = str(seq).upper()
l2 = math.log(2)
if 'A' not in seq:
term_a = 0
View
18 Tests/common_BioSQL.py
@@ -275,7 +275,7 @@ def test_seq(self):
self.assertTrue(isinstance(alphabet, Alphabet.Alphabet))
data = test_seq.data
self.assertEqual(type(data), type(""))
- string_rep = test_seq.tostring()
+ string_rep = str(test_seq)
self.assertEqual(string_rep, str(test_seq)) #check __str__ too
self.assertEqual(type(string_rep), type(""))
self.assertEqual(len(test_seq), 880)
@@ -314,15 +314,15 @@ def test_seq_slicing(self):
new_seq = test_seq[:10]
self.assertTrue(isinstance(new_seq, BioSeq.DBSeq))
# simple slicing
- self.assertEqual(test_seq[:5].tostring(), 'ATTTG')
- self.assertEqual(test_seq[0:5].tostring(), 'ATTTG')
- self.assertEqual(test_seq[2:3].tostring(), 'T')
- self.assertEqual(test_seq[2:4].tostring(), 'TT')
- self.assertEqual(test_seq[870:].tostring(), 'TTGAATTATA')
+ self.assertEqual(str(test_seq[:5]), 'ATTTG')
+ self.assertEqual(str(test_seq[0:5]), 'ATTTG')
+ self.assertEqual(str(test_seq[2:3]), 'T')
+ self.assertEqual(str(test_seq[2:4]), 'TT')
+ self.assertEqual(str(test_seq[870:]), 'TTGAATTATA')
# getting more fancy
self.assertEqual(test_seq[-1], 'A')
self.assertEqual(test_seq[1], 'T')
- self.assertEqual(test_seq[-10:][5:].tostring(), "TTATA")
+ self.assertEqual(str(test_seq[-10:][5:]), "TTATA")
self.assertEqual(str(test_seq[-10:][5:]), "TTATA")
def test_seq_features(self):
@@ -657,14 +657,14 @@ def test_record_loading(self):
self.assertEqual(test_record.id, "X55053.1")
self.assertEqual(test_record.description, "A.thaliana cor6.6 mRNA.")
self.assertTrue(isinstance(test_record.seq.alphabet, Alphabet.DNAAlphabet))
- self.assertEqual(test_record.seq[:10].tostring(), 'AACAAAACAC')
+ self.assertEqual(str(test_record.seq[:10]), 'AACAAAACAC')
test_record = self.db.lookup(accession = "X62281")
self.assertEqual(test_record.name, "ATKIN2")
self.assertEqual(test_record.id, "X62281.1")
self.assertEqual(test_record.description, "A.thaliana kin2 gene.")
self.assertTrue(isinstance(test_record.seq.alphabet, Alphabet.DNAAlphabet))
- self.assertEqual(test_record.seq[:10].tostring(), 'ATTTGGCCTA')
+ self.assertEqual(str(test_record.seq[:10]), 'ATTTGGCCTA')
def test_seq_feature(self):
"""Indepth check that SeqFeatures are transmitted through the db.
View
30 Tests/seq_tests_common.py
@@ -10,10 +10,10 @@ def checksum_summary(record):
if isinstance(record.seq, UnknownSeq):
return repr(record.seq)
if len(record.seq) < 25:
- short = record.seq.tostring()
+ short = str(record.seq)
else:
- short = record.seq.tostring()[:19] \
- + "..." + record.seq.tostring()[-3:]
+ short = str(record.seq)[:19] \
+ + "..." + str(record.seq)[-3:]
return "%s [%s] len %i" \
% (short, seguid(record.seq), len(record.seq))
@@ -178,7 +178,7 @@ def compare_feature(old_f, new_f):
def compare_sequence(old, new):
"""Compare two Seq or DBSeq objects"""
assert len(old) == len(new), "%i vs %i" % (len(old), len(new))
- assert old.tostring() == new.tostring()
+ assert str(old) == str(new)
if isinstance(old, UnknownSeq):
assert isinstance(new, UnknownSeq)
@@ -186,7 +186,7 @@ def compare_sequence(old, new):
assert not isinstance(new, UnknownSeq)
ln = len(old)
- s = old.tostring()
+ s = str(old)
assert isinstance(s, str)
#Don't check every single element; for long sequences
@@ -210,29 +210,29 @@ def compare_sequence(old, new):
for i in indices:
for j in indices:
expected = s[i:j]
- assert expected == old[i:j].tostring(), \
+ assert expected == str(old[i:j]), \
"Slice %s vs %s" % (repr(expected), repr(old[i:j]))
- assert expected == new[i:j].tostring(), \
+ assert expected == str(new[i:j]), \
"Slice %s vs %s" % (repr(expected), repr(new[i:j]))
#Slicing with step of 1 should make no difference.
#Slicing with step 3 might be useful for codons.
for step in [1,3]:
expected = s[i:j:step]
- assert expected == old[i:j:step].tostring()
- assert expected == new[i:j:step].tostring()
+ assert expected == str(old[i:j:step])
+ assert expected == str(new[i:j:step])
#Check automatic end points
expected = s[i:]
- assert expected == old[i:].tostring()
- assert expected == new[i:].tostring()
+ assert expected == str(old[i:])
+ assert expected == str(new[i:])
expected = s[:i]
- assert expected == old[:i].tostring()
- assert expected == new[:i].tostring()
+ assert expected == str(old[:i])
+ assert expected == str(new[:i])
#Check "copy" splice
- assert s == old[:].tostring()
- assert s == new[:].tostring()
+ assert s == str(old[:])
+ assert s == str(new[:])
return True
def compare_features(old_list, new_list):
View
4 Tests/test_AlignIO.py
@@ -83,7 +83,7 @@ def alignment_summary(alignment, index=" ", vertical_threshold=5):
#Show each sequence row horizontally
for record in alignment:
answer.append("%s%s %s" \
- % (index,str_summary(record.seq.tostring()),record.id))
+ % (index,str_summary(str(record.seq)),record.id))
else:
#Show each sequence row vertically
for i in range(min(5,alignment_len)):
@@ -172,7 +172,7 @@ def simple_alignment_comparison(alignments, alignments2, format):
#many formats can't store more than that.
#Check the sequence
- assert r1.seq.tostring() == r2.seq.tostring()
+ assert str(r1.seq) == str(r2.seq)
#Beware of different quirks and limitations in the
#valid character sets and the identifier lengths!
View
42 Tests/test_GACrossover.py
@@ -30,7 +30,7 @@ def test_fitness(genome):
"""Simple class for calculating fitnesses.
"""
seq_genome = genome.toseq()
- return int(seq_genome.tostring())
+ return int(str(seq_genome))
class SinglePointTest(unittest.TestCase):
"""Test simple point crossovers.
@@ -108,8 +108,8 @@ def test_ds_prop_uniform_crossover(self):
self.assertTrue(len(new_org_1.genome) > len(new_org_2.genome),
"Strings are of wrong sizes after uniform crossover.")
- self.assertEqual(new_org_2.genome.tostring().count("1"),
- new_org_1.genome.tostring().count("3"),
+ self.assertEqual(str(new_org_2.genome).count("1"),
+ str(new_org_1.genome).count("3"),
"There should be equal distributions of the smaller string")
self.assertEqual(str(self.org_1.genome[len(new_org_2.genome):]),
@@ -125,11 +125,11 @@ def test_ss_prop_uniform_crossover(self):
self.assertEqual(len(new_org_1.genome), len(new_org_2.genome),
"Strings are of different sizes after uniform crossover.")
- self.assertEqual(new_org_1.genome.tostring().count("1"),
- new_org_2.genome.tostring().count("2"),
+ self.assertEqual(str(new_org_1.genome).count("1"),
+ str(new_org_2.genome).count("2"),
"There should be equal, inverse distributions")
- self.assertEqual(new_org_1.genome.tostring().count("2") ,
- new_org_2.genome.tostring().count("1"),
+ self.assertEqual(str(new_org_1.genome).count("2") ,
+ str(new_org_2.genome).count("1"),
"There should be equal, inverse distributions")
@@ -176,16 +176,16 @@ def test_prop_sym_crossover(self):
self.assertEqual(len(new_org_1.genome), len(new_org_2.genome),
"Strings are of different sizes after interleave point crossover.")
- self.assertEqual(new_org_1.genome.tostring().count("1"),
- new_org_2.genome.tostring().count("2"),
+ self.assertEqual(str(new_org_1.genome).count("1"),
+ str(new_org_2.genome).count("2"),
"There should be equal, inverse distributions")
- self.assertEqual(new_org_1.genome.tostring().count("2") ,
- new_org_2.genome.tostring().count("1"),
+ self.assertEqual(str(new_org_1.genome).count("2") ,
+ str(new_org_2.genome).count("1"),
"There should be equal, inverse distributions")
- self.assertEqual(new_org_1.genome.tostring(), "12121",
+ self.assertEqual(str(new_org_1.genome), "12121",
"Did not interleave.")
- self.assertEqual(new_org_2.genome.tostring(), "21212",
+ self.assertEqual(str(new_org_2.genome), "21212",
"Did not interleave.")
def test_prop_asym_crossover(self):
@@ -206,9 +206,9 @@ def test_prop_asym_crossover(self):
self.assertNotEqual(str(new_org_3), str(self.org_3),
"Returned an exact copy of the original organism.")
- self.assertEqual(new_org_1.genome.tostring(), "13131",
+ self.assertEqual(str(new_org_1.genome), "13131",
"Did not interleave with growth.")
- self.assertEqual(new_org_3.genome.tostring(), "31313333",
+ self.assertEqual(str(new_org_3.genome), "31313333",
"Did not interleave with growth.")
class FourPointTest(unittest.TestCase):
@@ -253,11 +253,11 @@ def test_prop_sym_crossover(self):
self.assertEqual(len(new_org_1.genome), len(new_org_2.genome),
"Strings are of different sizes after symmetric crossover.")
- self.assertEqual(new_org_1.genome.tostring().count("1"),
- new_org_2.genome.tostring().count("2"),
+ self.assertEqual(str(new_org_1.genome).count("1"),
+ str(new_org_2.genome).count("2"),
"There should be equal, inverse distributions")
- self.assertEqual(new_org_1.genome.tostring().count("2") ,
- new_org_2.genome.tostring().count("1"),
+ self.assertEqual(str(new_org_1.genome).count("2") ,
+ str(new_org_2.genome).count("1"),
"There should be equal, inverse distributions")
def test_basic_asym_crossover(self):
@@ -324,8 +324,8 @@ def __init__(self):
def do_crossover(self, org_1, org_2):
seq_org1 = org_1.genome.toseq()
seq_org2 = org_2.genome.toseq()
- org1_genome = seq_org1.tostring()
- org2_genome = seq_org2.tostring()
+ org1_genome = str(seq_org1)
+ org2_genome = str(seq_org2)
new_org_1 = org_1.copy()
new_org_2 = org_2.copy()
View
4 Tests/test_GAMutation.py
@@ -24,7 +24,7 @@ def test_fitness(genome):
"""Simple class for calculating fitnesses.
"""
seq_genome = genome.toseq()
- return int(seq_genome.tostring())
+ return int(str(seq_genome))
class MutationHelper:
"""Mixin class which provides useful functions for testing mutations.
@@ -122,7 +122,7 @@ def __init__(self):
def mutate(self, org):
org_genome_seq = org.genome.toseq()
- old_org_genome = org_genome_seq.tostring()
+ old_org_genome = str(org_genome_seq)
new_org = org.copy()
View
2 Tests/test_GAOrganism.py
@@ -31,7 +31,7 @@ def fitness_calculator(genome):
assert isinstance(genome, MutableSeq), "Expected MutableSeq for a genome."
regular_seq = genome.toseq()
- return int(regular_seq.tostring())
+ return int(str(regular_seq))
class CreatePopulationTest(unittest.TestCase):
"""Tests for utility functions for creating populations.
View
4 Tests/test_GARepair.py
@@ -53,7 +53,7 @@ def test_single_repair(self):
new_genome_seq = new_org.genome.toseq()
assert new_genome_seq.count("*") == 2, \
- "Did not repair genome, got %s" % new_genome_seq.tostring()
+ "Did not repair genome, got %s" % str(new_genome_seq)
def test_multiple_repair(self):
"""Test repair of multiple ambiguous positions in a genome.
@@ -65,7 +65,7 @@ def test_multiple_repair(self):
new_genome_seq = new_org.genome.toseq()
assert new_genome_seq.count("*") == 0, \
- "Did not repair genome, got %s" % new_genome_seq.tostring()
+ "Did not repair genome, got %s" % str(new_genome_seq)
if __name__ == "__main__":
runner = unittest.TextTestRunner(verbosity = 2)
View
2 Tests/test_GASelection.py
@@ -31,7 +31,7 @@ def test_fitness(genome):
"""Simple class for calculating fitnesses.
"""
genome_seq = genome.toseq()
- return int(genome_seq.tostring())
+ return int(str(genome_seq))
class NoSelection:
"""A simple 'selection' class that just returns the generated population.
View
804 Tests/test_Motif.py
@@ -60,335 +60,335 @@ def test_alignace_parsing(self):
self.assertEqual(len(record.motifs), 16)
self.assertEqual(record.motifs[0].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[0].instances), 11)
- self.assertEqual(record.motifs[0].instances[0].tostring(), "TCTACGATTGAG")
- self.assertEqual(record.motifs[0].instances[1].tostring(), "TCTACGATTGAG")
- self.assertEqual(record.motifs[0].instances[2].tostring(), "TCTACGATTGAG")
- self.assertEqual(record.motifs[0].instances[3].tostring(), "TCTACGATTGAG")
- self.assertEqual(record.motifs[0].instances[4].tostring(), "TCTACGATTGAG")
- self.assertEqual(record.motifs[0].instances[5].tostring(), "TCTACGATTGAG")
- self.assertEqual(record.motifs[0].instances[6].tostring(), "TCTACGATTGAG")
- self.assertEqual(record.motifs[0].instances[7].tostring(), "TCTACGATTGAG")
- self.assertEqual(record.motifs[0].instances[8].tostring(), "TCTACGATTGAG")
- self.assertEqual(record.motifs[0].instances[9].tostring(), "TCAAAGATAGAG")
- self.assertEqual(record.motifs[0].instances[10].tostring(), "TCTACGATTGAG")
+ self.assertEqual(str(record.motifs[0].instances[0]), "TCTACGATTGAG")
+ self.assertEqual(str(record.motifs[0].instances[1]), "TCTACGATTGAG")
+ self.assertEqual(str(record.motifs[0].instances[2]), "TCTACGATTGAG")
+ self.assertEqual(str(record.motifs[0].instances[3]), "TCTACGATTGAG")
+ self.assertEqual(str(record.motifs[0].instances[4]), "TCTACGATTGAG")
+ self.assertEqual(str(record.motifs[0].instances[5]), "TCTACGATTGAG")
+ self.assertEqual(str(record.motifs[0].instances[6]), "TCTACGATTGAG")
+ self.assertEqual(str(record.motifs[0].instances[7]), "TCTACGATTGAG")
+ self.assertEqual(str(record.motifs[0].instances[8]), "TCTACGATTGAG")
+ self.assertEqual(str(record.motifs[0].instances[9]), "TCAAAGATAGAG")
+ self.assertEqual(str(record.motifs[0].instances[10]), "TCTACGATTGAG")
self.assertEqual(record.motifs[0].mask, [1,1,0,1,1,1,1,1,0,1,1,1])
self.assertAlmostEqual(record.motifs[0].score, 57.9079)
self.assertEqual(record.motifs[1].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[1].instances), 22)
- self.assertEqual(record.motifs[1].instances[0].tostring(), "GCGAAGGAAGCAGCGCGTGTG")
- self.assertEqual(record.motifs[1].instances[1].tostring(), "GGCACCGCCTCTACGATTGAG")
- self.assertEqual(record.motifs[1].instances[2].tostring(), "CAGAGCTTAGCATTGAACGCG")
- self.assertEqual(record.motifs[1].instances[3].tostring(), "CTAATGAAAGCAATGAGAGTG")
- self.assertEqual(record.motifs[1].instances[4].tostring(), "CTTGTGCCCTCTAAGCGTCCG")
- self.assertEqual(record.motifs[1].instances[5].tostring(), "GAGCACGACGCTTTGTACCTG")
- self.assertEqual(record.motifs[1].instances[6].tostring(), "CGGCACTTAGCAGCGTATCGT")
- self.assertEqual(record.motifs[1].instances[7].tostring(), "CTGGTTTCATCTACGATTGAG")
- self.assertEqual(record.motifs[1].instances[8].tostring(), "GGGCCAATAGCGGCGCCGGAG")
- self.assertEqual(record.motifs[1].instances[9].tostring(), "GTGGAGTTATCTTAGTGCGCG")
- self.assertEqual(record.motifs[1].instances[10].tostring(), "GAGAGGTTATCTACGATTGAG")
- self.assertEqual(record.motifs[1].instances[11].tostring(), "CTGCTCCCCGCATACAGCGCG")
- self.assertEqual(record.motifs[1].instances[12].tostring(), "CAGAACCGAGGTCCGGTACGG")
- self.assertEqual(record.motifs[1].instances[13].tostring(), "GTGCCCCAAGCTTACCCAGGG")
- self.assertEqual(record.motifs[1].instances[14].tostring(), "CGCCTCTGATCTACGATTGAG")
- self.assertEqual(record.motifs[1].instances[15].tostring(), "GTGCTCATAGGGACGTCGCGG")
- self.assertEqual(record.motifs[1].instances[16].tostring(), "CTGCCCCCCGCATAGTAGGGG")
- self.assertEqual(record.motifs[1].instances[17].tostring(), "GTAAAGAAATCGATGTGCCAG")
- self.assertEqual(record.motifs[1].instances[18].tostring(), "CACCTGCAATTGCTGGCAGCG")
- self.assertEqual(record.motifs[1].instances[19].tostring(), "GGCGGGCCATCCCTGTATGAA")
- self.assertEqual(record.motifs[1].instances[20].tostring(), "CTCCAGGTCGCATGGAGAGAG")
- self.assertEqual(record.motifs[1].instances[21].tostring(), "CCTCGGATCGCTTGGGAAGAG")
+ self.assertEqual(str(record.motifs[1].instances[0]), "GCGAAGGAAGCAGCGCGTGTG")
+ self.assertEqual(str(record.motifs[1].instances[1]), "GGCACCGCCTCTACGATTGAG")
+ self.assertEqual(str(record.motifs[1].instances[2]), "CAGAGCTTAGCATTGAACGCG")
+ self.assertEqual(str(record.motifs[1].instances[3]), "CTAATGAAAGCAATGAGAGTG")
+ self.assertEqual(str(record.motifs[1].instances[4]), "CTTGTGCCCTCTAAGCGTCCG")
+ self.assertEqual(str(record.motifs[1].instances[5]), "GAGCACGACGCTTTGTACCTG")
+ self.assertEqual(str(record.motifs[1].instances[6]), "CGGCACTTAGCAGCGTATCGT")
+ self.assertEqual(str(record.motifs[1].instances[7]), "CTGGTTTCATCTACGATTGAG")
+ self.assertEqual(str(record.motifs[1].instances[8]), "GGGCCAATAGCGGCGCCGGAG")
+ self.assertEqual(str(record.motifs[1].instances[9]), "GTGGAGTTATCTTAGTGCGCG")
+ self.assertEqual(str(record.motifs[1].instances[10]), "GAGAGGTTATCTACGATTGAG")
+ self.assertEqual(str(record.motifs[1].instances[11]), "CTGCTCCCCGCATACAGCGCG")
+ self.assertEqual(str(record.motifs[1].instances[12]), "CAGAACCGAGGTCCGGTACGG")
+ self.assertEqual(str(record.motifs[1].instances[13]), "GTGCCCCAAGCTTACCCAGGG")
+ self.assertEqual(str(record.motifs[1].instances[14]), "CGCCTCTGATCTACGATTGAG")
+ self.assertEqual(str(record.motifs[1].instances[15]), "GTGCTCATAGGGACGTCGCGG")
+ self.assertEqual(str(record.motifs[1].instances[16]), "CTGCCCCCCGCATAGTAGGGG")
+ self.assertEqual(str(record.motifs[1].instances[17]), "GTAAAGAAATCGATGTGCCAG")
+ self.assertEqual(str(record.motifs[1].instances[18]), "CACCTGCAATTGCTGGCAGCG")
+ self.assertEqual(str(record.motifs[1].instances[19]), "GGCGGGCCATCCCTGTATGAA")
+ self.assertEqual(str(record.motifs[1].instances[20]), "CTCCAGGTCGCATGGAGAGAG")
+ self.assertEqual(str(record.motifs[1].instances[21]), "CCTCGGATCGCTTGGGAAGAG")
self.assertEqual(record.motifs[1].mask, [1,0,1,1,0,1,0,0,1,1,1,0,0,0,1,0,0,0,1,0,1])
self.assertAlmostEqual(record.motifs[1].score, 19.6235)
self.assertEqual(record.motifs[2].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[2].instances), 18)
- self.assertEqual(record.motifs[2].instances[0].tostring(), "GTGCGCGAAGGAAGCAGCGCG")
- self.assertEqual(record.motifs[2].instances[1].tostring(), "CAGAGCTTAGCATTGAACGCG")
- self.assertEqual(record.motifs[2].instances[2].tostring(), "GTGCCCGATGACCACCCGTCG")
- self.assertEqual(record.motifs[2].instances[3].tostring(), "GCCCTCTAAGCGTCCGCGGAT")
- self.assertEqual(record.motifs[2].instances[4].tostring(), "GAGCACGACGCTTTGTACCTG")
- self.assertEqual(record.motifs[2].instances[5].tostring(), "CGGCACTTAGCAGCGTATCGT")
- self.assertEqual(record.motifs[2].instances[6].tostring(), "GGGCCAATAGCGGCGCCGGAG")
- self.assertEqual(record.motifs[2].instances[7].tostring(), "GCGCACTAAGATAACTCCACG")
- self.assertEqual(record.motifs[2].instances[8].tostring(), "CGGCCCGTTGTCCAGCAGACG")
- self.assertEqual(record.motifs[2].instances[9].tostring(), "CTGCTCCCCGCATACAGCGCG")
- self.assertEqual(record.motifs[2].instances[10].tostring(), "GTGCCCCAAGCTTACCCAGGG")
- self.assertEqual(record.motifs[2].instances[11].tostring(), "GTGCTCATAGGGACGTCGCGG")
- self.assertEqual(record.motifs[2].instances[12].tostring(), "CTGCCCCCCGCATAGTAGGGG")
- self.assertEqual(record.motifs[2].instances[13].tostring(), "CGCCGCCATGCGACGCAGAGG")
- self.assertEqual(record.motifs[2].instances[14].tostring(), "AACCTCTAAGCATACTCTACG")
- self.assertEqual(record.motifs[2].instances[15].tostring(), "GACCTGGAGGCTTAGACTTGG")
- self.assertEqual(record.motifs[2].instances[16].tostring(), "GCGCTCTTCCCAAGCGATCCG")
- self.assertEqual(record.motifs[2].instances[17].tostring(), "GGGCCGTCAGCTCTCAAGTCT")
+ self.assertEqual(str(record.motifs[2].instances[0]), "GTGCGCGAAGGAAGCAGCGCG")
+ self.assertEqual(str(record.motifs[2].instances[1]), "CAGAGCTTAGCATTGAACGCG")
+ self.assertEqual(str(record.motifs[2].instances[2]), "GTGCCCGATGACCACCCGTCG")
+ self.assertEqual(str(record.motifs[2].instances[3]), "GCCCTCTAAGCGTCCGCGGAT")
+ self.assertEqual(str(record.motifs[2].instances[4]), "GAGCACGACGCTTTGTACCTG")
+ self.assertEqual(str(record.motifs[2].instances[5]), "CGGCACTTAGCAGCGTATCGT")
+ self.assertEqual(str(record.motifs[2].instances[6]), "GGGCCAATAGCGGCGCCGGAG")
+ self.assertEqual(str(record.motifs[2].instances[7]), "GCGCACTAAGATAACTCCACG")
+ self.assertEqual(str(record.motifs[2].instances[8]), "CGGCCCGTTGTCCAGCAGACG")
+ self.assertEqual(str(record.motifs[2].instances[9]), "CTGCTCCCCGCATACAGCGCG")
+ self.assertEqual(str(record.motifs[2].instances[10]), "GTGCCCCAAGCTTACCCAGGG")
+ self.assertEqual(str(record.motifs[2].instances[11]), "GTGCTCATAGGGACGTCGCGG")
+ self.assertEqual(str(record.motifs[2].instances[12]), "CTGCCCCCCGCATAGTAGGGG")
+ self.assertEqual(str(record.motifs[2].instances[13]), "CGCCGCCATGCGACGCAGAGG")
+ self.assertEqual(str(record.motifs[2].instances[14]), "AACCTCTAAGCATACTCTACG")
+ self.assertEqual(str(record.motifs[2].instances[15]), "GACCTGGAGGCTTAGACTTGG")
+ self.assertEqual(str(record.motifs[2].instances[16]), "GCGCTCTTCCCAAGCGATCCG")
+ self.assertEqual(str(record.motifs[2].instances[17]), "GGGCCGTCAGCTCTCAAGTCT")
self.assertEqual(record.motifs[2].mask, [1,0,1,1,0,1,0,0,0,1,1,0,0,0,1,0,1,0,0,1,1])
self.assertAlmostEqual(record.motifs[2].score, 19.1804)
self.assertEqual(record.motifs[3].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[3].instances), 16)
- self.assertEqual(record.motifs[3].instances[0].tostring(), "GCCCCAAGCTTACCCAGGGAC")
- self.assertEqual(record.motifs[3].instances[1].tostring(), "GCCGTCTGCTGGACAACGGGC")
- self.assertEqual(record.motifs[3].instances[2].tostring(), "GCCGACGGGTGGTCATCGGGC")
- self.assertEqual(record.motifs[3].instances[3].tostring(), "GCCAATAGCGGCGCCGGAGTC")
- self.assertEqual(record.motifs[3].instances[4].tostring(), "GCCCCCCGCATAGTAGGGGGA")
- self.assertEqual(record.motifs[3].instances[5].tostring(), "GCCCGTACCGGACCTCGGTTC")
- self.assertEqual(record.motifs[3].instances[6].tostring(), "GCCTCATGTACCGGAAGGGAC")
- self.assertEqual(record.motifs[3].instances[7].tostring(), "GACACGCGCCTGGGAGGGTTC")
- self.assertEqual(record.motifs[3].instances[8].tostring(), "GCCTTTGGCCTTGGATGAGAA")
- self.assertEqual(record.motifs[3].instances[9].tostring(), "GGCCCTCGGATCGCTTGGGAA")
- self.assertEqual(record.motifs[3].instances[10].tostring(), "GCATGTTGGGAATCCGCGGAC")
- self.assertEqual(record.motifs[3].instances[11].tostring(), "GACACGCGCTGTATGCGGGGA")
- self.assertEqual(record.motifs[3].instances[12].tostring(), "GCCAGGTACAAAGCGTCGTGC")
- self.assertEqual(record.motifs[3].instances[13].tostring(), "GCGATCAGCTTGTGGGCGTGC")
- self.assertEqual(record.motifs[3].instances[14].tostring(), "GACAAATCGGATACTGGGGCA")
- self.assertEqual(record.motifs[3].instances[15].tostring(), "GCACTTAGCAGCGTATCGTTA")
+ self.assertEqual(str(record.motifs[3].instances[0]), "GCCCCAAGCTTACCCAGGGAC")
+ self.assertEqual(str(record.motifs[3].instances[1]), "GCCGTCTGCTGGACAACGGGC")
+ self.assertEqual(str(record.motifs[3].instances[2]), "GCCGACGGGTGGTCATCGGGC")
+ self.assertEqual(str(record.motifs[3].instances[3]), "GCCAATAGCGGCGCCGGAGTC")
+ self.assertEqual(str(record.motifs[3].instances[4]), "GCCCCCCGCATAGTAGGGGGA")
+ self.assertEqual(str(record.motifs[3].instances[5]), "GCCCGTACCGGACCTCGGTTC")
+ self.assertEqual(str(record.motifs[3].instances[6]), "GCCTCATGTACCGGAAGGGAC")
+ self.assertEqual(str(record.motifs[3].instances[7]), "GACACGCGCCTGGGAGGGTTC")
+ self.assertEqual(str(record.motifs[3].instances[8]), "GCCTTTGGCCTTGGATGAGAA")
+ self.assertEqual(str(record.motifs[3].instances[9]), "GGCCCTCGGATCGCTTGGGAA")
+ self.assertEqual(str(record.motifs[3].instances[10]), "GCATGTTGGGAATCCGCGGAC")
+ self.assertEqual(str(record.motifs[3].instances[11]), "GACACGCGCTGTATGCGGGGA")
+ self.assertEqual(str(record.motifs[3].instances[12]), "GCCAGGTACAAAGCGTCGTGC")
+ self.assertEqual(str(record.motifs[3].instances[13]), "GCGATCAGCTTGTGGGCGTGC")
+ self.assertEqual(str(record.motifs[3].instances[14]), "GACAAATCGGATACTGGGGCA")
+ self.assertEqual(str(record.motifs[3].instances[15]), "GCACTTAGCAGCGTATCGTTA")
self.assertEqual(record.motifs[3].mask, [1,1,1,0,0,0,0,1,1,0,0,0,0,1,0,0,1,1,1,0,1])
self.assertAlmostEqual(record.motifs[3].score, 18.0097)
self.assertEqual(record.motifs[4].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[4].instances), 15)
- self.assertEqual(record.motifs[4].instances[0].tostring(), "CGGCACAGAGCTT")
- self.assertEqual(record.motifs[4].instances[1].tostring(), "ATCCGCGGACGCT")
- self.assertEqual(record.motifs[4].instances[2].tostring(), "CGCCTGGGAGGGT")
- self.assertEqual(record.motifs[4].instances[3].tostring(), "CGGAAGGGACGTT")
- self.assertEqual(record.motifs[4].instances[4].tostring(), "ACACACAGACGGT")
- self.assertEqual(record.motifs[4].instances[5].tostring(), "TGCCAGAGAGGTT")
- self.assertEqual(record.motifs[4].instances[6].tostring(), "AGACTGAGACGTT")
- self.assertEqual(record.motifs[4].instances[7].tostring(), "AATCGTAGAGGAT")
- self.assertEqual(record.motifs[4].instances[8].tostring(), "CGTCTCGTAGGGT")
- self.assertEqual(record.motifs[4].instances[9].tostring(), "CGTCGCGGAGGAT")
- self.assertEqual(record.motifs[4].instances[10].tostring(), "CTTCTTAGACGCT")
- self.assertEqual(record.motifs[4].instances[11].tostring(), "CGACGCAGAGGAT")
- self.assertEqual(record.motifs[4].instances[12].tostring(), "ATGCTTAGAGGTT")
- self.assertEqual(record.motifs[4].instances[13].tostring(), "AGACTTGGGCGAT")
- self.assertEqual(record.motifs[4].instances[14].tostring(), "CGACCTGGAGGCT")
+ self.assertEqual(str(record.motifs[4].instances[0]), "CGGCACAGAGCTT")
+ self.assertEqual(str(record.motifs[4].instances[1]), "ATCCGCGGACGCT")
+ self.assertEqual(str(record.motifs[4].instances[2]), "CGCCTGGGAGGGT")
+ self.assertEqual(str(record.motifs[4].instances[3]), "CGGAAGGGACGTT")
+ self.assertEqual(str(record.motifs[4].instances[4]), "ACACACAGACGGT")
+ self.assertEqual(str(record.motifs[4].instances[5]), "TGCCAGAGAGGTT")
+ self.assertEqual(str(record.motifs[4].instances[6]), "AGACTGAGACGTT")
+ self.assertEqual(str(record.motifs[4].instances[7]), "AATCGTAGAGGAT")
+ self.assertEqual(str(record.motifs[4].instances[8]), "CGTCTCGTAGGGT")
+ self.assertEqual(str(record.motifs[4].instances[9]), "CGTCGCGGAGGAT")
+ self.assertEqual(str(record.motifs[4].instances[10]), "CTTCTTAGACGCT")
+ self.assertEqual(str(record.motifs[4].instances[11]), "CGACGCAGAGGAT")
+ self.assertEqual(str(record.motifs[4].instances[12]), "ATGCTTAGAGGTT")
+ self.assertEqual(str(record.motifs[4].instances[13]), "AGACTTGGGCGAT")
+ self.assertEqual(str(record.motifs[4].instances[14]), "CGACCTGGAGGCT")
self.assertEqual(record.motifs[4].mask, [1,1,0,1,0,1,1,1,1,1,1,0,1])
self.assertAlmostEqual(record.motifs[4].score, 16.8287)
self.assertEqual(record.motifs[5].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[5].instances), 18)
- self.assertEqual(record.motifs[5].instances[0].tostring(), "GTGCGCGAAGGAAGCAGCGCGTG")
- self.assertEqual(record.motifs[5].instances[1].tostring(), "TTGAGCCGAGTAAAGGGCTGGTG")
- self.assertEqual(record.motifs[5].instances[2].tostring(), "CAATGCTAAGCTCTGTGCCGACG")
- self.assertEqual(record.motifs[5].instances[3].tostring(), "CAACTCTCTATGTAGTGCCCGAG")
- self.assertEqual(record.motifs[5].instances[4].tostring(), "CGACGCTTTGTACCTGGCTTGCG")
- self.assertEqual(record.motifs[5].instances[5].tostring(), "CGAGTCAATGACACGCGCCTGGG")
- self.assertEqual(record.motifs[5].instances[6].tostring(), "CGATACGCTGCTAAGTGCCGTCC")
- self.assertEqual(record.motifs[5].instances[7].tostring(), "CCGGGCCAATAGCGGCGCCGGAG")
- self.assertEqual(record.motifs[5].instances[8].tostring(), "CCACGCTTCGACACGTGGTATAG")
- self.assertEqual(record.motifs[5].instances[9].tostring(), "CCGAGCCTCATGTACCGGAAGGG")
- self.assertEqual(record.motifs[5].instances[10].tostring(), "CTGCTCCCCGCATACAGCGCGTG")
- self.assertEqual(record.motifs[5].instances[11].tostring(), "CCGAGGTCCGGTACGGGCAAGCC")
- self.assertEqual(record.motifs[5].instances[12].tostring(), "GTGCTCATAGGGACGTCGCGGAG")
- self.assertEqual(record.motifs[5].instances[13].tostring(), "CCCTACTATGCGGGGGGCAGGTC")
- self.assertEqual(record.motifs[5].instances[14].tostring(), "GCCAGCAATTGCAGGTGGTCGTG")
- self.assertEqual(record.motifs[5].instances[15].tostring(), "CTCTGCGTCGCATGGCGGCGTGG")
- self.assertEqual(record.motifs[5].instances[16].tostring(), "GGAGGCTTAGACTTGGGCGATAC")
- self.assertEqual(record.motifs[5].instances[17].tostring(), "GCATGGAGAGAGATCCGGAGGAG")
+ self.assertEqual(str(record.motifs[5].instances[0]), "GTGCGCGAAGGAAGCAGCGCGTG")
+ self.assertEqual(str(record.motifs[5].instances[1]), "TTGAGCCGAGTAAAGGGCTGGTG")
+ self.assertEqual(str(record.motifs[5].instances[2]), "CAATGCTAAGCTCTGTGCCGACG")
+ self.assertEqual(str(record.motifs[5].instances[3]), "CAACTCTCTATGTAGTGCCCGAG")
+ self.assertEqual(str(record.motifs[5].instances[4]), "CGACGCTTTGTACCTGGCTTGCG")
+ self.assertEqual(str(record.motifs[5].instances[5]), "CGAGTCAATGACACGCGCCTGGG")
+ self.assertEqual(str(record.motifs[5].instances[6]), "CGATACGCTGCTAAGTGCCGTCC")
+ self.assertEqual(str(record.motifs[5].instances[7]), "CCGGGCCAATAGCGGCGCCGGAG")
+ self.assertEqual(str(record.motifs[5].instances[8]), "CCACGCTTCGACACGTGGTATAG")
+ self.assertEqual(str(record.motifs[5].instances[9]), "CCGAGCCTCATGTACCGGAAGGG")
+ self.assertEqual(str(record.motifs[5].instances[10]), "CTGCTCCCCGCATACAGCGCGTG")
+ self.assertEqual(str(record.motifs[5].instances[11]), "CCGAGGTCCGGTACGGGCAAGCC")
+ self.assertEqual(str(record.motifs[5].instances[12]), "GTGCTCATAGGGACGTCGCGGAG")
+ self.assertEqual(str(record.motifs[5].instances[13]), "CCCTACTATGCGGGGGGCAGGTC")
+ self.assertEqual(str(record.motifs[5].instances[14]), "GCCAGCAATTGCAGGTGGTCGTG")
+ self.assertEqual(str(record.motifs[5].instances[15]), "CTCTGCGTCGCATGGCGGCGTGG")
+ self.assertEqual(str(record.motifs[5].instances[16]), "GGAGGCTTAGACTTGGGCGATAC")
+ self.assertEqual(str(record.motifs[5].instances[17]), "GCATGGAGAGAGATCCGGAGGAG")
self.assertEqual(record.motifs[5].mask, [1,0,1,0,1,1,0,0,0,1,0,0,0,0,1,0,1,1,0,0,1,0,1])
self.assertAlmostEqual(record.motifs[5].score, 15.0441)
self.assertEqual(record.motifs[6].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[6].instances), 20)
- self.assertEqual(record.motifs[6].instances[0].tostring(), "GCGCGTGTGTGTAAC")
- self.assertEqual(record.motifs[6].instances[1].tostring(), "GCACAGAGCTTAGCA")
- self.assertEqual(record.motifs[6].instances[2].tostring(), "GGTGGTCATCGGGCA")
- self.assertEqual(record.motifs[6].instances[3].tostring(), "GCGCGTGTCATTGAC")
- self.assertEqual(record.motifs[6].instances[4].tostring(), "GGACGGCACTTAGCA")
- self.assertEqual(record.motifs[6].instances[5].tostring(), "GCGCGTCCCGGGCCA")
- self.assertEqual(record.motifs[6].instances[6].tostring(), "GCTCGGCCCGTTGTC")
- self.assertEqual(record.motifs[6].instances[7].tostring(), "GCGCGTGTCCTTTAA")
- self.assertEqual(record.motifs[6].instances[8].tostring(), "GCTGATCGCTGCTCC")
- self.assertEqual(record.motifs[6].instances[9].tostring(), "GCCCGTACCGGACCT")
- self.assertEqual(record.motifs[6].instances[10].tostring(), "GGACGTCGCGGAGGA")
- self.assertEqual(record.motifs[6].instances[11].tostring(), "GCGGGGGGCAGGTCA")
- self.assertEqual(record.motifs[6].instances[12].tostring(), "GGACGTACTGGCACA")
- self.assertEqual(record.motifs[6].instances[13].tostring(), "GCAGGTGGTCGTGCA")
- self.assertEqual(record.motifs[6].instances[14].tostring(), "GCGCATACCTTAACA")
- self.assertEqual(record.motifs[6].instances[15].tostring(), "GCACGGGACTTCAAC")
- self.assertEqual(record.motifs[6].instances[16].tostring(), "GCACGTAGCTGGTAA")
- self.assertEqual(record.motifs[6].instances[17].tostring(), "GCTCGTCTATGGTCA")
- self.assertEqual(record.motifs[6].instances[18].tostring(), "GCGCATGCTGGATCC")
- self.assertEqual(record.motifs[6].instances[19].tostring(), "GGCCGTCAGCTCTCA")
+ self.assertEqual(str(record.motifs[6].instances[0]), "GCGCGTGTGTGTAAC")
+ self.assertEqual(str(record.motifs[6].instances[1]), "GCACAGAGCTTAGCA")
+ self.assertEqual(str(record.motifs[6].instances[2]), "GGTGGTCATCGGGCA")
+ self.assertEqual(str(record.motifs[6].instances[3]), "GCGCGTGTCATTGAC")
+ self.assertEqual(str(record.motifs[6].instances[4]), "GGACGGCACTTAGCA")
+ self.assertEqual(str(record.motifs[6].instances[5]), "GCGCGTCCCGGGCCA")
+ self.assertEqual(str(record.motifs[6].instances[6]), "GCTCGGCCCGTTGTC")
+ self.assertEqual(str(record.motifs[6].instances[7]), "GCGCGTGTCCTTTAA")
+ self.assertEqual(str(record.motifs[6].instances[8]), "GCTGATCGCTGCTCC")
+ self.assertEqual(str(record.motifs[6].instances[9]), "GCCCGTACCGGACCT")
+ self.assertEqual(str(record.motifs[6].instances[10]), "GGACGTCGCGGAGGA")
+ self.assertEqual(str(record.motifs[6].instances[11]), "GCGGGGGGCAGGTCA")
+ self.assertEqual(str(record.motifs[6].instances[12]), "GGACGTACTGGCACA")
+ self.assertEqual(str(record.motifs[6].instances[13]), "GCAGGTGGTCGTGCA")
+ self.assertEqual(str(record.motifs[6].instances[14]), "GCGCATACCTTAACA")
+ self.assertEqual(str(record.motifs[6].instances[15]), "GCACGGGACTTCAAC")
+ self.assertEqual(str(record.motifs[6].instances[16]), "GCACGTAGCTGGTAA")
+ self.assertEqual(str(record.motifs[6].instances[17]), "GCTCGTCTATGGTCA")
+ self.assertEqual(str(record.motifs[6].instances[18]), "GCGCATGCTGGATCC")
+ self.assertEqual(str(record.motifs[6].instances[19]), "GGCCGTCAGCTCTCA")
self.assertEqual(record.motifs[6].mask, [1,1,0,1,1,1,1,0,1,0,1,0,0,1,1])
self.assertAlmostEqual(record.motifs[6].score, 13.3145)
self.assertEqual(record.motifs[7].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[7].instances), 20)
- self.assertEqual(record.motifs[7].instances[0].tostring(), "GAACCGAGGTCCGGTACGGGC")
- self.assertEqual(record.motifs[7].instances[1].tostring(), "GCCCCCCGCATAGTAGGGGGA")
- self.assertEqual(record.motifs[7].instances[2].tostring(), "GTCCCTGGGTAAGCTTGGGGC")
- self.assertEqual(record.motifs[7].instances[3].tostring(), "ACTCCACGCTTCGACACGTGG")
- self.assertEqual(record.motifs[7].instances[4].tostring(), "ATCCTCTGCGTCGCATGGCGG")
- self.assertEqual(record.motifs[7].instances[5].tostring(), "GTTCAATGCTAAGCTCTGTGC")
- self.assertEqual(record.motifs[7].instances[6].tostring(), "GCTCATAGGGACGTCGCGGAG")
- self.assertEqual(record.motifs[7].instances[7].tostring(), "GTCCCGGGCCAATAGCGGCGC")
- self.assertEqual(record.motifs[7].instances[8].tostring(), "GCACTTAGCAGCGTATCGTTA")
- self.assertEqual(record.motifs[7].instances[9].tostring(), "GGCCCTCGGATCGCTTGGGAA")
- self.assertEqual(record.motifs[7].instances[10].tostring(), "CTGCTGGACAACGGGCCGAGC")
- self.assertEqual(record.motifs[7].instances[11].tostring(), "GGGCACTACATAGAGAGTTGC")
- self.assertEqual(record.motifs[7].instances[12].tostring(), "AGCCTCCAGGTCGCATGGAGA")
- self.assertEqual(record.motifs[7].instances[13].tostring(), "AATCGTAGATCAGAGGCGAGA")
- self.assertEqual(record.motifs[7].instances[14].tostring(), "GAACTCCACTAAGACTTGAGA")
- self.assertEqual(record.motifs[7].instances[15].tostring(), "GAGCAGCGATCAGCTTGTGGG")
- self.assertEqual(record.motifs[7].instances[16].tostring(), "GCCAGGTACAAAGCGTCGTGC")
- self.assertEqual(record.motifs[7].instances[17].tostring(), "AGTCAATGACACGCGCCTGGG")
- self.assertEqual(record.motifs[7].instances[18].tostring(), "GGTCATGGAATCTTATGTAGC")
- self.assertEqual(record.motifs[7].instances[19].tostring(), "GTAGATAACAGAGGTCGGGGG")
+ self.assertEqual(str(record.motifs[7].instances[0]), "GAACCGAGGTCCGGTACGGGC")
+ self.assertEqual(str(record.motifs[7].instances[1]), "GCCCCCCGCATAGTAGGGGGA")
+ self.assertEqual(str(record.motifs[7].instances[2]), "GTCCCTGGGTAAGCTTGGGGC")
+ self.assertEqual(str(record.motifs[7].instances[3]), "ACTCCACGCTTCGACACGTGG")
+ self.assertEqual(str(record.motifs[7].instances[4]), "ATCCTCTGCGTCGCATGGCGG")
+ self.assertEqual(str(record.motifs[7].instances[5]), "GTTCAATGCTAAGCTCTGTGC")
+ self.assertEqual(str(record.motifs[7].instances[6]), "GCTCATAGGGACGTCGCGGAG")
+ self.assertEqual(str(record.motifs[7].instances[7]), "GTCCCGGGCCAATAGCGGCGC")
+ self.assertEqual(str(record.motifs[7].instances[8]), "GCACTTAGCAGCGTATCGTTA")
+ self.assertEqual(str(record.motifs[7].instances[9]), "GGCCCTCGGATCGCTTGGGAA")
+ self.assertEqual(str(record.motifs[7].instances[10]), "CTGCTGGACAACGGGCCGAGC")
+ self.assertEqual(str(record.motifs[7].instances[11]), "GGGCACTACATAGAGAGTTGC")
+ self.assertEqual(str(record.motifs[7].instances[12]), "AGCCTCCAGGTCGCATGGAGA")
+ self.assertEqual(str(record.motifs[7].instances[13]), "AATCGTAGATCAGAGGCGAGA")
+ self.assertEqual(str(record.motifs[7].instances[14]), "GAACTCCACTAAGACTTGAGA")
+ self.assertEqual(str(record.motifs[7].instances[15]), "GAGCAGCGATCAGCTTGTGGG")
+ self.assertEqual(str(record.motifs[7].instances[16]), "GCCAGGTACAAAGCGTCGTGC")
+ self.assertEqual(str(record.motifs[7].instances[17]), "AGTCAATGACACGCGCCTGGG")
+ self.assertEqual(str(record.motifs[7].instances[18]), "GGTCATGGAATCTTATGTAGC")
+ self.assertEqual(str(record.motifs[7].instances[19]), "GTAGATAACAGAGGTCGGGGG")
self.assertEqual(record.motifs[7].mask, [1,0,0,1,0,0,0,1,1,0,0,1,1,0,0,0,1,1,0,1,1])
self.assertAlmostEqual(record.motifs[7].score, 11.6098)
self.assertEqual(record.motifs[8].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[8].instances), 14)
- self.assertEqual(record.motifs[8].instances[0].tostring(), "CCGAGTAAAGGGCTG")
- self.assertEqual(record.motifs[8].instances[1].tostring(), "GTGGTCATCGGGCAC")
- self.assertEqual(record.motifs[8].instances[2].tostring(), "GATAACAGAGGTCGG")
- self.assertEqual(record.motifs[8].instances[3].tostring(), "CGGCGCCGGAGTCTG")
- self.assertEqual(record.motifs[8].instances[4].tostring(), "GCGCGTCCCGGGCCA")
- self.assertEqual(record.motifs[8].instances[5].tostring(), "CTGGACAACGGGCCG")
- self.assertEqual(record.motifs[8].instances[6].tostring(), "CGGATACTGGGGCAG")
- self.assertEqual(record.motifs[8].instances[7].tostring(), "GGGAGCAGCGATCAG")
- self.assertEqual(record.motifs[8].instances[8].tostring(), "CAGAACCGAGGTCCG")
- self.assertEqual(record.motifs[8].instances[9].tostring(), "GGGTCCCTGGGTAAG")
- self.assertEqual(record.motifs[8].instances[10].tostring(), "GTGCTCATAGGGACG")
- self.assertEqual(record.motifs[8].instances[11].tostring(), "GAGATCCGGAGGAGG")
- self.assertEqual(record.motifs[8].instances[12].tostring(), "GCGATCCGAGGGCCG")
- self.assertEqual(record.motifs[8].instances[13].tostring(), "GAGTTCACATGGCTG")
+ self.assertEqual(str(record.motifs[8].instances[0]), "CCGAGTAAAGGGCTG")
+ self.assertEqual(str(record.motifs[8].instances[1]), "GTGGTCATCGGGCAC")
+ self.assertEqual(str(record.motifs[8].instances[2]), "GATAACAGAGGTCGG")
+ self.assertEqual(str(record.motifs[8].instances[3]), "CGGCGCCGGAGTCTG")
+ self.assertEqual(str(record.motifs[8].instances[4]), "GCGCGTCCCGGGCCA")
+ self.assertEqual(str(record.motifs[8].instances[5]), "CTGGACAACGGGCCG")
+ self.assertEqual(str(record.motifs[8].instances[6]), "CGGATACTGGGGCAG")
+ self.assertEqual(str(record.motifs[8].instances[7]), "GGGAGCAGCGATCAG")
+ self.assertEqual(str(record.motifs[8].instances[8]), "CAGAACCGAGGTCCG")
+ self.assertEqual(str(record.motifs[8].instances[9]), "GGGTCCCTGGGTAAG")
+ self.assertEqual(str(record.motifs[8].instances[10]), "GTGCTCATAGGGACG")
+ self.assertEqual(str(record.motifs[8].instances[11]), "GAGATCCGGAGGAGG")
+ self.assertEqual(str(record.motifs[8].instances[12]), "GCGATCCGAGGGCCG")
+ self.assertEqual(str(record.motifs[8].instances[13]), "GAGTTCACATGGCTG")
self.assertEqual(record.motifs[8].mask, [1,0,1,0,0,1,1,0,1,1,1,1,1,0,1])
self.assertAlmostEqual(record.motifs[8].score, 11.2943)
self.assertEqual(record.motifs[9].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[9].instances), 18)
- self.assertEqual(record.motifs[9].instances[0].tostring(), "TAGAGGCGGTG")
- self.assertEqual(record.motifs[9].instances[1].tostring(), "GCTAAGCTCTG")
- self.assertEqual(record.motifs[9].instances[2].tostring(), "TGGAAGCAGTG")
- self.assertEqual(record.motifs[9].instances[3].tostring(), "GCGAGGCTGTG")
- self.assertEqual(record.motifs[9].instances[4].tostring(), "ACGACGCTTTG")
- self.assertEqual(record.motifs[9].instances[5].tostring(), "GGGACGCGCAC")
- self.assertEqual(record.motifs[9].instances[6].tostring(), "TCGAAGCGTGG")
- self.assertEqual(record.motifs[9].instances[7].tostring(), "TGTATGCGGGG")
- self.assertEqual(record.motifs[9].instances[8].tostring(), "GGTAAGCTTGG")
- self.assertEqual(record.motifs[9].instances[9].tostring(), "TGTACGCTGGG")
- self.assertEqual(record.motifs[9].instances[10].tostring(), "ACTATGCGGGG")
- self.assertEqual(record.motifs[9].instances[11].tostring(), "GGTATGCGCTG")
- self.assertEqual(record.motifs[9].instances[12].tostring(), "GGTACCCGGAG")
- self.assertEqual(record.motifs[9].instances[13].tostring(), "GCGACGCAGAG")
- self.assertEqual(record.motifs[9].instances[14].tostring(), "TGGCGGCGTGG")
- self.assertEqual(record.motifs[9].instances[15].tostring(), "TCTAGGCGGGC")
- self.assertEqual(record.motifs[9].instances[16].tostring(), "AGTATGCTTAG")
- self.assertEqual(record.motifs[9].instances[17].tostring(), "TGGAGGCTTAG")
+ self.assertEqual(str(record.motifs[9].instances[0]), "TAGAGGCGGTG")
+ self.assertEqual(str(record.motifs[9].instances[1]), "GCTAAGCTCTG")
+ self.assertEqual(str(record.motifs[9].instances[2]), "TGGAAGCAGTG")
+ self.assertEqual(str(record.motifs[9].instances[3]), "GCGAGGCTGTG")
+ self.assertEqual(str(record.motifs[9].instances[4]), "ACGACGCTTTG")
+ self.assertEqual(str(record.motifs[9].instances[5]), "GGGACGCGCAC")
+ self.assertEqual(str(record.motifs[9].instances[6]), "TCGAAGCGTGG")
+ self.assertEqual(str(record.motifs[9].instances[7]), "TGTATGCGGGG")
+ self.assertEqual(str(record.motifs[9].instances[8]), "GGTAAGCTTGG")
+ self.assertEqual(str(record.motifs[9].instances[9]), "TGTACGCTGGG")
+ self.assertEqual(str(record.motifs[9].instances[10]), "ACTATGCGGGG")
+ self.assertEqual(str(record.motifs[9].instances[11]), "GGTATGCGCTG")
+ self.assertEqual(str(record.motifs[9].instances[12]), "GGTACCCGGAG")
+ self.assertEqual(str(record.motifs[9].instances[13]), "GCGACGCAGAG")
+ self.assertEqual(str(record.motifs[9].instances[14]), "TGGCGGCGTGG")
+ self.assertEqual(str(record.motifs[9].instances[15]), "TCTAGGCGGGC")
+ self.assertEqual(str(record.motifs[9].instances[16]), "AGTATGCTTAG")
+ self.assertEqual(str(record.motifs[9].instances[17]), "TGGAGGCTTAG")
self.assertEqual(record.motifs[9].mask, [1,1,1,1,0,1,1,1,1,1,1])
self.assertAlmostEqual(record.motifs[9].score, 9.7924)
self.assertEqual(record.motifs[10].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[10].instances), 13)
- self.assertEqual(record.motifs[10].instances[0].tostring(), "GCACAGAGCTTAGCATTGAAC")
- self.assertEqual(record.motifs[10].instances[1].tostring(), "GTCCGCGGATTCCCAACATGC")
- self.assertEqual(record.motifs[10].instances[2].tostring(), "ATACACAGCCTCGCAAGCCAG")
- self.assertEqual(record.motifs[10].instances[3].tostring(), "GGCCCGGGACGCGCACTAAGA")
- self.assertEqual(record.motifs[10].instances[4].tostring(), "GCCCGTTGTCCAGCAGACGGC")
- self.assertEqual(record.motifs[10].instances[5].tostring(), "GAGCAGCGATCAGCTTGTGGG")
- self.assertEqual(record.motifs[10].instances[6].tostring(), "GAACCGAGGTCCGGTACGGGC")
- self.assertEqual(record.motifs[10].instances[7].tostring(), "GTCCCTGGGTAAGCTTGGGGC")
- self.assertEqual(record.motifs[10].instances[8].tostring(), "GACCTGCCCCCCGCATAGTAG")
- self.assertEqual(record.motifs[10].instances[9].tostring(), "AACCAGCGCATACCTTAACAG")
- self.assertEqual(record.motifs[10].instances[10].tostring(), "ATCCTCTGCGTCGCATGGCGG")
- self.assertEqual(record.motifs[10].instances[11].tostring(), "GACCATAGACGAGCATCAAAG")
- self.assertEqual(record.motifs[10].instances[12].tostring(), "GGCCCTCGGATCGCTTGGGAA")
+ self.assertEqual(str(record.motifs[10].instances[0]), "GCACAGAGCTTAGCATTGAAC")
+ self.assertEqual(str(record.motifs[10].instances[1]), "GTCCGCGGATTCCCAACATGC")
+ self.assertEqual(str(record.motifs[10].instances[2]), "ATACACAGCCTCGCAAGCCAG")
+ self.assertEqual(str(record.motifs[10].instances[3]), "GGCCCGGGACGCGCACTAAGA")
+ self.assertEqual(str(record.motifs[10].instances[4]), "GCCCGTTGTCCAGCAGACGGC")
+ self.assertEqual(str(record.motifs[10].instances[5]), "GAGCAGCGATCAGCTTGTGGG")
+ self.assertEqual(str(record.motifs[10].instances[6]), "GAACCGAGGTCCGGTACGGGC")
+ self.assertEqual(str(record.motifs[10].instances[7]), "GTCCCTGGGTAAGCTTGGGGC")
+ self.assertEqual(str(record.motifs[10].instances[8]), "GACCTGCCCCCCGCATAGTAG")
+ self.assertEqual(str(record.motifs[10].instances[9]), "AACCAGCGCATACCTTAACAG")
+ self.assertEqual(str(record.motifs[10].instances[10]), "ATCCTCTGCGTCGCATGGCGG")
+ self.assertEqual(str(record.motifs[10].instances[11]), "GACCATAGACGAGCATCAAAG")
+ self.assertEqual(str(record.motifs[10].instances[12]), "GGCCCTCGGATCGCTTGGGAA")
self.assertEqual(record.motifs[10].mask, [1,0,1,1,0,0,0,1,0,0,0,1,1,1,1,0,0,0,0,1,1])
self.assertAlmostEqual(record.motifs[10].score, 9.01393)
self.assertEqual(record.motifs[11].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[11].instances), 16)
- self.assertEqual(record.motifs[11].instances[0].tostring(), "GCCGTCCGTC")
- self.assertEqual(record.motifs[11].instances[1].tostring(), "GGCGTGCGCG")
- self.assertEqual(record.motifs[11].instances[2].tostring(), "GGCGCGTGTC")
- self.assertEqual(record.motifs[11].instances[3].tostring(), "AGCGCGTGTG")
- self.assertEqual(record.motifs[11].instances[4].tostring(), "GCGGTGCGTG")
- self.assertEqual(record.motifs[11].instances[5].tostring(), "AGCGCGTGTC")
- self.assertEqual(record.motifs[11].instances[6].tostring(), "AGCGTCCGCG")
- self.assertEqual(record.motifs[11].instances[7].tostring(), "ACCGTCTGTG")
- self.assertEqual(record.motifs[11].instances[8].tostring(), "GCCATGCGAC")
- self.assertEqual(record.motifs[11].instances[9].tostring(), "ACCACCCGTC")
- self.assertEqual(record.motifs[11].instances[10].tostring(), "GGCGCCGGAG")
- self.assertEqual(record.motifs[11].instances[11].tostring(), "ACCACGTGTC")
- self.assertEqual(record.motifs[11].instances[12].tostring(), "GGCTTGCGAG")
- self.assertEqual(record.motifs[11].instances[13].tostring(), "GCGATCCGAG")
- self.assertEqual(record.motifs[11].instances[14].tostring(), "AGTGCGCGTC")
- self.assertEqual(record.motifs[11].instances[15].tostring(), "AGTGCCCGAG")
+ self.assertEqual(str(record.motifs[11].instances[0]), "GCCGTCCGTC")
+ self.assertEqual(str(record.motifs[11].instances[1]), "GGCGTGCGCG")
+ self.assertEqual(str(record.motifs[11].instances[2]), "GGCGCGTGTC")
+ self.assertEqual(str(record.motifs[11].instances[3]), "AGCGCGTGTG")
+ self.assertEqual(str(record.motifs[11].instances[4]), "GCGGTGCGTG")
+ self.assertEqual(str(record.motifs[11].instances[5]), "AGCGCGTGTC")
+ self.assertEqual(str(record.motifs[11].instances[6]), "AGCGTCCGCG")
+ self.assertEqual(str(record.motifs[11].instances[7]), "ACCGTCTGTG")
+ self.assertEqual(str(record.motifs[11].instances[8]), "GCCATGCGAC")
+ self.assertEqual(str(record.motifs[11].instances[9]), "ACCACCCGTC")
+ self.assertEqual(str(record.motifs[11].instances[10]), "GGCGCCGGAG")
+ self.assertEqual(str(record.motifs[11].instances[11]), "ACCACGTGTC")
+ self.assertEqual(str(record.motifs[11].instances[12]), "GGCTTGCGAG")
+ self.assertEqual(str(record.motifs[11].instances[13]), "GCGATCCGAG")
+ self.assertEqual(str(record.motifs[11].instances[14]), "AGTGCGCGTC")
+ self.assertEqual(str(record.motifs[11].instances[15]), "AGTGCCCGAG")
self.assertEqual(record.motifs[11].mask, [1,1,1,1,1,1,1,1,1,1])
self.assertAlmostEqual(record.motifs[11].score, 7.51121)
self.assertEqual(record.motifs[12].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[12].instances), 16)
- self.assertEqual(record.motifs[12].instances[0].tostring(), "GCCGACGGGTGGTCATCGGG")
- self.assertEqual(record.motifs[12].instances[1].tostring(), "GCACGACGCTTTGTACCTGG")
- self.assertEqual(record.motifs[12].instances[2].tostring(), "CCTGGGAGGGTTCAATAACG")
- self.assertEqual(record.motifs[12].instances[3].tostring(), "GCGCGTCCCGGGCCAATAGC")
- self.assertEqual(record.motifs[12].instances[4].tostring(), "GCCGTCTGCTGGACAACGGG")
- self.assertEqual(record.motifs[12].instances[5].tostring(), "GTCCCTTCCGGTACATGAGG")
- self.assertEqual(record.motifs[12].instances[6].tostring(), "GCTGCTCCCCGCATACAGCG")
- self.assertEqual(record.motifs[12].instances[7].tostring(), "GCCCCAAGCTTACCCAGGGA")
- self.assertEqual(record.motifs[12].instances[8].tostring(), "ACCGGCTGACGCTAATACGG")
- self.assertEqual(record.motifs[12].instances[9].tostring(), "GCGGGGGGCAGGTCATTACA")
- self.assertEqual(record.motifs[12].instances[10].tostring(), "GCTGGCAGCGTCTAAGAAGG")
- self.assertEqual(record.motifs[12].instances[11].tostring(), "GCAGGTGGTCGTGCAATACG")
- self.assertEqual(record.motifs[12].instances[12].tostring(), "GCTGGTTGAAGTCCCGTGCG")
- self.assertEqual(record.motifs[12].instances[13].tostring(), "GCACGTAGCTGGTAAATAGG")
- self.assertEqual(record.motifs[12].instances[14].tostring(), "GCGGCGTGGATTTCATACAG")
- self.assertEqual(record.motifs[12].instances[15].tostring(), "CCTGGAGGCTTAGACTTGGG")
+ self.assertEqual(str(record.motifs[12].instances[0]), "GCCGACGGGTGGTCATCGGG")
+ self.assertEqual(str(record.motifs[12].instances[1]), "GCACGACGCTTTGTACCTGG")
+ self.assertEqual(str(record.motifs[12].instances[2]), "CCTGGGAGGGTTCAATAACG")
+ self.assertEqual(str(record.motifs[12].instances[3]), "GCGCGTCCCGGGCCAATAGC")
+ self.assertEqual(str(record.motifs[12].instances[4]), "GCCGTCTGCTGGACAACGGG")
+ self.assertEqual(str(record.motifs[12].instances[5]), "GTCCCTTCCGGTACATGAGG")
+ self.assertEqual(str(record.motifs[12].instances[6]), "GCTGCTCCCCGCATACAGCG")
+ self.assertEqual(str(record.motifs[12].instances[7]), "GCCCCAAGCTTACCCAGGGA")
+ self.assertEqual(str(record.motifs[12].instances[8]), "ACCGGCTGACGCTAATACGG")
+ self.assertEqual(str(record.motifs[12].instances[9]), "GCGGGGGGCAGGTCATTACA")
+ self.assertEqual(str(record.motifs[12].instances[10]), "GCTGGCAGCGTCTAAGAAGG")
+ self.assertEqual(str(record.motifs[12].instances[11]), "GCAGGTGGTCGTGCAATACG")
+ self.assertEqual(str(record.motifs[12].instances[12]), "GCTGGTTGAAGTCCCGTGCG")
+ self.assertEqual(str(record.motifs[12].instances[13]), "GCACGTAGCTGGTAAATAGG")
+ self.assertEqual(str(record.motifs[12].instances[14]), "GCGGCGTGGATTTCATACAG")
+ self.assertEqual(str(record.motifs[12].instances[15]), "CCTGGAGGCTTAGACTTGGG")
self.assertEqual(record.motifs[12].mask, [1,1,0,1,1,0,0,1,1,0,1,0,0,0,1,0,0,0,1,1])
self.assertAlmostEqual(record.motifs[12].score, 5.63667)
self.assertEqual(record.motifs[13].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[13].instances), 15)
- self.assertEqual(record.motifs[13].instances[0].tostring(), "GCCGACGGGTGGTCATCGGG")
- self.assertEqual(record.motifs[13].instances[1].tostring(), "ATCCGCGGACGCTTAGAGGG")
- self.assertEqual(record.motifs[13].instances[2].tostring(), "ACGCTTTGTACCTGGCTTGC")
- self.assertEqual(record.motifs[13].instances[3].tostring(), "ACGGACGGCACTTAGCAGCG")
- self.assertEqual(record.motifs[13].instances[4].tostring(), "GCCGTCTGCTGGACAACGGG")
- self.assertEqual(record.motifs[13].instances[5].tostring(), "ACACACAGACGGTTGAAAGG")
- self.assertEqual(record.motifs[13].instances[6].tostring(), "GCCGATAGTGCTTAAGTTCG")
- self.assertEqual(record.motifs[13].instances[7].tostring(), "CTTGCCCGTACCGGACCTCG")
- self.assertEqual(record.motifs[13].instances[8].tostring(), "ACCGGCTGACGCTAATACGG")
- self.assertEqual(record.motifs[13].instances[9].tostring(), "GCCCCCCGCATAGTAGGGGG")
- self.assertEqual(record.motifs[13].instances[10].tostring(), "GCTGGCAGCGTCTAAGAAGG")
- self.assertEqual(record.motifs[13].instances[11].tostring(), "GCAGGTGGTCGTGCAATACG")
- self.assertEqual(record.motifs[13].instances[12].tostring(), "ACGCACGGGACTTCAACCAG")
- self.assertEqual(record.motifs[13].instances[13].tostring(), "GCACGTAGCTGGTAAATAGG")
- self.assertEqual(record.motifs[13].instances[14].tostring(), "ATCCTCTGCGTCGCATGGCG")
+ self.assertEqual(str(record.motifs[13].instances[0]), "GCCGACGGGTGGTCATCGGG")
+ self.assertEqual(str(record.motifs[13].instances[1]), "ATCCGCGGACGCTTAGAGGG")
+ self.assertEqual(str(record.motifs[13].instances[2]), "ACGCTTTGTACCTGGCTTGC")
+ self.assertEqual(str(record.motifs[13].instances[3]), "ACGGACGGCACTTAGCAGCG")
+ self.assertEqual(str(record.motifs[13].instances[4]), "GCCGTCTGCTGGACAACGGG")
+ self.assertEqual(str(record.motifs[13].instances[5]), "ACACACAGACGGTTGAAAGG")
+ self.assertEqual(str(record.motifs[13].instances[6]), "GCCGATAGTGCTTAAGTTCG")
+ self.assertEqual(str(record.motifs[13].instances[7]), "CTTGCCCGTACCGGACCTCG")
+ self.assertEqual(str(record.motifs[13].instances[8]), "ACCGGCTGACGCTAATACGG")
+ self.assertEqual(str(record.motifs[13].instances[9]), "GCCCCCCGCATAGTAGGGGG")
+ self.assertEqual(str(record.motifs[13].instances[10]), "GCTGGCAGCGTCTAAGAAGG")
+ self.assertEqual(str(record.motifs[13].instances[11]), "GCAGGTGGTCGTGCAATACG")
+ self.assertEqual(str(record.motifs[13].instances[12]), "ACGCACGGGACTTCAACCAG")
+ self.assertEqual(str(record.motifs[13].instances[13]), "GCACGTAGCTGGTAAATAGG")
+ self.assertEqual(str(record.motifs[13].instances[14]), "ATCCTCTGCGTCGCATGGCG")
self.assertEqual(record.motifs[13].mask, [1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,0,1,1])
self.assertAlmostEqual(record.motifs[13].score, 3.89842)
self.assertEqual(record.motifs[14].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[14].instances), 14)
- self.assertEqual(record.motifs[14].instances[0].tostring(), "GAGGCTGTGTAT")
- self.assertEqual(record.motifs[14].instances[1].tostring(), "GAGGTCGGGGGT")
- self.assertEqual(record.motifs[14].instances[2].tostring(), "GACGGACGGCAC")
- self.assertEqual(record.motifs[14].instances[3].tostring(), "TTGGCCCGGGAC")
- self.assertEqual(record.motifs[14].instances[4].tostring(), "GAGGCTCGGCCC")
- self.assertEqual(record.motifs[14].instances[5].tostring(), "CACGCGCTGTAT")
- self.assertEqual(record.motifs[14].instances[6].tostring(), "TAGGCCAGGTAT")
- self.assertEqual(record.motifs[14].instances[7].tostring(), "GAGGTCCGGTAC")
- self.assertEqual(record.motifs[14].instances[8].tostring(), "TACGCTGGGGAT")
- self.assertEqual(record.motifs[14].instances[9].tostring(), "GTCGCGGAGGAT")
- self.assertEqual(record.motifs[14].instances[10].tostring(), "TACGCACGGGAC")
- self.assertEqual(record.motifs[14].instances[11].tostring(), "TACTCCGGGTAC")
- self.assertEqual(record.motifs[14].instances[12].tostring(), "GACGCAGAGGAT")
- self.assertEqual(record.motifs[14].instances[13].tostring(), "TAGGCGGGCCAT")
+ self.assertEqual(str(record.motifs[14].instances[0]), "GAGGCTGTGTAT")
+ self.assertEqual(str(record.motifs[14].instances[1]), "GAGGTCGGGGGT")
+ self.assertEqual(str(record.motifs[14].instances[2]), "GACGGACGGCAC")
+ self.assertEqual(str(record.motifs[14].instances[3]), "TTGGCCCGGGAC")
+ self.assertEqual(str(record.motifs[14].instances[4]), "GAGGCTCGGCCC")
+ self.assertEqual(str(record.motifs[14].instances[5]), "CACGCGCTGTAT")
+ self.assertEqual(str(record.motifs[14].instances[6]), "TAGGCCAGGTAT")
+ self.assertEqual(str(record.motifs[14].instances[7]), "GAGGTCCGGTAC")
+ self.assertEqual(str(record.motifs[14].instances[8]), "TACGCTGGGGAT")
+ self.assertEqual(str(record.motifs[14].instances[9]), "GTCGCGGAGGAT")
+ self.assertEqual(str(record.motifs[14].instances[10]), "TACGCACGGGAC")
+ self.assertEqual(str(record.motifs[14].instances[11]), "TACTCCGGGTAC")
+ self.assertEqual(str(record.motifs[14].instances[12]), "GACGCAGAGGAT")
+ self.assertEqual(str(record.motifs[14].instances[13]), "TAGGCGGGCCAT")
self.assertEqual(record.motifs[14].mask, [1,1,1,1,1,0,1,1,1,0,1,1])
self.assertAlmostEqual(record.motifs[14].score, 3.33444)
self.assertEqual(record.motifs[15].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(len(record.motifs[15].instances), 21)
- self.assertEqual(record.motifs[15].instances[0].tostring(), "CGGCTCAATCGTAGAGGC")
- self.assertEqual(record.motifs[15].instances[1].tostring(), "CGACGGGTGGTCATCGGG")
- self.assertEqual(record.motifs[15].instances[2].tostring(), "CGCTTAGAGGGCACAAGC")
- self.assertEqual(record.motifs[15].instances[3].tostring(), "TGACACGCGCCTGGGAGG")
- self.assertEqual(record.motifs[15].instances[4].tostring(), "CGATACGCTGCTAAGTGC")
- self.assertEqual(record.motifs[15].instances[5].tostring(), "CGTCCCGGGCCAATAGCG")
- self.assertEqual(record.motifs[15].instances[6].tostring(), "CCACGCTTCGACACGTGG")
- self.assertEqual(record.motifs[15].instances[7].tostring(), "CGTCTGCTGGACAACGGG")
- self.assertEqual(record.motifs[15].instances[8].tostring(), "ACACAGACGGTTGAAAGG")
- self.assertEqual(record.motifs[15].instances[9].tostring(), "TGCTCCCCGCATACAGCG")
- self.assertEqual(record.motifs[15].instances[10].tostring(), "TGAGGCTTGCCCGTACCG")
- self.assertEqual(record.motifs[15].instances[11].tostring(), "TGCCCCAAGCTTACCCAG")
- self.assertEqual(record.motifs[15].instances[12].tostring(), "CGGCTGACGCTAATACGG")
- self.assertEqual(record.motifs[15].instances[13].tostring(), "CGCGACGTCCCTATGAGC")
- self.assertEqual(record.motifs[15].instances[14].tostring(), "TGCCCCCCGCATAGTAGG")
- self.assertEqual(record.motifs[15].instances[15].tostring(), "CGTTGCCTTCTTAGACGC")
- self.assertEqual(record.motifs[15].instances[16].tostring(), "TGACTCAATCGTAGACCC")
- self.assertEqual(record.motifs[15].instances[17].tostring(), "AGTCCCGTGCGTATGTGG")
- self.assertEqual(record.motifs[15].instances[18].tostring(), "AGGCTCGCACGTAGCTGG")
- self.assertEqual(record.motifs[15].instances[19].tostring(), "CCACGCCGCCATGCGACG")
- self.assertEqual(record.motifs[15].instances[20].tostring(), "AGCCTCCAGGTCGCATGG")
+ self.assertEqual(str(record.motifs[15].instances[0]), "CGGCTCAATCGTAGAGGC")
+ self.assertEqual(str(record.motifs[15].instances[1]), "CGACGGGTGGTCATCGGG")
+ self.assertEqual(str(record.motifs[15].instances[2]), "CGCTTAGAGGGCACAAGC")
+ self.assertEqual(str(record.motifs[15].instances[3]), "TGACACGCGCCTGGGAGG")
+ self.assertEqual(str(record.motifs[15].instances[4]), "CGATACGCTGCTAAGTGC")
+ self.assertEqual(str(record.motifs[15].instances[5]), "CGTCCCGGGCCAATAGCG")
+ self.assertEqual(str(record.motifs[15].instances[6]), "CCACGCTTCGACACGTGG")
+ self.assertEqual(str(record.motifs[15].instances[7]), "CGTCTGCTGGACAACGGG")
+ self.assertEqual(str(record.motifs[15].instances[8]), "ACACAGACGGTTGAAAGG")
+ self.assertEqual(str(record.motifs[15].instances[9]), "TGCTCCCCGCATACAGCG")
+ self.assertEqual(str(record.motifs[15].instances[10]), "TGAGGCTTGCCCGTACCG")
+ self.assertEqual(str(record.motifs[15].instances[11]), "TGCCCCAAGCTTACCCAG")
+ self.assertEqual(str(record.motifs[15].instances[12]), "CGGCTGACGCTAATACGG")
+ self.assertEqual(str(record.motifs[15].instances[13]), "CGCGACGTCCCTATGAGC")
+ self.assertEqual(str(record.motifs[15].instances[14]), "TGCCCCCCGCATAGTAGG")
+ self.assertEqual(str(record.motifs[15].instances[15]), "CGTTGCCTTCTTAGACGC")
+ self.assertEqual(str(record.motifs[15].instances[16]), "TGACTCAATCGTAGACCC")
+ self.assertEqual(str(record.motifs[15].instances[17]), "AGTCCCGTGCGTATGTGG")
+ self.assertEqual(str(record.motifs[15].instances[18]), "AGGCTCGCACGTAGCTGG")
+ self.assertEqual(str(record.motifs[15].instances[19]), "CCACGCCGCCATGCGACG")
+ self.assertEqual(str(record.motifs[15].instances[20]), "AGCCTCCAGGTCGCATGG")
self.assertEqual(record.motifs[15].mask, [1,1,0,1,0,1,0,0,1,1,0,1,1,0,0,0,1,1])
self.assertAlmostEqual(record.motifs[15].score, 1.0395)
@@ -527,16 +527,16 @@ def test_meme_parser_1(self):
self.assertEqual(motif.instances[7].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(motif.instances[8].alphabet, IUPAC.unambiguous_dna)
self.assertEqual(motif.instances[9].alphabet, IUPAC.unambiguous_dna)
- self.assertEqual(motif.instances[0].tostring(), "CTCAATCGTA")
- self.assertEqual(motif.instances[1].tostring(), "CTCAATCGTA")
- self.assertEqual(motif.instances[2].tostring(), "CTCAATCGTA")
- self.assertEqual(motif.instances[3].tostring(), "CTCAATCGTA")
- self.assertEqual(motif.instances[4].tostring(), "CTCAATCGTA")
- self.assertEqual(motif.instances[5].tostring(), "CTCAATCGTA")
- self.assertEqual(motif.instances[6].tostring(), "CTCAATCGTA")
- self.assertEqual(motif.instances[7].tostring(), "CTCAATCGTA")
- self.assertEqual(motif.instances[8].tostring(), "CTCAATCGTA")
- self.assertEqual(motif.instances[9].tostring(), "CTCAATCGTA")
+ self.assertEqual(str(motif.instances[0]), "CTCAATCGTA")
+ self.assertEqual(str(motif.instances[1]), "CTCAATCGTA")
+ self.assertEqual(str(motif.instances[2]), "CTCAATCGTA")
+ self.assertEqual(str(motif.instances[3]), "CTCAATCGTA")
+ self.assertEqual(str(motif.instances[4]), "CTCAATCGTA")
+ self.assertEqual(str(motif.instances[5]), "CTCAATCGTA")
+ self.assertEqual(str(motif.instances[6]), "CTCAATCGTA")
+ self.assertEqual(str(motif.instances[7]), "CTCAATCGTA")
+ self.assertEqual(str(motif.instances[8]), "CTCAATCGTA")
+ self.assertEqual(str(motif.instances[9]), "CTCAATCGTA")
handle.close()
def test_meme_parser_2(self):
@@ -600,13 +600,13 @@ def test_meme_parser_2(self):
self.assertEqual(motif.instances[4].start, 611)
self.assertEqual(motif.instances[5].start, 567)
self.assertEqual(motif.instances[6].start, 340)
- self.assertEqual(motif.instances[0].tostring(), "TTCACATGCCGC")
- self.assertEqual(motif.instances[1].tostring(), "TTCACATGCCGC")
- self.assertEqual(motif.instances[2].tostring(), "TTCACATGGCCC")
- self.assertEqual(motif.instances[3].tostring(), "TTCTCATGCCGC")
- self.assertEqual(motif.instances[4].tostring(), "TTCACACGGCAC")
- self.assertEqual(motif.instances[5].tostring(), "TTCACATGCTAC")
- self.assertEqual(motif.instances[6].tostring(), "TTCAGATCGCTC")
+ self.assertEqual(str(motif.instances[0]), "TTCACATGCCGC")
+ self.assertEqual(str(motif.instances[1]), "TTCACATGCCGC")
+ self.assertEqual(str(motif.instances[2]), "TTCACATGGCCC")
+ self.assertEqual(str(motif.instances[3]), "TTCTCATGCCGC")
+ self.assertEqual(str(motif.instances[4]), "TTCACACGGCAC")
+ self.assertEqual(str(motif.instances[5]), "TTCACATGCTAC")
+ self.assertEqual(str(motif.instances[6]), "TTCAGATCGCTC")
motif = record.motifs[1]
self.assertEqual(motif.num_occurrences, 7)
self.assertAlmostEqual(motif.evalue, 110)
@@ -648,13 +648,13 @@ def test_meme_parser_2(self):
self.assertEqual(motif.instances[4].start, 44)
self.assertEqual(motif.instances[5].start, 185)
self.assertEqual(motif.instances[6].start, 413)
- self.assertEqual(motif.instances[0].tostring(), "TCTGGCACAG")
- self.assertEqual(motif.instances[1].tostring(), "TCTGGCACAG")
- self.assertEqual(motif.instances[2].tostring(), "TCTGGCACAG")
- self.assertEqual(motif.instances[3].tostring(), "GCGGGCGCAG")
- self.assertEqual(motif.instances[4].tostring(), "GCAGGCACGG")
- self.assertEqual(motif.instances[5].tostring(), "TCTGGCACTC")
- self.assertEqual(motif.instances[6].tostring(), "TCTGGCATCG")
+ self.assertEqual(str(motif.instances[0]), "TCTGGCACAG")
+ self.assertEqual(str(motif.instances[1]), "TCTGGCACAG")
+ self.assertEqual(str(motif.instances[2]), "TCTGGCACAG")
+ self.assertEqual(str(motif.instances[3]), "GCGGGCGCAG")
+ self.assertEqual(str(motif.instances[4]), "GCAGGCACGG")
+ self.assertEqual(str(motif.instances[5]), "TCTGGCACTC")
+ self.assertEqual(str(motif.instances[6]), "TCTGGCATCG")
handle.close()
def test_meme_parser_3(self):
@@ -874,39 +874,39 @@ def test_meme_parser_3(self):
self.assertEqual(motif.instances[30].start, 193)
self.assertEqual(motif.instances[31].start, 26)
self.assertEqual(motif.instances[32].start, 349)
- self.assertEqual(motif.instances[0].tostring(), "YSASKFAVLGLTESLMQEVRKHNIRVSAL")
- self.assertEqual(motif.instances[1].tostring(), "YSSTKGAMTMLTKAMAMELGPHKIRVNSV")
- self.assertEqual(motif.instances[2].tostring(), "YCASKAGMIGFSKSLAQEIATRNITVNCV")
- self.assertEqual(motif.instances[3].tostring(), "YSSSKFAVRGLTQTAARDLAPLGITVNGF")
- self.assertEqual(motif.instances[4].tostring(), "YATSKAALASLTRELAHDYAPHGIRVNAI")
- self.assertEqual(motif.instances[5].tostring(), "YAASKGGMKLMTETLALEYAPKGIRVNNI")
- self.assertEqual(motif.instances[6].tostring(), "YTMAKGALEGLTRSAALELAPLQIRVNGV")
- self.assertEqual(motif.instances[7].tostring(), "YSASKAFLSTFMESLRVDLRGTGVRVTCI")
- self.assertEqual(motif.instances[8].tostring(), "YSAAKFGGVGLTQSLALDLAEYGITVHSL")
- self.assertEqual(motif.instances[9].tostring(), "YGASKWGVRGLSKLAAVELGTDRIRVNSV")
- self.assertEqual(motif.instances[10].tostring(), "YASSKAAASHLVRNMAFDLGEKNIRVNGI")
- self.assertEqual(motif.instances[11].tostring(), "YGSSKAAVTMFSSVMRLELSKWGIKVASI")
- self.assertEqual(motif.instances[12].tostring(), "YVAAKGGVAMLTRAMAVDLARHGILVNMI")
- self.assertEqual(motif.instances[13].tostring(), "YSSSKAGILGLSKTMAIEGAKNNIKVNIV")
- self.assertEqual(motif.instances[14].tostring(), "YSASKFAIRGLAEALQMEVKPYNVYITVA")
- self.assertEqual(motif.instances[15].tostring(), "YCITKFGVEAFSDCLRYEMYPLGVKVSVV")
- self.assertEqual(motif.instances[16].tostring(), "YTASKFAVQAFVHTTRRQVAQYGVRVGAV")
- self.assertEqual(motif.instances[17].tostring(), "YCASKFALEGLCESLAVLLLPFGVHLSLI")
- self.assertEqual(motif.instances[18].tostring(), "YPASKASVIGLTHGLGREIIRKNIRVVGV")
- self.assertEqual(motif.instances[19].tostring(), "YSAAKAASINLMEGYRQGLEKYGIGVSVC")
- self.assertEqual(motif.instances[20].tostring(), "YSASKFALDGFFSSIRKEYSVSRVNVSIT")
- self.assertEqual(motif.instances[21].tostring(), "YGASKAALKSLALSVGLELAGSGVRCNVV")
- self.assertEqual(motif.instances[22].tostring(), "YSASKAAVSALTRAAALSCRKQGYAIRVN")
- self.assertEqual(motif.instances[23].tostring(), "YSASKAFVCAFSKALQEEYKAKEVIIQVL")
- self.assertEqual(motif.instances[24].tostring(), "YSASKAAADHLVRAWQRTYRLPSIVSNCS")
- self.assertEqual(motif.instances[25].tostring(), "YGATKWAVRDLMEVLRMESAQEGTNIRTA")
- self.assertEqual(motif.instances[26].tostring(), "YTAAKQAIVGLVRELAFELAPYVRVNGVG")
- self.assertEqual(motif.instances[27].tostring(), "YRMSKAALNMAVRSMSTDLRPEGFVTVLL")
- self.assertEqual(motif.instances[28].tostring(), "MGLAKASLEANVRYMANAMGPEGVRVNAI")
- self.assertEqual(motif.instances[29].tostring(), "YSGTKAAVVNFTSSLAKLAPITGVTAYTV")
- self.assertEqual(motif.instances[30].tostring(), "YGVTKIGVTVLSRIHARKLSEQRKGDKIL")
- self.assertEqual(motif.instances[31].tostring(), "KDSTLFGVSSLSDSLKGDFTSSALRCKEL")
- self.assertEqual(motif.instances[32].tostring(), "YINCVAPLRMTELCLPHLYETGSGRIVNI")
+ self.assertEqual(str(motif.instances[0]), "YSASKFAVLGLTESLMQEVRKHNIRVSAL")
+ self.assertEqual(str(motif.instances[1]), "YSSTKGAMTMLTKAMAMELGPHKIRVNSV")
+ self.assertEqual(str(motif.instances[2]), "YCASKAGMIGFSKSLAQEIATRNITVNCV")
+ self.assertEqual(str(motif.instances[3]), "YSSSKFAVRGLTQTAARDLAPLGITVNGF")
+ self.assertEqual(str(motif.instances[4]), "YATSKAALASLTRELAHDYAPHGIRVNAI")
+ self.assertEqual(str(motif.instances[5]), "YAASKGGMKLMTETLALEYAPKGIRVNNI")
+ self.assertEqual(str(motif.instances[6]), "YTMAKGALEGLTRSAALELAPLQIRVNGV")
+ self.assertEqual(str(motif.instances[7]), "YSASKAFLSTFMESLRVDLRGTGVRVTCI")
+ self.assertEqual(str(motif.instances[8]), "YSAAKFGGVGLTQSLALDLAEYGITVHSL")
+ self.assertEqual(str(motif.instances[9]), "YGASKWGVRGLSKLAAVELGTDRIRVNSV")
+ self.assertEqual(str(motif.instances[10]), "YASSKAAASHLVRNMAFDLGEKNIRVNGI")
+ self.assertEqual(str(motif.instances[11]), "YGSSKAAVTMFSSVMRLELSKWGIKVASI")
+ self.assertEqual(str(motif.instances[12]), "YVAAKGGVAMLTRAMAVDLARHGILVNMI")
+ self.assertEqual(str(motif.instances[13]), "YSSSKAGILGLSKTMAIEGAKNNIKVNIV")
+ self.assertEqual(str(motif.instances[14]), "YSASKFAIRGLAEALQMEVKPYNVYITVA")
+ self.assertEqual(str(motif.instances[15]), "YCITKFGVEAFSDCLRYEMYPLGVKVSVV")
+ self.assertEqual(str(motif.instances[16]), "YTASKFAVQAFVHTTRRQVAQYGVRVGAV")
+ self.assertEqual(str(motif.instances[17]), "YCASKFALEGLCESLAVLLLPFGVHLSLI")
+ self.assertEqual(str(motif.instances[18]), "YPASKASVIGLTHGLGREIIRKNIRVVGV")
+ self.assertEqual(str(motif.instances[19]), "YSAAKAASINLMEGYRQGLEKYGIGVSVC")
+ self.assertEqual(str(motif.instances[20]), "YSASKFALDGFFSSIRKEYSVSRVNVSIT")
+ self.assertEqual(str(motif.instances[21]), "YGASKAALKSLALSVGLELAGSGVRCNVV")
+ self.assertEqual(str(motif.instances[22]), "YSASKAAVSALTRAAALSCRKQGYAIRVN")
+ self.assertEqual(str(motif.instances[23]), "YSASKAFVCAFSKALQEEYKAKEVIIQVL")
+ self.assertEqual(str(motif.instances[24]), "YSASKAAADHLVRAWQRTYRLPSIVSNCS")
+ self.assertEqual(str(motif.instances[25]), "YGATKWAVRDLMEVLRMESAQEGTNIRTA")
+ self.assertEqual(str(motif.instances[26]), "YTAAKQAIVGLVRELAFELAPYVRVNGVG")
+ self.assertEqual(str(motif.instances[27]), "YRMSKAALNMAVRSMSTDLRPEGFVTVLL")
+ self.assertEqual(str(motif.instances[28]), "MGLAKASLEANVRYMANAMGPEGVRVNAI")
+ self.assertEqual(str(motif.instances[29]), "YSGTKAAVVNFTSSLAKLAPITGVTAYTV")
+ self.assertEqual(str(motif.instances[30]), "YGVTKIGVTVLSRIHARKLSEQRKGDKIL")
+ self.assertEqual(str(motif.instances[31]), "KDSTLFGVSSLSDSLKGDFTSSALRCKEL")
+ self.assertEqual(str(motif.instances[32]), "YINCVAPLRMTELCLPHLYETGSGRIVNI")
motif = record.motifs[1]
self.assertEqual(motif.num_occurrences, 33)
self.assertAlmostEqual(motif.evalue, 2.3e-159)
@@ -1012,39 +1012,39 @@ def test_meme_parser_3(self):
self.assertEqual(motif.instances[30].start, 7)
self.assertEqual(motif.instances[31].start, 117)
self.assertEqual(motif.instances[32].start, 52)
- self.assertEqual(motif.instances[0].tostring(), 'KVVLITGAGAGLGKEYAKWFAKYGAKVVV')
- self.assertEqual(motif.instances[1].tostring(), 'KKVIVTGASKGIGREMAYHLAKMGAHVVV')
- self.assertEqual(motif.instances[2].tostring(), 'KVIIITGASSGIGKATALLLAEKGAKLVL')
- self.assertEqual(motif.instances[3].tostring(), 'KCAIITGAGAGIGKEIAITFATAGASVVV')
- self.assertEqual(motif.instances[4].tostring(), 'KVAAITGAASGIGLECARTLLGAGAKVVL')
- self.assertEqual(motif.instances[5].tostring(), 'KVALVTGAGQGIGKAIALRLVKDGFAVAI')
- self.assertEqual(motif.instances[6].tostring(), 'KNVWVTGAGKGIGYATALAFVEAGAKVTG')
- self.assertEqual(motif.instances[7].tostring(), 'LRALVTGAGKGIGRDTVKALHASGAKVVA')
- self.assertEqual(motif.instances[8].tostring(), 'KAAIVTGAAGGIGRATVEAYLREGASVVA')
- self.assertEqual(motif.instances[9].tostring(), 'KTALITGGGRGIGRATALALAKEGVNIGL')
- self.assertEqual(motif.instances[10].tostring(), 'KVVVITGSSTGLGKSMAIRFATEKAKVVV')
- self.assertEqual(motif.instances[11].tostring(), 'QWAVITGAGDGIGKAYSFELAKRGLNVVL')
- self.assertEqual(motif.instances[12].tostring(), 'GNVVITGASSGLGLATAKALAESGKWHVI')
- self.assertEqual(motif.instances[13].tostring(), 'KAVLVTGCDSGFGFSLAKHLHSKGFLVFA')
- self.assertEqual(motif.instances[14].tostring(), 'KVTIITGGTRGIGFAAAKIFIDNGAKVSI')
- self.assertEqual(motif.instances[15].tostring(), 'KVMLLTGASRGIGHATAKLFSEAGWRIIS')
- self.assertEqual(motif.instances[16].tostring(), 'KVALVTGGASGVGLEVVKLLLGEGAKVAF')
- self.assertEqual(motif.instances[17].tostring(), 'KTVIITGGARGLGAEAARQAVAAGARVVL')
- self.assertEqual(motif.instances[18].tostring(), 'PVALVTGAAKRLGRSIAEGLHAEGYAVCL')
- self.assertEqual(motif.instances[19].tostring(), 'AHVVVTGGSSGIGKCIAIECYKQGAFITL')
- self.assertEqual(motif.instances[20].tostring(), 'KAVLVTGGDCGLGHALCKYLDELGFTVFA')
- self.assertEqual(motif.instances[21].tostring(), 'QVAFITGGASGAGFGQAKVFGQAGAKIVV')
- self.assertEqual(motif.instances[22].tostring(), 'RKALVTGASGAIGGAIARVLHAQGAIVGL')
- self.assertEqual(motif.instances[23].tostring(), 'HVALVTGGNKGIGLAIVRDLCRLFSGDVV')
- self.assertEqual(motif.instances[24].tostring(), 'PVILVSGSNRGVGKAIAEDLIAHGYRLSL')
- self.assertEqual(motif.instances[25].tostring(), 'EAVLITGGASGLGRALVDRFVAEAKVAVL')
- self.assertEqual(motif.instances[26].tostring(), 'QVAVVIGGGQTLGAFLCHGLAAEGYRVAV')
- self.assertEqual(motif.instances[27].tostring(), 'TVVLITGCSSGIGLHLAVRLASDPSQSFK')
- self.assertEqual(motif.instances[28].tostring(), 'KNILVTGGAGFIGSAVVRHIIQNTRDSVV')
- self.assertEqual(motif.instances[29].tostring(), 'KNVIFVAGLGGIGLDTSKELLKRDLKNLV')
- self.assertEqual(motif.instances[30].tostring(), 'KRILVTGVASKLSIAYGIAQAMHREGAEL')
- self.assertEqual(motif.instances[31].tostring(), 'IDTNVTGAAATLSAVLPQMVERKRGHLVG')
- self.assertEqual(motif.instances[32].tostring(), 'TSAMLPGLRQGALRRVAHVTSRMGSLAAN')
+ self.assertEqual(str(motif.instances[0]), 'KVVLITGAGAGLGKEYAKWFAKYGAKVVV')
+ self.assertEqual(str(motif.instances[1]), 'KKVIVTGASKGIGREMAYHLAKMGAHVVV')
+ self.assertEqual(str(motif.instances[2]), 'KVIIITGASSGIGKATALLLAEKGAKLVL')
+ self.assertEqual(str(motif.instances[3]), 'KCAIITGAGAGIGKEIAITFATAGASVVV')
+ self.assertEqual(str(motif.instances[4]), 'KVAAITGAASGIGLECARTLLGAGAKVVL')
+ self.assertEqual(str(motif.instances[5]), 'KVALVTGAGQGIGKAIALRLVKDGFAVAI')
+ self.assertEqual(str(motif.instances[6]), 'KNVWVTGAGKGIGYATALAFVEAGAKVTG')
+ self.assertEqual(str(motif.instances[7]), 'LRALVTGAGKGIGRDTVKALHASGAKVVA')
+ self.assertEqual(str(motif.instances[8]), 'KAAIVTGAAGGIGRATVEAYLREGASVVA')
+ self.assertEqual(str(motif.instances[9]), 'KTALITGGGRGIGRATALALAKEGVNIGL')
+ self.assertEqual(str(motif.instances[10]), 'KVVVITGSSTGLGKSMAIRFATEKAKVVV')
+ self.assertEqual(str(motif.instances[11]), 'QWAVITGAGDGIGKAYSFELAKRGLNVVL')
+ self.assertEqual(str(motif.instances[12]), 'GNVVITGASSGLGLATAKALAESGKWHVI')
+ self.assertEqual(str(motif.instances[13]), 'KAVLVTGCDSGFGFSLAKHLHSKGFLVFA')
+ self.assertEqual(str(motif.instances[14]), 'KVTIITGGTRGIGFAAAKIFIDNGAKVSI')
+ self.assertEqual(str(motif.instances[15]), 'KVMLLTGASRGIGHATAKLFSEAGWRIIS')
+ self.assertEqual(str(motif.instances[16]), 'KVALVTGGASGVGLEVVKLLLGEGAKVAF')
+ self.assertEqual(str(motif.instances[17]), 'KTVIITGGARGLGAEAARQAVAAGARVVL')