Ejemplo n.º 1
0
def syntax_checker():
    """
    Parse the given variant and render the syntax checker HTML form.
    """
    # Backwards compatibility.
    if 'variant' in request.args:
        return redirect(url_for('.syntax_checker',
                                description=request.args['variant']),
                        code=301)

    description = request.args.get('description')

    if not description:
        return render_template('syntax-checker.html')

    output = Output(__file__)
    output.addMessage(__file__, -1, 'INFO',
                      'Received request syntaxCheck(%s) from %s'
                      % (description, request.remote_addr))
    stats.increment_counter('syntax-checker/website')

    grammar = Grammar(output)
    grammar.parse(description)

    parse_error = output.getOutput('parseError')
    messages = map(util.message_info, output.getMessages())

    output.addMessage(__file__, -1, 'INFO',
                      'Finished request syntaxCheck(%s)' % description)

    return render_template('syntax-checker.html',
                           description=description,
                           messages=messages,
                           parse_error=parse_error)
Ejemplo n.º 2
0
    def _parseInput(self, variant):
        """
        Parse a variant.

        @arg variant: variant description
        @type variant: string

        @return: parsetree object
        @rtype: object
        """
        grammar = Grammar(self.__output)
        parseTree = grammar.parse(variant)
        if not parseTree:
            self.__output.addMessage(__file__, 4, "EPARSE",
                                     "Could not parse the given variant")
            return None
        #if
        if not (parseTree.RefSeqAcc or parseTree.LrgAcc):
            self.__output.addMessage(
                __file__, 4, "EONLYGB",
                "Currently we only support GenBank and LRG records")
            return None
        #if
        self.parseTree = parseTree
        return parseTree
Ejemplo n.º 3
0
def syntax_checker():
    """
    Parse the given variant and render the syntax checker HTML form.
    """
    # Backwards compatibility.
    if 'variant' in request.args:
        return redirect(url_for('.syntax_checker',
                                description=request.args['variant']),
                        code=301)

    description = request.args.get('description')

    if not description:
        return render_template('syntax-checker.html')

    output = Output(__file__)
    output.addMessage(__file__, -1, 'INFO',
                      'Received request syntaxCheck(%s) from %s'
                      % (description, request.remote_addr))
    stats.increment_counter('syntax-checker/website')

    grammar = Grammar(output)
    grammar.parse(description)

    parse_error = output.getOutput('parseError')
    messages = map(util.message_info, output.getMessages())

    output.addMessage(__file__, -1, 'INFO',
                      'Finished request syntaxCheck(%s)' % description)

    return render_template('syntax-checker.html',
                           description=description,
                           messages=messages,
                           parse_error=parse_error)
Ejemplo n.º 4
0
    def _processSyntaxCheck(self, batch_job, cmd, flags):
        """
        Process an entry from the Syntax Check, write the results
        to the job-file.

        Side-effect:
            - Output written to outputfile

        @arg cmd:   The Syntax Checker input
        @type cmd:
        @arg i:     The JobID
        @type i:
        @arg flags: Flags of the current entry
        @type flags:
        """
        output = Output(__file__)
        grammar = Grammar(output)

        output.addMessage(__file__, -1, "INFO",
                          "Received SyntaxChecker batchvariant " + cmd)

        stats.increment_counter('syntax-checker/batch')

        skip = self.__processFlags(output, flags)
        #Process
        if not skip:
            parsetree = grammar.parse(cmd)
        else:
            parsetree = None

        if parsetree:
            result = "OK"
        else:
            result = "|".join(output.getBatchMessages(2))

        #Output
        filename = "%s/batch-job-%s.txt" % (settings.CACHE_DIR,
                                            batch_job.result_id)
        if not os.path.exists(filename):
            # If the file does not yet exist, create it with the correct
            # header above it. The header is read from the config file as
            # a list. We need a tab delimited string.
            header = ['Input', 'Status']
            handle = io.open(filename, mode='a', encoding='utf-8')
            handle.write("%s\n" % "\t".join(header))
        #if
        else:
            handle = io.open(filename, mode='a', encoding='utf-8')

        if flags and 'C' in flags:
            separator = '\t'
        else:
            separator = '\n'

        handle.write("%s\t%s%s" % (cmd, result, separator))
        handle.close()
        output.addMessage(__file__, -1, "INFO",
                          "Finished SyntaxChecker batchvariant " + cmd)
