On Tue, Dec 28, 2010 at 9:35 AM, Qian Liu <littleduck24@gmail.com> wrote:

> Hi there,
> I need some help with the RpsiXML.
>
> Question1:I have about 200 genes on the list, is it possible to pull out
> protein-protein interaction in one step or into one XML file?
>
> Question2: I use FOR Loop to pull out the protein-protein interaction data
> for each gene.
> I have list of genes. The 3rd gene "DRD1" dosen't have output from IntAct.
> the function parsePsimi25Interaction will show the following error message
>
> R code:
> genelist=c("HTR7","FRG1","DRD1","BRCA2")
> n=length(genelist)
> for (k in 1:n){
> url254L=paste("
> http://www.ebi.ac.uk/intact/export?query=q%3Dspecies%253Ahuman%2BAND%2B
> ",genelist[k
> ],
>
> "%26sort%3Drigid%2Basc%26rows%3D30%26start%3D0%26facet%3Dtrue%26facet.missing%3Dtrue%26facet.field%3Dexpansion%26facet.field%3DinteractorType_id&format=xml_2_54&conversationContext=1",sep='')
> intactSample=parsePsimi25Interaction(url254L,INTACT.PSIMI25,verbose=FALSE)
> ........
> }
>
> The first two genes works fine, but 3rd one show the following error
> message,and program stopped.
> I try to add if statement like  is.na, NULL, exists, but none of them can
> test whether the URL leads to real output.
> So what statement should I use so that the program can move on?
>
>

?try

for (k in 1:n) {
url254L=paste("
http://www.ebi.ac.uk/intact/export?query=q%3Dspecies%253Ahuman%2BAND%2B
",genelist[k],
"%26sort%3Drigid%2Basc%26rows%3D30%26start%3D0%26facet%3Dtrue%26facet.missing%3Dtrue%26facet.field%3Dexpansion%26facet.field%3DinteractorType_id&format=xml_2_54&conversationContext=1",sep='')

  intactSample =
try(parsePsimi25Interaction(url254L,INTACT.PSIMI25,verbose=FALSE),
silent=TRUE)
  print (class(intactSample))
  if (class(intactSample) == "try-error") {
  print("oops, an error")
    } else {
    print ("we can continue....")
    }
}




> Thank you,
> Qian
>
>
>
> 1 Entries found
> Parsing entry 1
>  Parsing experiments: ..
>  Parsing interactors:
>  25% ==========>
>  50% ====================>
>  75% ==============================>
>  100% ========================================>
>  Parsing interactions:
> ..
> 1 Entries found
> Parsing entry 1
>  Parsing experiments: ...
>  Parsing interactors:
>  17% =======>
>  33% =============>
>  50% ====================>
>  67% ===========================>
>  83% =================================>
>  100% ========================================>
>  Parsing interactions:
> ...
> EntityRef: expecting ';'
> EntityRef: expecting ';'
> EntityRef: expecting ';'
> EntityRef: expecting ';'
> EntityRef: expecting ';'
> EntityRef: expecting ';'
> EntityRef: expecting ';'
> Error: 1: EntityRef: expecting ';'
> 2: EntityRef: expecting ';'
> 3: EntityRef: expecting ';'
> 4: EntityRef: expecting ';'
> 5: EntityRef: expecting ';'
> 6: EntityRef: expecting ';'
> 7: EntityRef: expecting ';'
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

