Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_GenomeDiagram.LabelTest Class Reference

List of all members.

Public Member Functions

def setUp
def finish
def add_track_with_sigils
def test_label_default

Public Attributes

 gdd
 gdt_features
 gds_features

Detailed Description

Check label positioning.

Definition at line 257 of file test_GenomeDiagram.py.


Member Function Documentation

Definition at line 290 of file test_GenomeDiagram.py.

00290 
00291     def add_track_with_sigils(self, **kwargs):
00292         self.gdt_features = self.gdd.new_track(1, greytrack=False)
00293         self.gds_features = self.gdt_features.new_set()
00294         for i in range(18):
00295             start = int((400 * i)/18.0)
00296             end = start + 17
00297             if i % 3 == 0:
00298                 strand=None
00299                 name = "Strandless"
00300                 color=colors.orange
00301             elif i % 3 == 1:
00302                 strand=+1
00303                 name="Forward"
00304                 color=colors.red
00305             else:
00306                 strand = -1
00307                 name="Reverse"
00308                 color=colors.blue
00309             feature = SeqFeature(FeatureLocation(start, end), strand=strand)
00310             self.gds_features.add_feature(feature, name=name,
00311                                           color=color, label=True, **kwargs)

Here is the caller graph for this function:

def test_GenomeDiagram.LabelTest.finish (   self,
  name,
  circular = True 
)

Definition at line 264 of file test_GenomeDiagram.py.

00264 
00265     def finish(self, name, circular=True):
00266         #And draw it...
00267         tracks = len(self.gdd.tracks)
00268         #Work arround the page orientation code being too clever
00269         #and flipping the h & w round:
00270         if tracks <= 3:
00271             orient = "landscape"
00272         else:
00273             orient = "portrait"
00274         self.gdd.draw(format='linear', orientation=orient,
00275                       tracklines=False,
00276                       pagesize=(15*cm,5*cm*tracks),
00277                       fragments=1,
00278                       start=0, end=400)
00279         self.gdd.write(os.path.join('Graphics', name+".pdf"), "pdf")
00280         #For the tutorial this might be useful:
00281         #self.gdd.write(os.path.join('Graphics', name+".png"), "png")
00282         if circular:
00283             #Circular diagram
00284             self.gdd.draw(tracklines=False,
00285                           pagesize=(15*cm,15*cm),
00286                           fragments=1,
00287                           circle_core=0.5,
00288                           start=0, end=400)
00289             self.gdd.write(os.path.join('Graphics', name+"_c.pdf"), "pdf")
    

Here is the caller graph for this function:

Definition at line 259 of file test_GenomeDiagram.py.

00259 
00260     def setUp(self):
00261         self.gdd = Diagram('Test Diagram', circular=False,
00262                            y=0.01, yt=0.01, yb=0.01,
00263                            x=0.01, xl=0.01, xr=0.01)

Feature labels - default.

Definition at line 312 of file test_GenomeDiagram.py.

00312 
00313     def test_label_default(self):
00314         """Feature labels - default."""
00315         self.add_track_with_sigils()
00316         self.finish("labels_default")

Here is the call graph for this function:


Member Data Documentation

Definition at line 260 of file test_GenomeDiagram.py.

Definition at line 292 of file test_GenomeDiagram.py.

Definition at line 291 of file test_GenomeDiagram.py.


The documentation for this class was generated from the following file: