protected static String getReferenceBase ( String chromosome , int from , int to , Map < Integer , Character > referenceAlleles ) { int length = to - from ; if ( length < 0 ) { throw new IllegalStateException ( "Sequence length is negative: chromosome " + chromosome + " from " + from + " to " + to ) ; } StringBuilder sb = new StringBuilder ( length ) ; for ( int i = from ; i < to ; i ++ ) { sb . append ( referenceAlleles . getOrDefault ( i , ' ' ) ) ; } return sb . toString ( ) ; // return StringUtils.repeat('N', length); // current return default base TODO load reference sequence }
Get bases from reference sequence .