I'm using the package Biostrings
library("Biostrings")
DNAString("TATCAAATACTCAAGCACtaaggaaacaggaaaatct")
will return
37-letter "DNAString" instance seq: TATCAAATACTCAAGCACTAAGGAAACAGGAAAATCT
Why is aaggaaacaggaaaatct
not staying in lowercase?
Is there a way to prevent the transformation to uppercase? I need to keep the lowercase letters.
The thing is that I want to read a big fasta file, not just individual sequences.
But this one is not taking the masked sequences... is there a
readDNAStringSet
that can keep the masked sequences?The first place you should be looking is the help page for the function you are trying to use! I already tried to nudge you in that direction, so let me be more direct. Reading the help page first will save you lots of time, and that is what you should always do. If it seems to people who might help that you are using the support site as a stand in for doing your own homework, you will quickly find any help you might get dwindling down to nothing.
So do you see anything in the help page for
readDNAStringSet
that might be applicable to your situation, particularly in relation to what I have already told you aboutBStrings
?I actually look at help pages. I haven't found anything related to that. I also found somebody else, on another forum, asking for the same question and they said to ask the question here. Now, it seems that there are no easy way to do want I'm trying to aim.
This is my solution:
I used the raw genome that is masked, and then I needed to transform it in a file that was readable by R.
Then from this, I imported my file in R and did whatever I wanted. I actually merged that file with the one from the
readDNAStringSet
function to benefit from both worlds. Thanks for your help.If you have another solution, I'd be happy to see it.
For those who find this thread in Google: The function for reading multi-lined fasta containing both lower- and uppercase letters actually exists in
Biostings
. It isreadBStringSet()
. This function will keep lowercase letters in a sequence. To write aBStringSet
object in a file one may mere usewriteBstringSet()
. Maybe these functions were not presented in earlier versions ofBiostings
. My version is2.58.0
.