def _read_sts(line): """Reads STS lines: format is in the full docstring. Format: Name|Chromosome|StsId|Segment|SequenceKnown|Evidence """ return MappedRecord(sts_wrapper(line))
def _read_sts(line): """Turns an STS line (without label) into a record. Infuritatingly, STS lines are not semicolon-delimited, and spaces appear in places they shouldn't. This was the case as of 10/9/03: expect this 'feature' to be unstable! """ filtered = line.replace('=', ' ') return MappedRecord(list(ByPairs(filtered.split())))
def _read_cdd(line): """Reads CDD lines: format is Name|Key|Score|EValue|BitScore.""" return MappedRecord(cdd_wrapper(line))
def _read_map(line): """Reads MAP lines: format is Location|Source|Type.""" return MappedRecord(map_wrapper(line))
def _read_rell(line): """Reads RELL lines: format is Description|Id|IdType|Printable""" return MappedRecord(rell_wrapper(line))
def _read_accnum(line): """Reads ACCNUM lines: format is Accession|Gi|Strain|Start|End.""" return MappedRecord(accnum_wrapper(line))
def _read_contig(line): """Reads CONTIG lines. Format described in full docstring. Accession|Gi|Strain|From|To|Orientation|Chromosome|Assembly """ return MappedRecord(contig_wrapper(line))
def _read_accession(line): """Reads accession lines: format is Accession | Gi | Strain.""" return MappedRecord(accession_wrapper(line))
def _read_go(line): """Reads GO lines. Format: Category|Term|EvidenceCode|GoId|Source|PubMedId""" return MappedRecord(go_wrapper(line))
def _read_extannot(line): """Reads EXTANNOT lines. format: Category|Term|EvidenceCode|Source|PubMedId""" return MappedRecord(extannot_wrapper(line))
def _read_grif(line): """Reads GRIF lines: format is PubMedId|Description.""" return MappedRecord(grif_wrapper(line))
def _read_comp(line): """Reads COMP lines: format is in the full docstring. TaxonId|Symbol|Chromosome|Position|LocusId|ChromosomeSelf|SymbolSelf|MapName """ return MappedRecord(comp_wrapper(line))
def test_init_data(self): """MappedRecord should work like normal dict init""" exp = {'a': 3, 'b': 4} self.assertEqual(MappedRecord({'a': 3, 'b': 4}), exp) self.assertEqual(MappedRecord(a=3, b=4), exp) self.assertEqual(MappedRecord([['a', 3], ['b', 4]]), exp)
def test_init_empty(self): """MappedRecord empty init should work OK""" g = MappedRecord() self.assertEqual(g, {})
def setUp(self): """Define a few standard MappedRecords""" self.empty = MappedRecord() self.single = MappedRecord({'a': 3}) self.several = MappedRecord(a=4, b=5, c='a', d=[1, 2, 3])