Hello. I was wondering if anyone could help. I have a file containing a large table in the format:
marker1 marker2 marker3 marker4
position1 position2 position3 position4
genotype1 genotype2 genotype3 genotype4
with marker being a name, position a numeric measure of distance and genotype also a number.
I need to remove columns based on the values in the "position" line i.e. I need a script to take each position and remove adjacent columns that are within a certain distance of that marker, which is indicated by the value the position line which is a measure of distance. So if the file looked like this
rs1 rs2 rs3 rs4 rs5
1 2 3 4 5
2 3 1 1 2
and I was dealing with rs3 and the distance I wanted to remove was 1, I would want the output:
rs1 rs3 rs5
1 3 5
2 1 2
Does anyone know any way can do this? I appreciate any help and I hope I haven't been too confusing!