Question regarding the function pairwiseAlignment in R 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?
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