GRID
index
c:\my projects\python\bioinformatics\grid.py

Gene Interactions (GRID) data parser
Zafer Barutcuoglu 2003/11/25
This module parses the bioinformatical General Repository for Interaction Datasets (GRID) data.
It outputs a file for each experiment type, suitable for importing into Matlab as a sparse matrix.

 
Classes
       
Interactions

 
class Interactions
    GRID interaction data class.
 
self.experiments is dict(sName->Experiment)
self.genes is list of gene names for indexing
self.sources is list of sources for indexing
self.PubMed_IDs is list of PubMed IDs for indexing
 
  Methods defined here:
__init__(self, infile=None, bSkipComments=True, geneList=None)
Constructor.
<file> may be either a file name, open file object, or None.
<bSkipComments> skips lines until header row is found.
loadFile(self, infile, bSkipComments=True)
Loads data from file.
<infile> may be a file name or open file object. If latter, it is not closed on exit.
<bSkipComments> skips lines until header row is found.
loadLines(self, lines, bSkipComments=True)
Loads data from a list of data lines.
<bSkipComments> skips lines until header row is found.
Format: ORF_A   ORF_B   EXPERIMENTAL_SYSTEM     SOURCE  PUBMED_ID
saveAll(self, path)

Data and other attributes defined here:
Experiment = <class GRID.Experiment at 0x00E97120>
Data for one type of experiment.
self.data is dict: (A_index,B_index)->(source_index,PubMedIndices_list)
HEADER_ROW = 'ORF_A\tORF_B\tEXPERIMENTAL_SYSTEM\tSOURCE\tPUBMED_ID\n'
NUM_FIELDS = 5