-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremovemasked.py
More file actions
executable file
·34 lines (28 loc) · 869 Bytes
/
Copy pathremovemasked.py
File metadata and controls
executable file
·34 lines (28 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
removemasked.py removes the sequences that have been repeat masked
Takes as input fasta sequence with repeat masks and writes out a fasta
without repeat masked sequences.
Usage:
python removemasked.py <input-fasta> <output-fasta>
"""
import sys
def remove_masked(fasta_in, fasta_out):
"""
Removes fasta sequences that have been repeat-masked
"""
with open(fasta_in) as fa_in:
with open(fasta_out, "w") as fa_out:
for line in fa_in:
if "N" in line:
continue
# elif len(line.split()) < 3:
# continue
else:
fa_out.write(line)
if __name__ == '__main__':
if len(sys.argv) < 3:
print __doc__
sys.exit(1)
input_fa = sys.argv[1]
output_fa = sys.argv[2]
remove_masked(input_fa, output_fa)