Ejemplo n.º 5
0
    def _processSyntaxCheck(self, batch_job, cmd, flags):
        """
        Process an entry from the Syntax Check, write the results
        to the job-file.

        Side-effect:
            - Output written to outputfile

        @arg cmd:   The Syntax Checker input
        @type cmd:
        @arg i:     The JobID
        @type i:
        @arg flags: Flags of the current entry
        @type flags:
        """
        output = Output(__file__)
        grammar = Grammar(output)

        output.addMessage(__file__, -1, "INFO",
                           "Received SyntaxChecker batchvariant " + cmd)

        stats.increment_counter('syntax-checker/batch')

        skip = self.__processFlags(output, flags)
        #Process
        if not skip :
            parsetree = grammar.parse(cmd)
        else :
            parsetree = None

        if parsetree :
            result = "OK"
        else :
            result = "|".join(output.getBatchMessages(2))

        #Output
        filename = "%s/batch-job-%s.txt" % (settings.CACHE_DIR, batch_job.result_id)
        if not os.path.exists(filename) :
            # If the file does not yet exist, create it with the correct
            # header above it. The header is read from the config file as
            # a list. We need a tab delimited string.
            header = ['Input', 'Status']
            handle = io.open(filename, mode='a', encoding='utf-8')
            handle.write("%s\n" % "\t".join(header))
        #if
        else :
            handle = io.open(filename, mode='a', encoding='utf-8')

        if flags and 'C' in flags:
            separator = '\t'
        else:
            separator = '\n'

        handle.write("%s\t%s%s" % (cmd, result, separator))
        handle.close()
        output.addMessage(__file__, -1, "INFO",
                          "Finished SyntaxChecker batchvariant " + cmd)
Ejemplo n.º 6
0
    def _parseInput(self, variant) :
        """
        Parse a variant.

        @arg variant: variant description
        @type variant: string

        @return: parsetree object
        @rtype: object
        """
        grammar = Grammar(self.__output)
        parseTree = grammar.parse(variant)
        if not parseTree :
            self.__output.addMessage(__file__, 4, "EPARSE",
                    "Could not parse the given variant")
            return None
        #if
        if not (parseTree.RefSeqAcc or parseTree.LrgAcc):
            self.__output.addMessage(__file__, 4, "EONLYGB",
                "Currently we only support GenBank and LRG records")
            return None
        #if
        self.parseTree = parseTree
        return parseTree
