Mercurial > repos > iuc > circos
annotate scatter-from-wiggle.py @ 11:0ee66defe58b draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit b9ec351920dbc83fa14bd1f8cfdd0a6a19b89473"
| author | iuc | 
|---|---|
| date | Tue, 16 Nov 2021 09:19:09 +0000 | 
| parents | 890ef899a3d7 | 
| children | 
| rev | line source | 
|---|---|
| 2 
890ef899a3d7
"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 | 
| 
890ef899a3d7
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
 iuc parents: diff
changeset | 2 import logging | 
| 
890ef899a3d7
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
 iuc parents: diff
changeset | 3 import sys | 
| 
890ef899a3d7
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
 iuc parents: diff
changeset | 4 | 
| 
890ef899a3d7
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
 iuc parents: diff
changeset | 5 import pyBigWig | 
| 
890ef899a3d7
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
 iuc parents: diff
changeset | 6 | 
| 
890ef899a3d7
"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) | 
| 
890ef899a3d7
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
 iuc parents: diff
changeset | 8 log = logging.getLogger() | 
| 
890ef899a3d7
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
 iuc parents: diff
changeset | 9 | 
| 
890ef899a3d7
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
 iuc parents: diff
changeset | 10 if __name__ == "__main__": | 
| 
890ef899a3d7
"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]) | 
| 
890ef899a3d7
"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()): | 
| 
890ef899a3d7
"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): | 
| 
890ef899a3d7
"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)) | 
