def run(self): url = "http://pfam.sanger.ac.uk/family/alignment/download/gzipped?acc=%s&alnType=%s" url %= self.params['id'], ('full' if self.params['full'] else 'seed') tmp = StringIO.StringIO(urllib2.urlopen(url).read()) alignment = gzip.GzipFile(fileobj=tmp) msa = StockholmFormatMSA.from_text(alignment) path = "%s-%s" % (self.params['id'], ('full' if self.params['full'] else 'seed')) self.target.set_msa(msa.sequences, path, msa.ids, msa.descriptions)
def run(self): msa = StockholmFormatMSA.from_text(open(self.params['location'])) self.target.set_msa(msa.sequences, self.params['location'], msa.ids, msa.descriptions)