Ejemplo n.º 7
0
def position_converter():
    """
    Position converter.
    """
    # Backwards compatibility.
    if 'variant' in request.args:
        return redirect(url_for('.position_converter',
                                description=request.args['variant']),
                        code=301)

    assemblies = Assembly.query \
        .order_by(*Assembly.order_by_criteria) \
        .all()

    assembly_name_or_alias = request.args.get('assembly_name_or_alias',
                                              settings.DEFAULT_ASSEMBLY)
    description = request.args.get('description')

    if not description:
        return render_template('position-converter.html',
                               assemblies=assemblies,
                               assembly_name_or_alias=assembly_name_or_alias)

    output = Output(__file__)
    output.addMessage(__file__, -1, 'INFO',
                      'Received request positionConverter(%s, %s) from %s'
                      % (assembly_name_or_alias, description,
                         request.remote_addr))
    stats.increment_counter('position-converter/website')

    chromosomal_description = None
    transcript_descriptions = None

    try:
        assembly = Assembly.by_name_or_alias(assembly_name_or_alias)
    except NoResultFound:
        output.addMessage(__file__, 3, 'ENOASSEMBLY',
                          'Not a valid assembly.')
    else:
        converter = Converter(assembly, output)

        # Convert chromosome name to accession number.
        corrected_description = converter.correctChrVariant(description)

        if corrected_description:
            # Now we're ready to actually do position conversion.
            if not(':c.' in corrected_description or
                   ':n.' in corrected_description or
                   ':g.' in corrected_description or
                   ':m.' in corrected_description):
                grammar = Grammar(output)
                grammar.parse(corrected_description)

            if (':c.' in corrected_description or
                ':n.' in corrected_description):
                corrected_description = converter.c2chrom(
                        corrected_description)

            chromosomal_description = corrected_description

            if corrected_description and (':g.' in corrected_description or
                                          ':m.' in corrected_description):
                descriptions = converter.chrom2c(corrected_description, 'dict')
                if descriptions is None:
                    chromosomal_description = None
                elif descriptions:
                    transcript_descriptions = [
                        '%-10s:\t%s' % (key[:10], '\n\t\t'.join(value))
                        for key, value in descriptions.items()]

    messages = map(util.message_info, output.getMessages())

    output.addMessage(__file__, -1, 'INFO',
                      'Finished request positionConverter(%s, %s)'
                      % (assembly_name_or_alias, description))

    return render_template('position-converter.html',
                           assemblies=assemblies,
                           assembly_name_or_alias=assembly_name_or_alias,
                           description=description,
                           chromosomal_description=chromosomal_description,
                           transcript_descriptions=transcript_descriptions,
                           messages=messages)
Ejemplo n.º 8
0
def position_converter():
    """
    Position converter.
    """
    # Backwards compatibility.
    if 'variant' in request.args:
        return redirect(url_for('.position_converter',
                                description=request.args['variant']),
                        code=301)

    assemblies = Assembly.query \
        .order_by(*Assembly.order_by_criteria) \
        .all()

    assembly_name_or_alias = request.args.get('assembly_name_or_alias',
                                              settings.DEFAULT_ASSEMBLY)
    description = request.args.get('description')

    if not description:
        return render_template('position-converter.html',
                               assemblies=assemblies,
                               assembly_name_or_alias=assembly_name_or_alias)

    output = Output(__file__)
    output.addMessage(__file__, -1, 'INFO',
                      'Received request positionConverter(%s, %s) from %s'
                      % (assembly_name_or_alias, description,
                         request.remote_addr))
    stats.increment_counter('position-converter/website')

    chromosomal_description = None
    transcript_descriptions = None

    try:
        assembly = Assembly.by_name_or_alias(assembly_name_or_alias)
    except NoResultFound:
        output.addMessage(__file__, 3, 'ENOASSEMBLY',
                          'Not a valid assembly.')
    else:
        converter = Converter(assembly, output)

        # Convert chromosome name to accession number.
        corrected_description = converter.correctChrVariant(description)

        if corrected_description:
            # Now we're ready to actually do position conversion.
            if not(':c.' in corrected_description or
                   ':n.' in corrected_description or
                   ':g.' in corrected_description or
                   ':m.' in corrected_description):
                grammar = Grammar(output)
                grammar.parse(corrected_description)

            if (':c.' in corrected_description or
                ':n.' in corrected_description):
                corrected_description = converter.c2chrom(
                        corrected_description)

            chromosomal_description = corrected_description

            if corrected_description and (':g.' in corrected_description or
                                          ':m.' in corrected_description):
                descriptions = converter.chrom2c(corrected_description, 'dict')
                if descriptions is None:
                    chromosomal_description = None
                elif descriptions:
                    transcript_descriptions = [
                        '%-10s:\t%s' % (key[:10], '\n\t\t'.join(value))
                        for key, value in descriptions.items()]

    messages = map(util.message_info, output.getMessages())

    output.addMessage(__file__, -1, 'INFO',
                      'Finished request positionConverter(%s, %s)'
                      % (assembly_name_or_alias, description))

    return render_template('position-converter.html',
                           assemblies=assemblies,
                           assembly_name_or_alias=assembly_name_or_alias,
                           description=description,
                           chromosomal_description=chromosomal_description,
                           transcript_descriptions=transcript_descriptions,
                           messages=messages)
