weng-lab/TEMP2

How to create the input file -t

Closed this issue · 3 comments

hi, thanks for your program. From the outputs of RepeatMasker it is not clear for me which one should I use as -t.
RepeatMasker offer the optional output of -gff, is that the file necessary?

From the test file rmsk.bed can you clarify what is column 5 then maybe I can construct the file myself out of other out of RepeatMasker

Thank you!

Thanks for your quick reply!

I code some work around from the output "$Name.fna.out" of RepeatMasker. Maybe it is of some use for someone else, please consider to change all spaces to tab first.

 import argparse

parser = argparse.ArgumentParser(description= "Select Kimura under param and create bed")
parser.add_argument("--RMfnaout", "-RepeatMasker_fnaout",  help="out of RepeatMasker .fna.out")
arg = parser.parse_args()
filehandle = open(arg.RMfnaout)
for line in filehandle:
	if line.startswith("SW"):
		continue
	stripped=line.split("\t")
	Chr=stripped[4]
	startChr=stripped[5]
	endChr=stripped[6]
	if stripped[9].startswith("("):
		continue
	if stripped[9].startswith("A-rich"):
		continue
	if stripped[9].startswith("G-rich"):
		continue
	else:
		TEname=stripped[9]
	if stripped[8].startswith("C"):
		strand="-"
	else:
		strand=stripped[8]

	print(str(Chr)+"\t"+str(startChr)+"\t"+str(endChr)+"\t"+str(TEname)+"\t"+"0"+"\t"+str(strand))

Awesome, thanks for the contribution, Tomas!