| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 36 | 3 | 4 | 0.983 | compound_stmt |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 36 | 703 | Bio/Prosite/__init__.py |
| 2 | 36 | 296 | Bio/Prosite/Prodoc.py |
| 3 | 36 | 1192 | Bio/SwissProt/SProt.py |
| ||||
def index_file(filename,indexname,rec2key = None):
"""index_file(filename, indexname, rec2key=None)
Index a Prosite file. filename is the name of the file.
indexname is the name of the dictionary. rec2key is an
optional callback that takes a Record and generates a unique key
(e.g. the accession number) for the record. If not specified,
the id name will be used.
"""
import os
if not os.path.exists(filename):
raise ValueError("%s does not exist"%filename)
index = Index.Index(indexname,truncate = 1)
index[Dictionary._Dictionary__filename_key] = filename
handle = open(filename)
records = parse(handle)
end = 0
for record in records:
start = end
end = long(handle.tell( ))
length = end-start
if rec2key is not None:
key = rec2key(record)
else:
key = record.name
if not key:
raise KeyError("empty key was produced")
elif key in index:
raise KeyError("duplicate key %s found"%key)
index[key] = start,length
|
| ||||
def index_file(filename,indexname,rec2key = None):
"""index_file(filename, indexname, rec2key=None)
Index a Prodoc file. filename is the name of the file.
indexname is the name of the dictionary. rec2key is an
optional callback that takes a Record and generates a unique key
(e.g. the accession number) for the record. If not specified,
the id name will be used.
"""
import os
if not os.path.exists(filename):
raise ValueError("%s does not exist"%filename)
index = Index.Index(indexname,truncate = 1)
index[Dictionary._Dictionary__filename_key] = filename
handle = open(filename)
records = parse(handle)
end = 0
for record in records:
start = end
end = long(handle.tell( ))
length = end-start
if rec2key is not None:
key = rec2key(record)
else:
key = record.accession
if not key:
raise KeyError("empty key was produced")
elif key in index:
raise KeyError("duplicate key %s found"%key)
index[key] = start,length
|
| ||||
def index_file(filename,indexname,rec2key = None):
"""index_file(filename, indexname, rec2key=None)
Index a SwissProt file. filename is the name of the file.
indexname is the name of the dictionary. rec2key is an
optional callback that takes a Record and generates a unique key
(e.g. the accession number) for the record. If not specified,
the entry name will be used.
"""
from Bio.SwissProt import parse
if not os.path.exists(filename):
raise ValueError("%s does not exist"%filename)
index = Index.Index(indexname,truncate = 1)
index[Dictionary._Dictionary__filename_key] = filename
handle = open(filename)
records = parse(handle)
end = 0
for record in records:
start = end
end = long(handle.tell( ))
length = end-start
if rec2key is not None:
key = rec2key(record)
else:
key = record.entry_name
if not key:
raise KeyError("empty sequence key was produced")
elif key in index:
raise KeyError("duplicate key %s found"%key)
index[key] = start,length
|
| |||
def index_file(filename,indexname,rec2key = None):
[[#variable71a59b40]]
[[#variable71a59ac0]]
if not os.path.exists(filename):
raise ValueError("%s does not exist"%filename)
index = Index.Index(indexname,truncate = 1)
index[Dictionary._Dictionary__filename_key] = filename
handle = open(filename)
records = parse(handle)
end = 0
for record in records:
start = end
end = long(handle.tell( ))
length = end-start
if rec2key is not None:
key = rec2key(record)
else:
key = record. [[#variable71a59a60]]
if not key:
raise KeyError( [[#variable71a59960]])
elif key in index:
raise KeyError("duplicate key %s found"%key)
index[key] = start,length
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#71a59b40]] | """index_file(filename, indexname, rec2key=None)
Index a Prodoc file. filename is the name of the file.
indexname is the name of the dictionary. rec2key is an
optional callback that takes a Record and generates a unique key
(e.g. the accession number) for the record. If not specified,
the id name will be used.
""" |
| 1 | 2 | [[#71a59b40]] | """index_file(filename, indexname, rec2key=None)
Index a Prosite file. filename is the name of the file.
indexname is the name of the dictionary. rec2key is an
optional callback that takes a Record and generates a unique key
(e.g. the accession number) for the record. If not specified,
the id name will be used.
""" |
| 1 | 3 | [[#71a59b40]] | """index_file(filename, indexname, rec2key=None)
Index a SwissProt file. filename is the name of the file.
indexname is the name of the dictionary. rec2key is an
optional callback that takes a Record and generates a unique key
(e.g. the accession number) for the record. If not specified,
the entry name will be used.
""" |
| 2 | 1 | [[#71a59ac0]] | import os |
| 2 | 2 | [[#71a59ac0]] | import os |
| 2 | 3 | [[#71a59ac0]] | from Bio.SwissProt import parse |
| 3 | 1 | [[#71a59a60]] | accession |
| 3 | 2 | [[#71a59a60]] | name |
| 3 | 3 | [[#71a59a60]] | entry_name |
| 4 | 1 | [[#71a59960]] | "empty key was produced" |
| 4 | 2 | [[#71a59960]] | "empty key was produced" |
| 4 | 3 | [[#71a59960]] | "empty sequence key was produced" |