Ejemplo n.º 9
0
    def _processConversion(self, batch_job, cmd, flags):
        """
        Process an entry from the Position Converter, write the results
        to the job-file. The Position Converter is wrapped in a try except
        block which ensures that he Batch Process keeps running. Errors
        are caught and the user will be notified.

        Side-effect:
            - Output written to outputfile.

        @arg cmd: The Syntax Checker input
        @type cmd: unicode
        @arg i: The JobID
        @type i: integer
        @arg build: The build to use for the converter
        @type build: unicode
        @arg flags: Flags of the current entry
        @type flags:
        """
        O = Output(__file__)
        variant = cmd
        variants = None
        gName = ""
        cNames = [""]

        O.addMessage(__file__, -1, "INFO",
            "Received PositionConverter batchvariant " + cmd)

        stats.increment_counter('position-converter/batch')

        skip = self.__processFlags(O, flags)
        if not skip :
            try :
                #process
                try:
                    assembly = Assembly.by_name_or_alias(batch_job.argument)
                except NoResultFound:
                    O.addMessage(__file__, 3, 'ENOASSEMBLY',
                                 'Not a valid assembly: ' + batch_job.argument)
                    raise

                converter = Converter(assembly, O)

                #Also accept chr accNo
                variant = converter.correctChrVariant(variant)

                #TODO: Parse the variant and check for c or g. This is ugly
                if not(":c." in variant or ":n." in variant or ":g." in variant) :
                    #Bad name
                    grammar = Grammar(O)
                    grammar.parse(variant)
                #if

                if ":c." in variant or ":n." in variant :
                    # Do the c2chrom dance
                    variant = converter.c2chrom(variant)
                    # NOTE:
                    # If we received a coding reference convert that to the
                    # genomic position variant. Use that variant as the input
                    # of the chrom2c.

                # If the input is a genomic variant or if we converted a
                # coding variant to a genomic variant we try to find all
                # other affected coding variants.
                if variant and ":g." in variant :
                    # Do the chrom2c dance
                    variants = converter.chrom2c(variant, "dict")
                    if variants :
                        gName = variant
                        # Due to the cyclic behavior of the Position Converter
                        # we know for a fact that if a correct chrom name is
                        # generated by the converter.c2chrom that we will at
                        # least find one variant with chrom2c. Collect the
                        # variants from a nested lists and store them.
                        cNames = [cName for cName2 in variants.values() \
                                for cName in cName2]
            except Exception:
                #Catch all exceptions related to the processing of cmd
                O.addMessage(__file__, 4, "EBATCHU",
                        "Unexpected error occurred, dev-team notified")
            #except
        #if

        error = "%s" % "|".join(O.getBatchMessages(2))

        #Output
        filename = "%s/batch-job-%s.txt" % (settings.CACHE_DIR, batch_job.result_id)
        if not os.path.exists(filename) :
            # If the file does not yet exist, create it with the correct
            # header above it. The header is read from the config file as
            # a list. We need a tab delimited string.
            header = ['Input Variant',
                      'Errors',
                      'Chromosomal Variant',
                      'Coding Variant(s)']
            handle = io.open(filename, mode='a', encoding='utf-8')
            handle.write("%s\n" % "\t".join(header))
        #if
        else :
            handle = io.open(filename, mode='a', encoding='utf-8')

        if flags and 'C' in flags:
            separator = '\t'
        else:
            separator = '\n'

        handle.write("%s\t%s\t%s\t%s%s" % (cmd, error, gName, "\t".join(cNames), separator))
        handle.close()
        O.addMessage(__file__, -1, "INFO",
            "Finisehd PositionConverter batchvariant " + cmd)
