id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
31,400 | gotev/android-upload-service | uploadservice/src/main/java/net/gotev/uploadservice/UploadFile.java | UploadFile.getProperty | public String getProperty(String key, String defaultValue) {
String val = properties.get(key);
if (val == null) {
val = defaultValue;
}
return val;
} | java | public String getProperty(String key, String defaultValue) {
String val = properties.get(key);
if (val == null) {
val = defaultValue;
}
return val;
} | [
"public",
"String",
"getProperty",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"String",
"val",
"=",
"properties",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"val",
"=",
"defaultValue",
";",
"}",
"r... | Gets a property associated to this file.
@param key property key
@param defaultValue default value to use if the key does not exist or the value is null
@return property value or the default value passed | [
"Gets",
"a",
"property",
"associated",
"to",
"this",
"file",
"."
] | 0952fcbe4b32c100150ffd0a237de3be4942e0a8 | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice/src/main/java/net/gotev/uploadservice/UploadFile.java#L161-L169 |
31,401 | gotev/android-upload-service | uploadservice-ftp/src/main/java/net/gotev/uploadservice/ftp/FTPUploadTask.java | FTPUploadTask.calculateUploadedAndTotalBytes | private void calculateUploadedAndTotalBytes() {
uploadedBytes = 0;
for (String filePath : getSuccessfullyUploadedFiles()) {
uploadedBytes += new File(filePath).length();
}
totalBytes = uploadedBytes;
for (UploadFile file : params.files) {
totalBytes += ... | java | private void calculateUploadedAndTotalBytes() {
uploadedBytes = 0;
for (String filePath : getSuccessfullyUploadedFiles()) {
uploadedBytes += new File(filePath).length();
}
totalBytes = uploadedBytes;
for (UploadFile file : params.files) {
totalBytes += ... | [
"private",
"void",
"calculateUploadedAndTotalBytes",
"(",
")",
"{",
"uploadedBytes",
"=",
"0",
";",
"for",
"(",
"String",
"filePath",
":",
"getSuccessfullyUploadedFiles",
"(",
")",
")",
"{",
"uploadedBytes",
"+=",
"new",
"File",
"(",
"filePath",
")",
".",
"len... | Calculates the total bytes of this upload task.
This the sum of all the lengths of the successfully uploaded files and also the pending
ones. | [
"Calculates",
"the",
"total",
"bytes",
"of",
"this",
"upload",
"task",
".",
"This",
"the",
"sum",
"of",
"all",
"the",
"lengths",
"of",
"the",
"successfully",
"uploaded",
"files",
"and",
"also",
"the",
"pending",
"ones",
"."
] | 0952fcbe4b32c100150ffd0a237de3be4942e0a8 | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice-ftp/src/main/java/net/gotev/uploadservice/ftp/FTPUploadTask.java#L159-L171 |
31,402 | gotev/android-upload-service | uploadservice-ftp/src/main/java/net/gotev/uploadservice/ftp/FTPUploadTask.java | FTPUploadTask.makeDirectories | private void makeDirectories(String dirPath, String permissions) throws IOException {
if (!dirPath.contains("/")) return;
String[] pathElements = dirPath.split("/");
if (pathElements.length == 1) return;
// if the string ends with / it means that the dir path contains only directories... | java | private void makeDirectories(String dirPath, String permissions) throws IOException {
if (!dirPath.contains("/")) return;
String[] pathElements = dirPath.split("/");
if (pathElements.length == 1) return;
// if the string ends with / it means that the dir path contains only directories... | [
"private",
"void",
"makeDirectories",
"(",
"String",
"dirPath",
",",
"String",
"permissions",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"dirPath",
".",
"contains",
"(",
"\"/\"",
")",
")",
"return",
";",
"String",
"[",
"]",
"pathElements",
"=",
"di... | Creates a nested directory structure on a FTP server and enters into it.
@param dirPath Path of the directory, i.e /projects/java/ftp/demo
@param permissions UNIX permissions to apply to created directories. If null, the FTP
server defaults will be applied, because no UNIX permissions will be
explicitly set
@throws IOE... | [
"Creates",
"a",
"nested",
"directory",
"structure",
"on",
"a",
"FTP",
"server",
"and",
"enters",
"into",
"it",
"."
] | 0952fcbe4b32c100150ffd0a237de3be4942e0a8 | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice-ftp/src/main/java/net/gotev/uploadservice/ftp/FTPUploadTask.java#L251-L279 |
31,403 | gotev/android-upload-service | uploadservice-ftp/src/main/java/net/gotev/uploadservice/ftp/FTPUploadTask.java | FTPUploadTask.getRemoteFileName | private String getRemoteFileName(UploadFile file) {
// if the remote path ends with /
// it means that the remote path specifies only the directory structure, so
// get the remote file name from the local file
if (file.getProperty(PARAM_REMOTE_PATH).endsWith("/")) {
return f... | java | private String getRemoteFileName(UploadFile file) {
// if the remote path ends with /
// it means that the remote path specifies only the directory structure, so
// get the remote file name from the local file
if (file.getProperty(PARAM_REMOTE_PATH).endsWith("/")) {
return f... | [
"private",
"String",
"getRemoteFileName",
"(",
"UploadFile",
"file",
")",
"{",
"// if the remote path ends with /",
"// it means that the remote path specifies only the directory structure, so",
"// get the remote file name from the local file",
"if",
"(",
"file",
".",
"getProperty",
... | Checks if the remote file path contains also the remote file name. If it's not specified,
the name of the local file will be used.
@param file file to upload
@return remote file name | [
"Checks",
"if",
"the",
"remote",
"file",
"path",
"contains",
"also",
"the",
"remote",
"file",
"name",
".",
"If",
"it",
"s",
"not",
"specified",
"the",
"name",
"of",
"the",
"local",
"file",
"will",
"be",
"used",
"."
] | 0952fcbe4b32c100150ffd0a237de3be4942e0a8 | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice-ftp/src/main/java/net/gotev/uploadservice/ftp/FTPUploadTask.java#L287-L307 |
31,404 | gotev/android-upload-service | uploadservice-ftp/src/main/java/net/gotev/uploadservice/ftp/FTPUploadRequest.java | FTPUploadRequest.setUsernameAndPassword | public FTPUploadRequest setUsernameAndPassword(String username, String password) {
if (username == null || "".equals(username)) {
throw new IllegalArgumentException("Specify FTP account username!");
}
if (password == null || "".equals(password)) {
throw new IllegalArgume... | java | public FTPUploadRequest setUsernameAndPassword(String username, String password) {
if (username == null || "".equals(username)) {
throw new IllegalArgumentException("Specify FTP account username!");
}
if (password == null || "".equals(password)) {
throw new IllegalArgume... | [
"public",
"FTPUploadRequest",
"setUsernameAndPassword",
"(",
"String",
"username",
",",
"String",
"password",
")",
"{",
"if",
"(",
"username",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"username",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Set the credentials used to login on the FTP Server.
@param username account username
@param password account password
@return {@link FTPUploadRequest} | [
"Set",
"the",
"credentials",
"used",
"to",
"login",
"on",
"the",
"FTP",
"Server",
"."
] | 0952fcbe4b32c100150ffd0a237de3be4942e0a8 | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice-ftp/src/main/java/net/gotev/uploadservice/ftp/FTPUploadRequest.java#L74-L86 |
31,405 | gotev/android-upload-service | uploadservice/src/main/java/net/gotev/uploadservice/http/BodyWriter.java | BodyWriter.writeStream | public final void writeStream(InputStream stream, OnStreamWriteListener listener) throws IOException {
if (listener == null)
throw new IllegalArgumentException("listener MUST not be null!");
byte[] buffer = new byte[UploadService.BUFFER_SIZE];
int bytesRead;
try {
... | java | public final void writeStream(InputStream stream, OnStreamWriteListener listener) throws IOException {
if (listener == null)
throw new IllegalArgumentException("listener MUST not be null!");
byte[] buffer = new byte[UploadService.BUFFER_SIZE];
int bytesRead;
try {
... | [
"public",
"final",
"void",
"writeStream",
"(",
"InputStream",
"stream",
",",
"OnStreamWriteListener",
"listener",
")",
"throws",
"IOException",
"{",
"if",
"(",
"listener",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"listener MUST not be null... | Writes an input stream to the request body.
The stream will be automatically closed after successful write or if an exception is thrown.
@param stream input stream from which to read
@param listener listener which gets notified when bytes are written and which controls if
the transfer should continue
@throws IOExceptio... | [
"Writes",
"an",
"input",
"stream",
"to",
"the",
"request",
"body",
".",
"The",
"stream",
"will",
"be",
"automatically",
"closed",
"after",
"successful",
"write",
"or",
"if",
"an",
"exception",
"is",
"thrown",
"."
] | 0952fcbe4b32c100150ffd0a237de3be4942e0a8 | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice/src/main/java/net/gotev/uploadservice/http/BodyWriter.java#L42-L58 |
31,406 | gotev/android-upload-service | uploadservice/src/main/java/net/gotev/uploadservice/UploadNotificationAction.java | UploadNotificationAction.from | public static UploadNotificationAction from(NotificationCompat.Action action) {
return new UploadNotificationAction(action.icon, action.title, action.actionIntent);
} | java | public static UploadNotificationAction from(NotificationCompat.Action action) {
return new UploadNotificationAction(action.icon, action.title, action.actionIntent);
} | [
"public",
"static",
"UploadNotificationAction",
"from",
"(",
"NotificationCompat",
".",
"Action",
"action",
")",
"{",
"return",
"new",
"UploadNotificationAction",
"(",
"action",
".",
"icon",
",",
"action",
".",
"title",
",",
"action",
".",
"actionIntent",
")",
"... | Creates a new object from an existing NotificationCompat.Action object.
@param action notification compat action
@return new instance | [
"Creates",
"a",
"new",
"object",
"from",
"an",
"existing",
"NotificationCompat",
".",
"Action",
"object",
"."
] | 0952fcbe4b32c100150ffd0a237de3be4942e0a8 | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice/src/main/java/net/gotev/uploadservice/UploadNotificationAction.java#L30-L32 |
31,407 | gotev/android-upload-service | uploadservice/src/main/java/net/gotev/uploadservice/Placeholders.java | Placeholders.replace | public static String replace(String string, UploadInfo uploadInfo) {
if (string == null || string.isEmpty())
return "";
String tmp;
tmp = string.replace(ELAPSED_TIME, uploadInfo.getElapsedTimeString());
tmp = tmp.replace(PROGRESS, uploadInfo.getProgressPercent() + "%");
... | java | public static String replace(String string, UploadInfo uploadInfo) {
if (string == null || string.isEmpty())
return "";
String tmp;
tmp = string.replace(ELAPSED_TIME, uploadInfo.getElapsedTimeString());
tmp = tmp.replace(PROGRESS, uploadInfo.getProgressPercent() + "%");
... | [
"public",
"static",
"String",
"replace",
"(",
"String",
"string",
",",
"UploadInfo",
"uploadInfo",
")",
"{",
"if",
"(",
"string",
"==",
"null",
"||",
"string",
".",
"isEmpty",
"(",
")",
")",
"return",
"\"\"",
";",
"String",
"tmp",
";",
"tmp",
"=",
"str... | Replace placeholders in a string.
@param string string in which to replace placeholders
@param uploadInfo upload information data
@return string with replaced placeholders | [
"Replace",
"placeholders",
"in",
"a",
"string",
"."
] | 0952fcbe4b32c100150ffd0a237de3be4942e0a8 | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice/src/main/java/net/gotev/uploadservice/Placeholders.java#L44-L56 |
31,408 | gotev/android-upload-service | uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java | UploadTask.broadcastProgress | protected final void broadcastProgress(final long uploadedBytes, final long totalBytes) {
long currentTime = System.currentTimeMillis();
if (uploadedBytes < totalBytes && currentTime < lastProgressNotificationTime + UploadService.PROGRESS_REPORT_INTERVAL) {
return;
}
setLas... | java | protected final void broadcastProgress(final long uploadedBytes, final long totalBytes) {
long currentTime = System.currentTimeMillis();
if (uploadedBytes < totalBytes && currentTime < lastProgressNotificationTime + UploadService.PROGRESS_REPORT_INTERVAL) {
return;
}
setLas... | [
"protected",
"final",
"void",
"broadcastProgress",
"(",
"final",
"long",
"uploadedBytes",
",",
"final",
"long",
"totalBytes",
")",
"{",
"long",
"currentTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"if",
"(",
"uploadedBytes",
"<",
"totalBytes",
... | Broadcasts a progress update.
@param uploadedBytes number of bytes which has been uploaded to the server
@param totalBytes total bytes of the request | [
"Broadcasts",
"a",
"progress",
"update",
"."
] | 0952fcbe4b32c100150ffd0a237de3be4942e0a8 | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java#L228-L262 |
31,409 | gotev/android-upload-service | uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java | UploadTask.addSuccessfullyUploadedFile | protected final void addSuccessfullyUploadedFile(UploadFile file) {
if (!successfullyUploadedFiles.contains(file.path)) {
successfullyUploadedFiles.add(file.path);
params.files.remove(file);
}
} | java | protected final void addSuccessfullyUploadedFile(UploadFile file) {
if (!successfullyUploadedFiles.contains(file.path)) {
successfullyUploadedFiles.add(file.path);
params.files.remove(file);
}
} | [
"protected",
"final",
"void",
"addSuccessfullyUploadedFile",
"(",
"UploadFile",
"file",
")",
"{",
"if",
"(",
"!",
"successfullyUploadedFiles",
".",
"contains",
"(",
"file",
".",
"path",
")",
")",
"{",
"successfullyUploadedFiles",
".",
"add",
"(",
"file",
".",
... | Add a file to the list of the successfully uploaded files and remove it from the file list
@param file file on the device | [
"Add",
"a",
"file",
"to",
"the",
"list",
"of",
"the",
"successfully",
"uploaded",
"files",
"and",
"remove",
"it",
"from",
"the",
"file",
"list"
] | 0952fcbe4b32c100150ffd0a237de3be4942e0a8 | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java#L375-L380 |
31,410 | gotev/android-upload-service | uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java | UploadTask.createNotification | private void createNotification(UploadInfo uploadInfo) {
if (params.notificationConfig == null || params.notificationConfig.getProgress().message == null)
return;
UploadNotificationStatusConfig statusConfig = params.notificationConfig.getProgress();
notificationCreationTimeMillis = ... | java | private void createNotification(UploadInfo uploadInfo) {
if (params.notificationConfig == null || params.notificationConfig.getProgress().message == null)
return;
UploadNotificationStatusConfig statusConfig = params.notificationConfig.getProgress();
notificationCreationTimeMillis = ... | [
"private",
"void",
"createNotification",
"(",
"UploadInfo",
"uploadInfo",
")",
"{",
"if",
"(",
"params",
".",
"notificationConfig",
"==",
"null",
"||",
"params",
".",
"notificationConfig",
".",
"getProgress",
"(",
")",
".",
"message",
"==",
"null",
")",
"retur... | If the upload task is initialized with a notification configuration, this handles its
creation.
@param uploadInfo upload information and statistics | [
"If",
"the",
"upload",
"task",
"is",
"initialized",
"with",
"a",
"notification",
"configuration",
"this",
"handles",
"its",
"creation",
"."
] | 0952fcbe4b32c100150ffd0a237de3be4942e0a8 | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java#L460-L488 |
31,411 | gotev/android-upload-service | uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java | UploadTask.deleteFile | private boolean deleteFile(File fileToDelete) {
boolean deleted = false;
try {
deleted = fileToDelete.delete();
if (!deleted) {
Logger.error(LOG_TAG, "Unable to delete: "
+ fileToDelete.getAbsolutePath());
} else {
... | java | private boolean deleteFile(File fileToDelete) {
boolean deleted = false;
try {
deleted = fileToDelete.delete();
if (!deleted) {
Logger.error(LOG_TAG, "Unable to delete: "
+ fileToDelete.getAbsolutePath());
} else {
... | [
"private",
"boolean",
"deleteFile",
"(",
"File",
"fileToDelete",
")",
"{",
"boolean",
"deleted",
"=",
"false",
";",
"try",
"{",
"deleted",
"=",
"fileToDelete",
".",
"delete",
"(",
")",
";",
"if",
"(",
"!",
"deleted",
")",
"{",
"Logger",
".",
"error",
"... | Tries to delete a file from the device.
If it fails, the error will be printed in the LogCat.
@param fileToDelete file to delete
@return true if the file has been deleted, otherwise false. | [
"Tries",
"to",
"delete",
"a",
"file",
"from",
"the",
"device",
".",
"If",
"it",
"fails",
"the",
"error",
"will",
"be",
"printed",
"in",
"the",
"LogCat",
"."
] | 0952fcbe4b32c100150ffd0a237de3be4942e0a8 | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java#L572-L593 |
31,412 | thymeleaf/thymeleaf | src/main/java/org/thymeleaf/util/NumberUtils.java | NumberUtils.formatNumber | private static String formatNumber(final Number target, final Integer minIntegerDigits,
final NumberPointType thousandsPointType, final Integer fractionDigits,
final NumberPointType decimalPointType, final Locale locale) {
Validate.notNull(fractionDigits, "Fraction digits cannot be null");
... | java | private static String formatNumber(final Number target, final Integer minIntegerDigits,
final NumberPointType thousandsPointType, final Integer fractionDigits,
final NumberPointType decimalPointType, final Locale locale) {
Validate.notNull(fractionDigits, "Fraction digits cannot be null");
... | [
"private",
"static",
"String",
"formatNumber",
"(",
"final",
"Number",
"target",
",",
"final",
"Integer",
"minIntegerDigits",
",",
"final",
"NumberPointType",
"thousandsPointType",
",",
"final",
"Integer",
"fractionDigits",
",",
"final",
"NumberPointType",
"decimalPoint... | Formats a number as per the given values.
@param target The number to format.
@param minIntegerDigits Minimum number digits to return (0 padding).
@param thousandsPointType Character to use for separating number groups.
@param fractionDigits Minimum number of fraction digits to format to
(0 padding).... | [
"Formats",
"a",
"number",
"as",
"per",
"the",
"given",
"values",
"."
] | 2b0e6d6d7571fbe638904b5fd222fc9e77188879 | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/util/NumberUtils.java#L192-L216 |
31,413 | thymeleaf/thymeleaf | src/main/java/org/thymeleaf/util/NumberUtils.java | NumberUtils.formatCurrency | public static String formatCurrency(final Number target, final Locale locale) {
Validate.notNull(locale, "Locale cannot be null");
if (target == null) {
return null;
}
NumberFormat format = NumberFormat.getCurrencyInstance(locale);
return format.format(target);
... | java | public static String formatCurrency(final Number target, final Locale locale) {
Validate.notNull(locale, "Locale cannot be null");
if (target == null) {
return null;
}
NumberFormat format = NumberFormat.getCurrencyInstance(locale);
return format.format(target);
... | [
"public",
"static",
"String",
"formatCurrency",
"(",
"final",
"Number",
"target",
",",
"final",
"Locale",
"locale",
")",
"{",
"Validate",
".",
"notNull",
"(",
"locale",
",",
"\"Locale cannot be null\"",
")",
";",
"if",
"(",
"target",
"==",
"null",
")",
"{",
... | Formats a number as a currency value according to the specified locale.
@param target The number to format.
@param locale Locale to use for formatting.
@return The number formatted as a currency, or {@code null} if the number
given is {@code null}. | [
"Formats",
"a",
"number",
"as",
"a",
"currency",
"value",
"according",
"to",
"the",
"specified",
"locale",
"."
] | 2b0e6d6d7571fbe638904b5fd222fc9e77188879 | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/util/NumberUtils.java#L279-L290 |
31,414 | thymeleaf/thymeleaf | src/main/java/org/thymeleaf/util/NumberUtils.java | NumberUtils.formatPercent | public static String formatPercent(final Number target, final Integer minIntegerDigits,
final Integer fractionDigits, final Locale locale) {
Validate.notNull(fractionDigits, "Fraction digits cannot be null");
Validate.notNull(locale, "Locale cannot be null");
if (target == null) {
... | java | public static String formatPercent(final Number target, final Integer minIntegerDigits,
final Integer fractionDigits, final Locale locale) {
Validate.notNull(fractionDigits, "Fraction digits cannot be null");
Validate.notNull(locale, "Locale cannot be null");
if (target == null) {
... | [
"public",
"static",
"String",
"formatPercent",
"(",
"final",
"Number",
"target",
",",
"final",
"Integer",
"minIntegerDigits",
",",
"final",
"Integer",
"fractionDigits",
",",
"final",
"Locale",
"locale",
")",
"{",
"Validate",
".",
"notNull",
"(",
"fractionDigits",
... | Formats a number as a percentage value.
@param target The number to format.
@param minIntegerDigits Minimum number of digits to return (0 padding).
@param fractionDigits Minimum number of fraction digits to return (0
padding).
@param locale Locale to use for formatting.
@return The number formatt... | [
"Formats",
"a",
"number",
"as",
"a",
"percentage",
"value",
"."
] | 2b0e6d6d7571fbe638904b5fd222fc9e77188879 | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/util/NumberUtils.java#L303-L321 |
31,415 | thymeleaf/thymeleaf | src/main/java/org/thymeleaf/engine/Model.java | Model.sameAs | boolean sameAs(final Model model) {
if (model == null || model.queueSize != this.queueSize) {
return false;
}
for (int i = 0; i < this.queueSize; i++) {
if (this.queue[i] != model.queue[i]) {
return false;
}
}
return true;
} | java | boolean sameAs(final Model model) {
if (model == null || model.queueSize != this.queueSize) {
return false;
}
for (int i = 0; i < this.queueSize; i++) {
if (this.queue[i] != model.queue[i]) {
return false;
}
}
return true;
} | [
"boolean",
"sameAs",
"(",
"final",
"Model",
"model",
")",
"{",
"if",
"(",
"model",
"==",
"null",
"||",
"model",
".",
"queueSize",
"!=",
"this",
".",
"queueSize",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"... | considered "a change" anyway. | [
"considered",
"a",
"change",
"anyway",
"."
] | 2b0e6d6d7571fbe638904b5fd222fc9e77188879 | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/engine/Model.java#L352-L362 |
31,416 | thymeleaf/thymeleaf | src/main/java/org/thymeleaf/engine/SSEThrottledTemplateWriter.java | SSEThrottledTemplateWriter.checkTokenValid | private static boolean checkTokenValid(final char[] token) {
if (token == null || token.length == 0) {
return true;
}
for (int i = 0; i < token.length; i++) {
if (token[i] == '\n') {
return false;
}
}
return true;
} | java | private static boolean checkTokenValid(final char[] token) {
if (token == null || token.length == 0) {
return true;
}
for (int i = 0; i < token.length; i++) {
if (token[i] == '\n') {
return false;
}
}
return true;
} | [
"private",
"static",
"boolean",
"checkTokenValid",
"(",
"final",
"char",
"[",
"]",
"token",
")",
"{",
"if",
"(",
"token",
"==",
"null",
"||",
"token",
".",
"length",
"==",
"0",
")",
"{",
"return",
"true",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",... | Used to check internally that neither event names nor IDs contain line feeds | [
"Used",
"to",
"check",
"internally",
"that",
"neither",
"event",
"names",
"nor",
"IDs",
"contain",
"line",
"feeds"
] | 2b0e6d6d7571fbe638904b5fd222fc9e77188879 | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/engine/SSEThrottledTemplateWriter.java#L216-L227 |
31,417 | codelibs/fess | src/main/java/org/codelibs/fess/app/web/base/FessBaseAction.java | FessBaseAction.godHandPrologue | @Override
public ActionResponse godHandPrologue(final ActionRuntime runtime) {
fessLoginAssist.getSavedUserBean().ifPresent(u -> {
boolean result = u.getFessUser().refresh();
if (logger.isDebugEnabled()) {
logger.debug("refresh user info: {}", result);
}
... | java | @Override
public ActionResponse godHandPrologue(final ActionRuntime runtime) {
fessLoginAssist.getSavedUserBean().ifPresent(u -> {
boolean result = u.getFessUser().refresh();
if (logger.isDebugEnabled()) {
logger.debug("refresh user info: {}", result);
}
... | [
"@",
"Override",
"public",
"ActionResponse",
"godHandPrologue",
"(",
"final",
"ActionRuntime",
"runtime",
")",
"{",
"fessLoginAssist",
".",
"getSavedUserBean",
"(",
")",
".",
"ifPresent",
"(",
"u",
"->",
"{",
"boolean",
"result",
"=",
"u",
".",
"getFessUser",
... | you should remove the 'final' if you need to override this | [
"you",
"should",
"remove",
"the",
"final",
"if",
"you",
"need",
"to",
"override",
"this"
] | e5e4b722549d32a4958dfd94965b21937bfe64cf | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/app/web/base/FessBaseAction.java#L110-L119 |
31,418 | codelibs/fess | src/main/java/org/codelibs/fess/util/KuromojiCSVUtil.java | KuromojiCSVUtil.quoteEscape | public static String quoteEscape(final String original) {
String result = original;
if (result.indexOf('\"') >= 0) {
result = result.replace("\"", ESCAPED_QUOTE);
}
if (result.indexOf(COMMA) >= 0) {
result = "\"" + result + "\"";
}
return result;
... | java | public static String quoteEscape(final String original) {
String result = original;
if (result.indexOf('\"') >= 0) {
result = result.replace("\"", ESCAPED_QUOTE);
}
if (result.indexOf(COMMA) >= 0) {
result = "\"" + result + "\"";
}
return result;
... | [
"public",
"static",
"String",
"quoteEscape",
"(",
"final",
"String",
"original",
")",
"{",
"String",
"result",
"=",
"original",
";",
"if",
"(",
"result",
".",
"indexOf",
"(",
"'",
"'",
")",
">=",
"0",
")",
"{",
"result",
"=",
"result",
".",
"replace",
... | Quote and escape input value for CSV
@param original Original text.
@return Escaped text. | [
"Quote",
"and",
"escape",
"input",
"value",
"for",
"CSV"
] | e5e4b722549d32a4958dfd94965b21937bfe64cf | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/util/KuromojiCSVUtil.java#L121-L131 |
31,419 | codelibs/fess | src/main/java/org/codelibs/fess/util/ComponentUtil.java | ComponentUtil.setFessConfig | public static void setFessConfig(final FessConfig fessConfig) {
ComponentUtil.fessConfig = fessConfig;
if (fessConfig == null) {
FessProp.propMap.clear();
componentMap.clear();
}
} | java | public static void setFessConfig(final FessConfig fessConfig) {
ComponentUtil.fessConfig = fessConfig;
if (fessConfig == null) {
FessProp.propMap.clear();
componentMap.clear();
}
} | [
"public",
"static",
"void",
"setFessConfig",
"(",
"final",
"FessConfig",
"fessConfig",
")",
"{",
"ComponentUtil",
".",
"fessConfig",
"=",
"fessConfig",
";",
"if",
"(",
"fessConfig",
"==",
"null",
")",
"{",
"FessProp",
".",
"propMap",
".",
"clear",
"(",
")",
... | For test purpose only.
@param fessConfig fessConfig instance | [
"For",
"test",
"purpose",
"only",
"."
] | e5e4b722549d32a4958dfd94965b21937bfe64cf | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/util/ComponentUtil.java#L506-L512 |
31,420 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java | SuperPositionQCP.set | private void set(Point3d[] x, Point3d[] y) {
this.x = x;
this.y = y;
rmsdCalculated = false;
transformationCalculated = false;
} | java | private void set(Point3d[] x, Point3d[] y) {
this.x = x;
this.y = y;
rmsdCalculated = false;
transformationCalculated = false;
} | [
"private",
"void",
"set",
"(",
"Point3d",
"[",
"]",
"x",
",",
"Point3d",
"[",
"]",
"y",
")",
"{",
"this",
".",
"x",
"=",
"x",
";",
"this",
".",
"y",
"=",
"y",
";",
"rmsdCalculated",
"=",
"false",
";",
"transformationCalculated",
"=",
"false",
";",
... | Sets the two input coordinate arrays. These input arrays must be of equal
length. Input coordinates are not modified.
@param x
3d points of reference coordinate set
@param y
3d points of coordinate set for superposition | [
"Sets",
"the",
"two",
"input",
"coordinate",
"arrays",
".",
"These",
"input",
"arrays",
"must",
"be",
"of",
"equal",
"length",
".",
"Input",
"coordinates",
"are",
"not",
"modified",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java#L177-L182 |
31,421 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java | SuperPositionQCP.weightedSuperpose | public Matrix4d weightedSuperpose(Point3d[] fixed, Point3d[] moved, double[] weight) {
set(moved, fixed, weight);
getRotationMatrix();
if (!centered) {
calcTransformation();
} else {
transformation.set(rotmat);
}
return transformation;
} | java | public Matrix4d weightedSuperpose(Point3d[] fixed, Point3d[] moved, double[] weight) {
set(moved, fixed, weight);
getRotationMatrix();
if (!centered) {
calcTransformation();
} else {
transformation.set(rotmat);
}
return transformation;
} | [
"public",
"Matrix4d",
"weightedSuperpose",
"(",
"Point3d",
"[",
"]",
"fixed",
",",
"Point3d",
"[",
"]",
"moved",
",",
"double",
"[",
"]",
"weight",
")",
"{",
"set",
"(",
"moved",
",",
"fixed",
",",
"weight",
")",
";",
"getRotationMatrix",
"(",
")",
";"... | Weighted superposition.
@param fixed
@param moved
@param weight
array of weigths for each equivalent point position
@return | [
"Weighted",
"superposition",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java#L228-L237 |
31,422 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java | SuperPositionQCP.calcRmsd | private void calcRmsd(Point3d[] x, Point3d[] y) {
if (centered) {
innerProduct(y, x);
} else {
// translate to origin
xref = CalcPoint.clonePoint3dArray(x);
xtrans = CalcPoint.centroid(xref);
logger.debug("x centroid: " + xtrans);
xtrans.negate();
CalcPoint.translate(new Vector3d(xtrans), xref)... | java | private void calcRmsd(Point3d[] x, Point3d[] y) {
if (centered) {
innerProduct(y, x);
} else {
// translate to origin
xref = CalcPoint.clonePoint3dArray(x);
xtrans = CalcPoint.centroid(xref);
logger.debug("x centroid: " + xtrans);
xtrans.negate();
CalcPoint.translate(new Vector3d(xtrans), xref)... | [
"private",
"void",
"calcRmsd",
"(",
"Point3d",
"[",
"]",
"x",
",",
"Point3d",
"[",
"]",
"y",
")",
"{",
"if",
"(",
"centered",
")",
"{",
"innerProduct",
"(",
"y",
",",
"x",
")",
";",
"}",
"else",
"{",
"// translate to origin",
"xref",
"=",
"CalcPoint"... | Calculates the RMSD value for superposition of y onto x. This requires
the coordinates to be precentered.
@param x
3d points of reference coordinate set
@param y
3d points of coordinate set for superposition | [
"Calculates",
"the",
"RMSD",
"value",
"for",
"superposition",
"of",
"y",
"onto",
"x",
".",
"This",
"requires",
"the",
"coordinates",
"to",
"be",
"precentered",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java#L257-L276 |
31,423 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java | AsaCalculator.calculateAsas | public double[] calculateAsas() {
double[] asas = new double[atomCoords.length];
long start = System.currentTimeMillis();
if (useSpatialHashingForNeighbors) {
logger.debug("Will use spatial hashing to find neighbors");
neighborIndices = findNeighborIndicesSpatialHashing();
} else {
logger.debug("Will... | java | public double[] calculateAsas() {
double[] asas = new double[atomCoords.length];
long start = System.currentTimeMillis();
if (useSpatialHashingForNeighbors) {
logger.debug("Will use spatial hashing to find neighbors");
neighborIndices = findNeighborIndicesSpatialHashing();
} else {
logger.debug("Will... | [
"public",
"double",
"[",
"]",
"calculateAsas",
"(",
")",
"{",
"double",
"[",
"]",
"asas",
"=",
"new",
"double",
"[",
"atomCoords",
".",
"length",
"]",
";",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"if",
"(",
"useSpatialH... | Calculates the Accessible Surface Areas for the atoms given in constructor and with parameters given.
Beware that the parallel implementation is quite memory hungry. It scales well as long as there is
enough memory available.
@return an array with asa values corresponding to each atom of the input array | [
"Calculates",
"the",
"Accessible",
"Surface",
"Areas",
"for",
"the",
"atoms",
"given",
"in",
"constructor",
"and",
"with",
"parameters",
"given",
".",
"Beware",
"that",
"the",
"parallel",
"implementation",
"is",
"quite",
"memory",
"hungry",
".",
"It",
"scales",
... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java#L255-L332 |
31,424 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java | AsaCalculator.generateSpherePoints | private Point3d[] generateSpherePoints(int nSpherePoints) {
Point3d[] points = new Point3d[nSpherePoints];
double inc = Math.PI * (3.0 - Math.sqrt(5.0));
double offset = 2.0 / nSpherePoints;
for (int k=0;k<nSpherePoints;k++) {
double y = k * offset - 1.0 + (offset / 2.0);
double r = Math.sqrt(1.0 - y*y);
... | java | private Point3d[] generateSpherePoints(int nSpherePoints) {
Point3d[] points = new Point3d[nSpherePoints];
double inc = Math.PI * (3.0 - Math.sqrt(5.0));
double offset = 2.0 / nSpherePoints;
for (int k=0;k<nSpherePoints;k++) {
double y = k * offset - 1.0 + (offset / 2.0);
double r = Math.sqrt(1.0 - y*y);
... | [
"private",
"Point3d",
"[",
"]",
"generateSpherePoints",
"(",
"int",
"nSpherePoints",
")",
"{",
"Point3d",
"[",
"]",
"points",
"=",
"new",
"Point3d",
"[",
"nSpherePoints",
"]",
";",
"double",
"inc",
"=",
"Math",
".",
"PI",
"*",
"(",
"3.0",
"-",
"Math",
... | Returns list of 3d coordinates of points on a sphere using the
Golden Section Spiral algorithm.
@param nSpherePoints the number of points to be used in generating the spherical dot-density
@return | [
"Returns",
"list",
"of",
"3d",
"coordinates",
"of",
"points",
"on",
"a",
"sphere",
"using",
"the",
"Golden",
"Section",
"Spiral",
"algorithm",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java#L350-L361 |
31,425 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java | AsaCalculator.findNeighborIndices | int[][] findNeighborIndices() {
// looking at a typical protein case, number of neighbours are from ~10 to ~50, with an average of ~30
int initialCapacity = 60;
int[][] nbsIndices = new int[atomCoords.length][];
for (int k=0; k<atomCoords.length; k++) {
double radius = radii[k] + probe + probe;
List<I... | java | int[][] findNeighborIndices() {
// looking at a typical protein case, number of neighbours are from ~10 to ~50, with an average of ~30
int initialCapacity = 60;
int[][] nbsIndices = new int[atomCoords.length][];
for (int k=0; k<atomCoords.length; k++) {
double radius = radii[k] + probe + probe;
List<I... | [
"int",
"[",
"]",
"[",
"]",
"findNeighborIndices",
"(",
")",
"{",
"// looking at a typical protein case, number of neighbours are from ~10 to ~50, with an average of ~30",
"int",
"initialCapacity",
"=",
"60",
";",
"int",
"[",
"]",
"[",
"]",
"nbsIndices",
"=",
"new",
"int... | Returns the 2-dimensional array with neighbor indices for every atom.
@return 2-dimensional array of size: n_atoms x n_neighbors_per_atom | [
"Returns",
"the",
"2",
"-",
"dimensional",
"array",
"with",
"neighbor",
"indices",
"for",
"every",
"atom",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java#L367-L394 |
31,426 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java | AsaCalculator.findNeighborIndicesSpatialHashing | int[][] findNeighborIndicesSpatialHashing() {
// looking at a typical protein case, number of neighbours are from ~10 to ~50, with an average of ~30
int initialCapacity = 60;
List<Contact> contactList = calcContacts();
Map<Integer, List<Integer>> indices = new HashMap<>(atomCoords.length);
for (Contact cont... | java | int[][] findNeighborIndicesSpatialHashing() {
// looking at a typical protein case, number of neighbours are from ~10 to ~50, with an average of ~30
int initialCapacity = 60;
List<Contact> contactList = calcContacts();
Map<Integer, List<Integer>> indices = new HashMap<>(atomCoords.length);
for (Contact cont... | [
"int",
"[",
"]",
"[",
"]",
"findNeighborIndicesSpatialHashing",
"(",
")",
"{",
"// looking at a typical protein case, number of neighbours are from ~10 to ~50, with an average of ~30",
"int",
"initialCapacity",
"=",
"60",
";",
"List",
"<",
"Contact",
">",
"contactList",
"=",
... | Returns the 2-dimensional array with neighbor indices for every atom,
using spatial hashing to avoid all to all distance calculation.
@return 2-dimensional array of size: n_atoms x n_neighbors_per_atom | [
"Returns",
"the",
"2",
"-",
"dimensional",
"array",
"with",
"neighbor",
"indices",
"for",
"every",
"atom",
"using",
"spatial",
"hashing",
"to",
"avoid",
"all",
"to",
"all",
"distance",
"calculation",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java#L401-L453 |
31,427 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java | AsaCalculator.getRadiusForAmino | private static double getRadiusForAmino(AminoAcid amino, Atom atom) {
if (atom.getElement().equals(Element.H)) return Element.H.getVDWRadius();
// some unusual entries (e.g. 1tes) contain Deuterium atoms in standard aminoacids
if (atom.getElement().equals(Element.D)) return Element.D.getVDWRadius();
String at... | java | private static double getRadiusForAmino(AminoAcid amino, Atom atom) {
if (atom.getElement().equals(Element.H)) return Element.H.getVDWRadius();
// some unusual entries (e.g. 1tes) contain Deuterium atoms in standard aminoacids
if (atom.getElement().equals(Element.D)) return Element.D.getVDWRadius();
String at... | [
"private",
"static",
"double",
"getRadiusForAmino",
"(",
"AminoAcid",
"amino",
",",
"Atom",
"atom",
")",
"{",
"if",
"(",
"atom",
".",
"getElement",
"(",
")",
".",
"equals",
"(",
"Element",
".",
"H",
")",
")",
"return",
"Element",
".",
"H",
".",
"getVDW... | Gets the radius for given amino acid and atom
@param amino
@param atom
@return | [
"Gets",
"the",
"radius",
"for",
"given",
"amino",
"acid",
"and",
"atom"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java#L523-L593 |
31,428 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java | AsaCalculator.getRadiusForNucl | private static double getRadiusForNucl(NucleotideImpl nuc, Atom atom) {
if (atom.getElement().equals(Element.H)) return Element.H.getVDWRadius();
if (atom.getElement().equals(Element.D)) return Element.D.getVDWRadius();
if (atom.getElement()==Element.C) return NUC_CARBON_VDW;
if (atom.getElement()==Element.N... | java | private static double getRadiusForNucl(NucleotideImpl nuc, Atom atom) {
if (atom.getElement().equals(Element.H)) return Element.H.getVDWRadius();
if (atom.getElement().equals(Element.D)) return Element.D.getVDWRadius();
if (atom.getElement()==Element.C) return NUC_CARBON_VDW;
if (atom.getElement()==Element.N... | [
"private",
"static",
"double",
"getRadiusForNucl",
"(",
"NucleotideImpl",
"nuc",
",",
"Atom",
"atom",
")",
"{",
"if",
"(",
"atom",
".",
"getElement",
"(",
")",
".",
"equals",
"(",
"Element",
".",
"H",
")",
")",
"return",
"Element",
".",
"H",
".",
"getV... | Gets the radius for given nucleotide atom
@param atom
@return | [
"Gets",
"the",
"radius",
"for",
"given",
"nucleotide",
"atom"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java#L601-L616 |
31,429 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureReader.java | MmtfStructureReader.getCorrectAltLocGroup | private Group getCorrectAltLocGroup(Character altLoc) {
// see if we know this altLoc already;
List<Atom> atoms = group.getAtoms();
if (atoms.size() > 0) {
Atom a1 = atoms.get(0);
// we are just adding atoms to the current group
// probably there is a second group following later...
if (a1.getAltLoc()... | java | private Group getCorrectAltLocGroup(Character altLoc) {
// see if we know this altLoc already;
List<Atom> atoms = group.getAtoms();
if (atoms.size() > 0) {
Atom a1 = atoms.get(0);
// we are just adding atoms to the current group
// probably there is a second group following later...
if (a1.getAltLoc()... | [
"private",
"Group",
"getCorrectAltLocGroup",
"(",
"Character",
"altLoc",
")",
"{",
"// see if we know this altLoc already;",
"List",
"<",
"Atom",
">",
"atoms",
"=",
"group",
".",
"getAtoms",
"(",
")",
";",
"if",
"(",
"atoms",
".",
"size",
"(",
")",
">",
"0",... | Generates Alternate location groups.
@param altLoc the alt loc
@return the correct alt loc group | [
"Generates",
"Alternate",
"location",
"groups",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureReader.java#L362-L400 |
31,430 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/URLIdentifier.java | URLIdentifier.loadStructure | @Override
public Structure loadStructure(AtomCache cache) throws StructureException,
IOException {
StructureFiletype format = StructureFiletype.UNKNOWN;
// Use user-specified format
try {
Map<String, String> params = parseQuery(url);
if(params.containsKey(FORMAT_PARAM)) {
String formatStr = params.... | java | @Override
public Structure loadStructure(AtomCache cache) throws StructureException,
IOException {
StructureFiletype format = StructureFiletype.UNKNOWN;
// Use user-specified format
try {
Map<String, String> params = parseQuery(url);
if(params.containsKey(FORMAT_PARAM)) {
String formatStr = params.... | [
"@",
"Override",
"public",
"Structure",
"loadStructure",
"(",
"AtomCache",
"cache",
")",
"throws",
"StructureException",
",",
"IOException",
"{",
"StructureFiletype",
"format",
"=",
"StructureFiletype",
".",
"UNKNOWN",
";",
"// Use user-specified format",
"try",
"{",
... | Load the structure from the URL
@return null | [
"Load",
"the",
"structure",
"from",
"the",
"URL"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/URLIdentifier.java#L139-L193 |
31,431 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/URLIdentifier.java | URLIdentifier.guessPDBID | public static String guessPDBID(String name) {
Matcher match = PDBID_REGEX.matcher(name);
if(match.matches()) {
return match.group(1).toUpperCase();
} else {
// Give up if doesn't match
return null;
}
} | java | public static String guessPDBID(String name) {
Matcher match = PDBID_REGEX.matcher(name);
if(match.matches()) {
return match.group(1).toUpperCase();
} else {
// Give up if doesn't match
return null;
}
} | [
"public",
"static",
"String",
"guessPDBID",
"(",
"String",
"name",
")",
"{",
"Matcher",
"match",
"=",
"PDBID_REGEX",
".",
"matcher",
"(",
"name",
")",
";",
"if",
"(",
"match",
".",
"matches",
"(",
")",
")",
"{",
"return",
"match",
".",
"group",
"(",
... | Recognizes PDB IDs that occur at the beginning of name followed by some
delimiter.
@param name Input filename
@return A 4-character id-like string, or null if none is found | [
"Recognizes",
"PDB",
"IDs",
"that",
"occur",
"at",
"the",
"beginning",
"of",
"name",
"followed",
"by",
"some",
"delimiter",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/URLIdentifier.java#L202-L210 |
31,432 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/URLIdentifier.java | URLIdentifier.parseQuery | private static Map<String,String> parseQuery(URL url) throws UnsupportedEncodingException {
Map<String,String> params = new LinkedHashMap<String, String>();
String query = url.getQuery();
if( query == null || query.isEmpty()) {
// empty query
return params;
}
String[] pairs = url.getQuery().split("&");
... | java | private static Map<String,String> parseQuery(URL url) throws UnsupportedEncodingException {
Map<String,String> params = new LinkedHashMap<String, String>();
String query = url.getQuery();
if( query == null || query.isEmpty()) {
// empty query
return params;
}
String[] pairs = url.getQuery().split("&");
... | [
"private",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"parseQuery",
"(",
"URL",
"url",
")",
"throws",
"UnsupportedEncodingException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"String",... | Parses URL parameters into a map. Keys are stored lower-case.
@param url
@return
@throws UnsupportedEncodingException | [
"Parses",
"URL",
"parameters",
"into",
"a",
"map",
".",
"Keys",
"are",
"stored",
"lower",
"-",
"case",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/URLIdentifier.java#L219-L241 |
31,433 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java | LocalPDBDirectory.getInputStream | protected InputStream getInputStream(String pdbId) throws IOException{
if ( pdbId.length() != 4)
throw new IOException("The provided ID does not look like a PDB ID : " + pdbId);
// Check existing
File file = downloadStructure(pdbId);
if(!file.exists()) {
throw new IOException("Structure "+pdbId+" not f... | java | protected InputStream getInputStream(String pdbId) throws IOException{
if ( pdbId.length() != 4)
throw new IOException("The provided ID does not look like a PDB ID : " + pdbId);
// Check existing
File file = downloadStructure(pdbId);
if(!file.exists()) {
throw new IOException("Structure "+pdbId+" not f... | [
"protected",
"InputStream",
"getInputStream",
"(",
"String",
"pdbId",
")",
"throws",
"IOException",
"{",
"if",
"(",
"pdbId",
".",
"length",
"(",
")",
"!=",
"4",
")",
"throw",
"new",
"IOException",
"(",
"\"The provided ID does not look like a PDB ID : \"",
"+",
"pd... | Load or download the specified structure and return it as an InputStream
for direct parsing.
@param pdbId
@return
@throws IOException | [
"Load",
"or",
"download",
"the",
"specified",
"structure",
"and",
"return",
"it",
"as",
"an",
"InputStream",
"for",
"direct",
"parsing",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java#L347-L364 |
31,434 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java | LocalPDBDirectory.prefetchStructure | public void prefetchStructure(String pdbId) throws IOException {
if ( pdbId.length() != 4)
throw new IOException("The provided ID does not look like a PDB ID : " + pdbId);
// Check existing
File file = downloadStructure(pdbId);
if(!file.exists()) {
throw new IOException("Structure "+pdbId+" not found an... | java | public void prefetchStructure(String pdbId) throws IOException {
if ( pdbId.length() != 4)
throw new IOException("The provided ID does not look like a PDB ID : " + pdbId);
// Check existing
File file = downloadStructure(pdbId);
if(!file.exists()) {
throw new IOException("Structure "+pdbId+" not found an... | [
"public",
"void",
"prefetchStructure",
"(",
"String",
"pdbId",
")",
"throws",
"IOException",
"{",
"if",
"(",
"pdbId",
".",
"length",
"(",
")",
"!=",
"4",
")",
"throw",
"new",
"IOException",
"(",
"\"The provided ID does not look like a PDB ID : \"",
"+",
"pdbId",
... | Download a structure, but don't parse it yet or store it in memory.
Used to pre-fetch large numbers of structures.
@param pdbId
@throws IOException | [
"Download",
"a",
"structure",
"but",
"don",
"t",
"parse",
"it",
"yet",
"or",
"store",
"it",
"in",
"memory",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java#L373-L383 |
31,435 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java | LocalPDBDirectory.deleteStructure | public boolean deleteStructure(String pdbId) throws IOException{
boolean deleted = false;
// Force getLocalFile to check in obsolete locations
ObsoleteBehavior obsolete = getObsoleteBehavior();
setObsoleteBehavior(ObsoleteBehavior.FETCH_OBSOLETE);
try {
File existing = getLocalFile(pdbId);
while(existi... | java | public boolean deleteStructure(String pdbId) throws IOException{
boolean deleted = false;
// Force getLocalFile to check in obsolete locations
ObsoleteBehavior obsolete = getObsoleteBehavior();
setObsoleteBehavior(ObsoleteBehavior.FETCH_OBSOLETE);
try {
File existing = getLocalFile(pdbId);
while(existi... | [
"public",
"boolean",
"deleteStructure",
"(",
"String",
"pdbId",
")",
"throws",
"IOException",
"{",
"boolean",
"deleted",
"=",
"false",
";",
"// Force getLocalFile to check in obsolete locations",
"ObsoleteBehavior",
"obsolete",
"=",
"getObsoleteBehavior",
"(",
")",
";",
... | Attempts to delete all versions of a structure from the local directory.
@param pdbId
@return True if one or more files were deleted
@throws IOException if the file cannot be deleted | [
"Attempts",
"to",
"delete",
"all",
"versions",
"of",
"a",
"structure",
"from",
"the",
"local",
"directory",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java#L391-L429 |
31,436 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java | LocalPDBDirectory.downloadStructure | protected File downloadStructure(String pdbId) throws IOException{
if ( pdbId.length() != 4)
throw new IOException("The provided ID does not look like a PDB ID : " + pdbId);
// decide whether download is required
File existing = getLocalFile(pdbId);
switch(fetchBehavior) {
case LOCAL_ONLY:
if( existin... | java | protected File downloadStructure(String pdbId) throws IOException{
if ( pdbId.length() != 4)
throw new IOException("The provided ID does not look like a PDB ID : " + pdbId);
// decide whether download is required
File existing = getLocalFile(pdbId);
switch(fetchBehavior) {
case LOCAL_ONLY:
if( existin... | [
"protected",
"File",
"downloadStructure",
"(",
"String",
"pdbId",
")",
"throws",
"IOException",
"{",
"if",
"(",
"pdbId",
".",
"length",
"(",
")",
"!=",
"4",
")",
"throw",
"new",
"IOException",
"(",
"\"The provided ID does not look like a PDB ID : \"",
"+",
"pdbId"... | Downloads an MMCIF file from the PDB to the local path
@param pdbId
@return The file, or null if it was unavailable for download
@throws IOException for errors downloading or writing, or if the
fetchBehavior is {@link FetchBehavior#LOCAL_ONLY} | [
"Downloads",
"an",
"MMCIF",
"file",
"from",
"the",
"PDB",
"to",
"the",
"local",
"path"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java#L438-L500 |
31,437 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java | LocalPDBDirectory.downloadStructure | private File downloadStructure(String pdbId, String pathOnServer, boolean obsolete, File existingFile)
throws IOException{
File dir = getDir(pdbId,obsolete);
File realFile = new File(dir,getFilename(pdbId));
String ftp;
if (getFilename(pdbId).endsWith(".mmtf.gz")){
ftp = CodecUtils.getMmtfEntryUrl(pdbI... | java | private File downloadStructure(String pdbId, String pathOnServer, boolean obsolete, File existingFile)
throws IOException{
File dir = getDir(pdbId,obsolete);
File realFile = new File(dir,getFilename(pdbId));
String ftp;
if (getFilename(pdbId).endsWith(".mmtf.gz")){
ftp = CodecUtils.getMmtfEntryUrl(pdbI... | [
"private",
"File",
"downloadStructure",
"(",
"String",
"pdbId",
",",
"String",
"pathOnServer",
",",
"boolean",
"obsolete",
",",
"File",
"existingFile",
")",
"throws",
"IOException",
"{",
"File",
"dir",
"=",
"getDir",
"(",
"pdbId",
",",
"obsolete",
")",
";",
... | Download a file from the ftp server, replacing any existing files if needed
@param pdbId PDB ID
@param pathOnServer Path on the FTP server, e.g. data/structures/divided/pdb
@param obsolete Whether or not file should be saved to the obsolete location locally
@param existingFile if not null and checkServerFileDate is tru... | [
"Download",
"a",
"file",
"from",
"the",
"ftp",
"server",
"replacing",
"any",
"existing",
"files",
"if",
"needed"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java#L512-L568 |
31,438 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java | LocalPDBDirectory.getLastModifiedTime | private Date getLastModifiedTime(URL url) {
// see http://stackoverflow.com/questions/2416872/how-do-you-obtain-modified-date-from-a-remote-file-java
Date date = null;
try {
String lastModified = url.openConnection().getHeaderField("Last-Modified");
logger.debug("Last modified date of server file ({}) is {... | java | private Date getLastModifiedTime(URL url) {
// see http://stackoverflow.com/questions/2416872/how-do-you-obtain-modified-date-from-a-remote-file-java
Date date = null;
try {
String lastModified = url.openConnection().getHeaderField("Last-Modified");
logger.debug("Last modified date of server file ({}) is {... | [
"private",
"Date",
"getLastModifiedTime",
"(",
"URL",
"url",
")",
"{",
"// see http://stackoverflow.com/questions/2416872/how-do-you-obtain-modified-date-from-a-remote-file-java",
"Date",
"date",
"=",
"null",
";",
"try",
"{",
"String",
"lastModified",
"=",
"url",
".",
"open... | Get the last modified time of the file in given url by retrieveing the "Last-Modified" header.
Note that this only works for http URLs
@param url
@return the last modified date or null if it couldn't be retrieved (in that case a warning will be logged) | [
"Get",
"the",
"last",
"modified",
"time",
"of",
"the",
"file",
"in",
"given",
"url",
"by",
"retrieveing",
"the",
"Last",
"-",
"Modified",
"header",
".",
"Note",
"that",
"this",
"only",
"works",
"for",
"http",
"URLs"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java#L576-L601 |
31,439 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java | LocalPDBDirectory.getDir | protected File getDir(String pdbId, boolean obsolete) {
File dir = null;
if (obsolete) {
// obsolete is always split
String middle = pdbId.substring(1,3).toLowerCase();
dir = new File(obsoleteDirPath, middle);
} else {
String middle = pdbId.substring(1,3).toLowerCase();
dir = new File(splitDirPat... | java | protected File getDir(String pdbId, boolean obsolete) {
File dir = null;
if (obsolete) {
// obsolete is always split
String middle = pdbId.substring(1,3).toLowerCase();
dir = new File(obsoleteDirPath, middle);
} else {
String middle = pdbId.substring(1,3).toLowerCase();
dir = new File(splitDirPat... | [
"protected",
"File",
"getDir",
"(",
"String",
"pdbId",
",",
"boolean",
"obsolete",
")",
"{",
"File",
"dir",
"=",
"null",
";",
"if",
"(",
"obsolete",
")",
"{",
"// obsolete is always split",
"String",
"middle",
"=",
"pdbId",
".",
"substring",
"(",
"1",
",",... | Gets the directory in which the file for a given MMCIF file would live,
creating it if necessary.
The obsolete parameter is necessary to avoid additional server queries.
@param pdbId
@param obsolete Whether the pdbId is obsolete or not
@return File pointing to the directory, | [
"Gets",
"the",
"directory",
"in",
"which",
"the",
"file",
"for",
"a",
"given",
"MMCIF",
"file",
"would",
"live",
"creating",
"it",
"if",
"necessary",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java#L612-L632 |
31,440 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java | LocalPDBDirectory.getLocalFile | public File getLocalFile(String pdbId) throws IOException {
// Search for existing files
// Search directories:
// 1) LOCAL_MMCIF_SPLIT_DIR/<middle>/(pdb)?<pdbId>.<ext>
// 2) LOCAL_MMCIF_ALL_DIR/<middle>/(pdb)?<pdbId>.<ext>
LinkedList<File> searchdirs = new LinkedList<File>();
String middle = pdbId.substr... | java | public File getLocalFile(String pdbId) throws IOException {
// Search for existing files
// Search directories:
// 1) LOCAL_MMCIF_SPLIT_DIR/<middle>/(pdb)?<pdbId>.<ext>
// 2) LOCAL_MMCIF_ALL_DIR/<middle>/(pdb)?<pdbId>.<ext>
LinkedList<File> searchdirs = new LinkedList<File>();
String middle = pdbId.substr... | [
"public",
"File",
"getLocalFile",
"(",
"String",
"pdbId",
")",
"throws",
"IOException",
"{",
"// Search for existing files",
"// Search directories:",
"// 1) LOCAL_MMCIF_SPLIT_DIR/<middle>/(pdb)?<pdbId>.<ext>",
"// 2) LOCAL_MMCIF_ALL_DIR/<middle>/(pdb)?<pdbId>.<ext>",
"LinkedList",
"<"... | Searches for previously downloaded files
@param pdbId
@return A file pointing to the existing file, or null if not found
@throws IOException If the file exists but is empty and can't be deleted | [
"Searches",
"for",
"previously",
"downloaded",
"files"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java#L640-L678 |
31,441 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionAbstract.java | SuperPositionAbstract.checkInput | protected void checkInput(Point3d[] fixed, Point3d[] moved) {
if (fixed.length != moved.length)
throw new IllegalArgumentException(
"Point arrays to superpose are of different lengths.");
} | java | protected void checkInput(Point3d[] fixed, Point3d[] moved) {
if (fixed.length != moved.length)
throw new IllegalArgumentException(
"Point arrays to superpose are of different lengths.");
} | [
"protected",
"void",
"checkInput",
"(",
"Point3d",
"[",
"]",
"fixed",
",",
"Point3d",
"[",
"]",
"moved",
")",
"{",
"if",
"(",
"fixed",
".",
"length",
"!=",
"moved",
".",
"length",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Point arrays to super... | Check that the input to the superposition algorithms is valid.
@param fixed
@param moved | [
"Check",
"that",
"the",
"input",
"to",
"the",
"superposition",
"algorithms",
"is",
"valid",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionAbstract.java#L55-L59 |
31,442 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/math/SparseSquareMatrix.java | SparseSquareMatrix.get | public double get(int i, int j) {
if (i < 0 || i >= N) throw new IllegalArgumentException("Illegal index " + i + " should be > 0 and < " + N);
if (j < 0 || j >= N) throw new IllegalArgumentException("Illegal index " + j + " should be > 0 and < " + N);
return rows[i].get(j);
} | java | public double get(int i, int j) {
if (i < 0 || i >= N) throw new IllegalArgumentException("Illegal index " + i + " should be > 0 and < " + N);
if (j < 0 || j >= N) throw new IllegalArgumentException("Illegal index " + j + " should be > 0 and < " + N);
return rows[i].get(j);
} | [
"public",
"double",
"get",
"(",
"int",
"i",
",",
"int",
"j",
")",
"{",
"if",
"(",
"i",
"<",
"0",
"||",
"i",
">=",
"N",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Illegal index \"",
"+",
"i",
"+",
"\" should be > 0 and < \"",
"+",
"N",
")"... | access a value at i,j
@param i
@param j
@return return A[i][j] | [
"access",
"a",
"value",
"at",
"i",
"j"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/math/SparseSquareMatrix.java#L87-L93 |
31,443 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/MultiThreadedDBSearch.java | MultiThreadedDBSearch.interrupt | public void interrupt() {
interrupted.set(true);
ExecutorService pool = ConcurrencyTools.getThreadPool();
pool.shutdownNow();
try {
DomainProvider domainProvider = DomainProviderFactory.getDomainProvider();
if (domainProvider instanceof RemoteDomainProvider){
RemoteDomainProvider remote = (RemoteDomai... | java | public void interrupt() {
interrupted.set(true);
ExecutorService pool = ConcurrencyTools.getThreadPool();
pool.shutdownNow();
try {
DomainProvider domainProvider = DomainProviderFactory.getDomainProvider();
if (domainProvider instanceof RemoteDomainProvider){
RemoteDomainProvider remote = (RemoteDomai... | [
"public",
"void",
"interrupt",
"(",
")",
"{",
"interrupted",
".",
"set",
"(",
"true",
")",
";",
"ExecutorService",
"pool",
"=",
"ConcurrencyTools",
".",
"getThreadPool",
"(",
")",
";",
"pool",
".",
"shutdownNow",
"(",
")",
";",
"try",
"{",
"DomainProvider"... | stops what is currently happening and does not continue | [
"stops",
"what",
"is",
"currently",
"happening",
"and",
"does",
"not",
"continue"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/MultiThreadedDBSearch.java#L449-L463 |
31,444 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/Equals.java | Equals.equal | public static boolean equal(Object one, Object two) {
return one == null && two == null || !(one == null || two == null) && (one == two || one.equals(two));
} | java | public static boolean equal(Object one, Object two) {
return one == null && two == null || !(one == null || two == null) && (one == two || one.equals(two));
} | [
"public",
"static",
"boolean",
"equal",
"(",
"Object",
"one",
",",
"Object",
"two",
")",
"{",
"return",
"one",
"==",
"null",
"&&",
"two",
"==",
"null",
"||",
"!",
"(",
"one",
"==",
"null",
"||",
"two",
"==",
"null",
")",
"&&",
"(",
"one",
"==",
"... | Does not compare class types.
@see #classEqual(Object, Object) | [
"Does",
"not",
"compare",
"class",
"types",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/Equals.java#L49-L51 |
31,445 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java | IOUtils.processReader | public static void processReader(BufferedReader br, ReaderProcessor processor) throws ParserException {
String line;
try {
while( (line = br.readLine()) != null ) {
processor.process(line);
}
}
catch(IOException e) {
throw new ParserException("Could not read from the given BufferedReader");
}
f... | java | public static void processReader(BufferedReader br, ReaderProcessor processor) throws ParserException {
String line;
try {
while( (line = br.readLine()) != null ) {
processor.process(line);
}
}
catch(IOException e) {
throw new ParserException("Could not read from the given BufferedReader");
}
f... | [
"public",
"static",
"void",
"processReader",
"(",
"BufferedReader",
"br",
",",
"ReaderProcessor",
"processor",
")",
"throws",
"ParserException",
"{",
"String",
"line",
";",
"try",
"{",
"while",
"(",
"(",
"line",
"=",
"br",
".",
"readLine",
"(",
")",
")",
"... | Takes in a reader and a processor, reads every line from the given
file and then invokes the processor. What you do with the lines is
dependent on your processor.
The code will automatically close the given BufferedReader.
@param br The reader to process
@param processor The processor to invoke on all lines
@throws P... | [
"Takes",
"in",
"a",
"reader",
"and",
"a",
"processor",
"reads",
"every",
"line",
"from",
"the",
"given",
"file",
"and",
"then",
"invokes",
"the",
"processor",
".",
"What",
"you",
"do",
"with",
"the",
"lines",
"is",
"dependent",
"on",
"your",
"processor",
... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java#L90-L103 |
31,446 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java | IOUtils.getList | public static List<String> getList(BufferedReader br) throws ParserException {
final List<String> list = new ArrayList<String>();
processReader(br, new ReaderProcessor() {
@Override
public void process(String line) {
list.add(line);
}
});
return list;
} | java | public static List<String> getList(BufferedReader br) throws ParserException {
final List<String> list = new ArrayList<String>();
processReader(br, new ReaderProcessor() {
@Override
public void process(String line) {
list.add(line);
}
});
return list;
} | [
"public",
"static",
"List",
"<",
"String",
">",
"getList",
"(",
"BufferedReader",
"br",
")",
"throws",
"ParserException",
"{",
"final",
"List",
"<",
"String",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"processReader",
"(",
... | Returns the contents of a buffered reader as a list of strings
@param br BufferedReader to read from; <strong>will be closed</strong>
@return List of Strings
@throws ParserException Can throw this if we cannot parse the given reader | [
"Returns",
"the",
"contents",
"of",
"a",
"buffered",
"reader",
"as",
"a",
"list",
"of",
"strings"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java#L112-L121 |
31,447 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java | IOUtils.getGCGChecksum | public static <S extends Sequence<C>, C extends Compound> int getGCGChecksum(List<S> sequences) {
int check = 0;
for (S as : sequences) {
check += getGCGChecksum(as);
}
return check % 10000;
} | java | public static <S extends Sequence<C>, C extends Compound> int getGCGChecksum(List<S> sequences) {
int check = 0;
for (S as : sequences) {
check += getGCGChecksum(as);
}
return check % 10000;
} | [
"public",
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"C",
">",
",",
"C",
"extends",
"Compound",
">",
"int",
"getGCGChecksum",
"(",
"List",
"<",
"S",
">",
"sequences",
")",
"{",
"int",
"check",
"=",
"0",
";",
"for",
"(",
"S",
"as",
":",
"sequen... | Calculates GCG checksum for entire list of sequences
@param sequences list of sequences
@return GCG checksum | [
"Calculates",
"GCG",
"checksum",
"for",
"entire",
"list",
"of",
"sequences"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java#L196-L202 |
31,448 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java | IOUtils.getGCGChecksum | public static <S extends Sequence<C>, C extends Compound> int getGCGChecksum(S sequence) {
String s = sequence.toString().toUpperCase();
int count = 0, check = 0;
for (int i = 0; i < s.length(); i++) {
count++;
check += count * s.charAt(i);
if (count == 57) {
count = 0;
}
}
return check % 1000... | java | public static <S extends Sequence<C>, C extends Compound> int getGCGChecksum(S sequence) {
String s = sequence.toString().toUpperCase();
int count = 0, check = 0;
for (int i = 0; i < s.length(); i++) {
count++;
check += count * s.charAt(i);
if (count == 57) {
count = 0;
}
}
return check % 1000... | [
"public",
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"C",
">",
",",
"C",
"extends",
"Compound",
">",
"int",
"getGCGChecksum",
"(",
"S",
"sequence",
")",
"{",
"String",
"s",
"=",
"sequence",
".",
"toString",
"(",
")",
".",
"toUpperCase",
"(",
")",
... | Calculates GCG checksum for a given sequence
@param sequence given sequence
@return GCG checksum | [
"Calculates",
"GCG",
"checksum",
"for",
"a",
"given",
"sequence"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java#L210-L221 |
31,449 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java | IOUtils.getGCGHeader | public static <S extends Sequence<C>, C extends Compound> String getGCGHeader(List<S> sequences) {
StringBuilder header = new StringBuilder();
S s1 = sequences.get(0);
header.append(String.format("MSA from BioJava%n%n MSF: %d Type: %s Check: %d ..%n%n",
s1.getLength(), getGCGType(s1.getCompoundSet()), getGC... | java | public static <S extends Sequence<C>, C extends Compound> String getGCGHeader(List<S> sequences) {
StringBuilder header = new StringBuilder();
S s1 = sequences.get(0);
header.append(String.format("MSA from BioJava%n%n MSF: %d Type: %s Check: %d ..%n%n",
s1.getLength(), getGCGType(s1.getCompoundSet()), getGC... | [
"public",
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"C",
">",
",",
"C",
"extends",
"Compound",
">",
"String",
"getGCGHeader",
"(",
"List",
"<",
"S",
">",
"sequences",
")",
"{",
"StringBuilder",
"header",
"=",
"new",
"StringBuilder",
"(",
")",
";",
... | Assembles a GCG file header
@param sequences list of sequences
@return GCG header | [
"Assembles",
"a",
"GCG",
"file",
"header"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java#L229-L242 |
31,450 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java | IOUtils.getGCGType | public static <C extends Compound> String getGCGType(CompoundSet<C> cs) {
return (cs == DNACompoundSet.getDNACompoundSet() || cs == AmbiguityDNACompoundSet.getDNACompoundSet()) ? "D" :
(cs == RNACompoundSet.getRNACompoundSet() || cs == AmbiguityRNACompoundSet.getRNACompoundSet()) ? "R" : "P";
} | java | public static <C extends Compound> String getGCGType(CompoundSet<C> cs) {
return (cs == DNACompoundSet.getDNACompoundSet() || cs == AmbiguityDNACompoundSet.getDNACompoundSet()) ? "D" :
(cs == RNACompoundSet.getRNACompoundSet() || cs == AmbiguityRNACompoundSet.getRNACompoundSet()) ? "R" : "P";
} | [
"public",
"static",
"<",
"C",
"extends",
"Compound",
">",
"String",
"getGCGType",
"(",
"CompoundSet",
"<",
"C",
">",
"cs",
")",
"{",
"return",
"(",
"cs",
"==",
"DNACompoundSet",
".",
"getDNACompoundSet",
"(",
")",
"||",
"cs",
"==",
"AmbiguityDNACompoundSet",... | Determines GCG type
@param cs compound set of sequences
@return GCG type | [
"Determines",
"GCG",
"type"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java#L249-L252 |
31,451 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java | IOUtils.getIDFormat | public static <S extends Sequence<C>, C extends Compound> String getIDFormat(List<S> sequences) {
int length = 0;
for (S as : sequences) {
length = Math.max(length, (as.getAccession() == null) ? 0 : as.getAccession().toString().length());
}
return (length == 0) ? null : "%-" + (length + 1) + "s";
} | java | public static <S extends Sequence<C>, C extends Compound> String getIDFormat(List<S> sequences) {
int length = 0;
for (S as : sequences) {
length = Math.max(length, (as.getAccession() == null) ? 0 : as.getAccession().toString().length());
}
return (length == 0) ? null : "%-" + (length + 1) + "s";
} | [
"public",
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"C",
">",
",",
"C",
"extends",
"Compound",
">",
"String",
"getIDFormat",
"(",
"List",
"<",
"S",
">",
"sequences",
")",
"{",
"int",
"length",
"=",
"0",
";",
"for",
"(",
"S",
"as",
":",
"seque... | Creates format String for accession IDs
@param sequences list of sequences
@return format String for accession IDs | [
"Creates",
"format",
"String",
"for",
"accession",
"IDs"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java#L260-L266 |
31,452 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java | IOUtils.getPDBCharacter | public static String getPDBCharacter(boolean web, char c1, char c2, boolean similar, char c) {
String s = String.valueOf(c);
return getPDBString(web, c1, c2, similar, s, s, s, s);
} | java | public static String getPDBCharacter(boolean web, char c1, char c2, boolean similar, char c) {
String s = String.valueOf(c);
return getPDBString(web, c1, c2, similar, s, s, s, s);
} | [
"public",
"static",
"String",
"getPDBCharacter",
"(",
"boolean",
"web",
",",
"char",
"c1",
",",
"char",
"c2",
",",
"boolean",
"similar",
",",
"char",
"c",
")",
"{",
"String",
"s",
"=",
"String",
".",
"valueOf",
"(",
"c",
")",
";",
"return",
"getPDBStri... | Creates formatted String for a single character of PDB output
@param web true for HTML display
@param c1 character in first sequence
@param c2 character in second sequence
@param similar true if c1 and c2 are considered similar compounds
@param c character to display
@return formatted String | [
"Creates",
"formatted",
"String",
"for",
"a",
"single",
"character",
"of",
"PDB",
"output"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java#L278-L281 |
31,453 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java | IOUtils.getPDBConservation | public static String getPDBConservation(boolean web, char c1, char c2, boolean similar) {
return getPDBString(web, c1, c2, similar, "|", ".", " ", web ? " " : " ");
} | java | public static String getPDBConservation(boolean web, char c1, char c2, boolean similar) {
return getPDBString(web, c1, c2, similar, "|", ".", " ", web ? " " : " ");
} | [
"public",
"static",
"String",
"getPDBConservation",
"(",
"boolean",
"web",
",",
"char",
"c1",
",",
"char",
"c2",
",",
"boolean",
"similar",
")",
"{",
"return",
"getPDBString",
"(",
"web",
",",
"c1",
",",
"c2",
",",
"similar",
",",
"\"|\"",
",",
"\".\"",
... | Creates formatted String for displaying conservation in PDB output
@param web true for HTML display
@param c1 character in first sequence
@param c2 character in second sequence
@param similar true if c1 and c2 are considered similar compounds
@return formatted String | [
"Creates",
"formatted",
"String",
"for",
"displaying",
"conservation",
"in",
"PDB",
"output"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java#L292-L294 |
31,454 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java | IOUtils.getPDBString | private static String getPDBString(boolean web, char c1, char c2, boolean similar, String m, String sm, String dm,
String qg) {
if (c1 == c2)
return web ? "<span class=\"m\">" + m + "</span>" : m;
else if (similar)
return web ? "<span class=\"sm\">" + sm + "</span>" : sm;
else if (c1 == '-' || c2 == '-')... | java | private static String getPDBString(boolean web, char c1, char c2, boolean similar, String m, String sm, String dm,
String qg) {
if (c1 == c2)
return web ? "<span class=\"m\">" + m + "</span>" : m;
else if (similar)
return web ? "<span class=\"sm\">" + sm + "</span>" : sm;
else if (c1 == '-' || c2 == '-')... | [
"private",
"static",
"String",
"getPDBString",
"(",
"boolean",
"web",
",",
"char",
"c1",
",",
"char",
"c2",
",",
"boolean",
"similar",
",",
"String",
"m",
",",
"String",
"sm",
",",
"String",
"dm",
",",
"String",
"qg",
")",
"{",
"if",
"(",
"c1",
"==",... | helper method for getPDBCharacter and getPDBConservation | [
"helper",
"method",
"for",
"getPDBCharacter",
"and",
"getPDBConservation"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java#L297-L307 |
31,455 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java | IOUtils.getPDBLegend | public static String getPDBLegend() {
StringBuilder s = new StringBuilder();
s.append("</pre></div>");
s.append(" <div class=\"subText\">");
s.append(" <b>Legend:</b>");
s.append(" <span class=\"m\">Green</span> - identical residues |");
s.append(" <span class=\"sm\">Pink... | java | public static String getPDBLegend() {
StringBuilder s = new StringBuilder();
s.append("</pre></div>");
s.append(" <div class=\"subText\">");
s.append(" <b>Legend:</b>");
s.append(" <span class=\"m\">Green</span> - identical residues |");
s.append(" <span class=\"sm\">Pink... | [
"public",
"static",
"String",
"getPDBLegend",
"(",
")",
"{",
"StringBuilder",
"s",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"s",
".",
"append",
"(",
"\"</pre></div>\"",
")",
";",
"s",
".",
"append",
"(",
"\" <div class=\\\"subText\\\">\"",
")",
";"... | Creates formatted String for displaying conservation legend in PDB output
@return legend String | [
"Creates",
"formatted",
"String",
"for",
"displaying",
"conservation",
"legend",
"in",
"PDB",
"output"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/util/IOUtils.java#L314-L326 |
31,456 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueNumber.java | ResidueNumber.equalsPositional | public boolean equalsPositional(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ResidueNumber other = (ResidueNumber) obj;
if (insCode == null) {
if (other.insCode != null)
return false;
} else if (!insCode.equals(oth... | java | public boolean equalsPositional(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ResidueNumber other = (ResidueNumber) obj;
if (insCode == null) {
if (other.insCode != null)
return false;
} else if (!insCode.equals(oth... | [
"public",
"boolean",
"equalsPositional",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"this",
"==",
"obj",
")",
"return",
"true",
";",
"if",
"(",
"obj",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"getClass",
"(",
")",
"!=",
"obj",
".",
"ge... | Check if the seqNum and insertion code are equivalent,
ignoring the chain
@param obj
@return | [
"Check",
"if",
"the",
"seqNum",
"and",
"insertion",
"code",
"are",
"equivalent",
"ignoring",
"the",
"chain"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueNumber.java#L122-L143 |
31,457 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueNumber.java | ResidueNumber.fromString | public static ResidueNumber fromString(String pdb_code) {
if(pdb_code == null)
return null;
ResidueNumber residueNumber = new ResidueNumber();
Integer resNum = null;
String icode = null;
try {
resNum = Integer.parseInt(pdb_code);
} catch ( NumberFormatException e){
// there is an insertion code..... | java | public static ResidueNumber fromString(String pdb_code) {
if(pdb_code == null)
return null;
ResidueNumber residueNumber = new ResidueNumber();
Integer resNum = null;
String icode = null;
try {
resNum = Integer.parseInt(pdb_code);
} catch ( NumberFormatException e){
// there is an insertion code..... | [
"public",
"static",
"ResidueNumber",
"fromString",
"(",
"String",
"pdb_code",
")",
"{",
"if",
"(",
"pdb_code",
"==",
"null",
")",
"return",
"null",
";",
"ResidueNumber",
"residueNumber",
"=",
"new",
"ResidueNumber",
"(",
")",
";",
"Integer",
"resNum",
"=",
"... | Convert a string representation of a residue number to a residue number object.
The string representation can be a integer followed by a character.
@param pdb_code
@return a ResidueNumber object, or null if the input was null | [
"Convert",
"a",
"string",
"representation",
"of",
"a",
"residue",
"number",
"to",
"a",
"residue",
"number",
"object",
".",
"The",
"string",
"representation",
"can",
"be",
"a",
"integer",
"followed",
"by",
"a",
"character",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueNumber.java#L192-L222 |
31,458 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueNumber.java | ResidueNumber.compareTo | @Override
public int compareTo(ResidueNumber other) {
// chain id
if (chainName != null && other.chainName != null) {
if (!chainName.equals(other.chainName)) return chainName.compareTo(other.chainName);
}
if (chainName != null && other.chainName == null) {
return 1;
} else if (chainName == null && oth... | java | @Override
public int compareTo(ResidueNumber other) {
// chain id
if (chainName != null && other.chainName != null) {
if (!chainName.equals(other.chainName)) return chainName.compareTo(other.chainName);
}
if (chainName != null && other.chainName == null) {
return 1;
} else if (chainName == null && oth... | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"ResidueNumber",
"other",
")",
"{",
"// chain id",
"if",
"(",
"chainName",
"!=",
"null",
"&&",
"other",
".",
"chainName",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"chainName",
".",
"equals",
"(",
"other"... | Compare residue numbers by chain, sequence number, and insertion code | [
"Compare",
"residue",
"numbers",
"by",
"chain",
"sequence",
"number",
"and",
"insertion",
"code"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueNumber.java#L228-L242 |
31,459 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueNumber.java | ResidueNumber.compareToPositional | public int compareToPositional(ResidueNumber other) {
// sequence number
if (seqNum != null && other.seqNum != null) {
if (!seqNum.equals(other.seqNum)) return seqNum.compareTo(other.seqNum);
}
if (seqNum != null && other.seqNum == null) {
return 1;
} else if (seqNum == null && other.seqNum != null) {
... | java | public int compareToPositional(ResidueNumber other) {
// sequence number
if (seqNum != null && other.seqNum != null) {
if (!seqNum.equals(other.seqNum)) return seqNum.compareTo(other.seqNum);
}
if (seqNum != null && other.seqNum == null) {
return 1;
} else if (seqNum == null && other.seqNum != null) {
... | [
"public",
"int",
"compareToPositional",
"(",
"ResidueNumber",
"other",
")",
"{",
"// sequence number",
"if",
"(",
"seqNum",
"!=",
"null",
"&&",
"other",
".",
"seqNum",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"seqNum",
".",
"equals",
"(",
"other",
".",
"s... | Compare residue numbers by sequence number and insertion code,
ignoring the chain
@param other
@return | [
"Compare",
"residue",
"numbers",
"by",
"sequence",
"number",
"and",
"insertion",
"code",
"ignoring",
"the",
"chain"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueNumber.java#L250-L272 |
31,460 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueRangeAndLength.java | ResidueRangeAndLength.parse | public static ResidueRangeAndLength parse(String s, AtomPositionMap map) {
ResidueRange rr = parse(s);
ResidueNumber start = rr.getStart();
String chain = rr.getChainName();
// handle special "_" chain
if(chain == null || chain.equals("_")) {
ResidueNumber first = map.getNavMap().firstKey();
chain = f... | java | public static ResidueRangeAndLength parse(String s, AtomPositionMap map) {
ResidueRange rr = parse(s);
ResidueNumber start = rr.getStart();
String chain = rr.getChainName();
// handle special "_" chain
if(chain == null || chain.equals("_")) {
ResidueNumber first = map.getNavMap().firstKey();
chain = f... | [
"public",
"static",
"ResidueRangeAndLength",
"parse",
"(",
"String",
"s",
",",
"AtomPositionMap",
"map",
")",
"{",
"ResidueRange",
"rr",
"=",
"parse",
"(",
"s",
")",
";",
"ResidueNumber",
"start",
"=",
"rr",
".",
"getStart",
"(",
")",
";",
"String",
"chain... | Parses a residue range.
The AtomPositionMap is used to calculate the length and fill in missing
information, such as for whole chains ('A:'). Supports the special chain
name '_' for single-chain structures.
If residues are specified outside of the range given in the map,
attempts to decrease the input range to valid ... | [
"Parses",
"a",
"residue",
"range",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueRangeAndLength.java#L96-L128 |
31,461 | biojava/biojava | biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java | Jronn.convertProteinSequencetoFasta | public static FastaSequence convertProteinSequencetoFasta(ProteinSequence sequence){
StringBuffer buf = new StringBuffer();
for (AminoAcidCompound compound : sequence) {
String c = compound.getShortName();
if (! SequenceUtil.NON_AA.matcher(c).find()) {
buf.append(c);
} else {
buf.append("X");
... | java | public static FastaSequence convertProteinSequencetoFasta(ProteinSequence sequence){
StringBuffer buf = new StringBuffer();
for (AminoAcidCompound compound : sequence) {
String c = compound.getShortName();
if (! SequenceUtil.NON_AA.matcher(c).find()) {
buf.append(c);
} else {
buf.append("X");
... | [
"public",
"static",
"FastaSequence",
"convertProteinSequencetoFasta",
"(",
"ProteinSequence",
"sequence",
")",
"{",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"AminoAcidCompound",
"compound",
":",
"sequence",
")",
"{",
"String",
... | Utility method to convert a BioJava ProteinSequence object to the FastaSequence
object used internally in JRonn.
@param sequence
@return | [
"Utility",
"method",
"to",
"convert",
"a",
"BioJava",
"ProteinSequence",
"object",
"to",
"the",
"FastaSequence",
"object",
"used",
"internally",
"in",
"JRonn",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java#L159-L173 |
31,462 | biojava/biojava | biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java | Jronn.getDisorder | public static Range[] getDisorder(FastaSequence sequence) {
float[] scores = getDisorderScores(sequence);
return scoresToRanges(scores, RonnConstraint.DEFAULT_RANGE_PROBABILITY_THRESHOLD);
} | java | public static Range[] getDisorder(FastaSequence sequence) {
float[] scores = getDisorderScores(sequence);
return scoresToRanges(scores, RonnConstraint.DEFAULT_RANGE_PROBABILITY_THRESHOLD);
} | [
"public",
"static",
"Range",
"[",
"]",
"getDisorder",
"(",
"FastaSequence",
"sequence",
")",
"{",
"float",
"[",
"]",
"scores",
"=",
"getDisorderScores",
"(",
"sequence",
")",
";",
"return",
"scoresToRanges",
"(",
"scores",
",",
"RonnConstraint",
".",
"DEFAULT_... | Calculates the disordered regions of the sequence. More formally, the regions for which the
probability of disorder is greater then 0.50.
@param sequence an instance of FastaSequence object, holding the name and the sequence.
@return the array of ranges if there are any residues predicted to have the
probability of d... | [
"Calculates",
"the",
"disordered",
"regions",
"of",
"the",
"sequence",
".",
"More",
"formally",
"the",
"regions",
"for",
"which",
"the",
"probability",
"of",
"disorder",
"is",
"greater",
"then",
"0",
".",
"50",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java#L200-L203 |
31,463 | biojava/biojava | biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java | Jronn.scoresToRanges | public static Range[] scoresToRanges(float[] scores, float probability) {
assert scores!=null && scores.length>0;
assert probability>0 && probability<1;
int count=0;
int regionLen=0;
List<Range> ranges = new ArrayList<Range>();
for(float score: scores) {
count++;
// Round to 2 decimal points before ... | java | public static Range[] scoresToRanges(float[] scores, float probability) {
assert scores!=null && scores.length>0;
assert probability>0 && probability<1;
int count=0;
int regionLen=0;
List<Range> ranges = new ArrayList<Range>();
for(float score: scores) {
count++;
// Round to 2 decimal points before ... | [
"public",
"static",
"Range",
"[",
"]",
"scoresToRanges",
"(",
"float",
"[",
"]",
"scores",
",",
"float",
"probability",
")",
"{",
"assert",
"scores",
"!=",
"null",
"&&",
"scores",
".",
"length",
">",
"0",
";",
"assert",
"probability",
">",
"0",
"&&",
"... | Convert raw scores to ranges. Gives ranges for given probability of disorder value
@param scores the raw probability of disorder scores for each residue in the sequence.
@param probability the cut off threshold. Include all residues with the probability of disorder greater then this value
@return the array of ranges if... | [
"Convert",
"raw",
"scores",
"to",
"ranges",
".",
"Gives",
"ranges",
"for",
"given",
"probability",
"of",
"disorder",
"value"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java#L212-L238 |
31,464 | biojava/biojava | biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java | Jronn.getDisorderScores | public static Map<FastaSequence,float[]> getDisorderScores(List<FastaSequence> sequences) {
Map<FastaSequence,float[]> results = new TreeMap<FastaSequence, float[]>();
for(FastaSequence fsequence : sequences) {
results.put(fsequence, predictSerial(fsequence));
}
return results;
} | java | public static Map<FastaSequence,float[]> getDisorderScores(List<FastaSequence> sequences) {
Map<FastaSequence,float[]> results = new TreeMap<FastaSequence, float[]>();
for(FastaSequence fsequence : sequences) {
results.put(fsequence, predictSerial(fsequence));
}
return results;
} | [
"public",
"static",
"Map",
"<",
"FastaSequence",
",",
"float",
"[",
"]",
">",
"getDisorderScores",
"(",
"List",
"<",
"FastaSequence",
">",
"sequences",
")",
"{",
"Map",
"<",
"FastaSequence",
",",
"float",
"[",
"]",
">",
"results",
"=",
"new",
"TreeMap",
... | Calculates the probability of disorder scores for each residue in the sequence for
many sequences in the input.
@param sequences the list of the FastaSequence objects
@return the Map with key->FastaSequence, value->probability of disorder for each residue
@see #getDisorder(FastaSequence) | [
"Calculates",
"the",
"probability",
"of",
"disorder",
"scores",
"for",
"each",
"residue",
"in",
"the",
"sequence",
"for",
"many",
"sequences",
"in",
"the",
"input",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java#L248-L254 |
31,465 | biojava/biojava | biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java | Jronn.getDisorder | public static Map<FastaSequence,Range[]> getDisorder(List<FastaSequence> sequences) {
Map<FastaSequence,Range[]> disorderRanges = new TreeMap<FastaSequence,Range[]>();
for(FastaSequence fs: sequences) {
disorderRanges.put(fs, getDisorder(fs));
}
return disorderRanges;
} | java | public static Map<FastaSequence,Range[]> getDisorder(List<FastaSequence> sequences) {
Map<FastaSequence,Range[]> disorderRanges = new TreeMap<FastaSequence,Range[]>();
for(FastaSequence fs: sequences) {
disorderRanges.put(fs, getDisorder(fs));
}
return disorderRanges;
} | [
"public",
"static",
"Map",
"<",
"FastaSequence",
",",
"Range",
"[",
"]",
">",
"getDisorder",
"(",
"List",
"<",
"FastaSequence",
">",
"sequences",
")",
"{",
"Map",
"<",
"FastaSequence",
",",
"Range",
"[",
"]",
">",
"disorderRanges",
"=",
"new",
"TreeMap",
... | Calculates the disordered regions of the sequence for many sequences in the input.
@param sequences sequences the list of the FastaSequence objects
@return
@see #getDisorder(FastaSequence) | [
"Calculates",
"the",
"disordered",
"regions",
"of",
"the",
"sequence",
"for",
"many",
"sequences",
"in",
"the",
"input",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java#L263-L269 |
31,466 | biojava/biojava | biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java | Jronn.getDisorder | public static Map<FastaSequence,Range[]> getDisorder(String fastaFile) throws FileNotFoundException, IOException {
final List<FastaSequence> sequences = SequenceUtil.readFasta(new FileInputStream(fastaFile));
return getDisorder(sequences);
} | java | public static Map<FastaSequence,Range[]> getDisorder(String fastaFile) throws FileNotFoundException, IOException {
final List<FastaSequence> sequences = SequenceUtil.readFasta(new FileInputStream(fastaFile));
return getDisorder(sequences);
} | [
"public",
"static",
"Map",
"<",
"FastaSequence",
",",
"Range",
"[",
"]",
">",
"getDisorder",
"(",
"String",
"fastaFile",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"final",
"List",
"<",
"FastaSequence",
">",
"sequences",
"=",
"SequenceUtil"... | Calculates the disordered regions of the protein sequence.
@param fastaFile input file name containing the sequence in FASTA
@return the Map with key->FastaSequence, value->the list of disordered regions for each sequence
@throws FileNotFoundException if the input file cannot be found
@throws IOException of the system ... | [
"Calculates",
"the",
"disordered",
"regions",
"of",
"the",
"protein",
"sequence",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-protein-disorder/src/main/java/org/biojava/nbio/ronn/Jronn.java#L280-L283 |
31,467 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/CAConverter.java | CAConverter.getRepresentativeAtomsOnly | public static List<Chain> getRepresentativeAtomsOnly(List<Chain> chains){
List<Chain> newChains = new ArrayList<Chain>();
for (Chain chain : chains){
Chain newChain = getRepresentativeAtomsOnly(chain);
newChains.add(newChain);
}
return newChains;
} | java | public static List<Chain> getRepresentativeAtomsOnly(List<Chain> chains){
List<Chain> newChains = new ArrayList<Chain>();
for (Chain chain : chains){
Chain newChain = getRepresentativeAtomsOnly(chain);
newChains.add(newChain);
}
return newChains;
} | [
"public",
"static",
"List",
"<",
"Chain",
">",
"getRepresentativeAtomsOnly",
"(",
"List",
"<",
"Chain",
">",
"chains",
")",
"{",
"List",
"<",
"Chain",
">",
"newChains",
"=",
"new",
"ArrayList",
"<",
"Chain",
">",
"(",
")",
";",
"for",
"(",
"Chain",
"ch... | Convert a List of chain objects to another List of chains, containing Representative atoms only.
@param chains list of chains
@return a list of chains
@since Biojava 4.1.0 | [
"Convert",
"a",
"List",
"of",
"chain",
"objects",
"to",
"another",
"List",
"of",
"chains",
"containing",
"Representative",
"atoms",
"only",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/CAConverter.java#L44-L53 |
31,468 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/CAConverter.java | CAConverter.getRepresentativeAtomsOnly | public static Chain getRepresentativeAtomsOnly(Chain chain){
Chain newChain = new ChainImpl();
newChain.setId(chain.getId());
newChain.setName(chain.getName());
newChain.setEntityInfo(chain.getEntityInfo());
newChain.setSwissprotId(chain.getSwissprotId());
List<Group> groups = chain.getAtomGroups();
gr... | java | public static Chain getRepresentativeAtomsOnly(Chain chain){
Chain newChain = new ChainImpl();
newChain.setId(chain.getId());
newChain.setName(chain.getName());
newChain.setEntityInfo(chain.getEntityInfo());
newChain.setSwissprotId(chain.getSwissprotId());
List<Group> groups = chain.getAtomGroups();
gr... | [
"public",
"static",
"Chain",
"getRepresentativeAtomsOnly",
"(",
"Chain",
"chain",
")",
"{",
"Chain",
"newChain",
"=",
"new",
"ChainImpl",
"(",
")",
";",
"newChain",
".",
"setId",
"(",
"chain",
".",
"getId",
"(",
")",
")",
";",
"newChain",
".",
"setName",
... | Convert a Chain to a new Chain containing C-alpha atoms only.
@param chain to convert
@return a new chain containing Amino acids with C-alpha only.
@since Biojava 4.1.0 | [
"Convert",
"a",
"Chain",
"to",
"a",
"new",
"Chain",
"containing",
"C",
"-",
"alpha",
"atoms",
"only",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/CAConverter.java#L62-L95 |
31,469 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/GradientMapper.java | GradientMapper.getGradientMapper | public static GradientMapper getGradientMapper(int gradientType, double min, double max) {
GradientMapper gm;
switch( gradientType ) {
case BLACK_WHITE_GRADIENT:
gm = new GradientMapper(Color.BLACK, Color.WHITE);
gm.put(min, Color.BLACK);
gm.put(max, Color.WHITE);
return gm;
case WHITE_BLACK_GRADIEN... | java | public static GradientMapper getGradientMapper(int gradientType, double min, double max) {
GradientMapper gm;
switch( gradientType ) {
case BLACK_WHITE_GRADIENT:
gm = new GradientMapper(Color.BLACK, Color.WHITE);
gm.put(min, Color.BLACK);
gm.put(max, Color.WHITE);
return gm;
case WHITE_BLACK_GRADIEN... | [
"public",
"static",
"GradientMapper",
"getGradientMapper",
"(",
"int",
"gradientType",
",",
"double",
"min",
",",
"double",
"max",
")",
"{",
"GradientMapper",
"gm",
";",
"switch",
"(",
"gradientType",
")",
"{",
"case",
"BLACK_WHITE_GRADIENT",
":",
"gm",
"=",
"... | Constructs a gradientMapper to draw one of the pre-defined gradients
For example,
GradientMapper.getGradientMapper(GradientMapper.RAINBOW_GRADIENT, 0, 10)
@param gradientType One of the gradient types, eg GradientMapper.BLACK_WHITE_GRADIENT
@param min Start of the gradient
@param max End of the gradient
@return | [
"Constructs",
"a",
"gradientMapper",
"to",
"draw",
"one",
"of",
"the",
"pre",
"-",
"defined",
"gradients"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/GradientMapper.java#L81-L132 |
31,470 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/GradientMapper.java | GradientMapper.clear | @Override
public void clear() {
Color neg = mapping.get(Double.NEGATIVE_INFINITY);
Color pos = mapping.get(Double.POSITIVE_INFINITY);
mapping.clear();
mapping.put(Double.NEGATIVE_INFINITY, neg);
mapping.put(Double.POSITIVE_INFINITY, pos);
} | java | @Override
public void clear() {
Color neg = mapping.get(Double.NEGATIVE_INFINITY);
Color pos = mapping.get(Double.POSITIVE_INFINITY);
mapping.clear();
mapping.put(Double.NEGATIVE_INFINITY, neg);
mapping.put(Double.POSITIVE_INFINITY, pos);
} | [
"@",
"Override",
"public",
"void",
"clear",
"(",
")",
"{",
"Color",
"neg",
"=",
"mapping",
".",
"get",
"(",
"Double",
".",
"NEGATIVE_INFINITY",
")",
";",
"Color",
"pos",
"=",
"mapping",
".",
"get",
"(",
"Double",
".",
"POSITIVE_INFINITY",
")",
";",
"ma... | Clears all finite endpoints
@see java.util.Map#clear() | [
"Clears",
"all",
"finite",
"endpoints"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/GradientMapper.java#L168-L175 |
31,471 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/GradientMapper.java | GradientMapper.put | @Override
public Color put(Double position, Color color) {
if( position == null ) {
throw new NullPointerException("Null endpoint position");
}
if( color == null ){
throw new NullPointerException("Null colors are not allowed.");
}
return mapping.put(position, color);
} | java | @Override
public Color put(Double position, Color color) {
if( position == null ) {
throw new NullPointerException("Null endpoint position");
}
if( color == null ){
throw new NullPointerException("Null colors are not allowed.");
}
return mapping.put(position, color);
} | [
"@",
"Override",
"public",
"Color",
"put",
"(",
"Double",
"position",
",",
"Color",
"color",
")",
"{",
"if",
"(",
"position",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Null endpoint position\"",
")",
";",
"}",
"if",
"(",
"colo... | Adds a gradient endpoint at the specified position.
@param position The endpoint position. May be Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY for endpoints.
@param color
@return
@see java.util.Map#put(java.lang.Object, java.lang.Object) | [
"Adds",
"a",
"gradient",
"endpoint",
"at",
"the",
"specified",
"position",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/color/GradientMapper.java#L234-L243 |
31,472 | biojava/biojava | biojava-ontology/src/main/java/org/biojava/nbio/ontology/io/OboParser.java | OboParser.parseOBO | public Ontology parseOBO(
BufferedReader oboFile,
String ontoName,
String ontoDescription
)
throws ParseException, IOException {
try {
OntologyFactory factory = OntoTools.getDefaultFactory();
Ontology ontology = factory.createOntology(ontoName, ontoDescription);
OboFileParser parser = new ... | java | public Ontology parseOBO(
BufferedReader oboFile,
String ontoName,
String ontoDescription
)
throws ParseException, IOException {
try {
OntologyFactory factory = OntoTools.getDefaultFactory();
Ontology ontology = factory.createOntology(ontoName, ontoDescription);
OboFileParser parser = new ... | [
"public",
"Ontology",
"parseOBO",
"(",
"BufferedReader",
"oboFile",
",",
"String",
"ontoName",
",",
"String",
"ontoDescription",
")",
"throws",
"ParseException",
",",
"IOException",
"{",
"try",
"{",
"OntologyFactory",
"factory",
"=",
"OntoTools",
".",
"getDefaultFac... | Parse a OBO file and return its content as a BioJava Ontology object
@param oboFile the file to be parsed
@param ontoName
@param ontoDescription
@return the ontology represented as a BioJava ontology file
@throws ParseException
@throws IOException | [
"Parse",
"a",
"OBO",
"file",
"and",
"return",
"its",
"content",
"as",
"a",
"BioJava",
"Ontology",
"object"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-ontology/src/main/java/org/biojava/nbio/ontology/io/OboParser.java#L76-L103 |
31,473 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentDisplay.java | MultipleAlignmentDisplay.getRotatedAtoms | public static List<Atom[]> getRotatedAtoms(MultipleAlignment multAln)
throws StructureException {
int size = multAln.size();
List<Atom[]> atomArrays = multAln.getAtomArrays();
for (int i = 0; i < size; i++) {
if (atomArrays.get(i).length < 1)
throw new StructureException(
"Length of atoms arrays... | java | public static List<Atom[]> getRotatedAtoms(MultipleAlignment multAln)
throws StructureException {
int size = multAln.size();
List<Atom[]> atomArrays = multAln.getAtomArrays();
for (int i = 0; i < size; i++) {
if (atomArrays.get(i).length < 1)
throw new StructureException(
"Length of atoms arrays... | [
"public",
"static",
"List",
"<",
"Atom",
"[",
"]",
">",
"getRotatedAtoms",
"(",
"MultipleAlignment",
"multAln",
")",
"throws",
"StructureException",
"{",
"int",
"size",
"=",
"multAln",
".",
"size",
"(",
")",
";",
"List",
"<",
"Atom",
"[",
"]",
">",
"atom... | New structures are downloaded if they were not cached in the alignment
and they are entirely transformed here with the superposition information
in the Multiple Alignment.
@param multAln
@return list of transformed AtomArrays
@throws StructureException | [
"New",
"structures",
"are",
"downloaded",
"if",
"they",
"were",
"not",
"cached",
"in",
"the",
"alignment",
"and",
"they",
"are",
"entirely",
"transformed",
"here",
"with",
"the",
"superposition",
"information",
"in",
"the",
"Multiple",
"Alignment",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentDisplay.java#L59-L115 |
31,474 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/BondMaker.java | BondMaker.formLinkRecordBond | public void formLinkRecordBond(LinkRecord linkRecord) {
// only work with atoms that aren't alternate locations
if (linkRecord.getAltLoc1().equals(" ")
|| linkRecord.getAltLoc2().equals(" "))
return;
try {
Map<Integer, Atom> a = getAtomFromRecord(linkRecord.getName1(),
linkRecord.getAltLoc1(), lin... | java | public void formLinkRecordBond(LinkRecord linkRecord) {
// only work with atoms that aren't alternate locations
if (linkRecord.getAltLoc1().equals(" ")
|| linkRecord.getAltLoc2().equals(" "))
return;
try {
Map<Integer, Atom> a = getAtomFromRecord(linkRecord.getName1(),
linkRecord.getAltLoc1(), lin... | [
"public",
"void",
"formLinkRecordBond",
"(",
"LinkRecord",
"linkRecord",
")",
"{",
"// only work with atoms that aren't alternate locations",
"if",
"(",
"linkRecord",
".",
"getAltLoc1",
"(",
")",
".",
"equals",
"(",
"\" \"",
")",
"||",
"linkRecord",
".",
"getAltLoc2",... | Creates bond objects from a LinkRecord as parsed from a PDB file
@param linkRecord | [
"Creates",
"bond",
"objects",
"from",
"a",
"LinkRecord",
"as",
"parsed",
"from",
"a",
"PDB",
"file"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/BondMaker.java#L311-L346 |
31,475 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationGroup.java | RotationGroup.setEAxis | private void setEAxis() {
Rotation e = rotations.get(0);
Rotation h = rotations.get(principalAxisIndex);
e.setAxisAngle(new AxisAngle4d(h.getAxisAngle()));
e.getAxisAngle().angle = 0.0;
e.setFold(h.getFold());
} | java | private void setEAxis() {
Rotation e = rotations.get(0);
Rotation h = rotations.get(principalAxisIndex);
e.setAxisAngle(new AxisAngle4d(h.getAxisAngle()));
e.getAxisAngle().angle = 0.0;
e.setFold(h.getFold());
} | [
"private",
"void",
"setEAxis",
"(",
")",
"{",
"Rotation",
"e",
"=",
"rotations",
".",
"get",
"(",
"0",
")",
";",
"Rotation",
"h",
"=",
"rotations",
".",
"get",
"(",
"principalAxisIndex",
")",
";",
"e",
".",
"setAxisAngle",
"(",
"new",
"AxisAngle4d",
"(... | Add E operation to the highest order rotation axis. By definition
E belongs to the highest order axis. | [
"Add",
"E",
"operation",
"to",
"the",
"highest",
"order",
"rotation",
"axis",
".",
"By",
"definition",
"E",
"belongs",
"to",
"the",
"highest",
"order",
"axis",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationGroup.java#L249-L255 |
31,476 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/ScaleableMatrixPanel.java | ScaleableMatrixPanel.main | public static void main(String[] args){
PDBFileReader pdbr = new PDBFileReader();
pdbr.setPath("/tmp/");
//String pdb1 = "1crl";
//String pdb2 = "1ede";
String pdb1 = "1buz";
String pdb2 = "1ali";
//String pdb1 = "5pti";
//String pdb2 = "5pti";
// NO NEED TO DO CHANGE ANYTHING BELOW HERE...
S... | java | public static void main(String[] args){
PDBFileReader pdbr = new PDBFileReader();
pdbr.setPath("/tmp/");
//String pdb1 = "1crl";
//String pdb2 = "1ede";
String pdb1 = "1buz";
String pdb2 = "1ali";
//String pdb1 = "5pti";
//String pdb2 = "5pti";
// NO NEED TO DO CHANGE ANYTHING BELOW HERE...
S... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"PDBFileReader",
"pdbr",
"=",
"new",
"PDBFileReader",
"(",
")",
";",
"pdbr",
".",
"setPath",
"(",
"\"/tmp/\"",
")",
";",
"//String pdb1 = \"1crl\";",
"//String pdb2 = \"1ede\";",
"S... | Number of minor ticks per unit scaled | [
"Number",
"of",
"minor",
"ticks",
"per",
"unit",
"scaled"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/ScaleableMatrixPanel.java#L76-L144 |
31,477 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankSequenceParser.java | GenbankSequenceParser.readSection | private List<String[]> readSection(BufferedReader bufferedReader) {
List<String[]> section = new ArrayList<String[]>();
String line = "";
String currKey = null;
StringBuffer currVal = new StringBuffer();
boolean done = false;
int linecount = 0;
try {
while (!done) {
bufferedReader.mark(320);
... | java | private List<String[]> readSection(BufferedReader bufferedReader) {
List<String[]> section = new ArrayList<String[]>();
String line = "";
String currKey = null;
StringBuffer currVal = new StringBuffer();
boolean done = false;
int linecount = 0;
try {
while (!done) {
bufferedReader.mark(320);
... | [
"private",
"List",
"<",
"String",
"[",
"]",
">",
"readSection",
"(",
"BufferedReader",
"bufferedReader",
")",
"{",
"List",
"<",
"String",
"[",
"]",
">",
"section",
"=",
"new",
"ArrayList",
"<",
"String",
"[",
"]",
">",
"(",
")",
";",
"String",
"line",
... | key->value tuples | [
"key",
"-",
">",
"value",
"tuples"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankSequenceParser.java#L328-L394 |
31,478 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/InsdcParser.java | InsdcParser.parse | public Location parse(String locationString) throws ParserException {
featureGlobalStart = Integer.MAX_VALUE;
featureGlobalEnd = 1;
Location l;
List<Location> ll = parseLocationString(locationString, 1);
if (ll.size() == 1) {
l = ll.get(0);
} else {
l = new SimpleLocation(
featureGlobalStart,
... | java | public Location parse(String locationString) throws ParserException {
featureGlobalStart = Integer.MAX_VALUE;
featureGlobalEnd = 1;
Location l;
List<Location> ll = parseLocationString(locationString, 1);
if (ll.size() == 1) {
l = ll.get(0);
} else {
l = new SimpleLocation(
featureGlobalStart,
... | [
"public",
"Location",
"parse",
"(",
"String",
"locationString",
")",
"throws",
"ParserException",
"{",
"featureGlobalStart",
"=",
"Integer",
".",
"MAX_VALUE",
";",
"featureGlobalEnd",
"=",
"1",
";",
"Location",
"l",
";",
"List",
"<",
"Location",
">",
"ll",
"="... | Main method for parsing a location from a String instance
@param locationString Represents a logical location
@return The parsed location
@throws ParserException thrown in the event of any error during parsing | [
"Main",
"method",
"for",
"parsing",
"a",
"location",
"from",
"a",
"String",
"instance"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/InsdcParser.java#L138-L155 |
31,479 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/Subunit.java | Subunit.getProteinSequenceString | public String getProteinSequenceString() {
if (sequence != null)
return sequence.toString();
StringBuilder builder = new StringBuilder();
for (Atom a : reprAtoms)
// This method preferred over getChemComp.getOneLetterCode because
// it returns always X for Unknown residues
builder.append(StructureTo... | java | public String getProteinSequenceString() {
if (sequence != null)
return sequence.toString();
StringBuilder builder = new StringBuilder();
for (Atom a : reprAtoms)
// This method preferred over getChemComp.getOneLetterCode because
// it returns always X for Unknown residues
builder.append(StructureTo... | [
"public",
"String",
"getProteinSequenceString",
"(",
")",
"{",
"if",
"(",
"sequence",
"!=",
"null",
")",
"return",
"sequence",
".",
"toString",
"(",
")",
";",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Atom",
"a",
... | Get the protein sequence of the Subunit as String.
@return protein sequence String | [
"Get",
"the",
"protein",
"sequence",
"of",
"the",
"Subunit",
"as",
"String",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/Subunit.java#L108-L121 |
31,480 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/storage/JoiningSequenceReader.java | JoiningSequenceReader.linearSearch | private int linearSearch(int position) {
int[] minSeqIndex = getMinSequenceIndex();
int[] maxSeqIndex = getMaxSequenceIndex();
int length = minSeqIndex.length;
for (int i = 0; i < length; i++) {
if (position >= minSeqIndex[i] && position <= maxSeqIndex[i]) {
return i;
}
}
throw new IndexOutOfBound... | java | private int linearSearch(int position) {
int[] minSeqIndex = getMinSequenceIndex();
int[] maxSeqIndex = getMaxSequenceIndex();
int length = minSeqIndex.length;
for (int i = 0; i < length; i++) {
if (position >= minSeqIndex[i] && position <= maxSeqIndex[i]) {
return i;
}
}
throw new IndexOutOfBound... | [
"private",
"int",
"linearSearch",
"(",
"int",
"position",
")",
"{",
"int",
"[",
"]",
"minSeqIndex",
"=",
"getMinSequenceIndex",
"(",
")",
";",
"int",
"[",
"]",
"maxSeqIndex",
"=",
"getMaxSequenceIndex",
"(",
")",
";",
"int",
"length",
"=",
"minSeqIndex",
"... | Scans through the sequence index arrays in linear time. Not the best
performance but easier to code | [
"Scans",
"through",
"the",
"sequence",
"index",
"arrays",
"in",
"linear",
"time",
".",
"Not",
"the",
"best",
"performance",
"but",
"easier",
"to",
"code"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/storage/JoiningSequenceReader.java#L174-L184 |
31,481 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/storage/JoiningSequenceReader.java | JoiningSequenceReader.binarySearch | private int binarySearch(int position) {
int[] minSeqIndex = getMinSequenceIndex();
int[] maxSeqIndex = getMaxSequenceIndex();
int low = 0;
int high = minSeqIndex.length - 1;
while (low <= high) {
//Go to the mid point in the array
int mid = (low + high) >>> 1;
//Get the max position represented by... | java | private int binarySearch(int position) {
int[] minSeqIndex = getMinSequenceIndex();
int[] maxSeqIndex = getMaxSequenceIndex();
int low = 0;
int high = minSeqIndex.length - 1;
while (low <= high) {
//Go to the mid point in the array
int mid = (low + high) >>> 1;
//Get the max position represented by... | [
"private",
"int",
"binarySearch",
"(",
"int",
"position",
")",
"{",
"int",
"[",
"]",
"minSeqIndex",
"=",
"getMinSequenceIndex",
"(",
")",
";",
"int",
"[",
"]",
"maxSeqIndex",
"=",
"getMaxSequenceIndex",
"(",
")",
";",
"int",
"low",
"=",
"0",
";",
"int",
... | Scans through the sequence index arrays using binary search | [
"Scans",
"through",
"the",
"sequence",
"index",
"arrays",
"using",
"binary",
"search"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/storage/JoiningSequenceReader.java#L189-L216 |
31,482 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/storage/JoiningSequenceReader.java | JoiningSequenceReader.iterator | @Override
public Iterator<C> iterator() {
final List<Sequence<C>> localSequences = sequences;
return new Iterator<C>() {
private Iterator<C> currentSequenceIterator = null;
private int currentPosition = 0;
@Override
public boolean hasNext() {
//If the current iterator is null then see if the Seq... | java | @Override
public Iterator<C> iterator() {
final List<Sequence<C>> localSequences = sequences;
return new Iterator<C>() {
private Iterator<C> currentSequenceIterator = null;
private int currentPosition = 0;
@Override
public boolean hasNext() {
//If the current iterator is null then see if the Seq... | [
"@",
"Override",
"public",
"Iterator",
"<",
"C",
">",
"iterator",
"(",
")",
"{",
"final",
"List",
"<",
"Sequence",
"<",
"C",
">",
">",
"localSequences",
"=",
"sequences",
";",
"return",
"new",
"Iterator",
"<",
"C",
">",
"(",
")",
"{",
"private",
"Ite... | Iterator implementation which attempts to move through the 2D structure
attempting to skip onto the next sequence as & when it is asked to | [
"Iterator",
"implementation",
"which",
"attempts",
"to",
"move",
"through",
"the",
"2D",
"structure",
"attempting",
"to",
"skip",
"onto",
"the",
"next",
"sequence",
"as",
"&",
"when",
"it",
"is",
"asked",
"to"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/storage/JoiningSequenceReader.java#L223-L270 |
31,483 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopFactory.java | ScopFactory.getSCOP | public static ScopDatabase getSCOP(String version, boolean forceLocalData){
if( version == null ) {
version = defaultVersion;
}
ScopDatabase scop = versionedScopDBs.get(version);
if ( forceLocalData) {
// Use a local installation
if( scop == null || !(scop instanceof LocalScopDatabase) ) {
logger.i... | java | public static ScopDatabase getSCOP(String version, boolean forceLocalData){
if( version == null ) {
version = defaultVersion;
}
ScopDatabase scop = versionedScopDBs.get(version);
if ( forceLocalData) {
// Use a local installation
if( scop == null || !(scop instanceof LocalScopDatabase) ) {
logger.i... | [
"public",
"static",
"ScopDatabase",
"getSCOP",
"(",
"String",
"version",
",",
"boolean",
"forceLocalData",
")",
"{",
"if",
"(",
"version",
"==",
"null",
")",
"{",
"version",
"=",
"defaultVersion",
";",
"}",
"ScopDatabase",
"scop",
"=",
"versionedScopDBs",
".",... | Gets an instance of the specified scop version.
<p>
The particular implementation returned is influenced by the <tt>forceLocalData</tt>
parameter. When false, the instance returned will generally be a
{@link RemoteScopInstallation}, although this may be influenced by
previous calls to this class. When true, the result... | [
"Gets",
"an",
"instance",
"of",
"the",
"specified",
"scop",
"version",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopFactory.java#L136-L161 |
31,484 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopFactory.java | ScopFactory.setScopDatabase | public static void setScopDatabase(String version, boolean forceLocalData) {
logger.debug("ScopFactory: Setting ScopDatabase to version: {}, forced local: {}", version, forceLocalData);
getSCOP(version,forceLocalData);
defaultVersion = version;
} | java | public static void setScopDatabase(String version, boolean forceLocalData) {
logger.debug("ScopFactory: Setting ScopDatabase to version: {}, forced local: {}", version, forceLocalData);
getSCOP(version,forceLocalData);
defaultVersion = version;
} | [
"public",
"static",
"void",
"setScopDatabase",
"(",
"String",
"version",
",",
"boolean",
"forceLocalData",
")",
"{",
"logger",
".",
"debug",
"(",
"\"ScopFactory: Setting ScopDatabase to version: {}, forced local: {}\"",
",",
"version",
",",
"forceLocalData",
")",
";",
"... | Set the default scop version
@param version A version number, such as {@link #VERSION_1_75A}
@param forceLocalData Whether to use a local installation or a remote installation | [
"Set",
"the",
"default",
"scop",
"version"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopFactory.java#L178-L182 |
31,485 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopFactory.java | ScopFactory.setScopDatabase | public static void setScopDatabase(ScopDatabase scop){
logger.debug("ScopFactory: Setting ScopDatabase to type: {}", scop.getClass().getName());
defaultVersion = scop.getScopVersion();
versionedScopDBs.put(defaultVersion,scop);
} | java | public static void setScopDatabase(ScopDatabase scop){
logger.debug("ScopFactory: Setting ScopDatabase to type: {}", scop.getClass().getName());
defaultVersion = scop.getScopVersion();
versionedScopDBs.put(defaultVersion,scop);
} | [
"public",
"static",
"void",
"setScopDatabase",
"(",
"ScopDatabase",
"scop",
")",
"{",
"logger",
".",
"debug",
"(",
"\"ScopFactory: Setting ScopDatabase to type: {}\"",
",",
"scop",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"defaultVersion",
... | Set the default scop version and instance
@param scop | [
"Set",
"the",
"default",
"scop",
"version",
"and",
"instance"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopFactory.java#L188-L192 |
31,486 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/SequenceDisplay.java | SequenceDisplay.setStructure1 | public void setStructure1(Structure structure){
this.structure1 = structure;
if ( structure != null) {
setAtoms(structure1,panel1);
label1.setText(structure.getPDBCode());
label1.repaint();
}
} | java | public void setStructure1(Structure structure){
this.structure1 = structure;
if ( structure != null) {
setAtoms(structure1,panel1);
label1.setText(structure.getPDBCode());
label1.repaint();
}
} | [
"public",
"void",
"setStructure1",
"(",
"Structure",
"structure",
")",
"{",
"this",
".",
"structure1",
"=",
"structure",
";",
"if",
"(",
"structure",
"!=",
"null",
")",
"{",
"setAtoms",
"(",
"structure1",
",",
"panel1",
")",
";",
"label1",
".",
"setText",
... | has been called with setting the atoms directly | [
"has",
"been",
"called",
"with",
"setting",
"the",
"atoms",
"directly"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/SequenceDisplay.java#L373-L382 |
31,487 | biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/SequenceDisplay.java | SequenceDisplay.calcScale | public void calcScale(int zoomFactor){
float s = getScaleForZoom(zoomFactor);
scale = s;
//logger.info("calc scale zoom:"+zoomFactor+ " s: " + s);
panel1.setScale(s);
panel2.setScale(s);
panel1.repaint();
panel2.repaint();
//return scale;
} | java | public void calcScale(int zoomFactor){
float s = getScaleForZoom(zoomFactor);
scale = s;
//logger.info("calc scale zoom:"+zoomFactor+ " s: " + s);
panel1.setScale(s);
panel2.setScale(s);
panel1.repaint();
panel2.repaint();
//return scale;
} | [
"public",
"void",
"calcScale",
"(",
"int",
"zoomFactor",
")",
"{",
"float",
"s",
"=",
"getScaleForZoom",
"(",
"zoomFactor",
")",
";",
"scale",
"=",
"s",
";",
"//logger.info(\"calc scale zoom:\"+zoomFactor+ \" s: \" + s);",
"panel1",
".",
"setScale",
"(",
"s",
")",... | a value of 100 means that the whole sequence should be displayed in the current visible window
a factor of 1 means that one amino acid shoud be drawn as big as possible
@param zoomFactor - a value between 1 and 100 | [
"a",
"value",
"of",
"100",
"means",
"that",
"the",
"whole",
"sequence",
"should",
"be",
"displayed",
"in",
"the",
"current",
"visible",
"window",
"a",
"factor",
"of",
"1",
"means",
"that",
"one",
"amino",
"acid",
"shoud",
"be",
"drawn",
"as",
"big",
"as"... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/SequenceDisplay.java#L505-L518 |
31,488 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqBuilder.java | FastqBuilder.withSequence | public FastqBuilder withSequence(final String sequence)
{
if (sequence == null)
{
throw new IllegalArgumentException("sequence must not be null");
}
if (this.sequence == null)
{
this.sequence = new StringBuilder(sequence.length());
}
this.sequence.replace(0, this.sequence.length(), sequence);
ret... | java | public FastqBuilder withSequence(final String sequence)
{
if (sequence == null)
{
throw new IllegalArgumentException("sequence must not be null");
}
if (this.sequence == null)
{
this.sequence = new StringBuilder(sequence.length());
}
this.sequence.replace(0, this.sequence.length(), sequence);
ret... | [
"public",
"FastqBuilder",
"withSequence",
"(",
"final",
"String",
"sequence",
")",
"{",
"if",
"(",
"sequence",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"sequence must not be null\"",
")",
";",
"}",
"if",
"(",
"this",
".",
"seq... | Return this FASTQ formatted sequence builder configured with the specified sequence.
@param sequence sequence for this FASTQ formatted sequence builder, must not be null
@return this FASTQ formatted sequence builder configured with the specified sequence | [
"Return",
"this",
"FASTQ",
"formatted",
"sequence",
"builder",
"configured",
"with",
"the",
"specified",
"sequence",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqBuilder.java#L87-L99 |
31,489 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqBuilder.java | FastqBuilder.appendSequence | public FastqBuilder appendSequence(final String sequence)
{
if (sequence == null)
{
throw new IllegalArgumentException("sequence must not be null");
}
if (this.sequence == null)
{
this.sequence = new StringBuilder(sequence.length());
}
this.sequence.append(sequence);
return this;
} | java | public FastqBuilder appendSequence(final String sequence)
{
if (sequence == null)
{
throw new IllegalArgumentException("sequence must not be null");
}
if (this.sequence == null)
{
this.sequence = new StringBuilder(sequence.length());
}
this.sequence.append(sequence);
return this;
} | [
"public",
"FastqBuilder",
"appendSequence",
"(",
"final",
"String",
"sequence",
")",
"{",
"if",
"(",
"sequence",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"sequence must not be null\"",
")",
";",
"}",
"if",
"(",
"this",
".",
"s... | Return this FASTQ formatted sequence builder configured with the specified sequence
appended to its current sequence.
@param sequence sequence to append to the sequence for this FASTQ formatted sequence builder, must not be null
@return this FASTQ formatted sequence builder configured with the specified sequence
appen... | [
"Return",
"this",
"FASTQ",
"formatted",
"sequence",
"builder",
"configured",
"with",
"the",
"specified",
"sequence",
"appended",
"to",
"its",
"current",
"sequence",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqBuilder.java#L109-L121 |
31,490 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqBuilder.java | FastqBuilder.withQuality | public FastqBuilder withQuality(final String quality)
{
if (quality == null)
{
throw new IllegalArgumentException("quality must not be null");
}
if (this.quality == null)
{
this.quality = new StringBuilder(quality.length());
}
this.quality.replace(0, this.quality.length(), quality);
return this;
... | java | public FastqBuilder withQuality(final String quality)
{
if (quality == null)
{
throw new IllegalArgumentException("quality must not be null");
}
if (this.quality == null)
{
this.quality = new StringBuilder(quality.length());
}
this.quality.replace(0, this.quality.length(), quality);
return this;
... | [
"public",
"FastqBuilder",
"withQuality",
"(",
"final",
"String",
"quality",
")",
"{",
"if",
"(",
"quality",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"quality must not be null\"",
")",
";",
"}",
"if",
"(",
"this",
".",
"quality... | Return this FASTQ formatted sequence builder configured with the specified quality scores.
@param quality quality scores for this FASTQ formatted sequence builder, must not be null
@return this FASTQ formatted sequence builder configured with the specified quality scores | [
"Return",
"this",
"FASTQ",
"formatted",
"sequence",
"builder",
"configured",
"with",
"the",
"specified",
"quality",
"scores",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqBuilder.java#L129-L141 |
31,491 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqBuilder.java | FastqBuilder.appendQuality | public FastqBuilder appendQuality(final String quality)
{
if (quality == null)
{
throw new IllegalArgumentException("quality must not be null");
}
if (this.quality == null)
{
this.quality = new StringBuilder(quality.length());
}
this.quality.append(quality);
return this;
} | java | public FastqBuilder appendQuality(final String quality)
{
if (quality == null)
{
throw new IllegalArgumentException("quality must not be null");
}
if (this.quality == null)
{
this.quality = new StringBuilder(quality.length());
}
this.quality.append(quality);
return this;
} | [
"public",
"FastqBuilder",
"appendQuality",
"(",
"final",
"String",
"quality",
")",
"{",
"if",
"(",
"quality",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"quality must not be null\"",
")",
";",
"}",
"if",
"(",
"this",
".",
"quali... | Return this FASTQ formatted sequence builder configured with the specified quality scores
appended to its current quality scores.
@param quality quality scores to append to the quality scores for this FASTQ formatted sequence
builder, must not be null
@return this FASTQ formatted sequence builder configured with the s... | [
"Return",
"this",
"FASTQ",
"formatted",
"sequence",
"builder",
"configured",
"with",
"the",
"specified",
"quality",
"scores",
"appended",
"to",
"its",
"current",
"quality",
"scores",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqBuilder.java#L152-L164 |
31,492 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqBuilder.java | FastqBuilder.sequenceAndQualityLengthsMatch | public boolean sequenceAndQualityLengthsMatch()
{
if (sequence == null && quality == null)
{
return true;
}
if ((sequence != null && quality == null) || (sequence == null && quality != null))
{
return false;
}
return sequence.length() == quality.length();
} | java | public boolean sequenceAndQualityLengthsMatch()
{
if (sequence == null && quality == null)
{
return true;
}
if ((sequence != null && quality == null) || (sequence == null && quality != null))
{
return false;
}
return sequence.length() == quality.length();
} | [
"public",
"boolean",
"sequenceAndQualityLengthsMatch",
"(",
")",
"{",
"if",
"(",
"sequence",
"==",
"null",
"&&",
"quality",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"(",
"sequence",
"!=",
"null",
"&&",
"quality",
"==",
"null",
")",
... | Return true if the sequence and quality scores for this FASTQ formatted sequence builder are equal in length.
@return true if the sequence and quality scores for this FASTQ formatted sequence builder are equal in length | [
"Return",
"true",
"if",
"the",
"sequence",
"and",
"quality",
"scores",
"for",
"this",
"FASTQ",
"formatted",
"sequence",
"builder",
"are",
"equal",
"in",
"length",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqBuilder.java#L171-L182 |
31,493 | biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqBuilder.java | FastqBuilder.build | public Fastq build()
{
if (description == null)
{
throw new IllegalStateException("description must not be null");
}
if (sequence == null)
{
throw new IllegalStateException("sequence must not be null");
}
if (quality == null)
{
throw new IllegalStateException("quality must not be null");
}
... | java | public Fastq build()
{
if (description == null)
{
throw new IllegalStateException("description must not be null");
}
if (sequence == null)
{
throw new IllegalStateException("sequence must not be null");
}
if (quality == null)
{
throw new IllegalStateException("quality must not be null");
}
... | [
"public",
"Fastq",
"build",
"(",
")",
"{",
"if",
"(",
"description",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"description must not be null\"",
")",
";",
"}",
"if",
"(",
"sequence",
"==",
"null",
")",
"{",
"throw",
"new",
"Il... | Build and return a new FASTQ formatted sequence configured from the properties of this builder.
@return a new FASTQ formatted sequence configured from the properties of this builder
@throws IllegalStateException if the configuration of this builder results in an illegal state | [
"Build",
"and",
"return",
"a",
"new",
"FASTQ",
"formatted",
"sequence",
"configured",
"from",
"the",
"properties",
"of",
"this",
"builder",
"."
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/io/fastq/FastqBuilder.java#L206-L226 |
31,494 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/FCAlignHelper.java | FCAlignHelper.doAlign | private void doAlign(){
int i, j;
double s, e, c, d, wa;
double[] CC = new double[N+1]; //note N + 1
double[] DD = new double[N+1];
double maxs = -100;
char trace_e, trace_d;
//forward-phase
CC[0] = 0;
for(j = 1; j <= N; j ++) {
CC[j] = 0;
DD[j] = -g;
} //local-alignment, ... | java | private void doAlign(){
int i, j;
double s, e, c, d, wa;
double[] CC = new double[N+1]; //note N + 1
double[] DD = new double[N+1];
double maxs = -100;
char trace_e, trace_d;
//forward-phase
CC[0] = 0;
for(j = 1; j <= N; j ++) {
CC[j] = 0;
DD[j] = -g;
} //local-alignment, ... | [
"private",
"void",
"doAlign",
"(",
")",
"{",
"int",
"i",
",",
"j",
";",
"double",
"s",
",",
"e",
",",
"c",
",",
"d",
",",
"wa",
";",
"double",
"[",
"]",
"CC",
"=",
"new",
"double",
"[",
"N",
"+",
"1",
"]",
";",
"//note N + 1",
"double",
"[",
... | local-model | [
"local",
"-",
"model"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/FCAlignHelper.java#L108-L184 |
31,495 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/FCAlignHelper.java | FCAlignHelper.trace | private void trace(char mod, int i, int j)
{
if(mod == '0' || i <= 0 || j <= 0) {
B1 = i + 1;
B2 = j + 1;
}
if(mod == 's') {
trace(trace[i - 1][j - 1], i - 1, j - 1);
rep();
}
else if(mod == 'D') {
trace(trace[i - 1][j], i - 1, j);
del(1);
}
else if(mod == 'd') {
trace(... | java | private void trace(char mod, int i, int j)
{
if(mod == '0' || i <= 0 || j <= 0) {
B1 = i + 1;
B2 = j + 1;
}
if(mod == 's') {
trace(trace[i - 1][j - 1], i - 1, j - 1);
rep();
}
else if(mod == 'D') {
trace(trace[i - 1][j], i - 1, j);
del(1);
}
else if(mod == 'd') {
trace(... | [
"private",
"void",
"trace",
"(",
"char",
"mod",
",",
"int",
"i",
",",
"int",
"j",
")",
"{",
"if",
"(",
"mod",
"==",
"'",
"'",
"||",
"i",
"<=",
"0",
"||",
"j",
"<=",
"0",
")",
"{",
"B1",
"=",
"i",
"+",
"1",
";",
"B2",
"=",
"j",
"+",
"1",... | trace-back, recorded in sapp, wrong method! | [
"trace",
"-",
"back",
"recorded",
"in",
"sapp",
"wrong",
"method!"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/FCAlignHelper.java#L191-L217 |
31,496 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/FCAlignHelper.java | FCAlignHelper.checkScore | private double checkScore()
{
int i, j, op, s;
double sco;
sco = 0;
op = 0;
s = 0;
i = B1;
j = B2;
while (i <= E1 && j <= E2) {
op = sapp0[s ++];
if (op == 0) {
sco += sij[i - 1][j - 1];
//if (debug)
//System.err.println(String.format("%d-%d %f\n", i - 1, j - 1, sij[i - 1][... | java | private double checkScore()
{
int i, j, op, s;
double sco;
sco = 0;
op = 0;
s = 0;
i = B1;
j = B2;
while (i <= E1 && j <= E2) {
op = sapp0[s ++];
if (op == 0) {
sco += sij[i - 1][j - 1];
//if (debug)
//System.err.println(String.format("%d-%d %f\n", i - 1, j - 1, sij[i - 1][... | [
"private",
"double",
"checkScore",
"(",
")",
"{",
"int",
"i",
",",
"j",
",",
"op",
",",
"s",
";",
"double",
"sco",
";",
"sco",
"=",
"0",
";",
"op",
"=",
"0",
";",
"s",
"=",
"0",
";",
"i",
"=",
"B1",
";",
"j",
"=",
"B2",
";",
"while",
"(",... | checkscore - return the score of the alignment stored in sapp | [
"checkscore",
"-",
"return",
"the",
"score",
"of",
"the",
"alignment",
"stored",
"in",
"sapp"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/FCAlignHelper.java#L266-L296 |
31,497 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/StructureIO.java | StructureIO.guessFiletype | public static StructureFiletype guessFiletype(String filename) {
String lower = filename.toLowerCase();
for(StructureFiletype type : StructureFiletype.values()) {
for(String ext : type.getExtensions()) {
if(lower.endsWith(ext.toLowerCase())) {
return type;
}
}
}
return StructureFiletype.UNKNO... | java | public static StructureFiletype guessFiletype(String filename) {
String lower = filename.toLowerCase();
for(StructureFiletype type : StructureFiletype.values()) {
for(String ext : type.getExtensions()) {
if(lower.endsWith(ext.toLowerCase())) {
return type;
}
}
}
return StructureFiletype.UNKNO... | [
"public",
"static",
"StructureFiletype",
"guessFiletype",
"(",
"String",
"filename",
")",
"{",
"String",
"lower",
"=",
"filename",
".",
"toLowerCase",
"(",
")",
";",
"for",
"(",
"StructureFiletype",
"type",
":",
"StructureFiletype",
".",
"values",
"(",
")",
")... | Attempts to guess the type of a structure file based on the extension
@param filename
@return | [
"Attempts",
"to",
"guess",
"the",
"type",
"of",
"a",
"structure",
"file",
"based",
"on",
"the",
"extension"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureIO.java#L309-L319 |
31,498 | biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/embl/EmblReference.java | EmblReference.copyEmblReference | public EmblReference copyEmblReference(EmblReference emblReference) {
EmblReference copy = new EmblReference();
copy.setReferenceAuthor(emblReference.getReferenceAuthor());
copy.setReferenceComment(emblReference.getReferenceComment());
copy.setReferenceCrossReference(emblReference.getReferenceCrossReference());... | java | public EmblReference copyEmblReference(EmblReference emblReference) {
EmblReference copy = new EmblReference();
copy.setReferenceAuthor(emblReference.getReferenceAuthor());
copy.setReferenceComment(emblReference.getReferenceComment());
copy.setReferenceCrossReference(emblReference.getReferenceCrossReference());... | [
"public",
"EmblReference",
"copyEmblReference",
"(",
"EmblReference",
"emblReference",
")",
"{",
"EmblReference",
"copy",
"=",
"new",
"EmblReference",
"(",
")",
";",
"copy",
".",
"setReferenceAuthor",
"(",
"emblReference",
".",
"getReferenceAuthor",
"(",
")",
")",
... | return copy of EmblReference
@param emblReference
@return EmblReference | [
"return",
"copy",
"of",
"EmblReference"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/embl/EmblReference.java#L170-L181 |
31,499 | biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucState.java | SecStrucState.addBridge | public boolean addBridge(BetaBridge bridge) {
if (bridge1 == null) {
bridge1 = bridge;
return true;
} else if (bridge1.equals(bridge)) {
return true;
} else if (bridge2 == null) {
bridge2 = bridge;
return true;
} else if (bridge2.equals(bridge)) {
return true;
} else { //no space left, canno... | java | public boolean addBridge(BetaBridge bridge) {
if (bridge1 == null) {
bridge1 = bridge;
return true;
} else if (bridge1.equals(bridge)) {
return true;
} else if (bridge2 == null) {
bridge2 = bridge;
return true;
} else if (bridge2.equals(bridge)) {
return true;
} else { //no space left, canno... | [
"public",
"boolean",
"addBridge",
"(",
"BetaBridge",
"bridge",
")",
"{",
"if",
"(",
"bridge1",
"==",
"null",
")",
"{",
"bridge1",
"=",
"bridge",
";",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"bridge1",
".",
"equals",
"(",
"bridge",
")",
")",
"{... | Adds a Bridge to the residue. Each residue can only store two bridges. If
the residue contains already two Bridges, the Bridge will not be added
and the method returns false.
@param bridge
@return false if the Bridge was not added, true otherwise | [
"Adds",
"a",
"Bridge",
"to",
"the",
"residue",
".",
"Each",
"residue",
"can",
"only",
"store",
"two",
"bridges",
".",
"If",
"the",
"residue",
"contains",
"already",
"two",
"Bridges",
"the",
"Bridge",
"will",
"not",
"be",
"added",
"and",
"the",
"method",
... | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucState.java#L201-L217 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.