CloneSet34


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
36340.983compound_stmt
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
136703
Bio/Prosite/__init__.py
236296
Bio/Prosite/Prodoc.py
3361192
Bio/SwissProt/SProt.py
Clone Instance
1
Line Count
36
Source Line
703
Source File
Bio/Prosite/__init__.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 
     


Clone Instance
2
Line Count
36
Source Line
296
Source File
Bio/Prosite/Prodoc.py

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 
     


Clone Instance
3
Line Count
36
Source Line
1192
Source File
Bio/SwissProt/SProt.py

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 
     


Clone AbstractionParameter Count: 4Parameter Bindings

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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#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.

    """ 
12[[#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.

    """ 
13[[#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.

    """ 
21[[#71a59ac0]]
import os 
22[[#71a59ac0]]
import os 
23[[#71a59ac0]]
from Bio.SwissProt import parse 
31[[#71a59a60]]
accession 
32[[#71a59a60]]
name 
33[[#71a59a60]]
entry_name 
41[[#71a59960]]
"empty key was produced" 
42[[#71a59960]]
"empty key was produced" 
43[[#71a59960]]
"empty sequence key was produced"