Ejemplo n.º 10
0
    def _processConversion(self, batch_job, cmd, flags):
        """
        Process an entry from the Position Converter, write the results
        to the job-file. The Position Converter is wrapped in a try except
        block which ensures that he Batch Process keeps running. Errors
        are caught and the user will be notified.

        Side-effect:
            - Output written to outputfile.

        @arg cmd: The Syntax Checker input
        @type cmd: unicode
        @arg i: The JobID
        @type i: integer
        @arg build: The build to use for the converter
        @type build: unicode
        @arg flags: Flags of the current entry
        @type flags:
        """
        O = Output(__file__)
        variant = cmd
        variants = None
        gName = ""
        cNames = [""]

        O.addMessage(__file__, -1, "INFO",
                     "Received PositionConverter batchvariant " + cmd)

        stats.increment_counter('position-converter/batch')

        skip = self.__processFlags(O, flags)
        if not skip:
            try:
                #process
                try:
                    assembly = Assembly.by_name_or_alias(batch_job.argument)
                except NoResultFound:
                    O.addMessage(__file__, 3, 'ENOASSEMBLY',
                                 'Not a valid assembly: ' + batch_job.argument)
                    raise

                converter = Converter(assembly, O)

                #Also accept chr accNo
                variant = converter.correctChrVariant(variant)

                #TODO: Parse the variant and check for c or g. This is ugly
                if not (":c." in variant or ":n." in variant
                        or ":g." in variant):
                    #Bad name
                    grammar = Grammar(O)
                    grammar.parse(variant)
                #if

                if ":c." in variant or ":n." in variant:
                    # Do the c2chrom dance
                    variant = converter.c2chrom(variant)
                    # NOTE:
                    # If we received a coding reference convert that to the
                    # genomic position variant. Use that variant as the input
                    # of the chrom2c.

                # If the input is a genomic variant or if we converted a
                # coding variant to a genomic variant we try to find all
                # other affected coding variants.
                if variant and ":g." in variant:
                    # Do the chrom2c dance
                    variants = converter.chrom2c(variant, "dict")
                    if variants:
                        gName = variant
                        # Due to the cyclic behavior of the Position Converter
                        # we know for a fact that if a correct chrom name is
                        # generated by the converter.c2chrom that we will at
                        # least find one variant with chrom2c. Collect the
                        # variants from a nested lists and store them.
                        cNames = [cName for cName2 in variants.values() \
                                for cName in cName2]
            except Exception:
                #Catch all exceptions related to the processing of cmd
                O.addMessage(__file__, 4, "EBATCHU",
                             "Unexpected error occurred, dev-team notified")
            #except
        #if

        error = "%s" % "|".join(O.getBatchMessages(2))

        #Output
        filename = "%s/batch-job-%s.txt" % (settings.CACHE_DIR,
                                            batch_job.result_id)
        if not os.path.exists(filename):
            # If the file does not yet exist, create it with the correct
            # header above it. The header is read from the config file as
            # a list. We need a tab delimited string.
            header = [
                'Input Variant', 'Errors', 'Chromosomal Variant',
                'Coding Variant(s)'
            ]
            handle = io.open(filename, mode='a', encoding='utf-8')
            handle.write("%s\n" % "\t".join(header))
        #if
        else:
            handle = io.open(filename, mode='a', encoding='utf-8')

        if flags and 'C' in flags:
            separator = '\t'
        else:
            separator = '\n'

        handle.write("%s\t%s\t%s\t%s%s" %
                     (cmd, error, gName, "\t".join(cNames), separator))
        handle.close()
        O.addMessage(__file__, -1, "INFO",
                     "Finisehd PositionConverter batchvariant " + cmd)
Ejemplo n.º 11
0
 def setup(self):
     super(TestGrammar, self).setup()
     self.output = Output(__file__)
     self.grammar = Grammar(self.output)
