// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Contact: phylosoft @ gmail . com
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Contact: phylosoft @ gmail . com
public final class ResampleableMsa extends BasicMsa {
private int[] _resampled_column_positions = null;
public final class ResampleableMsa extends BasicMsa {
private int[] _resampled_column_positions = null;
- public void resample( final int[] resampled_column_positions ) {
+ @Override
+ final public char getResidueAt( final int row, final int col ) {
+ if ( _resampled_column_positions != null ) {
+ return super.getResidueAt( row, _resampled_column_positions[ col ] );
+ }
+ return super.getResidueAt( row, col );
+ }
+
+ final public void resample( final int[] resampled_column_positions ) {
throw new IllegalArgumentException( "illegal attempt to use " + resampled_column_positions.length
+ " resampled column positions on msa of length " + getLength() );
}
throw new IllegalArgumentException( "illegal attempt to use " + resampled_column_positions.length
+ " resampled column positions on msa of length " + getLength() );
}
- public char getResidueAt( final int row, final int col ) {
- if ( _resampled_column_positions != null ) {
- return super.getResidueAt( row, _resampled_column_positions[ col ] );
- }
- return super.getResidueAt( row, col );
+ final public void setResidueAt( final int row, final int col, final char residue ) {
+ throw new NoSuchMethodError( "illegal attempt to set residue in resampleable msa" );
- public void setResidueAt( final int row, final int col, final char residue ) {
- throw new NoSuchMethodError( "illegal attempt to set residue in resampleable msa" );
+ public Sequence getSequence( final int row ) {
+ return new BasicSequence( getIdentifier( row ), getSequenceAsString( row ).toString(), getType() );