code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
private boolean isMatchingFileExtension() {
String[] fileExtensions = mediaArgs.getFileExtensions();
if (fileExtensions == null || fileExtensions.length == 0) {
return true;
}
for (String fileExtension : fileExtensions) {
if (StringUtils.equalsIgnoreCase(fileExtension, getFileExtension())) {... | java |
private Dimension getRequestedDimension() {
// check for fixed dimensions from media args
if (mediaArgs.getFixedWidth() > 0 || mediaArgs.getFixedHeight() > 0) {
return new Dimension(mediaArgs.getFixedWidth(), mediaArgs.getFixedHeight());
}
// check for dimensions from mediaformat (evaluate only ... | java |
public @NotNull List<Resource> getResources() {
return getResources((Predicate<Resource>)null, (Resource)null);
} | java |
public @NotNull String build() {
SortedMap<String, Object> sortedParameterMap = new TreeMap<>(parameterMap);
// gather resource paths in a treeset (having them in a defined order helps with caching)
SortedSet<String> resourcePathsSet = new TreeSet<>();
// iterate over all parts that should be kept fro... | java |
private void detectIntegratorTemplateModes() {
// integrator mode cannot be active if no modes defined
if (urlHandlerConfig.getIntegratorModes().isEmpty()) {
return;
}
if (request != null && RequestPath.hasSelector(request, SELECTOR_INTEGRATORTEMPLATE_SECURE)) {
integratorTemplateSecureMode ... | java |
@Override
public @NotNull String getIntegratorTemplateSelector() {
if (currentPage != null && urlHandlerConfig.isIntegrator(currentPage)) {
if (isResourceUrlSecure(currentPage)) {
return SELECTOR_INTEGRATORTEMPLATE_SECURE;
}
else {
return SELECTOR_INTEGRATORTEMPLATE;
}
... | java |
@SuppressWarnings("null")
private @NotNull IntegratorMode getIntegratorMode(ValueMap properties) {
IntegratorMode mode = null;
Collection<IntegratorMode> integratorModes = urlHandlerConfig.getIntegratorModes();
String modeString = properties.get(IntegratorNameConstants.PN_INTEGRATOR_MODE, String.class);
... | java |
@SuppressWarnings("null")
private IntegratorProtocol getIntegratorProtocol(ValueMap properties) {
IntegratorProtocol protocol = IntegratorProtocol.AUTO;
try {
String protocolString = properties.get(IntegratorNameConstants.PN_INTEGRATOR_PROTOCOL, String.class);
if (StringUtils.isNotEmpty(protocolSt... | java |
private boolean isResourceUrlSecure(Page page) {
ValueMap props = getPagePropertiesNullSafe(page);
IntegratorMode mode = getIntegratorMode(props);
if (mode.isDetectProtocol()) {
IntegratorProtocol integratorProtocol = getIntegratorProtocol(props);
if (integratorProtocol == IntegratorProtocol.HTT... | java |
private Page getTargetPage(String targetPath, InternalLinkResolverOptions options) {
if (StringUtils.isEmpty(targetPath)) {
return null;
}
// Rewrite target to current site context
String rewrittenPath;
if (options.isRewritePathToContext() && !useTargetContext(options)) {
rewrittenPath... | java |
private boolean useTargetContext(InternalLinkResolverOptions options) {
if (options.isUseTargetContext() && !options.isRewritePathToContext()) {
return true;
}
// even is use target context is not activated use it if current page is an experience fragment
// otherwise it will be always impossible ... | java |
public final T addCssClass(String value) {
if (StringUtils.isNotEmpty(value)) {
return setCssClass(StringUtils.isNotEmpty(getCssClass()) ? getCssClass() + " " + value : value);
}
else {
return (T)this;
}
} | java |
public final Map<String, String> getStyles() {
Map<String, String> styleMap = new HashMap<String, String>();
// de-serialize style string, fill style map
String styleString = getStyleString();
if (styleString != null) {
String[] styles = StringUtils.split(styleString, ";");
for (String styl... | java |
public final T setStyle(String styleAttribute, String styleValue) {
// Add style to style map
Map<String, String> styleMap = getStyles();
styleMap.put(styleAttribute, styleValue);
// Serialize style string
StringBuilder styleString = new StringBuilder();
for (Map.Entry style : styleMap.entrySe... | java |
private static String guessHumanReadableRatioString(double ratio, NumberFormat numberFormat) {
for (long width = 1; width <= 50; width++) {
double height = width / ratio;
if (isLong(height)) {
return numberFormat.format(width) + ":" + numberFormat.format(height);
}
}
for (long widt... | java |
public Dimension getMinDimension() {
long effWithMin = getEffectiveMinWidth();
long effHeightMin = getEffectiveMinHeight();
double effRatio = getRatio();
if (effWithMin == 0 && effHeightMin > 0 && effRatio > 0) {
effWithMin = Math.round(effHeightMin * effRatio);
}
if (effWithMin > 0 && ef... | java |
private boolean resolveByNames(MediaArgs mediaArgs) {
// resolved media formats already set? done.
if (mediaArgs.getMediaFormats() != null) {
return true;
}
// no media format names present? done.
if (mediaArgs.getMediaFormatNames() == null) {
return true;
}
String[] mediaFormatN... | java |
private boolean addResponsiveImageMediaFormats(MediaArgs mediaArgs) {
Map<String, MediaFormat> additionalMediaFormats = new LinkedHashMap<>();
// check if additional on-the-fly generated media formats needs to be added for responsive image handling
if (!resolveForImageSizes(mediaArgs, additionalMediaFormat... | java |
private Asset getInlineAsset(Resource ntResourceResource, Media media, String fileName) {
return new InlineAsset(ntResourceResource, media, fileName, adaptable);
} | java |
private String detectFileName(Resource referencedResource, Resource ntFileResource,
Resource ntResourceResource) {
// detect file name
String fileName = null;
// if referenced resource is not the nt:file node check for <nodename>Name property
if (ntFileResource != null && !referencedResource.equal... | java |
private String cleanupFileName(String fileName) {
String processedFileName = fileName;
// strip off path parts
if (StringUtils.contains(processedFileName, "/")) {
processedFileName = StringUtils.substringAfterLast(processedFileName, "/");
}
if (StringUtils.contains(processedFileName, "\\")) {... | java |
private boolean isRenditionMatchSizeSameBigger(MediaFormat mediaFormat, MediaFormat mediaFormatRequested) {
long widthRequested = mediaFormatRequested.getEffectiveMinWidth();
long heightRequested = mediaFormatRequested.getEffectiveMinHeight();
long widthMax = mediaFormat.getEffectiveMaxWidth();
long he... | java |
private boolean isRenditionMatchSizeSameSmaller(MediaFormat mediaFormat, MediaFormat mediaFormatRequested) {
long widthRequested = mediaFormatRequested.getEffectiveMinWidth();
long heightRequested = mediaFormatRequested.getEffectiveMinHeight();
long widthMin = mediaFormat.getEffectiveMinWidth();
long h... | java |
private boolean isRenditionMatchExtension(MediaFormat mediaFormat) {
for (String extension : mediaFormat.getExtensions()) {
if (FileExtension.isImage(extension)) {
return true;
}
}
return false;
} | java |
private NavigableSet<RenditionMetadata> rotateSourceRenditions(Set<RenditionMetadata> candidates) {
if (rotation == null) {
return new TreeSet<>(candidates);
}
return candidates.stream()
.map(rendition -> new VirtualTransformedRenditionMetadata(rendition.getRendition(),
rotateMapWi... | java |
private VirtualTransformedRenditionMetadata getCropRendition(NavigableSet<RenditionMetadata> candidates) {
RenditionMetadata original = getOriginalRendition();
if (original == null) {
return null;
}
Double scaleFactor = getCropScaleFactor();
CropDimension scaledCropDimension = new CropDimensio... | java |
private double getCropScaleFactor() {
RenditionMetadata original = getOriginalRendition();
RenditionMetadata webEnabled = AutoCropping.getWebRenditionForCropping(getAsset());
if (original == null || webEnabled == null || original.getWidth() == 0 || webEnabled.getWidth() == 0) {
return 1d;
}
re... | java |
static @NotNull Resource get(String path, ResourceResolver resolver) {
Resource resource = resolver.getResource(path);
if (resource != null) {
return resource;
}
return new SyntheticNavigatableResource(path, resolver);
} | java |
public @NotNull MediaArgs dragDropSupport(DragDropSupport value) {
if (value == null) {
throw new IllegalArgumentException("No null value allowed for drag&drop support.");
}
this.dragDropSupport = value;
return this;
} | java |
public static String getImageFileName(String originalFilename) {
String namePart = StringUtils.substringBeforeLast(originalFilename, ".");
String extensionPart = StringUtils.substringAfterLast(originalFilename, ".");
// use PNG format if original image is PNG, otherwise always use JPEG
if (StringUtils.... | java |
public static String toHtml5DataName(String headlessCamelCaseName) {
if (StringUtils.isEmpty(headlessCamelCaseName)) {
throw new IllegalArgumentException("Property name is empty.");
}
if (!isHeadlessCamelCaseName(headlessCamelCaseName)) {
throw new IllegalArgumentException("This is not a valid h... | java |
public static String toHeadlessCamelCaseName(String html5DataName) {
if (StringUtils.isEmpty(html5DataName)) {
throw new IllegalArgumentException("Property name is empty.");
}
if (!isHtml5DataName(html5DataName)) {
throw new IllegalArgumentException("This is not a valid HTML5 data property name:... | java |
@Override
@Deprecated
public final org.jdom2.Element setName(String value) {
return super.setName(value);
} | java |
public final int getAttributeValueAsInteger(String attributeName) {
Attribute attribute = getAttribute(attributeName);
if (attribute == null) {
return 0;
}
else {
try {
return attribute.getIntValue();
}
catch (DataConversionException ex) {
return 0;
}
}
... | java |
public final T setAttributeValueAsLong(String name, long value) {
setAttribute(name, Long.toString(value));
return (T)this;
} | java |
public final long getAttributeValueAsLong(String attributeName) {
Attribute attribute = getAttribute(attributeName);
if (attribute == null) {
return 0;
}
else {
try {
return attribute.getLongValue();
}
catch (DataConversionException ex) {
return 0;
}
}
... | java |
public final T setAttributeValueAsInteger(String name, int value) {
setAttribute(name, Integer.toString(value));
return (T)this;
} | java |
@Override
public final org.jdom2.Element addContent(Content content) {
// ignore empty elements
if (content == null) {
return null;
}
return super.addContent(content);
} | java |
@Override
public final org.jdom2.Element addContent(Collection collection) {
// ignore empty elements
if (collection == null) {
return null;
}
return super.addContent(collection);
} | java |
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
String filename = xhtmlResourceMap.get(publicId);
if (filename != null) {
String resourceName = resourceFolder + "/" + filename;
InputStream is = XHtmlEntityResolver.class.getResourceAs... | java |
Object readResolve() {
if (favorites != null) {
data = Maps.newConcurrentMap();
for (String job : favorites) {
data.put(job, true);
}
favorites = null;
}
return this;
} | java |
@Nonnull
@ReturnsMutableCopy
public ICommonsList <IIndexerWorkItem> stop ()
{
// don't take any more actions
m_aImmediateCollector.stopQueuingNewObjects ();
// Get all remaining objects and save them for late reuse
final ICommonsList <IIndexerWorkItem> aRemainingItems = m_aImmediateCollector.drai... | java |
public void queueObject (@Nonnull final IIndexerWorkItem aItem)
{
ValueEnforcer.notNull (aItem, "Item");
m_aImmediateCollector.queueObject (aItem);
} | java |
public void addItem (@Nonnull final ReIndexWorkItem aItem) throws IllegalStateException
{
ValueEnforcer.notNull (aItem, "Item");
m_aRWLock.writeLocked ( () -> {
internalCreateItem (aItem);
});
LOGGER.info ("Added " + aItem.getLogText () + " to re-try list for retry #" + (aItem.getRetryCount () +... | java |
@Nonnull
private EChange _queueUniqueWorkItem (@Nonnull final IIndexerWorkItem aWorkItem)
{
ValueEnforcer.notNull (aWorkItem, "WorkItem");
// Check for duplicate
m_aRWLock.writeLock ().lock ();
try
{
if (!m_aUniqueItems.add (aWorkItem))
{
LOGGER.info ("Ignoring work item " +... | java |
@Nonnull
public EChange queueWorkItem (@Nonnull final IParticipantIdentifier aParticipantID,
@Nonnull final EIndexerWorkItemType eType,
@Nonnull @Nonempty final String sOwnerID,
@Nonnull @Nonempty final String sRequestingH... | java |
public void expireOldEntries ()
{
// Expire old entries
final ICommonsList <IReIndexWorkItem> aExpiredItems = m_aReIndexList.getAndRemoveAllEntries (IReIndexWorkItem::isExpired);
if (aExpiredItems.isNotEmpty ())
{
LOGGER.info ("Expiring " + aExpiredItems.size () + " re-index work items and move ... | java |
public void reIndexParticipantData ()
{
final LocalDateTime aNow = PDTFactory.getCurrentLocalDateTime ();
// Get and remove all items to re-index "now"
final List <IReIndexWorkItem> aReIndexNowItems = m_aReIndexList.getAndRemoveAllEntries (aWorkItem -> aWorkItem.isRetryPossible (aNow));
if (LOGGER.i... | java |
@Nonnull
public static ClientCertificateValidationResult verifyClientCertificate (@Nonnull final HttpServletRequest aHttpRequest,
@Nonnull final String sLogPrefix)
{
if (s_bIsCheckDisabled.get ())
{
if (LOGGER.isDebugEnabled ()... | java |
@Nonnull
@ReturnsMutableCopy
public static IMultiMapListBased <IParticipantIdentifier, PDStoredBusinessEntity> getGroupedByParticipantID (@Nonnull final Iterable <PDStoredBusinessEntity> aDocs)
{
final MultiLinkedHashMapArrayListBased <IParticipantIdentifier, PDStoredBusinessEntity> ret = new MultiLinkedHashM... | java |
@Nonnull
private static ClientCertificateValidationResult _checkClientCertificate (@Nonnull final HttpServletRequest aHttpServletRequest,
@Nonnull final String sLogPrefix)
{
try
{
return ClientCertificateValidator.verifyClient... | java |
public void incRetryCount ()
{
m_nRetries++;
m_aPreviousRetryDT = PDTFactory.getCurrentLocalDateTime ();
m_aNextRetryDT = m_aPreviousRetryDT.plusMinutes (PDServerConfiguration.getReIndexRetryMinutes ());
} | java |
@Nullable
public IndexSearcher getSearcher () throws IOException
{
_checkClosing ();
final IndexReader aReader = getReader ();
if (aReader == null)
{
// Index not readable
LOGGER.warn ("Index not readable");
return null;
}
if (m_aSearchReader == aReader)
{
// Rea... | java |
@MustBeLocked (ELockType.WRITE)
public void updateDocuments (@Nullable final Term aDelTerm,
@Nonnull final Iterable <? extends Iterable <? extends IndexableField>> aDocs) throws IOException
{
long nSeqNum;
if (false)
{
// Delete and than add
nSeqNum = _getWrite... | java |
@Nonnull
public ESuccess writeLockedAtomic (@Nonnull final IThrowingRunnable <IOException> aRunnable) throws IOException
{
m_aRWLock.writeLock ().lock ();
try
{
if (isClosing ())
{
LOGGER.info ("Cannot executed something write locked, because Lucene is shutting down");
return... | java |
@Nullable
public final NATIVE_TYPE getDocValue (@Nonnull final Document aDoc)
{
final IndexableField aField = getDocField (aDoc);
if (aField != null)
return getFieldNativeValue (aField);
return null;
} | java |
@Nullable
public static PDBusinessCard parseBusinessCard (@Nonnull final byte [] aData, @Nullable final Charset aCharset)
{
ValueEnforcer.notNull (aData, "Data");
{
// Read version 1
final PD1BusinessCardMarshaller aMarshaller1 = new PD1BusinessCardMarshaller ();
aMarshaller1.readExceptio... | java |
@Nullable
public static PDBusinessCard parseBusinessCard (@Nonnull final Node aNode)
{
ValueEnforcer.notNull (aNode, "Node");
{
// Read version 1
final PD1BusinessCardMarshaller aMarshaller1 = new PD1BusinessCardMarshaller ();
aMarshaller1.readExceptionCallbacks ().removeAll ();
fin... | java |
@Nonnull
public static ClientCertificateValidationResult createSuccess (@Nonnull @Nonempty final String sClientID)
{
ValueEnforcer.notEmpty (sClientID, "ClientID");
return new ClientCertificateValidationResult (true, sClientID);
} | java |
@Nonnull
@OverrideOnDemand
protected <T> T executeRequest (@Nonnull final HttpRequestBase aRequest,
@Nonnull final ResponseHandler <T> aHandler) throws IOException
{
// Contextual attributes set the local context level will take
// precedence over those set at the client ... | java |
@Nonnull
public boolean isServiceGroupRegistered (@Nonnull final IParticipantIdentifier aParticipantID)
{
ValueEnforcer.notNull (aParticipantID, "ParticipantID");
final HttpGet aGet = new HttpGet (m_sPDIndexerURL + aParticipantID.getURIPercentEncoded ());
try
{
return executeRequest (aGet, ne... | java |
public static void streamFileXMLTo (@Nonnull final UnifiedResponse aUR)
{
// Do it in a read lock!
s_aRWLock.readLock ().lock ();
try
{
final File f = _getFileXML ();
// setContent(IReadableResource) is lazy
aUR.setContent (new FileSystemResource (f));
}
finally
{
s... | java |
public static void streamFileExcelTo (@Nonnull final UnifiedResponse aUR)
{
// Do it in a read lock!
s_aRWLock.readLock ().lock ();
try
{
final File f = _getFileExcel ();
// setContent(IReadableResource) is lazy
aUR.setContent (new FileSystemResource (f));
}
finally
{
... | java |
@Nonnull
public static ESuccess executeWorkItem (@Nonnull final IPDStorageManager aStorageMgr,
@Nonnull final IIndexerWorkItem aWorkItem,
@Nonnegative final int nRetryCount,
@Nonnull final Con... | java |
protected BufferedInputStream buffer(final InputStream inputStream) {
// reject null early on rather than waiting for IO operation to fail
if (inputStream == null) { // not checked by BufferedInputStream
throw new NullPointerException("inputStream == null");
}
return inputStr... | java |
@Override
public int exitValue() throws ManagedProcessException {
try {
return resultHandler.getExitValue();
} catch (IllegalStateException e) {
throw new ManagedProcessException("Exit Value not (yet) available for "
+ getProcLongName(), e);
}
... | java |
@Override
public void close() {
if (!closed.compareAndSet(false, true))
return;
//is synchronized with itself and _next calls,
//so no synchronization on inner reader is needed
try {
synchronized (inputStream) {
inputStream.close();
... | java |
public void write(OutputStream stream) throws IOException {
//Creating buffer
ByteArrayOutputStream bos = new ByteArrayOutputStream();
//Creating compressed output data stream
DeflaterOutputStream deflate = new DeflaterOutputStream(bos);
DataOutputStream dataStream = new DataOut... | java |
public static FileIndex read(InputStream stream) throws IOException {
//Creating raw input stream
DataInputStream raw = new DataInputStream(stream);
//Reading magic number
int magic = raw.readInt();
if (magic != MAGIC)
throw new IOException("Wrong magic number");
... | java |
public static void register(Alphabet alphabet) {
if (alphabetsByName.put(alphabet.getAlphabetName(), alphabet) != null)
throw new IllegalStateException("Alphabet with this name is already registered.");
if (alphabetsById.put(alphabet.getId(), alphabet) != null)
throw new Illegal... | java |
public static <T> OutputPortCloseable<T> sort(
OutputPort<T> initialSource,
Comparator<T> comparator,
int chunkSize,
Class<T> clazz,
File tempFile) throws IOException {
return sort(initialSource, comparator, chunkSize,
new ObjectSeriali... | java |
private void move1() {
if (node == null)
return;
if (position >= reference.size()) {
node = null;
return;
}
node = node.links[reference.codeAt(position++)];
} | java |
public void seekToRecord(long recordNumber) throws IOException {
if (currentRecordNumber == recordNumber)
return;
long skip;
if (recordNumber < fileIndex.getStartingRecordNumber()) {
if (currentRecordNumber < recordNumber)
skip = recordNumber - currentReco... | java |
@Override
public T take() {
T t = take0();
if (t != null)
++currentRecordNumber;
return t;
} | java |
public int getLengthDelta() {
int delta = 0;
for (int mut : mutations)
switch (mut & MUTATION_TYPE_MASK) {
case RAW_MUTATION_TYPE_DELETION:
--delta;
break;
case RAW_MUTATION_TYPE_INSERTION:
++delta;
... | java |
public Mutations<S> concat(final Mutations<S> other) {
return new MutationsBuilder<>(alphabet, false)
.ensureCapacity(this.size() + other.size())
.append(this)
.append(other)
.createAndDestroy();
} | java |
public Mutations<S> move(int offset) {
int[] newMutations = new int[mutations.length];
for (int i = 0; i < mutations.length; ++i)
newMutations[i] = Mutation.move(mutations[i], offset);
return new Mutations<S>(alphabet, newMutations, true);
} | java |
public Mutations<S> removeMutationsInRange(int from, int to) {
if (to < from)
throw new IllegalArgumentException("Reversed ranges are not supported.");
// If range is empty return untouched mutations object
if (from == to)
return this;
// Determine range in muta... | java |
public static long[] getSortedDistinct(long[] values) {
if (values.length == 0)
return values;
Arrays.sort(values);
int shift = 0;
int i = 0;
while (i + shift + 1 < values.length)
if (values[i + shift] == values[i + shift + 1])
++shift;
... | java |
public String toPrettyString() {
String seq = sequence.toString();
String qual = quality.toString();
return seq + '\n' + qual;
} | java |
private void ensureCapacity(int newSize) {
int oldSize;
if ((oldSize = branchingEnumerators.length) < newSize) {
branchingEnumerators = Arrays.copyOfRange(branchingEnumerators, 0, newSize);
for (int i = oldSize; i < newSize; ++i)
branchingEnumerators[i] = new Bran... | java |
private void setupBranchingEnumerators() {
//Getting required sequence of differences (mutations)
final byte[] bSequence = branchingSequences[branchingSequenceIndex];
//Ensure number of branching enumerators
ensureCapacity(bSequence.length);
//Setting up initial branching enume... | java |
public static LinearGapAlignmentScoring<AminoAcidSequence> getAminoAcidBLASTScoring(BLASTMatrix matrix, int gapPenalty) {
return new LinearGapAlignmentScoring<>(AminoAcidSequence.ALPHABET,
matrix.getMatrix(),
gapPenalty);
} | java |
public static RandomAccessFastaIndex index(Path file, int indexStep, boolean save, LongProcessReporter reporter) {
Path indexFile = file.resolveSibling(file.getFileName() + INDEX_SUFFIX);
if (Files.exists(indexFile))
try (FileInputStream fis = new FileInputStream(indexFile.toFile())) {
... | java |
public static KAlignerParameters getByName(String name) {
KAlignerParameters params = knownParameters.get(name);
if (params == null)
return null;
return params.clone();
} | java |
public OutputPortCloseable<RawFastaRecord> asRawRecordsPort() {
return new OutputPortCloseable<RawFastaRecord>() {
@Override
public void close() {
FastaReader.this.close();
}
@Override
public RawFastaRecord take() {
ret... | java |
public static SourceInformation from(Pattern sourceRegex, String name) {
if (sourceRegex == null) {
return new SourceInformation(null, name);
}
Matcher matcher = sourceRegex.matcher(name);
if (matcher.groupCount() != 1) {
log.error("Source regex matcher must defin... | java |
public static <T, S extends Sequence<S>> List<Cluster<T>> performClustering(Collection<T> inputObjects,
SequenceExtractor<T, S> sequenceExtractor,
ClusteringStr... | java |
public int calculateScore(AlignmentScoring<S> scoring) {
return AlignmentUtils.calculateScore(sequence1, sequence1Range, mutations, scoring);
} | java |
public Range convertToSeq1Range(Range rangeInSeq2) {
int from = aabs(convertToSeq1Position(rangeInSeq2.getFrom()));
int to = aabs(convertToSeq1Position(rangeInSeq2.getTo()));
if (from == -1 || to == -1)
return null;
return new Range(from, to);
} | java |
public Range convertToSeq2Range(Range rangeInSeq1) {
int from = aabs(convertToSeq2Position(rangeInSeq1.getFrom()));
int to = aabs(convertToSeq2Position(rangeInSeq1.getTo()));
if (from == -1 || to == -1)
return null;
return new Range(from, to);
} | java |
public Alignment<S> invert(S sequence2) {
return new Alignment<>(sequence2, getRelativeMutations().invert().move(sequence2Range.getFrom()),
sequence2Range, sequence1Range, score);
} | java |
public float similarity() {
int match = 0, mismatch = 0;
AlignmentIteratorForward<S> iterator = forwardIterator();
while (iterator.advance()) {
final int mut = iterator.getCurrentMutation();
if (mut == NON_MUTATION)
++match;
else
... | java |
public Long peekDelta(String name, long count) {
Long previous = lookup.get(name);
return calculateDelta(name, previous, count);
} | java |
public Long getDelta(String name, long count) {
Long previous = lookup.put(name, count);
return calculateDelta(name, previous, count);
} | java |
public static Range extendRange(SequenceQuality quality, QualityTrimmerParameters parameters, Range initialRange) {
int lower = pabs(trim(quality, 0, initialRange.getLower(), -1, false, parameters));
int upper = pabs(trim(quality, initialRange.getUpper(), quality.size(), +1, false, parameters)) + 1;
... | java |
public static Range trim(SequenceQuality quality, QualityTrimmerParameters parameters) {
return trim(quality, parameters, new Range(0, quality.size()));
} | java |
public static Range trim(SequenceQuality quality, QualityTrimmerParameters parameters, Range initialRange) {
int lower = pabs(trim(quality, initialRange.getLower(), initialRange.getUpper(), +1, true, parameters)) + 1;
assert lower >= initialRange.getLower();
if (lower == initialRange.getUpper())... | java |
public static AminoAcidSequence translate(NucleotideSequence sequence) {
if (sequence.size() % 3 != 0)
throw new IllegalArgumentException("Only nucleotide sequences with size multiple " +
"of three are supported (in-frame).");
byte[] aaData = new byte[sequence.size() / 3]... | java |
public void validate() {
for (String in : getInputFiles()) {
if (!new File(in).exists())
throwValidationException("ERROR: input file \"" + in + "\" does not exist.", false);
validateInfo(in);
}
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.