/** * A helper method to return the first sequence. * * @param sequence the full sequence * * @return the first {@link #getMaxSequenceSize()} characters of the sequence; could be null if * <code>sequence</code> is empty or null. */ private static String getFirstSequence( String sequence ) { return getSequence( sequence, 0, true, true ); }
setFullSequence( getSequence( sequence, startSequence, endSequence, forceConsistency)); prepareUpStreamDownStreamSequence(startSequence, endSequence, sequence, forceConsistency);
/** * A helper method to return the last sequence. * * @param sequence the full sequence * * @return the last {@link #getMaxSequenceSize()} characters of the sequence; could be null if <code>sequence</code> * is empty or null. */ private static String getLastSequence( String sequence ) { return getSequence( sequence, 0, false, true ); }
setFullSequence( getSequence( sequence, startSequence, endSequence, forceConsistency)); prepareUpStreamDownStreamSequence(startSequence, endSequence, sequence, forceConsistency);
/** * A helper method to return the sequence starting at given index. * * @param sequence the full sequence * @param start the starting number for the sequence to return. * * @return the sequence starting at <code>start</code> with max of {@link #getMaxSequenceSize()} characters of the * sequence; could be null if <code>sequence</code> is empty or null. */ private static String getSequenceStartingFrom( String sequence, int start ) { return getSequence( sequence, start, true ); }
/** * A helper method to return the last sequence. * * @param sequence the full sequence * * @return the last {@link #getMaxSequenceSize()} characters of the sequence; could be null if <code>sequence</code> * is empty or null. */ private static String getLastSequence( String sequence ) { return getSequence( sequence, 0, false, true ); }
/** * A helper method to return the last sequence. * * @param sequence the full sequence * * @return the last {@link #getMaxSequenceSize()} characters of the sequence; could be null if <code>sequence</code> * is empty or null. */ private static String getLastSequence( String sequence ) { return getSequence( sequence, 0, false ); }
/** * A helper method to return the first sequence. * * @param sequence the full sequence * * @return the first {@link #getMaxSequenceSize()} characters of the sequence; could be null if * <code>sequence</code> is empty or null. */ private static String getFirstSequence( String sequence ) { return getSequence( sequence, 0, true ); }
/** * A helper method to return the first sequence. * * @param sequence the full sequence * * @return the first {@link #getMaxSequenceSize()} characters of the sequence; could be null if * <code>sequence</code> is empty or null. */ private static String getFirstSequence( String sequence ) { return getSequence( sequence, 0, true, true ); }
/** * A helper method to return the sequence starting at given index. * * @param sequence the full sequence * @param start the starting number for the sequence to return. * @param forceConsistency : if the sequence to extract is not valid and forceConsistency is true, will throw an IllegalArgumentException * * @return the sequence starting at <code>start</code> with max of {@link #getMaxSequenceSize()} characters of the * sequence; could be null if <code>sequence</code> is empty or null. */ private static String getSequenceStartingFrom( String sequence, int start, boolean forceConsistency ) { return getSequence( sequence, start, true, forceConsistency ); }
/** * A helper method to return the sequence starting at given index. * * @param sequence the full sequence * @param start the starting number for the sequence to return. * @param forceConsistency : if the sequence to extract is not valid and forceConsistency is true, will throw an IllegalArgumentException * * @return the sequence starting at <code>start</code> with max of {@link #getMaxSequenceSize()} characters of the * sequence; could be null if <code>sequence</code> is empty or null. */ private static String getSequenceStartingFrom( String sequence, int start, boolean forceConsistency ) { return getSequence( sequence, start, true, forceConsistency ); }
/** * A helper method to return the last sequence. * * @param sequence the full sequence * * @return the last {@link #getMaxSequenceSize()} characters of the sequence; could be null if <code>sequence</code> * is empty or null. */ private static String getLastFullSequence( String sequence ) { int start = sequence.length() - ourMaxSeqSize + 1; if (start < 0){ start = 1; } return getSequence( sequence, start, sequence.length(), true ); }
/** * A helper method to return the last sequence. * * @param sequence the full sequence * * @return the last {@link #getMaxSequenceSize()} characters of the sequence; could be null if <code>sequence</code> * is empty or null. */ private static String getLastFullSequence( String sequence ) { int start = sequence.length() - ourMaxSeqSize + 1; if (start < 0){ start = 1; } return getSequence( sequence, start, sequence.length(), true ); }
/** * A helper method to return the first sequence. * * @param sequence the full sequence * * @return the first {@link #getMaxSequenceSize()} characters of the sequence; could be null if * <code>sequence</code> is empty or null. */ private static String getFirstFullSequence( String sequence ) { int end = ourMaxSeqSize; if (end > sequence.length()){ end = sequence.length(); } if (end <= 0){ end = 1; } return getSequence( sequence, 1, end, true ); }
/** * A helper method to return the first sequence. * * @param sequence the full sequence * * @return the first {@link #getMaxSequenceSize()} characters of the sequence; could be null if * <code>sequence</code> is empty or null. */ private static String getFirstFullSequence( String sequence ) { int end = ourMaxSeqSize; if (end > sequence.length()){ end = sequence.length(); } if (end <= 0){ end = 1; } return getSequence( sequence, 1, end, true ); }
protected Range cloneRange(Range range) throws IntactClonerException { if (range == null) { throw new IllegalArgumentException("You must give a non null range"); } Range clone = new Range(); clonerManager.addClone(range, clone); clone.setFromIntervalStart(range.getFromIntervalStart()); clone.setFromIntervalEnd(range.getFromIntervalEnd()); clone.setToIntervalStart(range.getToIntervalStart()); clone.setToIntervalEnd(range.getToIntervalEnd()); clone.setSequence(range.getSequence()); clone.setFullSequence(range.getFullSequence()); clone.setUpStreamSequence(range.getUpStreamSequence()); clone.setDownStreamSequence(range.getDownStreamSequence()); clone.setFromCvFuzzyType(clone(range.getFromCvFuzzyType())); clone.setToCvFuzzyType(clone(range.getToCvFuzzyType())); clone.setFeature(clone(range.getFeature())); return clone; }
protected Range cloneRange(Range range) throws IntactClonerException { if (range == null) { throw new IllegalArgumentException("You must give a non null range"); } Range clone = new Range(); clonerManager.addClone(range, clone); clone.setFromIntervalStart(range.getFromIntervalStart()); clone.setFromIntervalEnd(range.getFromIntervalEnd()); clone.setToIntervalStart(range.getToIntervalStart()); clone.setToIntervalEnd(range.getToIntervalEnd()); clone.setSequence(range.getSequence()); clone.setFullSequence(range.getFullSequence()); clone.setUpStreamSequence(range.getUpStreamSequence()); clone.setDownStreamSequence(range.getDownStreamSequence()); clone.setFromCvFuzzyType(clone(range.getFromCvFuzzyType())); clone.setToCvFuzzyType(clone(range.getToCvFuzzyType())); clone.setFeature(clone(range.getFeature())); return clone; }