So I have a list of several thousand RNA transcripts, and I am trying to find out how they are spliced. Right now I am running
matchLRpatterns() from the Biostrings package with a max gap length of 0, after running a
matchpattern function to categorize the transcripts by donor sites (where the first cut in an RNA transcript is made to cut out introns). But applying that to several thousand transcripts is quite time consuming, when you have 5 donor sequences to match to 9 acceptor sequences in 100 nucleotide long transcripts. Instead, I am thinking to sort by donor, remove all that comes before the splice junction by converting it to a string then using
gsub, then using
matchpattern again, but I only want to check the first 8 nucleotides after the splice junction for the consensus sequence that follows my list of acceptor sites. If I just run
matchpattern without shortening the length of the transcript, I will just find acceptor sites in the RNA transcript, not the acceptor site at the splice junction.
I was thinking
gsub function to the transcripts to remove up to the splice junction, then
strsplit function to make a list of lists of groups of 1 character strings,
head function to get the first 8 single character strings in each list,
paste function to make them one string again,
DNAString function to make the sequences readable by matchpattern, then lapply the
matchpattern function to check the acceptor sequence at the splice junction. Is there a better way? This feels a bit clunky and roundabout way of doing it. I know gsub can remove characters after a certain character or sequence of characters, but I am not sure what the first sequence in each transcript is at the splice junction. Can I still use gsub, but tell it to remove characters after a certain number of characters? Or better yet, is there a way to get matchpattern to only check the first x nucleotides in a sequence?