%
% NOTE -- ONLY EDIT THE .Rnw FILE!!!  The .tex file is
% likely to be overwritten.
%
% \VignetteIndexEntry{Using the package ppiStats}
%\VignetteDepends{}
%\VignettePackage{y2hStat}
\documentclass[11pt]{article}

\usepackage{times}
\usepackage{hyperref}

\usepackage[authoryear,round]{natbib}
\usepackage{times}
\usepackage{comment}

\textwidth=6.2in
\textheight=8.5in
%\parskip=.3cm
\oddsidemargin=.1in
\evensidemargin=.1in
\headheight=-.3in

\newcommand{\Rfunction}[1]{{\texttt{#1}}}
\newcommand{\Robject}[1]{{\texttt{#1}}}
\newcommand{\Rpackage}[1]{{\textit{#1}}}
\newcommand{\Rclass}[1]{{\textit{#1}}}

\bibliographystyle{plainnat}

\title{Using the functions within the ppiData package}
\author{T Chiang}

\usepackage{Sweave}
\begin{document}

\maketitle

For those interested in analyzing the publicly available protein-protein
interaction (PPI) data located within the IntAct repository, \Robject{ppiData}
is an R-data package with built in functions that can parse through the IntAct repository and gather
empirical PPI data such as physical binary interactions between protein
pairs via the Yeast 2-Hybrid (Y2H) systems or such as complex co-membership between
sets of proteins via the Affinity Purification - Mass Spectrometry (AP-MS) 
systems. In this vignette, we show how one can collect such PPI data 
from IntAct, how one can take the collected data and generate useful R-objects
(such as the adjacency matrix representation, graph representations, etc), and 
how to do some simply statistical computations.


For the remainder of the vignette, we shall only be concerned with collecting 
three particular Y2H data-sets: those corresponding to "awasthi-2001-1", 
"cagney-2001-1", and "zhao-2005-2" (though we will note which functions are
used to create the various data files in this data package). We also use two new terms: viable baits and
viable preys. A viable bait for a particular experiment is any protein sampled 
as a bait that detects at least one other protein as prey within the respective
experiment. Viable preys are similarly defined. 

The first function that we will call will be the \Rfunction{collectIntactPPIData}
function. As the name implies, this function goes into the Intact repository,
which exists within this package as a modified XML file downloaded from
its primary souce and collects the relevant data given the particular experiments 
(as given by its IntAct Accession (AC) Identification Code). In our working 
example ("awasthi-2001-1", "cagney-2001-1", "zhao-2005-2") is identified 
within IntAct by the AC codes ("EBI-531419", "EBI-698096","EBI-762635"). Before
we can gather the information concerning any empirical data, we must first 
identify its corresponding AC code. (We shall discuss this at the end since
this involves searching the internet.)

Let's begin by collecting the specified data-sets via the function
\Rfunction{collectIntactPPIData}:

\begin{Schunk}
\begin{Sinput}
> dataList <- collectIntactPPIData(c("EBI-531419", "EBI-698096","EBI-762635"))