Commit 2e1fe445 authored by Alisa Muraveva's avatar Alisa Muraveva
Browse files

Some stupid mistakes were fixed

git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/branches/mobile-2013@739 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
parent 244b7001
...@@ -112,7 +112,7 @@ class Locus(object) : ...@@ -112,7 +112,7 @@ class Locus(object) :
self.linkMethod = None self.linkMethod = None
self.transcriptProduct = None self.transcriptProduct = None
self.proteinProduct = None self.proteinProduct = None
self.nonusableList = []
#__init__ #__init__
def cancelDescription(self): def cancelDescription(self):
...@@ -298,6 +298,7 @@ class Record(object) : ...@@ -298,6 +298,7 @@ class Record(object) :
self.chromDescription = "" self.chromDescription = ""
self.orientation = 1 self.orientation = 1
self.recordId = None self.recordId = None
self.nonusableList = []
#__init__ #__init__
def findGene(self, name) : def findGene(self, name) :
......
...@@ -621,10 +621,10 @@ class GBparser(): ...@@ -621,10 +621,10 @@ class GBparser():
myRealGene.transcriptList.append(myTranscript) myRealGene.transcriptList.append(myTranscript)
#if #if
else: else:
if not i.gene in myTranscript.nonusableList: if not i.gene in record.nonusableList:
output.addMessage(__file__, 2, 'WPOSITION', output.addMessage(__file__, 2, 'WPOSITION',
"The gene's {0} coordinates extend beyond transcript".format(i.gene)) "The gene's {0} coordinates extend beyond transcript".format(i.gene))
myTranscript.nonusableList.append(i.gene) record.nonusableList.append(i.gene)
#for #for
for i in myGene.cdsList : for i in myGene.cdsList :
if not i.linked and \ if not i.linked and \
......
...@@ -1366,7 +1366,7 @@ def _add_transcript_info(mutator, transcript, output): ...@@ -1366,7 +1366,7 @@ def _add_transcript_info(mutator, transcript, output):
if str(cds_original[0:3]) in \ if str(cds_original[0:3]) in \
Bio.Data.CodonTable.unambiguous_dna_by_id \ Bio.Data.CodonTable.unambiguous_dna_by_id \
[transcript.txTable].start_codons: [transcript.txTable].start_codons:
output.addMessage(__file__,2, "WSTART", 'Non canonical start codon {0} was found in reference protein'.format(cds_original[0:3])) output.addMessage(__file__,2, "WSTART", 'Non canonical start codon {0} was found in the reference protein'.format(cds_original[0:3]))
else: else:
output.addMessage(__file__,2, "WSTART", '{0} codon of {1} was not found in table of start codons for current organism '.format(cds_original[0:3], transcript.locusTag)) output.addMessage(__file__,2, "WSTART", '{0} codon of {1} was not found in table of start codons for current organism '.format(cds_original[0:3], transcript.locusTag))
if str(cds_variant[0:3]) in \ if str(cds_variant[0:3]) in \
...@@ -1502,6 +1502,10 @@ def process_variant(mutator, description, record, output): ...@@ -1502,6 +1502,10 @@ def process_variant(mutator, description, record, output):
genes = record.record.listGenes() genes = record.record.listGenes()
transcript_id = transcript_id and "%.3i" % int(transcript_id) transcript_id = transcript_id and "%.3i" % int(transcript_id)
locus = list(record.record.locusDict) locus = list(record.record.locusDict)
if locus:
gene_names = locus
else:
gene_names = genes
if gene_symbol in genes: if gene_symbol in genes:
# We found our gene. # We found our gene.
gene = record.record.findGene(gene_symbol) gene = record.record.findGene(gene_symbol)
...@@ -1515,12 +1519,12 @@ def process_variant(mutator, description, record, output): ...@@ -1515,12 +1519,12 @@ def process_variant(mutator, description, record, output):
gene = record.record.geneList[0] gene = record.record.geneList[0]
else: else:
output.addMessage(__file__, 4, "EINVALIDGENE", output.addMessage(__file__, 4, "EINVALIDGENE",
"No gene specified. Please choose from: %s" % ", ".join(locus)) "No gene specified. Please choose from: %s" % ", ".join(gene_names))
else: else:
output.addMessage(__file__, 4, "EINVALIDGENE", output.addMessage(__file__, 4, "EINVALIDGENE",
"Gene %s not found. Please choose from: %s" % ( "Gene %s not found. Please choose from: %s" % (
gene_symbol, ", ".join(genes))) gene_symbol, ", ".join(gene_names)))
if gene: if gene:
# Find transcript. # Find transcript.
......
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