Simple subject extraction question with biostrings
1
0
Entering edit mode
James • 0
@60d686b0
Last seen 3 months ago
United States

Hello there! I am new to Biostrings and have what is likely a simple question, but I can't seem to figure out a solution to this issue.

I am doing global pairwise alignments using pairwiseAlignment.

I have an example where the alignment results in three gaps at the start of the sequence. EX:

> align
Global PairwiseAlignmentsSingleSubject (1 of 1)
pattern: ---FLVLLPLVSSQCVNLTTRTQ...GSCCKFDEDDSEPVLKGVKLHYT
subject: MFVFLVLLPLVSSQCVNLTTRTQ...GSCCKFDEDDSEPVLKGVKLHYT
score: 5433.158 
> pattern(align)
[1] FLVLLPLVSSQCVNLTTRTQLPPA...GSCCKFDEDDSEPVLKGVKLHYT 
> subject(align)
[4] FLVLLPLVSSQCVNLTTRTQLPPA...GSCCKFDEDDSEPVLKGVKLHYT

I am in need of having the full sequences including leading gaps (as well as corresponding positions in the subject/reference sequence).

I have discovered how to get the pattern as desired...

> as.character(align)
[1] "---FLVLLPLVSSQCVNLTTRTQ...VLKGVKLHYT

but I can not figure out how one would do this with the subject/ref sequence. I have scoured the documentation, but must be missing something.

If anyone has advice, it would be greatly appreciated!

Biostrings • 127 views
ADD COMMENT
0
Entering edit mode
DannyM • 0
@dannym-18984
Last seen 3 months ago
Germany

Hi,

can you please provide the code where you generate the alignment?

Best

ADD COMMENT
0
Entering edit mode

Thank you for reminding me, I should have added that to the start.

ref <- readAAStringSet('ref.fasta')
study <- readAAStringSet('study.fasta')
align <- pairwiseAlignment(pattern = study[[1]], subject = ref[[1]],type = "global")
ADD REPLY

Login before adding your answer.

Traffic: 527 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6