def loadTsv(self, attrsFile): """load a GENCODE attributes file, adding bin""" typeMap = { "ccdsId": noneIfEmpty, "proteinId": noneIfEmpty, "level": int } rows = [ self._loadTsvRow(row) for row in TsvReader(attrsFile, typeMap=typeMap) ] self.loads(rows)
def loadInfoFromFile(self, gencodeInfo, onlyExisting=True): """load file produced by the gencodeGtfToAttrs script. If onlyExisting is true, only entries for transcripts already loaded from genePreds area included. """ infoTypeMap = { "geneType": BioType, "transcriptType": BioType, "level": int, "tags": BioTags, "havanaGene": _noneIfEmpty, "havanaTranscript": _noneIfEmpty, "ccdsId": _noneIfEmpty } for info in TsvReader(gencodeInfo, typeMap=infoTypeMap): self.__loadInfoRow(info, onlyExisting)
def loadTsv(self, sourceFile): """load a GENCODE attributes file, adding bin""" rows = [self._loadTsvRow(row) for row in TsvReader(sourceFile)] self.loads(rows)
def GeneCheckReader(fspec): for gc in TsvReader(fspec, typeMap=typeMap): yield gc