Mercurial > repos > iuc > vardict_java
comparison split.py @ 3:e0734e88a104 draft default tip
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/vardict commit 80e3742f499e8efabad1fe7627201466d0bdd190"
author | iuc |
---|---|
date | Thu, 27 Jan 2022 15:19:23 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2:d262577e04b0 | 3:e0734e88a104 |
---|---|
1 import sys | |
2 | |
3 | |
4 fai = sys.argv[1] | |
5 chunk_size = int(sys.argv[2]) | |
6 overlap = int(sys.argv[3]) # Base pairs | |
7 with open(fai, 'r') as infile: | |
8 for line in infile: | |
9 name = line.split('\t')[0] | |
10 stop = int(line.split('\t')[1]) | |
11 start = 1 | |
12 while start < stop: | |
13 start = max(1, start - overlap) | |
14 print('\t'.join([name, str(start), | |
15 str(min(start + chunk_size, stop))])) | |
16 start += chunk_size |