[BioPython] Re: TMHMM

Timothy Wu 2huggie at gmail.com
Sat Oct 8 08:21:28 EDT 2005


On 10/5/05, Timothy Wu <2huggie at gmail.com> wrote:
>
> (sorry for the previous post, I accidently sent it before I finish it)
>
> Hi,
>
> Two things;
>
> 1. Is there a TMHMM module (and hopfully documented) in BioPython?
>
2. I had posted a similar question to the Python mailing list a long time
> ago, but unfortunately I had not get a satisfiable answer. I hope I can find
> some help here.
>
> From viewing TMHMM html source (http://www.cbs.dtu.dk/services/TMHMM/) I
> think the form fields are:
>
> seqfile --> file, which I don't know how to use, so I will not use it.
> SEQ --> text box, which should be aa sequences
> outform --> radio buttons, valid values are '-noshort', '-noplot',
> '-short'. I would like to have it as '-short'
> version --> a check box, valid value is '-v1'
>
> I tested using urllib with something like this:
>
> -----------------------------------------
> params = urllib.urlencode({
> 'configfile':'/usr/opt/www/pub/CBS/services/TMHMM-2.0/TMHMM2.cf',
> 'SEQ':'VVDGLHQAETISSQGFKELFEGYGNFNNTRNGVEVENLKQAVIQKGADAIRTGSGSLGGTV',
> 'version': '-short'
> })
>
> f = urllib.urlopen("http://www.cbs.dtu.dk/cgi-bin/nph-webface", params)
> sec = f.read()
> -----------------------------------------
>
> Of course, a successful TMHMM query requires me to read the return page
> from urlopen, and parse another url
> from within to obtain the final result page. But this is only the code to
> obtain the intermediate page.
>
> My problem is, notice my above strange code. For the 'version' field, I
> need to fill in either '-v1' or leave it empty.
> For outform (which I didn't include), I should have '-short'. But that
> doesn't work! Had I done that it would return "Read: Field not declared;
> 'outform'".
>
> I can get it to work if I only fill in "configfile" and "SEQ" fields. But
> I would get the equivalent of having 'noshort' value in 'outform' (extensive
> with graphics). The only way I am going to get the '-short' effect (one line
> per protein) is to fill in '-short' in the version field. This is very
> bizarre.
>
> Is there something I am missing? SignalP which also is provided by the
> same script also show this bizarre nature. I have also tried a perl script
> to do the same thing. Strange behavior also result but not like the Python
> one:
>
> -----------------------------------------
> my $agent = new LWP::UserAgent;
> my $request = POST($GS_URL,
> Content_Type => 'form-data',
> Content => [
> configfile => '/usr/opt/www/pub/CBS/services/TMHMM-2.0/TMHMM2.cf',
>  SEQ => 'VVDGLHQAETISSQGFKELFEGYGNFNNTRNGVEVENLKQAVIQKGADAIRTGSGSLGGTV',
> outform => '-short',
> ]
> );
> -----------------------------------------
>
> The script works. But if I swap the lines between configfile and seq
> parameters, it doesn't. I am not really familier with Perl so I have no idea
> why this is the way it is.
> Anyone can tell me why I had to fill in '-noshort' in the supposingly
> wrong field 'version'? Thanks a bunch.
>
> Timothy
>


I mailed the Center for Biological Sequence Analysis (which host the TMHMM
web service) and the response I got was to put the configfile field as the
first key value pair. So instead of a dictionary I sent a list of tuples to
the urlencode() instead. This solved all problems. The version=-short works
because it was put on a commandline as a commandline switch. So it works
regardless.

Timothy



More information about the BioPython mailing list