コード例 #1
0
 def testCompressed(self):
     reader = genomics_reader.TFRecordReader(
         test_utils.genomics_core_testdata('test_features.gff.tfrecord.gz'),
         gff_pb2.GffRecord(),
     )
     records = list(reader.iterate())
     self.assertEqual('GenBank', records[0].source)
     self.assertEqual('ctg123', records[1].range.reference_name)
コード例 #2
0
    def setUp(self):
        self.options = gff_pb2.GffReaderOptions()
        self.first = gff_pb2.GffRecord()
        self.first.range.reference_name = 'ctg123'
        self.first.range.start = 999
        self.first.range.end = 9000
        self.first.source = 'GenBank'
        self.first.type = 'gene'
        self.first.score = 2.5
        self.first.strand = gff_pb2.GffRecord.FORWARD_STRAND
        self.first.phase = 0
        self.first.attributes['ID'] = 'gene00001'
        self.first.attributes['Name'] = 'EDEN'

        self.second = gff_pb2.GffRecord()
        self.second.range.reference_name = 'ctg123'
        self.second.range.start = 999
        self.second.range.end = 1012
        self.second.phase = -1
        self.second.score = -float('inf')
コード例 #3
0
 def setUp(self):
     out_fname = test_utils.test_tmpfile('output.gff')
     self.writer = gff_writer.GffWriter.to_file(out_fname,
                                                gff_pb2.GffHeader(),
                                                gff_pb2.GffWriterOptions())
     self.expected_gff_content = open(
         test_utils.genomics_core_testdata(
             'test_features.gff')).readlines()
     self.header = gff_pb2.GffHeader(
         sequence_regions=[ranges.make_range('ctg123', 0, 1497228)])
     self.record = gff_pb2.GffRecord(
         range=ranges.make_range('ctg123', 1000, 1100))
コード例 #4
0
ファイル: clif_postproc.py プロジェクト: yijunyu/nucleus
 def _raw_next(self):
     record = gff_pb2.GffRecord()
     not_done = self._cc_iterable.PythonNext(record)
     return record, not_done