This is a test version of Biostars. For the public version, visit https://www.biostars.org.
tab-delimited file - use in bedtools?

Hi,

I have a tab-delimited .txt file. However, instead of being arranged in columns the values appear like so:

Loci ID Lung proportion   Heart proportion   Kidney proportion^Mloc.40699281     51.70969181     15.88331538^Mloc.14331  5.255465101     86.04853954     8.695995364^M

The ^M seems to indicate where a new line should appear.

I then want to use this file for bedtools intersect with another bedfile containing the locus identities. Is this possible?

Thank you,

bed bedtools

Which operating system do you use? Did you prepare this file using a Windows program? Looks like a incorrect newline character. I'm not sure if it will help but you could try dos2unix (it often does work)

1 answer

Hi a.rex,

The ^M is a representation of DOS' carriage return character. Just run dos2unix on that file. Since the data is not in bed-format, try to use join (here are some nice examples: https://shapeshed.com/unix-join/ and http://www.thegeekstuff.com/2012/10/15-linux-split-and-join-command-examples-to-manage-large-files/ ) .

Cheers,

Michael

Log in to answer this question.