I have two Genbank files which I am extracting the genes doing the following:
genes_1 = []
for feature in sequence.features:
if feature.type=='gene':
genes_1.append(feature)
That is working just fine, I am able to obtain the sequence, the GC content and translation of the gene I need.
The second Genbank file is a very similar strain of bacteria. My idea is using the newly extracted sequence:
dnaA = hits[0]
extracted_sequence_1 = dnaA.extract(sequence_tuberculosis)
To do a search on the second Genbank file:
for extracted_sequence_1 in genes_2:
for gene in genes_2.extract(sequence_2):
if extracted_sequence_1 in genes_2.extract(sequences_2):
print('Match')
However, as it is obvious, I am getting an error:
AttributeError: 'list' object has no attribute 'extract'
I have been trying to find this information on the bioPython instructions but there's nothing similar to what I need. Is there a way of doing this without running alignments?