Thursday, 26 May 2011

Scripting against a remote HTML blast server

## Scripting against the CN Solexa blast server:



## See "blast.form.html", the HTML dump generated by "blast.jsp". This
## file shows how the names for the various options.



## The blast server page
URL=http://.../blast.jsp
URL=http://.../blast.cgi

## Get this from firefox (Note, expires after about 5 min!)
JSESSIONID=
JSESSIONID=BE55C37071E8CE748053DBCC47FCA3F3
JSESSIONID=1D179D4B6EF55555D344E388D6ABEA19
JSESSIONID=8921525F177EE917E5A27D3FB0CC577D

## Sequence file to submit to the form
SEQFILE=test.seq
SEQFILE=C02HBa0008G02.seq



## All other settings will be default ...

## Don't forget to redirect the result somewhere sensible

curl \
--cookie JSESSIONID=$JSESSIONID \
--form SEQFILE=@$SEQFILE \
--form DATALIB=potato \
$URL \
> $SEQFILE.cn.blast



## Try grabbing (lots of) XML output

JSESSIONID=AE961CF9BF250CCF656832143701BE59
SEQFILE=test.seq

curl \
--cookie JSESSIONID=$JSESSIONID \
--form SEQFILE=@$SEQFILE \
--form DATALIB=potato \
--form ALIGNMENT_VIEW=7 \
--form DESCRIPTIONS=500 \
--form ALIGNMENTS=500 \
$URL \
> $SEQFILE.cn.blast.xml



## Test the XML format using BioPerl

perl -e 'use Bio::SearchIO;
while($r = Bio::SearchIO->
new(
-file=>"$SEQFILE.cn.blast.xml",
-format=>blastxml,
)->next_result){
print $r->query_name, "\n";
while( $h = $r->next_hit ) {
print "\t", $h->name, "\n";
}
}
'


## Looks good!

No comments: