Passed
Push — master ( a47e0a...19735b )
by Marcin
04:27
created

chunker.chunks()   A

Complexity

Conditions 2

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
2
3
4
def chunks(l, n):
5
    """Yield successive n-sized chunks from l."""
6
    for i in range(0, len(l), n):
7
        yield l[i:i + n]
8
9
#main
10
f = open('pdb_list.txt').read().split()
11
# 30 = runs * 10 = 300cores
12
no_of_files = int(round(len(f) / 100))
13
c = 0
14
for i in chunks(f, no_of_files):
15
    txt = "echo '" 
16
    # -g farna_hires.csv
17
    txt += "/home/magnus/mqaprna_env/mqapRNA/main/mqaprna  -o FARNA__hires_" + str(c) + " " + " ".join(i) +"'"
18
    txt += " | qsub -N mq" + str(c) + " -V -cwd -pe mpi 1"
19
    print txt
20
    c += 1
21
    
22