https://github.com/fjruizruano/ngs-protocols
Raw File
Tip revision: 39a091d1fa569a7fc717ac73c4b3de07f0a1204d authored by fjruizruano on 03 August 2023, 11:48:27 UTC
adding gfa2fas.py and extract_gfa.py
Tip revision: 39a091d
id_rmasker_rexp.py
#!/usr/bin/python

import sys

try:
    file = sys.argv[1]
except:
    print "Usage: id_rmasker.py FastaFile"

data = open(file).readlines()

w = open(file+".rmasker", "w")

for line in data:
    if line.startswith(">"):
        line = line.split(" ")
        cl = line[0]
        cl = cl.split("Contig")
        line = line[0]+"#Unknown/"+cl[0][1:]+"\n"
    w.write(line)

w.close()
back to top