Mercurial > repos > iuc > circos
comparison genome-lengths-to-karyotype.py @ 2:014a21767ac4 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
author | iuc |
---|---|
date | Tue, 17 Sep 2019 16:54:57 -0400 |
parents | |
children | 740057a5126d |
comparison
equal
deleted
inserted
replaced
1:ae9994cf526f | 2:014a21767ac4 |
---|---|
1 #!/usr/bin/env python | |
2 import csv | |
3 import sys | |
4 | |
5 | |
6 idx = 0 | |
7 with open(sys.argv[1], "r") as csvfile: | |
8 spamreader = csv.reader(csvfile, delimiter="\t", quotechar='"') | |
9 for row in spamreader: | |
10 if len(row) < 2: | |
11 continue | |
12 | |
13 seq_id = row[0] | |
14 length = row[1] | |
15 | |
16 sys.stdout.write( | |
17 "chr - {seq_id} {seq_id} 0 {length} {theme}-{color}\n".format( | |
18 seq_id=seq_id, | |
19 idx=idx, | |
20 length=length, | |
21 color=((idx + 1) % 12), | |
22 theme=sys.argv[2], | |
23 ) | |
24 ) | |
25 idx += 1 |