Here you can find the source of modulateCircularIndex(int index, int seqLength)
Parameter | Description |
---|---|
index | Index of the position to work with |
seqLength | Length of the Sequence |
public static int modulateCircularIndex(int index, int seqLength)
//package com.java2s; /*//w w w . j a va2 s .c om * BioJava development code * * This code may be freely distributed and modified under the * terms of the GNU Lesser General Public Licence. This should * be distributed with the code. If you do not have a copy, * see: * * http://www.gnu.org/copyleft/lesser.html * * Copyright for this code is held jointly by the individual * authors. These should be listed in @author doc comments. * * For more information on the BioJava project and its aims, * or to join the biojava-l mailing list, visit the home page * at: * * http://www.biojava.org/ * * Created on 01-21-2010 */ public class Main { /** * Takes a point on a circular location and moves it left until it falls * at the earliest possible point that represents the same base. * * @param index Index of the position to work with * @param seqLength Length of the Sequence * @return The shifted point */ public static int modulateCircularIndex(int index, int seqLength) { // Dummy case if (seqLength == 0) { return index; } // Modulate while (index > seqLength) { index -= seqLength; } return index; } }