Starter in using R and Bioconductor for bioinformatics projects, my question is:
I have a list of DNAstringsSet
s (seen below) and want to use the writeXstringset()
function which takes a DNAstringset
object as an argument in order to save as a FASTA file.Anyone knows how is it possible to collapse the list of DNAstringset
s into a single DNAStringset
object?
$NM_008866
A DNAStringSet instance of length 13
width seq names
[1] 693 ATGTGCGGCAACAACATGTCCGCTCCGA...GATAAGCTCCTACCTCCAATTGATTGA NM_008866
[2] 72 ATGGATGGGCAGAAGCCTTTGCAGGTAT...AATACATCTGTCCACATGCCCCTGTGA NM_008866
[3] 114 ATGGGCAGAAGCCTTTGCAGGTATCAAA...GAATATGGCTATGCCTTCTTGGTTTGA NM_008866
[4] 213 ATGGCATTCCTTCTAACAGGATTATTTT...AGTGCCATGGAGATTGTGACCCTTTAG NM_008866
[5] 63 ATGTCAAGCACTTCATTGATAAGCTCCT...TTGATTGACATCACTAAGAGGCCTTGA NM_008866
... ... ...
[9] 219 ATGGCCCTTCTATTGGGAGACCAGGCTT...CAGAGGCAGGCGGATCTCTGTCAATAG NM_008866
[10] 144 ATGTTATGCTTAAAACCAAATACTGTTC...CAGTCTCCTGTACAAATATTAAAATAA NM_008866
[11] 78 ATGTTGCAAAAATTATGGTTATTTCTGA...CCAACCAACCAAGAAGCACCTTTATAA NM_008866
[12] 75 ATGGTTATTTCTGAACGGTTGCTTTTCT...AGAAGCACCTTTATAAACAGGTGCTAA NM_008866
[13] 90 ATGTCTGGATTTAAAACAATTTCAAACA...AATTTACTTCAGTTATTCTATCTGTAA
$NM_001159750
A DNAStringSet instance of length 9
width seq names
[1] 903 ATGGAGGACGAGGTGGTTCGCATTGCCA...ATGTGGAAATCGGTGGAAGTTCTGTTGA NM_001159750
[2] 105 ATGGACCATCAACTGATAAAGACCCTGA...AGAGAAGAAAGTTCCAGCAGCAATGTAA NM_001159750
[3] 75 ATGAGACAAATGCTCGAGATACATATGT...CCAAGCACTTCTGATTCTGTGCGATTAA NM_001159750
[4] 75 ATGATTATGTTGCAATTGGAGCTGATGA...ATTGAGGAAGCTATATATCAAGAAATAA NM_001159750
[5] 129 ATGAATGTGGAAATCGGTGGAAGTTCTG...GCCAGGCAACTCGTTTCCTTGCAAGTGA NM_001159750
[6] 63 ATGTGGAAATCGGTGGAAGTTCTGTTGA...AGAATTGGCAAAGTATCTGGACCATTAA NM_001159750
[7] 102 ATGTGTCCCACTTGTTTTGCTAGTAATA...TATAGTAAAGGCCACTTTTATAAATTAA NM_001159750
[8] 102 ATGGAAAACAATATGTCCATGTTAAAAG...CGGGAGGCAGAGGCAGGCGGATTTCTGA NM_001159750
[9] 75 ATGGATAATTTCTGTCACTTTAAAAATA...TAGTTTAAAAGTAATAAGGTTAAAATAG NM_001159750
$NM_011541
A DNAStringSet instance of length 9
width seq names
[1] 906 ATGGAGGACGAGGTGGTTCGCATTGCCA...ATGTGGAAATCGGTGGAAGTTCTGTTGA NM_011541
[2] 108 ATGGACCATCAACTGATAAAGACCCTGA...GAAGAAAGTAGTTCCAGCAGCAATGTAA NM_011541
[3] 75 ATGAGACAAATGCTCGAGATACATATGT...CCAAGCACTTCTGATTCTGTGCGATTAA NM_011541
[4] 75 ATGATTATGTTGCAATTGGAGCTGATGA...ATTGAGGAAGCTATATATCAAGAAATAA NM_011541
[5] 129 ATGAATGTGGAAATCGGTGGAAGTTCTG...GCCAGGCAACTCGTTTCCTTGCAAGTGA NM_011541
[6] 63 ATGTGGAAATCGGTGGAAGTTCTGTTGA...AGAATTGGCAAAGTATCTGGACCATTAA NM_011541
[7] 102 ATGTGTCCCACTTGTTTTGCTAGTAATA...TATAGTAAAGGCCACTTTTATAAATTAA NM_011541
[8] 102 ATGGAAAACAATATGTCCATGTTAAAAG...CGGGAGGCAGAGGCAGGCGGATTTCTGA NM_011541
[9] 75 ATGGATAATTTCTGTCACTTTAAAAATA...TAGTTTAAAAGTAATAAGGTTAAAATAG NM_011541
$NM_001159751
A DNAStringSet instance of length 9
width seq names
[1] 939 ATGTGTCCCTCGGTGTGTACCACTTTCC...ATGTGGAAATCGGTGGAAGTTCTGTTGA NM_001159751
[2] 108 ATGGACCATCAACTGATAAAGACCCTGA...GAAGAAAGTAGTTCCAGCAGCAATGTAA NM_001159751
[3] 75 ATGAGACAAATGCTCGAGATACATATGT...CCAAGCACTTCTGATTCTGTGCGATTAA NM_001159751
[4] 75 ATGATTATGTTGCAATTGGAGCTGATGA...ATTGAGGAAGCTATATATCAAGAAATAA NM_001159751
[5] 129 ATGAATGTGGAAATCGGTGGAAGTTCTG...GCCAGGCAACTCGTTTCCTTGCAAGTGA NM_001159751
[6] 63 ATGTGGAAATCGGTGGAAGTTCTGTTGA...AGAATTGGCAAAGTATCTGGACCATTAA NM_001159751
[7] 102 ATGTGTCCCACTTGTTTTGCTAGTAATA...TATAGTAAAGGCCACTTTTATAAATTAA NM_001159751
[8] 102 ATGGAAAACAATATGTCCATGTTAAAAG...CGGGAGGCAGAGGCAGGCGGATTTCTGA NM_001159751
[9] 75 ATGGATAATTTCTGTCACTTTAAAAATA...TAGTTTAAAAGTAATAAGGTTAAAATAG NM_001159751
Answered at stackexchange using:
do.call(c, dna_list)
Thanks, i used the
do.call
, but first i had to get rid of the names in myDNAStringSet
by using