-
Notifications
You must be signed in to change notification settings - Fork 2
/
testIMa.py
46 lines (32 loc) · 1.71 KB
/
testIMa.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import sys, pickle
from SAP.PostAnalysis import IMa
from SAP import Fasta
class Bunch(object):
"""
Generic class for lumping attributes.
"""
def __init__(self, **keywords):
self.__dict__.update(keywords)
def has(self, keyword):
return self.__dict__.has_key(keywords)
def __str__(self):
s = 'Bunch: '
for k, v in self.__dict__.items():
s += "%s: %s " % (k, v)
return s
options = Bunch()
pwd = "/Users/kasper/projects/sap/analyses/imatest/prelim/"
options.homologcache = pwd + "homologcache"
options.treestatscache = pwd + "treestatscache"
ass = IMa.Assignment(options)
"prelim_BOTW283_05_USNM_621383_Dendroica_kirtlandii_"
queryFastaRecord = Fasta.Record(title="HCBR116_03_1B_1613_Dendroica_caerulescens_", sequence='GGAATGGTAGGTACCGCCCTAAGCCTCCTCATTCGAGCAGAACTAGGCCAACCTGGAGCCCTTCTAGGAGACGACCAAGTCTACAACGTAGTTGTCACGGCCCATGCTTTCGTAATAATTTTCTTTATAGTTATGCCGATTATAATCGGAGGGTTCGGAAACTGACTAGTCCCCCTAATAATCGGAGCCCCAGACATAGCGTTCCCACGAATAAACAACATAAGCTTCTGACTACTCCCACCATCATTCCTTCTCCTCCTAGCATCCTCCACAGTTGAAGCAGGTGTAGGCACAGGCTGAACAGTATACCCCCCACTAGCTGGCAACTTGGCCCACGCCGGAGCCTCAGTCGACCTCGCAATCTTCTCCCTACACCTAGCCGGTATTTCCTCAATCCTCGGGGCAATCAACTTCATTACAACAGCAATTAATATGAAACCTCCTGCCCTCTCACAATACCAAACCCCACTATTCGTCTGATCAGTCCTAATCACTGCAGTCCTCTTACTCCTTTCCCTTCCAGTTCTAGCTGCAGGAATCACAATGCTCCTCACAGACCGCAACCTTAACACCACATTCTTCGACCCTGCTGGAGGAGGAGATCCCGTCCTATATCAACATCTCTTCTGATTCTTTGGTCACCCAGAAGTTTACATCCTAATCCTC')
with open('/Users/kasper/Desktop/test.fasta', 'w') as out:
print >>out, queryFastaRecord
ass.run(['/Users/kasper/Desktop/test.fasta'])
# cmd = "im -h"
# outputPrefix = '/tmp/kasper'
#
# arguments = cmd.split(' ')
#
# retval = IM.runprogram(arguments, outputPrefix)