Beispiel #1
0
 def testGetRegionSequence(self):
     rows = self.queries.getRegionSequence("Pf3D7_01")
     row = rows[0]
     
     length = row["length"]
     start = 1
     end = 10
     
     dna = row["dna"]
     dna = dna[start-1:end-1]
     
     data = {
         "response" : {
             "name" : "region/sequence",
             "sequence" :  {
                 "start" : start,
                 "end" : end,
                 "length" : length,
                 "dna" : dna
             }
         }
     }
     
     formatter = Formatter(data, os.path.dirname(__file__) + "/../tpl/")
     print formatter.formatJSON()
Beispiel #2
0
 def testGetGenesWithPrivateAnnotationChanges(self):
     since = "2009-06-01"
     rows = self.queries.getGenesWithPrivateAnnotationChanges(14, since)
 
     data = {
         "response" : {
             "name" : "genome/recorded_annotation_changes",
             "taxonID" : "420245",
             "count" : len(rows),
             "results" : rows
         }
     }
 
     formatter = Formatter(data, os.path.dirname(__file__) + "/../tpl/")
     formatter.formatXML('private_annotations.xml.tpl')
     formatter.formatJSON()
Beispiel #3
0
 def testAllChanged(self):
         since = "2009-06-01"
         organism_id = 14
         changed_features = self.queries.getAllChangedFeaturesForOrganism(since, organism_id)
     
         data = {
             "response" : {
                 "name" : "genome/changes",
                 "taxonID" : "420245",
                 "count" : len(changed_features),
                 "since" : since,
                 "results" : changed_features
             }
         }
     
         formatter = Formatter(data, os.path.dirname(__file__) + "/../tpl/")
         formatter.formatJSON()
         formatter.formatXML("changes.xml.tpl")