Multiple sequences can be submitted in bulk using a simple POST mechanism. The results are a tab-delimited table.
file - a file uploadfileType - set this to "sequences" or "snvlist" depending on the format. See SNV Query tab for accepted formats.gb argument:
https://mitomap.org/mitomaster/websrvc.cgi?gb=JX153710.1&output=summary
output argument
output => 'detail' - very similar to the detail page shown in the Mitomaster web application, with a line for each mutation (default)output => 'summary' - very similar to the summary page shown in the Mitomaster web application, with a line for each sequenceoutput => 'hsd' - variants in a HaploGrep-compatible .hsd file format
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request::Common;
my $userAgent = LWP::UserAgent->new(timeout => 1800); #a half-hour
#fileType can be sequences or snvlist
my $request = POST 'https://mitomap.org/mitomaster/websrvc.cgi',
Content_Type => 'multipart/form-data',
Content => [ file => ['mySequences.fasta'], fileType => 'sequences', output => 'detail'];
my $response = $userAgent->request($request);
print $response->error_as_HTML . "
" if $response->is_error;
if ($response->is_success) {
print $response->decoded_content;
} else {
die $response->status_line;
}
#!/usr/bin/env python2
from poster.encode import multipart_encode
from poster.streaminghttp import register_openers
import urllib2
register_openers()
#fileType can be sequences or snvlist
datagen, headers = multipart_encode({"file": open("mySequences.fasta"),'fileType':'sequences','output':'detail'})
request = urllib2.Request("https://mitomap.org/mitomaster/websrvc.cgi", datagen, headers)
try:
print urllib2.urlopen(request).read()
except urllib2.HTTPError, e:
print "HTTP error: %d" % e.code
except urllib2.URLError, e:
print "Network error: %s" % e.reason.args[1]
#!/usr/bin/env python3
import requests
try:
response = requests.post("https://mitomap.org/mitomaster/websrvc.cgi", files={"file": open("mySequences.fasta"),'fileType': ('', 'sequences'),'output': ('', 'detail')})
print(str(response.content, 'utf-8'))
except requests.exceptions.HTTPError as err:
print("HTTP error: " + err)
except:
print("Error")