library("Biostrings")
s1 <-
DNAString("TGCTCTCGGGAGCCGCCTCCCGACACCCGAGCCCCGCCGGCGCCTCCCGCTCCCGGCTCCCGGCTCCTGGCTCCCTCCGCCTCCCCCGCCCCTCGCCCCGCCGCCGAAGAGGCCCCGCTCCCGGGTCGGACGCCTGGGTCTGCCGGGAAGAGCGATGAGAGGTGTCTGAAGGTGGCTATTCACTGAGCGATGGGGTTGGACTTGAAGGAATGCCAAGAGATGCTGCCCCCACCCCCTTAGGCCCGAGGGATCAGGAGCTATGGGACCAGAGGCCCTGTCATCTTTACTGCTGCTGCTCTTGGTGGCAAGTGGAGATGCTGACATGAAGGGACATTTTGATCCTGCCAAGTGCCGCTATGCCCTGGGCATGCAGGACCGGACCATCCCAGACAGTGACATCTCTGCTTCCAGCTCCTGGTCAGATTCCACTGCCGCCCGCCACAGCAGGTTGGAGAGCAGTGACGGGGATGGGGCCTGGTGCCCCGCAGGGTCGGTGTTTCCCAAGGAGGAGGAGTACTTGCAGGTGGATCTACAACGACTGCACCTGGTGGCTCTGGTGGGCACCCAGGGACGGCATGCCGGGGGCCTGGGCAAGGAGTTCTCCCGGAGCTACCGGCTGCGTTACTCCCGGGATGGTCGCCGCTGGATGGGCTGGAAGGACCGCTGGGGTCAGGAGGTGATCTCAGGCAATGAGGACCCTGAGGGAGTGGTGCTGAAGGACCTTGGGCCCCCCATGGTTGCCCGACTGGTTCGCTTCTACCCCCGGGCTGACCGGGTCATGAGCGTCTGTCTGCGGGTAGAGCTCTATGGCTGCCTCTGGAGGGATGGACTCCTGTCTTACACCGCCCCTGTGGGGCAGACAATGTATTTATCTGAGGCCGTGTACCTCAACGACTCCACCTATGACGGACATACCGTGGGCGGACTGCAGTATGGGGGTCTGGGCCAGCTGGCAGATGGTGTGGTGGGGCTGGATGACTTTAGGAAGAGTCAGGAGCTGCGGGTCTGGCCAGGCTATGACTATGTGGGATGGAGCAACCACAGCTTCTCCAGTGGCTATGTGGAGATGGAGTTTGAGTTTGACCGGCTGAGGG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CCTTTGCTGGTAGCTGTCAAGATCTTACGGCCAGATGCCACCAAGAATGCCAGGAATGATTTCCTGAAAGAGGTGAAGATCATGTCGAGGCTCAAGGACCCAAACATCATTCGGCTGCTGGGCGTGTGTGTGCAGGACGACCCCCTCTGCATGATTACTGACTACATGGAGAACGGCGACCTCAACCAGTTCCTCAGTGCCCACCAGCTGGAGGACAAGGCAGCCGAGGGGGCCCCTGGGGACGGGCAGGCTGCGCAGGGGCCCACCATCAGCTACCCAATGCTGCTGCATGTGGCAGCCCAGATCGCCTCCGGCATGCGCTATCTGGCCACACTCAACTTTGTACATCGGGACCTGGCCACGCGGAACTGCCTAGTTGGGGAAAATTTCACCATCAAAATCGCAGACTTTGGCATGAGCCGGAACCTCTATGCTGGGGACTATTACCGTGTGCAGGGCCGGGCAGTGCTGCCCATCCGCTGGATGGCCTGGGAGTGCATCCTCATGGGGAAGTTCACGACTGCGAGTGACGTGTGGGCCTTTGGTGTGACCCTGTGGGAGGTGCTGATGCTCTGTAGGGCCCAGCCCTTTGGGCAGCTCACCGACGAGCAGGTCATCGAGAACGCGGGGGAGTTCTTCCGGGACCAGGGCCGGCAGGTGTACCTGTCCCGGCCGCCTGCCTGCCCGCAGGGCCTATATGAGCTGATGCTTCGGTGCTGGAGCCGGGAGTCTGAGCAGCGACCACCCTTTTCCCAGCTGCATCGGTTCCTGGCAGAGGATGCACTCAACACGGTGTGAATCACACATCCAGCTGCCCCTCCCTCAGGGAGCGATCCAGGGGAAGCCAGTGACACTAAAACAAGAGGACACAATGGCACCTCTGCCCTTCCCCTCCCGACAGCCCATCACCTCTAATAGAGGCAGTGAGACTGCAGGTGGGCTGGGCCCACCCAGGGAGCTGATGCCCCTTCTCCCCTTCCTGGACACACTCTCATGTCCCCTTCCTGTTCTTCCTTCCTAGAAGCCCCTGTCGCCCACCCAGCTGGTCCTGTGGATGGGATCCTCTCCACCCTCCTCTAGCCATCCCTTGGGGAAGGGTGGGGAGAAATATAGGATAGACACTGGACATGGCCCATTGGAGCACCTGGGCCCCACTGGACAACACTGATTCCTGGAGAGGTGGCTGCGCCCCCAGCTTCTCTCTCCCTGTCACACACTGGACCCCACTGGCTGAGAATCTGGGGGTGAGGAGGACAAGAAGGAGAGGAAAATGTTTCCTTGTGCCTGCTCCTGTACTTGTCCTCAGCTTGGGCTTCTTCCTCCTCCATCACCTGAAACACTGGACCTGGGGGTAGCCCCGCCCCAGCCCTCAGTCACCCCCACTTCCCACTTGCAGTCTTGTAGCTAGAACTTCTCTAAGCCTATACGTTTCTGTGGAGTAAATATTGGGATTGGGGGGAAAGAGGGAGCAACGGCCCATAGCCTTGGGGTTGGACATCTCTAGTGTAGCTGCCACATTGATTTTTCTATAATCACTTGGGGTTTGTACATTTTTGGGGGGAGAGACACAGATTTTTACACTAATATATGGACCTAGCTTGAGGCAATTTTAATCCCCTGCACTAGGCAGGTAATAATAAAGGTTGAGTTTTCCACAAAAAAAAAAAAAAAAAA")
s2 <-
DNAString("GCCGCCGAAGAGGCCCCGCTCCCGGGTCGGACGCCTGGGTCTGCCGGGAAGAGCGATGAGAGAGATGCTGCCCCCACCCCCTTAGGCCCGAGGGATCAGGAGCTATGGGACCAGAGGCCCTGTCATCTTTACTGCTGCTGCTCTTGGTGGCAAGTGGAGATGCTGACATGAAGGGACATTTTGATCCTGCCAAGTGCCGCTATGCCCTGGGCATGCAGGACCGGACCATCCCAGACAGTGACATCTCTGCTTCCAGCTCCTGGTCAGATTCCACTGCCGCCCGCCACAGCAGGTTGGAGAGCAGTGACGGGGATGGGGCCTGGTGCCCCGCAGGGTCGGTGTTTCCCAAGGAGGAGGAGTACTTGCAGGTGGATCTACAACGACTGCACCTGGTGGCTCTGGTGGGCACCCAGGGACGGCATGCCGGGGGCCTGGGCAAGGAGTTCTCCCGGAGCTACCGGCTGCGTTACTCCCGGGATGGTCGCCGCTGGATGGGCTGGAAGGACCGCTGGGGTCAGGAGGTGATCTCAGGCAATGAGGACCCTGAGGGAGTGGTGCTGAAGGACCTTGGGCCCCCC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CATTATGCCGAGGCTGACATTGTTACCCTGCAGGGCGTCACCGGGGGCAACACCTATGCTGTGCCTGCACTGCCCCCAGGGGCAGTCGGGGATGGGCCCCCCAGAGTGGATTTCCCTCGATCTCGACTCCGCTTCAAGGAGAAGCTTGGCGAGGGCCAGTTTGGGGAGGTGCACCTGTGTGAGGTCGACAGCCCTCAAGATCTGGTCAGTCTTGATTTCCCCCTTAATGTGCGTAAGGGACACCCTTTGCTGGTAGCTGTCAAGATCTTACGGCCAGATGCCACCAAGAATGCCAGGAATGATTTCCTGAAAGAGGTGAAGATCATGTCGAGGCTCAAGGACCCAAACATCATTCGGCTGCTGGGCGTGTGTGTGCAGGACGACCCCCTCTGCATGATTACTGACTACATGGAGAACGGCGACCTCAACCAGTTCCTCAGTGCCCACCAGCTGGAGGACAAGGCAGCCGAGGGGGCCCCTGGGGACGGGCAGGCTGCGCAGGGGCCCACCATCAGCTACCAAATGCTGCTGCATGTGGCAGCCCAGATCGCCTCCGGCATGCGCTATCTGGCCACACTCAACTTTGTACATCGGGACCTGGCCACGCGGAACTGCCTAGTTGGGGAAAATTTCACCATCAAAATCGCAGACTTTGGCATGAGCCGGAACCTCTATGCTGGGGACTATTACCGTGTGCAGGGCCGGGCAGTGCTGCCCATCCGCTGGATGGCCTGGGAGTGCATCCTCATGGGGAAGTTCACGACTGCGAGTGACGTGTGGGCCTTTGGTGTGACCCTGTGGGAGGTGCTGATGCTCTGTAGGGCCCAGCCCTTTGGGCAGCTCACCGACGAGCAGGTCATCGAGAACGCGGGGGAGTTCTTCCGGGACCAGGGCCGGCAGGTGTACCTGTCCCGGCCGCCTGCCTGCCCGCAGGGCCTATATGAGCTGATGCTTCGGTGCTGGAGCCGGGAGTCTGAGCAGCGACCACCCTTTTCCCAGCTGCATCGGTTCCTGGCAGAGGATGCACTCAACACGGTGTGAATCACACATCCAGCTGCCCCTCCCTCAGGGAGCGATCCAGGGGAAGCCAGTGACACTAAAACAAGAGGACACAATGGCACCTCTGCCCTTCCCCTCCCGACAGCCCATCACCTCTAATAGAGGCAGTGAGACTGCAGGTGGGCTGGGCCCACCCAGGGAGCTGATGCCCCTTCTCCCCTTCCTGGACACACACTCATGTCCCCTTCCTGTTCTTCCTTCCTAGAAGCCCCTGTCGCCCACCCAGCTGGTCCTGTGGATGGGATCCTCTCCACCCTCCTCTAGCCATCCCTTGGGGAAGGGTGGGGAGAAATATAGGATAGACACTGGACATGGCCCATTGGAGCACCTGGGCCCCACTGGACAACACTGATTCCTGGAGAGGTGGCTGCGCCCCCAGCTTCTCTCTCCCTGTCACACACTGGACCCCACTGGCTGAGAATCTGGGGGTGAGGAGGACAAGAAGGAGAGGAAAATGTTTCCTTGTGCCTGCTCCTGTACTTGTCCTCAGCTTGGGCTTCTTCCTCCTCCATCACCTGAAACACTGGACCTGGGGGTAGCCCCGCCCCAGCCCTCAGTCACCCCCACTTCCCACTTGCAGTCTTGTAGCTAGAACTTCTCTAAGCCTATACGTTTCTGTGGAGTAAATATTGGGATTGGGGGGAAAGAGGGAGCAACGGCCCATAGCCTTGGGGTTGGACATCTCTAGTGTAGCTGCCACATTGATTTTTCTATAATCACTTGGGGTTTGTACATTTTTGGGGGGAGAGACACAGATTTTTACACTAATATATGGACCTAGCTTGAGGCAATTTTAATCCCCTGCACTAGGCAGGTAATAATAAAGGTTGAGTTTTCCACaaaaaaaaaaaaaaaa")
s1
s2
mat <- nucleotideSubstitutionMatrix(match = 2, mismatch = -3, baseOnly = FALSE)
psa2 <-
pairwiseAlignment(pattern = s1,
subject = s2,
substitutionMatrix = mat,
type = "local",
gapOpening = 5, gapExtension = 2,
scoreOnly=FALSE)
x <- insertion(psa2)
gives
IRangesList of length 1
[[1]]
IRanges object with 2 ranges and 0 metadata columns:
start end width
<integer> <integer> <integer>
[1] 63 118 56
[2] 1619 1729 111
I want a single string which looks like this 63-118, 1619-1729 or two strings which look like this 63,1619 & 118,1729.
i.e I just want all the start and ends in one variable.
Sorry but i'm not an R Programer or a Biologist so this is all a struggle to me.
Thanks Michael but that only works where there is one range otherwise I get this error message
Error in as.vector(x, mode) :
coercing an AtomicList object to an atomic vector is supported only for
objects with top-level elements of length <= 1
Are you using the latest version of Bioconductor (3.5)? Your installation may be too old.