This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Conversion ......... Bed File In Hg18 To Hg19

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

1 answer

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.

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

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

Log in to answer this question.