I have a file with multiple sequences like this:
ATTCCTACTGGCCCATAATC
TCCTACTGGCCCATAATCCA
ATTCCCACTGGCCCATAATC
GGCCCATAATCCAGCTGTGG
AGTCCTACTGGCCCATAATC
CTGGCCCATAATCCAGCTGT
ACTCCTACTGGCCCATAATC
I need to line up sequences 2-N in relation to sequence 1 so that my output file looks like this:
ATTCCTACTGGCCCATAATC
TCCTACTGGCCCATAATCCA
ATTCCCACTGGCCCATAATC
GGCCCATAATCCAGCTGTGG
AGTCCTACTGGCCCATAATC
CTGGCCCATAATCCAGCTGT
ACTCCTACTGGCCCATAATC
I have tired to use BioStrings but get this:
library(Biostrings)
s1 = DNAString("ATTCCTACTGGCCCATAATC")
s2 = DNAString("TCCTACTGGCCCATAATCCA")
pairwiseAlignment(s1, s2)
Global PairwiseAlignmentsSingleSubject (1 of 1)
pattern: [3] TCCTACTGGCCCATAATC
subject: [1] TCCTACTGGCCCATAATC
score: -0.3283901
Which is not what I want. I tested all of the alignment methods in Biostrings and they all give the same answer. I have also looked at BioPerl options but none seem to work the way I need.
What I want to do is to introduce spaces into the beginning of the sequence to make the sequences line up when printed one on top of the other. I do not want to introduce gaps and I do not want to lose any of the bases in any sequence. I just want them shifted.
Does anyone know a way to do this?
This is the output I get:
I am getting the same result as Hernan is showing. How is it that your output lines up correctly?