# What format is this? Pretty sure it's not a BED file

Time for guess the bioinformatics file format... :)

I found this '.bed' file on GEO (GSE84660), but it's clearly not a BED file. Anyone know what it might be? And what can view it? It's from a HiC expt.

#column headers: bait1_chr, bait1_start, bait1_end, bait2_chr, bait2_start, bait2_end, contact_ID, NA, NA, B1_D0_counts, B1_D3_counts, B1_D6_counts, B2_D0_counts, B2_D3_counts, B2_D6_counts

chr1    831895  848168  chr1    850619  874081  b2b_1   .       .       114     125     127     75      97      92
chr1    831895  848168  chr1    889424  903640  b2b_2   .       .       15      12      16      4       15      20
chr1    831895  848168  chr1    903641  927394  b2b_3   .       .       13      13      10      18      15      8
...

• Could you explain what you need it for? I mean, that's just a simple text file so any text editor (or even excel) can view it. What information do you need to extract from it? Aug 29, 2017 at 18:51
• Are you trying to visualize the contact matrix? This data comes from this paper. Aug 29, 2017 at 19:32
• @DevonRyan ideally yes, but first I wanted to check that this wasn't some specific format I wasn't aware of. Have any suggestions to visualise a contact matrix? Aug 29, 2017 at 20:36
• @ithinkiam I'd suggest HiCExplorer, but I'm biased. To your original question, you'll still need to munge this file, but I'll see if I can come up with some code for that. Aug 29, 2017 at 20:39
• Perhaps it's been called .bed to suggest that the start/end coordinates are to be interpreted in a BED-style 0-based half-open (or equivalently 0-based start, 1-based end) way? The pair of genomic intervals per record is reminiscent of BEDPE format, but I'm not familiar with anything HiC so wouldn't comment on whether this is mere coincidence… Aug 30, 2017 at 10:38

It looks like a weird way to represent data. You're right, it does not at all look like a BED.

Digging in GEO made me find this information:

Supplementary_files_format_and_content: Tab-delimited file reports one contact per row. Interacting HindIII fragments are represented in bed format (chr/start/stop) with bait (or upstream bait, in the case of b2b contacts) listed first. The following fields correspond to a unique contact ID, fragment IDs for first and second fragments, and raw read counts supporting contacts in each replicates.

So I think the authors merged a BED3 format plus additional BED-unrelated fields generating a tab-separated file - not clearly stated in their methods though. The easiest would be to contact the authors maybe?

Depending on your aims, if you only need the first 3 fields (but I doubt it) I would reformat this "bed" file (to make it processable as a BED file) in two sub-files:

cat original.bed | cut -f 1,2,3 > bait1.txt
chr1    831895  848168
chr1    831895  848168
chr1    831895  848168

cat original.bed | cut -f 4,5,6 > bait2.txt

• You could simplify your command to cut -f 1-3 original.bed > bait1.txt if you like. The cat isn't needed, cut can take a file path as input and lists of fields can be defined with x-y. Aug 29, 2017 at 18:55