Std.feature_qualifier_description(Martel.UntilEol()) + \
           Martel.AnyEol() + \
           Martel.Rep(
               Martel.Str("FT                   ") + \
               (Martel.AssertNot(Martel.Str("/")) |
               Martel.AssertNot(Martel.Re(r"/\w+="))) + \
           Std.feature_qualifier_description(Martel.UntilEol()) + \
               Martel.AnyEol())

feature_qualifier = Std.feature_qualifier(
    Martel.Str("FT                   /") + \
    (fq_dbxref | fq_generic))

feature = Std.feature(
    Martel.Str("FT   ") + \
    Std.feature_name(Martel.UntilSep(sep = " ")) + \
    whitespace + \
    Std.feature_location(Martel.UntilEol()) + \
    Martel.AnyEol() + \
    Martel.Rep(Martel.Str("FT                   ") + \
               Martel.AssertNot(Martel.Str("/")) + \
               Std.feature_location(Martel.UntilEol()) + \
               Martel.AnyEol()
               ) + \
    Martel.Rep(feature_qualifier)
    )
    
FT_block = Std.feature_block(Martel.Rep(feature),
                             {"location-style": "genbank"})

                         
示例#2
0
feature_key = Martel.Group("feature_key",
                           Martel.Alt(*valid_feature_keys))

location = Martel.Group("location",
                        Std.feature_location(Martel.UntilEol()) +
                        Martel.AnyEol() +
                        Martel.Rep(qualifier_space + 
                                   Martel.AssertNot(Martel.Str("/")) +
                                   Std.feature_location(Martel.UntilEol()) +
                                   Martel.AnyEol())
                        )


feature_key_line = Martel.Group("feature_key_line",
                                big_indent_space +
                                Std.feature_name(feature_key) +
                                Martel.Spaces() +
                                location)

# -- now set up all of the info we can have for qualifiers
# a listing of valid qualifier keys
# For now use a simple list and get all of the matching text.
# In the future could allow more specific matches for each key.
# XXX Because of a bug in Martel, if one name is a substring of
# XXX another, put the longer name first.  Eg, "clone_lib" before "clone"
feature_qualifier_names = (
    "allele",         # Name of the allele for the a given gene
    "anticodon",      # Location of the anticodon of tRNA and the amino
                      #   acid for which it codes
    "bound_moiety",   # Moiety bound
    "cell_line",      # Cell line from which the sequence was obtained
# "FT   " + ".{8}" + " " + ".{6}" + " " + ".{6}" + "       " + "[^\R]*" + "\R"
# "FT   .{8} .{6} .{6}       [^\R]*\R"

##FT_range = Martel.Group("FT",
##                        Martel.Re("FT   (?P<ft_name>.{8}) " \
##                                  "(?P<ft_from>.{6}) (?P<ft_to>.{6})" \
##                                  "(       (?P<ft_description>[^\R]*))?\R")
##                        )
##FT_continuation = Martel.Group("FT_continuation",
##                        Martel.Re("FT                                " \
##                                  "(?P<ft_description>[^\R]*)\R")
##                        )
##FT = Martel.Group("feature", FT_range + Martel.Rep(FT_continuation))

FT_name = Std.feature_name(Martel.Re(r".{8}"))
FT_start = Std.feature_location_start(Martel.Re(r".{6}"))
FT_end = Std.feature_location_end(Martel.Re(r".{6}"))
FT_desc = Std.feature_description(Martel.UntilEol())

FT_range = Martel.Str("FT   ") + \
           FT_name + \
           Martel.Str(" ") + \
           FT_start + \
           Martel.Str(" ") + \
           FT_end + \
           Martel.Opt(Martel.Str("       ") + \
                      FT_desc) + \
           Martel.AnyEol()

FT_continuation = Martel.Str("FT                                ") + \