Conversion ......... Bed File In Hg18 To Hg19
1
0
Entering edit mode
10.8 years ago
Dataminer ★ 2.8k

Hi!

Yes, I know about the Lift over tool from UCSC. The problem here is bit more complicated.

I have a raw BED file in hg18, that looks like this:

chr1    235    535    AACCCTAACCCTAAACCCTAAACCCTAATCCC    1    +
chr1    2913    3213    GTCGACCCAGCTGGAGGCAGCCAGGCTTGCCT    1    -
chr1    2921    3221    CTGGCTGCCTCCAGCTGGGTCGACAGACAGGG    1    +
chr1    2925    3225    CTGCCTCCAGCTGGGTCGACAGACAGGGGCTG    1    +
chr1    2934    3234    GCTGGGCCGACAGACAGGGGCTGGAGAAGGGG    1    +
chr1    3160    3460    ACCAGGGCTCAGATCCAGGCCAACAGCGTGTC    1    -
chr1    3162    3462    CACGCTGTTGGCCTGGATCTGAGCCCTGGTGG    1    +
chr1    3167    3467    GACCTCCACCAGGGCTCAGATCCAGGCCAACA    1    -
chr1    3169    3469    TTGACCTCCACCAGGGCTCAGATCCAGGCCAA    1    -
chr1    3173    3473    GGCTTTGACCTCCACCAGGGCTCAGATCCAGG    1    -

I want to convert this file into hg19.

Now, if I had the FASTQ file for this one it would be a regular exercise. But I don't have it . Secondly, liftover will only convert first three columns and the other columns will be unchanged, which is not ideal.

Any suggestions how can I achieve my goal.

Thank you

conversion genomics chip-seq • 4.6k views
ADD COMMENT
5
Entering edit mode
10.8 years ago
KCC ★ 4.1k

Liftover gets you part of the way, yes. I assume you want to change the sequence as well.

  1. Liftover to get the coordinates

  2. fastaFromBED to get the sequence. This is in the bedtools package.

    fastaFromBed -fi hg19.fa -bed seqs.bed -fo seqs.fa

  3. You could filter the lines that contain ">" .

    grep -v ">" seqs.fa > seqs.txt

  4. Now you just have to stitch together your lifted over file and seqs.txt. I usually use python at this point.

ADD COMMENT
0
Entering edit mode

sequences should be the same right? only the coordinates will change.

ADD REPLY
0
Entering edit mode

I don't know about the specific differences between hg18 and hg19. In general, potentially, there might be a substitution, a deletion or insertion.

ADD REPLY

Login before adding your answer.

Traffic: 2971 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6