Exemple #1
0
    def __init__(self, input_path):
        """Initializes a NativeGffReader.

    Args:
      input_path: string. A path to a resource containing GFF records.
    """
        super(NativeGffReader, self).__init__()
        gff_path = input_path.encode('utf8')
        reader_options = gff_pb2.GffReaderOptions()
        self._reader = gff_reader.GffReader.from_file(gff_path, reader_options)
        self.header = self._reader.header
Exemple #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')