Ejemplo n.º 12
0
class TestGrammar(MutalyzerTest):
    """
    Test the mytalyzer.grammar module.
    """
    def setup(self):
        super(TestGrammar, self).setup()
        self.output = Output(__file__)
        self.grammar = Grammar(self.output)

    def _parse(self, description):
        """
        Parse a variant description.
        """
        self.grammar.parse(description)
        assert self.output.getOutput('parseError') == []

    def test_some_variants(self):
        """
        Some example variants.
        """
        self._parse('NM_002001.2:c.[12del]')
        self._parse('NM_002001.2:c.[(12del)]')
        self._parse('NM_002001.2:c.[(12del)?]')
        self._parse('NM_002001.2:c.[(12del);(12del)]')
        self._parse('NM_002001.2:c.[(12del;12del)]')
        self._parse('NM_002001.2:c.[((12del)?;12del)?]')

    def test_compound_insertion(self):
        """
        Some some compound insertions.
        """
        self._parse('NM_002001.2:c.15_16insA')
        self._parse('NM_002001.2:c.15_16insATC')
        self._parse('NM_002001.2:c.15_16ins[A]')
        self._parse('NM_002001.2:c.15_16ins[ATC]')
        self._parse('NM_002001.2:c.15_16ins28_39')
        self._parse('NM_002001.2:c.15_16ins[28_39]')
        self._parse('NM_002001.2:c.15_16ins[28_39;A]')
        self._parse('NM_002001.2:c.15_16ins[28_39;ATC]')
        self._parse('NM_002001.2:c.15_16ins[28_39;A;ATC]')
        self._parse('NM_002001.2:c.15_16ins28_39inv')
        self._parse('NM_002001.2:c.15_16ins[28_39inv]')
        self._parse('NM_002001.2:c.15_16ins[28_39inv;A]')
        self._parse('NM_002001.2:c.15_16ins[28_39inv;ATC]')
        self._parse('NM_002001.2:c.15_16ins[28_39inv;A;ATC]')

    def test_compound_delins(self):
        """
        Some some compound deletion-insertions.
        """
        self._parse('NM_002001.2:c.12_17delinsA')
        self._parse('NM_002001.2:c.12_17delinsATC')
        self._parse('NM_002001.2:c.12_17delins[A]')
        self._parse('NM_002001.2:c.12_17delins[ATC]')
        self._parse('NM_002001.2:c.12_17delins28_39')
        self._parse('NM_002001.2:c.12_17delins[28_39]')
        self._parse('NM_002001.2:c.12_17delins[28_39;A]')
        self._parse('NM_002001.2:c.12_17delins[28_39;ATC]')
        self._parse('NM_002001.2:c.12_17delins[28_39;A;ATC]')
        self._parse('NM_002001.2:c.12_17delins28_39inv')
        self._parse('NM_002001.2:c.12_17delins[28_39inv]')
        self._parse('NM_002001.2:c.12_17delins[28_39inv;A]')
        self._parse('NM_002001.2:c.12_17delins[28_39inv;ATC]')
        self._parse('NM_002001.2:c.12_17delins[28_39inv;A;ATC]')

    def test_protein_variants(self):
        """
        Some protein variants.
        """
        self._parse('NG_009105.1(OPN1LW):p.=')
        self._parse('NG_009105.1(OPN1LW):p.?')
        self._parse('NM_000076.2(CDKN1C):p.0')
        self._parse('NM_000076.2(CDKN1C):p.0?')
        self._parse('NG_009105.1(OPN1LW):p.(=)')
        self._parse('NM_000076.2(CDKN1C):p.(Ala123del)')
        self._parse('NM_000076.2(CDKN1C):p.(Ala123_Leu126del)')
        self._parse('NM_000076.2(CDKN1C):p.(Ala123_Leu126delinsVal)')
        self._parse('NM_000076.2(CDKN1C):p.Ala123del')
        self._parse('NM_000076.2(CDKN1C):p.Ala123_Leu126del')
        self._parse('NM_000076.2(CDKN1C):p.Ala123_Leu126delinsVal')
        self._parse('NM_000076.2(CDKN1C):p.Ala123_*317delinsVal')
        self._parse('NM_000076.2(CDKN1C):p.Ala123_X317delinsVal')
        self._parse('NM_000076.2(CDKN1C):p.Ala123delinsVal')
        self._parse('NM_000076.2(CDKN1C):p.Ala123delinsValPro')
        self._parse('NM_000076.2(CDKN1C):p.Ala123delinsVP')
        self._parse('NM_000076.2(CDKN1C):p.Ala123fs')
        self._parse('NM_000076.2(CDKN1C_i001):p.(Glu124Serfs*148)')
        self._parse('NM_000076.2(CDKN1C_i001):p.(Glu124SerfsX148)')
        self._parse('NM_000076.2(CDKN1C_i001):p.(E124Sfs*148)')
        self._parse('NM_000076.2(CDKN1C_i001):p.(E124SfsX148)')
        self._parse('NG_009105.1(OPN1LW):p.Met1Leu')
        self._parse('NP_064445.1(OPN1LW):p.Met1?')
        self._parse('NP_064445.1(OPN1LW):p.M1?')
        self._parse('NP_064445.1:p.Gln16del')
        self._parse('NP_064445.1:p.Gln16dup')
        self._parse('NP_064445.1:p.Gln3del')
        self._parse('NP_064445.1:p.Q16del')
        self._parse('NP_064445.1:p.Q16dup')
        self._parse('NP_064445.1:p.Q16*')
        self._parse('NP_064445.1:p.Q16X')
        self._parse('NG_009105.1:p.Gln3Leu')
        self._parse('NG_009105.1(OPN1LW):p.Gln3Leu')
        self._parse('NG_009105.1(OPN1LW_i1):p.Gln3Leu')
        self._parse('NG_009105.1(OPN1LW_v1):p.Gln3Leu')
        self._parse('NG_009105.1(OPN1LW):p.Gln3_Gln4insLeu')
        self._parse('NG_009105.1(OPN1LW):p.Gln3_Gln4insGln')
        self._parse('NG_009105.1(OPN1LW):p.Gln3_Gln4dup')
        self._parse('NG_009105.1(OPN1LW):p.Q3_Q4insQ')
        self._parse('NG_009105.1(OPN1LW):p.Q3_Q4insQQ')
        self._parse('NG_009105.1(OPN1LW):p.Q3_Q4dup')
        self._parse('NG_009105.1(OPN1LW):p.Gln3_Leu7del')
        self._parse('NG_009105.1(OPN1LW):p.Gln3_Leu7delinsValLeu')
        self._parse('NG_009105.1(OPN1LW):p.Gln3_Leu7delinsValPro')
        self._parse('NG_009105.1(OPN1LW):p.Gln3_Leu7delinsGlnGlnTrpSerLeu')
        self._parse('NG_009105.1(OPN1LW):p.Q3_L7delinsGlnGlnTrpSerLeu')
        self._parse('NG_009105.1(OPN1LW):p.Gln3_Leu7delinsQQWSL')
        #self._parse('NG_009105.1(OPN1LW):p.Met1AlaextMet-1')
        #self._parse('NG_009105.1(OPN1LW):p.M1AextM-1')
        #self._parse('NG_009105.1(OPN1LW):p.Gln3_Leu7[3]')
        self._parse('NG_009105.1(OPN1LW):p.Gln3_Leu7(1_6)')
        self._parse('NG_009105.1(OPN1LW):p.Gln3Leu')
        self._parse('NG_009105.1(OPN1LW):p.Gln3Leu')
        #self._parse('NM_000076.2(CDKN1C_i001):p.(*317Trpext*3)')
        self._parse('NM_000076.2(CDKN1C_i001):p.(*317TrpextX3)')
        #self._parse('NM_000076.2(CDKN1C_i001):p.(*317Cysext*1)')
        self._parse('NM_000076.2(CDKN1C_i001):p.(*317CysextX1)')
        #self._parse('NM_000076.2(CDKN1C_i001):p.(*317Cext*1)')
        self._parse('NM_000076.2(CDKN1C_i001):p.(*317CextX1)')
        #self._parse('t(X;17)(DMD:p.Met1_Val1506; SGCA:p.Val250_*387)')

    def test_minus_in_gene_symbol(self):
        """
        Gene symbol is allowed to contain a minus character.
        """
        self._parse('UD_132464528477(KRTAP2-4_v001):c.100del')
Ejemplo n.º 13
0
def grammar(output):
    return Grammar(output)