can greatly simplify this:

```python
returns = {'optimal_alignment_score: self.p.score1,
              'suboptiomal_alignment_score': self.p.score2,
             # ...snip...
              }
return_value = returns.get(name, None)

if return_value is None:
    raise AttributeError("...")
else:
    return return_value
```