Extracting fasta sequences from a RE digested genome .bed file
1
0
Entering edit mode
ferbecneu • 0
@ferbecneu-16188
Last seen 4.2 years ago

Hello, Is it possible to get the sequences between restriction sites from a .bed file containing the coordinates of fragments generated from a in silico RE digestion of mouse mm9 genome in Bioconductor? If so, how can I do it?

I want a fasta file containing all the restriction fragments for alignment of 4c-seq reads in a short read aligner.

Thank you very much and greetings!

biostrings genomicalignments rsamtools • 1.5k views
ADD COMMENT
0
Entering edit mode
@herve-pages-1542
Last seen 5 days ago
Seattle, WA, United States

Hi,

Load the genomic coordinates of your fragments with rtracklayer::import(), use the object returned by rtracklayer::import() to extract the corresponding DNA sequences from the BSgenome object for mm9, then write the sequences to a FASTA file with Biostrings::writeXStringSet(). Will look something like:

library(rtracklayer)                  # for import()
library(BSgenome)                     # for getSeq()
library(BSgenome.Mmusculus.UCSC.mm9)
library(Biostrings)                   # for writeXStringSet()

restriction_sites <- import("path/to/restriction_sites.bed")
restriction_fragments <- getSeq(BSgenome.Mmusculus.UCSC.mm9, restriction_sites)
writeXStringSet(restriction_fragments, "restriction_fragments.fa")

Hope this helps,

H.

ADD COMMENT
0
Entering edit mode

Thank you very much!

ADD REPLY

Login before adding your answer.

Traffic: 487 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