Mercurial > repos > iuc > circos
annotate scatter-from-wiggle.py @ 13:8b1cf140bbd4 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 0cfd88d16b0b20a66d4b21b037ddee6a8c440d88
| author | iuc | 
|---|---|
| date | Wed, 12 Apr 2023 15:08:23 +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)) | 
