Mercurial > repos > rnateam > graphclust_preprocessing
comparison splitSHAPE.py @ 11:c0c9d19bc7b2 draft
planemo upload for repository https://github.com/eteriSokhoyan/galaxytools/tree/branchForIterations/tools/GraphClust commit 746497a64b955f6b9afc1944d1c1d8d877e53267
author | rnateam |
---|---|
date | Tue, 18 Jul 2017 01:43:49 -0400 |
parents | 0690d59881b9 |
children |
comparison
equal
deleted
inserted
replaced
10:16bcaef3dc1e | 11:c0c9d19bc7b2 |
---|---|
1 import os | 1 import os |
2 import re | 2 import re |
3 import sys | 3 import sys |
4 | 4 |
5 shape_file = sys.argv[1] | 5 shape_file = sys.argv[1] |
6 win_size = int(sys.argv[2]) | |
7 | 6 |
8 pattern = re.compile("^>.*$") | 7 pattern = re.compile("^>.*$") |
9 toWrite = "" | 8 toWrite = "" |
10 | 9 |
11 count_for_id = 1 | 10 count_for_id = 1 |
16 seq_string = [] | 15 seq_string = [] |
17 orig_id = [] | 16 orig_id = [] |
18 name_file = "FASTA/data.names" | 17 name_file = "FASTA/data.names" |
19 array_all_chunks = [] | 18 array_all_chunks = [] |
20 with open(name_file, 'r') as f: | 19 with open(name_file, 'r') as f: |
21 content = f.read() | 20 for line in f: |
22 lines = content.split('\n')[:-1] | 21 if len(line.strip()) == 0: |
23 for line in lines: | 22 continue |
24 seq_id.append(int(line.split()[0])) | 23 seq_id.append(int(line.split()[0])) |
25 seq_string.append(line.split()[1]) | 24 seq_string.append(line.split()[1]) |
26 orig_id_srt = line.split()[3] | 25 orig_id_srt = line.split()[3] |
27 orig_id_srt = orig_id_srt.rsplit('_',1)[0] | 26 orig_id_srt = orig_id_srt.rsplit('_',1)[0] |
28 orig_id.append(orig_id_srt) | 27 orig_id.append(orig_id_srt) |