2
$\begingroup$

I'm a bit confused and would appreciate your assistance, please.

I'm trying to use the pairwiseAlignment function from the Biostrings package to align two protein sequences.

I'm not quite sure where to put my reference sequence, the sequence I want to compare to. Is it under "subject" or "pattern"?

Also, is the score I get the edit distance? Is it the alignment score? Or is it the the alignment length? When I use local alignment, will the score be higher the more the sequences resemble each other? And when I use global alignment, will the score be lower the more the sequences resemble each other?

$\endgroup$
2
$\begingroup$

For semantic purposes, it's better to use the reference sequence as the pattern. Note that only the pattern argument can be used as a multi-element vector, i.e. you can match multiple patterns against a single subject with this function, but not a single pattern against multiple subjects. Knowing that might alter what is defined as a "pattern" or a "subject".

The scores are associated with the alignment method that is used. Alignment scores are higher for more similar matches and lower for poor matches, but the weightings associated with matches and mismatches dictate what that actually means. It might be that a score of -2 happens to be the optimal alignment score, because all other possible alignments are more negative.

It's possible to use pairwiseAlignment to generate the levenshtein distance (most commonly-used edit distance) between two sequences by setting the match score to 0, the mismatch score to -1, gap opening penalty to 0, gap extension penalty to 1, and then negating the resultant pairwiseAlignment score.

$\endgroup$
2
$\begingroup$

According to the help page, it seems more logic to put the reference sequence in subject, and your query sequence in pattern, but it won't really matter for the outcome (except that the pattern sequence will be on top of the alignment).

For your second question:

the scores for the optimal pairwise alignments is returned

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.