jh041 / SamGate

Create input files for MegaSat
1 stars 1 forks source link

Change the column order of the output file #2

Open patrick-douglas opened 5 years ago

patrick-douglas commented 5 years ago

Hello, In the MEGASAT example file the order of columns is different of the SAMGATE output, there is any way to fix? or this does not make difference? Bellow the example from MEGASAT page

Name left_oligo Rev_Comp_right_oligo 5Flank 3Flank Repeat

Bellow the example from SAMGATE final output (Note that 5Flank comes before 3Flank in the MEGA sat file)

Locus-Name no_tail_left Rev_Comp_of_no_tail_Right ThreeFlank FiveFlank Repeat

jh041 commented 5 years ago

That's interesting. Megasat was written by a computer programmer, not a biologist, and so she originally listed the 3 prime flank before the 5 prime flank, thinking that was the correct order. I wrote the script according to her design. But maybe somebody has updated Megasat since I worked with that group.

I definitely think that the order is important. Either the example is wrong, or there has been an update. I'm sorry but I don't know which.

patrick-douglas commented 5 years ago

Hello again, I tested the different scenarios and worked for me as required in the MEGASAT example file I have been updated the heads of final output and created a pull request to output as required by MEGASAT Please, could you inverse 5Flank and 3Flank columns?

Head columns named as bellow, does not work in the latest version of MEGASAT Locus-Name no_tail_left Rev_Comp_of_no_tail_Right ThreeFlank FiveFlank Repeat

jh041 commented 5 years ago

Hi Patrick,

I no longer maintain this piece of software, but for you, and others, who want to hack the original script and change the column order this is easy.

In lines 123-126 just switch the "three" and "five" elements.

with open('MegaSat_primer.txt', mode = 'w') as file: file.write("Locus-Name\tno_tail_left\tRev_Comp_of_no_tail_Right\tThreeFlank\tFiveFlank\tRepeat\n") for gate in gates: file.write("%s\t%s\t%s\t%s\t%s\t%s\n" % (gate.id, gate.left, gate.right, gate.three, gate.five, gate.repeat))