Commit 772d6c2f authored by Alisa Muraveva's avatar Alisa Muraveva
Browse files

Some erros were fixed

git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/branches/mobile-2013@741 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
parent b1fe77c5
...@@ -1326,7 +1326,7 @@ def _add_transcript_info(mutator, transcript, output): ...@@ -1326,7 +1326,7 @@ def _add_transcript_info(mutator, transcript, output):
output.addMessage(__file__, 3, 'ESTOP', output.addMessage(__file__, 3, 'ESTOP',
'In frame stop codon.') 'In frame stop codon.')
protein_variant = cds_variant.translate(table = transcript.txTable) protein_variant = cds_variant.translate(table = transcript.txTable)
protein_variant, result = substitute_variant_prot(cds_variant, protein_variant, triplets, transcript,output,True,res) protein_variant, result = substitute_variant_prot(cds_variant, protein_variant, triplets, transcript,output, True, res)
if result: if result:
output.addMessage(__file__, 2, 'WSUBST', output.addMessage(__file__, 2, 'WSUBST',
' The noncanonical amino acids were found and substituted in \ ' The noncanonical amino acids were found and substituted in \
...@@ -1356,7 +1356,6 @@ def _add_transcript_info(mutator, transcript, output): ...@@ -1356,7 +1356,6 @@ def _add_transcript_info(mutator, transcript, output):
# Todo: Protein differences are not color-coded, # Todo: Protein differences are not color-coded,
# use something like below in protein_description(). # use something like below in protein_description().
if protein_original[0]!="M": if protein_original[0]!="M":
print "ORIGINAL"
# util.print_protein_html('M' + protein_original[1:] + '*', 0, 0, output, # util.print_protein_html('M' + protein_original[1:] + '*', 0, 0, output,
# 'oldProteinFancy') # 'oldProteinFancy')
# util.print_protein_html('M'+ protein_original[1:] + '*', 0, 0, output, # util.print_protein_html('M'+ protein_original[1:] + '*', 0, 0, output,
...@@ -1393,7 +1392,6 @@ def _add_transcript_info(mutator, transcript, output): ...@@ -1393,7 +1392,6 @@ def _add_transcript_info(mutator, transcript, output):
output.addOutput('newProteinFancy', pprint_sequence('?', format=HtmlFormat, annotations=[[(0, 0)], [(0,0)]])) output.addOutput('newProteinFancy', pprint_sequence('?', format=HtmlFormat, annotations=[[(0, 0)], [(0,0)]]))
output.addOutput('newProteinFancyText', pprint_sequence('?', format=AnsiFormat, annotations=[[(0, 0)], [(0,0)]])) output.addOutput('newProteinFancyText', pprint_sequence('?', format=AnsiFormat, annotations=[[(0, 0)], [(0,0)]]))
output.addMessage(__file__, 2, "WSTART", "No start codon was found in predicted cds") output.addMessage(__file__, 2, "WSTART", "No start codon was found in predicted cds")
print cds_variant[0:3], cds_original[0:3]
else: else:
cds_length = util.cds_length( cds_length = util.cds_length(
...@@ -1992,7 +1990,6 @@ def star_subst(cds_original,protein, transcript, triplets, aa_dict_r, output, fl ...@@ -1992,7 +1990,6 @@ def star_subst(cds_original,protein, transcript, triplets, aa_dict_r, output, fl
output.addOutput('reference_exceptions', [str(start+1), str(start*3+1) + ".." + str(start*3+3), str(genomic+1) + ".." + str(genomic+3) , str(cds_original[start*3:start*3+3]), protein[start] + ' (' + aa_dict_r[protein[start]] + ')', aa + ' (' + aa_dict_r[aa] + ')']) output.addOutput('reference_exceptions', [str(start+1), str(start*3+1) + ".." + str(start*3+3), str(genomic+1) + ".." + str(genomic+3) , str(cds_original[start*3:start*3+3]), protein[start] + ' (' + aa_dict_r[protein[start]] + ')', aa + ' (' + aa_dict_r[aa] + ')'])
protein[start] = aa protein[start] = aa
protein=protein.toseq() protein=protein.toseq()
return protein.split("*")[0], res return protein.split("*")[0], res
def substitute_variant_prot(nucl_seq, prot_seq, triplets, transcript, output, flag, start_original, Sec = False): def substitute_variant_prot(nucl_seq, prot_seq, triplets, transcript, output, flag, start_original, Sec = False):
'''This function return a changed protein. Amino acids are substituted according to triplets dictionary. '''This function return a changed protein. Amino acids are substituted according to triplets dictionary.
...@@ -2012,9 +2009,12 @@ def substitute_variant_prot(nucl_seq, prot_seq, triplets, transcript, output, fl ...@@ -2012,9 +2009,12 @@ def substitute_variant_prot(nucl_seq, prot_seq, triplets, transcript, output, fl
if flag: if flag:
genomic = transcript.CM.x2g(i*3, 0) genomic = transcript.CM.x2g(i*3, 0)
if i in start_original: semaph = True
for start, aa, sch in transcript.transl_except:
if i == start and triplets[triplet] == aa:
exceptions.append([i+1, str(i*3+1) + ".." + str(i*3+3), str(genomic+1) + ".." + str(genomic+3), triplet, prot[i] + ' (' + aa_dict_r[prot[i]] + ')', triplets[triplet] + ' (' + aa_dict_r[triplets[triplet]] + ')', 'Yes']) exceptions.append([i+1, str(i*3+1) + ".." + str(i*3+3), str(genomic+1) + ".." + str(genomic+3), triplet, prot[i] + ' (' + aa_dict_r[prot[i]] + ')', triplets[triplet] + ' (' + aa_dict_r[triplets[triplet]] + ')', 'Yes'])
else: semaph = False
if semaph:
exceptions.append([i+1, str(i*3+1) + ".." + str(i*3+3), str(genomic+1) + ".." + str(genomic+3), triplet, prot[i] + ' (' + aa_dict_r[prot[i]] + ')', triplets[triplet] + ' (' + aa_dict_r[triplets[triplet]] + ')']) exceptions.append([i+1, str(i*3+1) + ".." + str(i*3+3), str(genomic+1) + ".." + str(genomic+3), triplet, prot[i] + ' (' + aa_dict_r[prot[i]] + ')', triplets[triplet] + ' (' + aa_dict_r[triplets[triplet]] + ')'])
prot[i] = triplets[triplet] prot[i] = triplets[triplet]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment