Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(460)  |  Call(417)  |  Derive(0)  |  Import(43)
Specify the location of a feature along a sequence.

The FeatureLocation is used for simple continous features, which can
be described as running from a start position to and end position
(optionally with a strand and reference information).  More complex
locations made up from several non-continuous parts (e.g. a coding
sequence made up of several exons) are currently described using a
SeqFeature with sub-features.

Note that the start and end location numbering follow Python's scheme,(more...)

src/b/i/biopython-1.63/Doc/examples/Proux_et_al_2002_Figure_6.py   biopython(Download)
 
from Bio import SeqIO
from Bio.SeqFeature import SeqFeature, FeatureLocation
 
name = "Proux Fig 6"
        border = colors.lightgrey
        f_x = get_feature(features_X, x)
        F_x = set_X.add_feature(SeqFeature(FeatureLocation(f_x.location.start, f_x.location.end, strand=0)),
                                color=color, border=border)
        f_y = get_feature(features_Y, y)
        F_y = set_Y.add_feature(SeqFeature(FeatureLocation(f_y.location.start, f_y.location.end, strand=0)),

src/b/i/biopython-HEAD/Doc/examples/Proux_et_al_2002_Figure_6.py   biopython(Download)
 
from Bio import SeqIO
from Bio.SeqFeature import SeqFeature, FeatureLocation
 
name = "Proux Fig 6"
        border = colors.lightgrey
        f_x = get_feature(features_X, x)
        F_x = set_X.add_feature(SeqFeature(FeatureLocation(f_x.location.start, f_x.location.end, strand=0)),
                                color=color, border=border)
        f_y = get_feature(features_Y, y)
        F_y = set_Y.add_feature(SeqFeature(FeatureLocation(f_y.location.start, f_y.location.end, strand=0)),

src/b/i/biopython-1.63/Doc/examples/ACT_example.py   biopython(Download)
from Bio.Blast.Applications import NcbitblastxCommandline
from Bio.Graphics.GenomeDiagram import Diagram, CrossLink
from Bio.SeqFeature import SeqFeature, FeatureLocation
from Bio import SeqIO
 
            c = colors.Color(1, 0, 0, alpha=0.25)
            b = False
        q_feature = q_set.add_feature(SeqFeature(FeatureLocation(q_start-1, q_end)),
                                                 color=c, border=b)
        s_feature = s_set.add_feature(SeqFeature(FeatureLocation(s_start-1, s_end)),

src/b/i/biopython-HEAD/Doc/examples/ACT_example.py   biopython(Download)
from Bio.Blast.Applications import NcbitblastxCommandline
from Bio.Graphics.GenomeDiagram import Diagram, CrossLink
from Bio.SeqFeature import SeqFeature, FeatureLocation
from Bio import SeqIO
 
            c = colors.Color(1, 0, 0, alpha=0.25)
            b = False
        q_feature = q_set.add_feature(SeqFeature(FeatureLocation(q_start-1, q_end)),
                                                 color=c, border=b)
        s_feature = s_set.add_feature(SeqFeature(FeatureLocation(s_start-1, s_end)),

src/p/i/picobio-HEAD/assembly_comparison/assembly_comparison.py   picobio(Download)
 
from Bio import SeqIO
from Bio.SeqFeature import SeqFeature, FeatureLocation
from Bio.Blast.Applications import NcbiblastnCommandline
 
gd_feature_set = gd_track_for_features.new_set()
#Add a dark grey background
gd_feature_set.add_feature(SeqFeature(FeatureLocation(0, len(record))),
                           sigil="BOX", color="grey", label=False),
 
        #Add Jaggy
        #print("Adding jaggy from %i to %i" % (offset, offset+SPACER))
        gd_feature_set.add_feature(SeqFeature(FeatureLocation(offset, offset+SPACER)),
                                   sigil="JAGGY",
                                   color=colors.slategrey, border=colors.black)
        offset += SPACER
    ref_offsets[hack_ncbi_fasta_name(record.id)] = offset
    #print("Adding %s to inner reference track at offset %i" % (record.id, offset))
    #Add feature for whole contig,
    loc = FeatureLocation(offset, offset + len(record), strand=0)
            j += 1
        #print("Adding jaggy")
        gd_contig_features.add_feature(SeqFeature(FeatureLocation(offset+i, offset+j)),
                                       sigil="JAGGY",
                                       color=colors.slategrey, border=colors.black)

src/p/i/picobio-HEAD/assembly_comparison/multi_comparison.py   picobio(Download)
from Bio import SeqIO
from Bio.SeqIO.FastaIO import SimpleFastaParser
from Bio.SeqFeature import SeqFeature, FeatureLocation
from Bio.Blast.Applications import NcbiblastnCommandline
 
            j += 1
        print("Adding jaggy")
        gd_contig_features.add_feature(SeqFeature(FeatureLocation(offset+i, offset+j)),
                                       sigil="JAGGY",
                                       color=colors.slategrey, border=colors.black)
 
        #Add feature for whole contig,
        loc = FeatureLocation(offset, offset + contig_len, strand=0)
        gd_contig_features.add_feature(SeqFeature(loc), color=colors.grey, border=colors.black,
                                   label=True, name=contig_id)
            color = colors.Color(color.red, color.green, color.blue, alpha=(hsp.ident_pct/200.0))
            assert offset == contig_offsets[hack_ncbi_fasta_name(hsp.query_id)]
            loc = FeatureLocation(offset + hsp.query_start, offset + hsp.query_end, strand=0)
            query = gd_contig_features.add_feature(SeqFeature(loc), color=color, border=border)
            try:
                    stop_err("Could not find offset for hit %r in dict (query id %r)"
                             % (hsp.hit_id, hsp.query_id))
            loc = FeatureLocation(r_offset + hsp.hit_start, r_offset + hsp.hit_end, strand=0)
            hit = gd_ref_features.add_feature(SeqFeature(loc), color=color, border=border)
            gd_diagram.cross_track_links.append(CrossLink(query, hit, color, border, flip))

src/b/i/biopython-1.63/Bio/GenBank/__init__.py   biopython(Download)
            else:
                raise ValueError("Invalid between location %s" % repr(loc_str))
            return SeqFeature.FeatureLocation(pos, pos, strand)
        else:
            #e.g. "123"
            s = loc_str
            e = loc_str
    return SeqFeature.FeatureLocation(_pos(s, -1), _pos(e), strand)
              self._convert_to_python_numbers(int(start.strip()),
                                              int(end.strip()))
            this_location = SeqFeature.FeatureLocation(new_start, new_end)
            new_locations.append(this_location)
        return new_locations
            #e.g. "123..456"
            s, e = location_line.split("..")
            cur_feature.location = SeqFeature.FeatureLocation(int(s)-1,
                                                              int(e),
                                                              strand)
            for part in location_line[i+1:-1].split(","):
                s, e = part.split("..")
                f = SeqFeature.SeqFeature(SeqFeature.FeatureLocation(int(s)-1,
                                                                     int(e),
                                                                     strand),

src/b/i/biopython-HEAD/Bio/GenBank/__init__.py   biopython(Download)
            else:
                raise ValueError("Invalid between location %s" % repr(loc_str))
            return SeqFeature.FeatureLocation(pos, pos, strand)
        else:
            #e.g. "123"
            s = loc_str
            e = loc_str
    return SeqFeature.FeatureLocation(_pos(s, -1), _pos(e), strand)
              self._convert_to_python_numbers(int(start.strip()),
                                              int(end.strip()))
            this_location = SeqFeature.FeatureLocation(new_start, new_end)
            new_locations.append(this_location)
        return new_locations
            #e.g. "123..456"
            s, e = location_line.split("..")
            cur_feature.location = SeqFeature.FeatureLocation(int(s)-1,
                                                              int(e),
                                                              strand)
            for part in location_line[i+1:-1].split(","):
                s, e = part.split("..")
                f = SeqFeature.SeqFeature(SeqFeature.FeatureLocation(int(s)-1,
                                                                     int(e),
                                                                     strand),

src/b/i/biopython-1.63/Bio/SeqIO/SwissIO.py   biopython(Download)
def _make_seqfeature(name, from_res, to_res, description, ft_id):
    """Construct SeqFeature from feature data from parser (PRIVATE)."""
    loc = SeqFeature.FeatureLocation(_make_position(from_res, -1),
                                     _make_position(to_res, 0))
    if not ft_id:

src/b/i/biopython-HEAD/Bio/SeqIO/SwissIO.py   biopython(Download)
def _make_seqfeature(name, from_res, to_res, description, ft_id):
    """Construct SeqFeature from feature data from parser (PRIVATE)."""
    loc = SeqFeature.FeatureLocation(_make_position(from_res, -1),
                                     _make_position(to_res, 0))
    if not ft_id:

  1 | 2 | 3 | 4 | 5 | 6  Next