Post Reply 

Need help with Python script

Sep 23, 2011, 08:13
Post: #1
Need help with Python script
Hi I am busy working with biological sequences, but I am having some problems.
Let's say that I want to compare two dna sequences i.e
seq1='ATGGAGGCAATGGCGGCCAGCACTTCCCTGCCTGACCCTGGAGACTTTGACCGGAACGTG
CCCCGGATCTGTGGGGTGTGTGGAGACCGAGCCACTGGCTTTCACTTCAATGCTATGACC
TGTGAAGGCTGCAAAGGCTTCTTCAGGCGAAGCATGAAGCGGAAGGCACTATTCACCTGC
CCCTTCAACGGGGACTGCCGCATCACCAAGGACAACCGACGCCACTGCCAGGCCTGCCGG
CTCAAACGCTGTGTGGACATCGGCATGATGAAGGAGTTCATTCTGACAGATGAGGAAGTG'
seq2='ATGGAGGCAATGGCGGCCAGCACTTCCCTGCCTGACCCTGGAGACTTTGACCGGAATGTG
CCCCGGATCTGTGGGGTGTGTGGAGACCGAGCCACTGGCTTTCACTTCAATGCTATGACC
TGTGAAGGCTGCAAAGGCTTCTTCAGGCGAAGCATGAAGCGGAAGGCACTATTCACCTGC
CCCTTCAATGGGGACTGCCGCATCACCAAGGACAACCGGCGCCACTGCCAGGCCTGCCGG
CTCAAACGCTGTGTGGACATCGGCATGATGAAGGAGTTCATCCTGACAGATGAGGAAGTG
CAGAGGAAGCGGGAGATGATCCTGAAGCGGAAGGAGGAGGAGGCCTTGAAGGACAGTCTG
CGGCCCAAGCTGTCTGAGGAGCAGCAGCGCATCATTGCCATACTGCTGGACGCCCACCAT
AAGACCTACGACCCCACCTACTCCGACTTCTGCCAGTTCCGGCCTCCAGTTCGTGTGAAT
GATGGTGGAGGGAGCCATCCTTCCAGGCCCAACTCCAGACACACTCCCAGCTTCTCTGGG
GACTCCTCCTCCTCCTGCTCAGATCACTGTATCACCTCTTCAGACATGATGGAC---TCG'

Thus my aim is to identify variations between those two sequences in term of codons, and the position in which the changed codon falls. Then I want to know the amino acid product related to that codon. Any helps?
this is what I done so far but I cannot see exactly want I want:

def sequence_compare(seq_a, seq_b):
len1= len(seq_a)
len2= len(seq_b)
mismatches = []
for pos in range (0,min(len1,len2)) :
if seq_a[pos] != seq_b[pos]:
mismatches.append('|')
else:
mismatches.append(' ')
print (seq_a)
print (mismatches)
print (seg_b)
sequence_compare(seq_a,seq_b)

Basically I would like to see something like: ATC-ATT and the related amino acid changed.

any suggestions please?
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Create new images button & Save as override from Script-fu beniman 12 611 Sep 10, 2014 10:57
Last Post: paynekj
  Line Script 2Old 6 678 Feb 6, 2014 18:50
Last Post: 2Old
  Script Fu Slandingo 1 742 Jun 14, 2013 20:26
Last Post: rich2005
  Gimp script SCM [Scale to/end at borders of] selection HalfNote5 4 1,038 Mar 15, 2013 00:49
Last Post: HalfNote5
  Script download kjacobs4242 4 991 Jan 3, 2013 21:50
Last Post: kjacobs4242

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS