Mercurial > repos > rnateam > graphclust_preprocessing
diff 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 |
line wrap: on
line diff
--- a/splitSHAPE.py Thu Jun 01 12:11:37 2017 -0400 +++ b/splitSHAPE.py Tue Jul 18 01:43:49 2017 -0400 @@ -3,7 +3,6 @@ import sys shape_file = sys.argv[1] -win_size = int(sys.argv[2]) pattern = re.compile("^>.*$") toWrite = "" @@ -18,9 +17,9 @@ name_file = "FASTA/data.names" array_all_chunks = [] with open(name_file, 'r') as f: - content = f.read() - lines = content.split('\n')[:-1] - for line in lines: + for line in f: + if len(line.strip()) == 0: + continue seq_id.append(int(line.split()[0])) seq_string.append(line.split()[1]) orig_id_srt = line.split()[3]