first pass cleanup of cistematic/genomes; change bamPreprocessing
[erange.git] / crossmatch.py
1 try:
2     import psyco
3     psyco.full()
4 except:
5     pass
6
7 import sys
8 from cistematic.core.orthomatcher import orthoMatcher
9
10
11 def main(argv=None):
12     if not argv:
13         argv = sys.argv
14
15     print "crossmatch: version 1.2"
16     if len(argv) < 7:
17         print "usage: python %s prefix directory genome1 genefile1 genome2 genefile2 [genome3 genefile3 .....]" % argv[0]
18         sys.exit(1)
19
20     prefix = argv[1]
21     directory = argv[2]
22     matchFiles = {}
23
24     genomesToMatch = (len(argv) - 3) / 2
25     for index in range(genomesToMatch):
26         genome = argv[3 + index * 2]
27         print genome
28         if genome not in matchFiles:
29             matchFiles[genome] = []
30
31         matchFiles[genome].append(argv[4 + index * 2])
32
33     print matchFiles
34     orthoMatcher(matchFiles, prefix, directory, fileList=True)
35
36
37 if __name__ == "__main__":
38     main(sys.argv)