This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Change chromosome names in bed file

I have a bed file like this:

chr1    11869   12227   +       processed_transcript
chr2    12613   12721   +       processed_transcript
chr3    13221   14409   +       processed_transcript
chr4    12010   12057   +       transcribed_unprocessed_pseudogene
chr5    12179   12227   +       transcribed_unprocessed_pseudogene
`

I want to change the chromosomes to NCBI format which is like this:

NC_000001.11    11869   12227   +       processed_transcript
NC_000002.12    12613   12721   +       processed_transcript
NC_000003.12    13221   14409   +       processed_transcript
NC_000004.12    12010   12057   +       transcribed_unprocessed_pseudogene
NC_000005.10    12179   12227   +       transcribed_unprocessed_pseudogene

How to do that?

rna-seq next-gen

1 answer

find a file mapping the two notations e.g: https://github.com/dpryan79/ChromosomeMappings/blob/master/GRCh37_NCBI2UCSC.txt

sort both files on chromosome

join both files on the chromosome using join https://linux.die.net/man/1/join

Log in to answer this question.