This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to convert Mummer coords output to a Bed file?

I'm trying to check the sequence similarity between two genes using mummer.

I have nucmer.coords file with the following information:

  [S1]     [E1]  |     [S2]     [E2]  |  [LEN 1]  [LEN 2]  |  [% IDY]  |  [LEN R]  [LEN Q]  |  [COV R]  [COV Q]  | [TAGS]
 ===============================================================================================================================
  5080     5651  |     12880    13453  |    572      574  |    78.97  |     3568     4514  |     3.69     5.84  | Gene1    Gene2
  5083     6078  |     39063    40043  |    996      981  |    79.75  |     3568     4514  |     1.92     3.21  | Gene1    Gene2
  5217     6079  |     20844    21712  |    863      869  |    89.96  |     3568     4514  |     8.98    14.53  | Gene1    Gene2
  5330     6079  |     36215    35465  |    750      751  |    59.60  |     3568     4514  |     3.85     5.95  | Gene1    Gene2

How to convert the above information into BED file?

nucmer mummer bed

Why did you delete the post, Biologist ?

1 answer

Try

awk -F '|' '!/^=/{gsub(/^[ \t]+|[ \t]+$/, "", $0); split($1, coords, " +"); split($15, tags, " +"); print tags[1] "\t" coords[1] "\t" coords[2] "\t" tags[2] "\t0\t+"}' nucmer.coords > output.bed

Log in to answer this question.