# Question regarding the function pairwiseAlignment in R

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?

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.
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).