Mercurial > repos > iuc > circos
annotate scatter-from-wiggle.py @ 5:a64dc31ab7f2 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 39a0176dab234a07118a79ac44ca7d79469d3b91"
author | iuc |
---|---|
date | Thu, 23 Jan 2020 07:27:22 -0500 |
parents | 014a21767ac4 |
children |
rev | line source |
---|---|
2
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
1 #!/usr/bin/env python |
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
2 import logging |
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
3 import sys |
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
4 |
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
5 import pyBigWig |
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
6 |
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
7 logging.basicConfig(level=logging.INFO) |
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
8 log = logging.getLogger() |
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
9 |
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
10 if __name__ == "__main__": |
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
11 bw = pyBigWig.open(sys.argv[1]) |
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
12 for chrom in sorted(bw.chroms().keys()): |
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
13 for (start, end, value) in bw.intervals(chrom): |
014a21767ac4
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
iuc
parents:
diff
changeset
|
14 sys.stdout.write("%s\t%s\t%s\t%s\n" % (chrom, start, end, value)) |