Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# Scala Steward: Reformat with scalafmt 3.6.0
df858b0ea7cc4743ec9c78cee1486ad91de1dbd4

# Scala Steward: Reformat with scalafmt 3.9.9
aa0891ef4a981f567bc7c8c827a934d5583e77ce
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ optIn.breakChainOnFirstMethodDot = false
align.openParenDefnSite = false
project.git = true
assumeStandardLibraryStripMargin = true
version = 3.6.1
version = 3.9.9
runner.dialect = scala213
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class UserDao @Inject() (
User.ACCOUNT_TYPE -> AccountType.REGISTEREDUSER.toInt,
User.DELETION_WARNING_SENT -> false,
User.CONNECTED -> false,
User.DATE_LAST_LOGIN -> BSONDocument(
User.DATE_LAST_LOGIN -> BSONDocument(
"$lt" -> BSONDateTime(warnRegistratedUserAfterLoginDate.toInstant.toEpochMilli)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class UserSessionService @Inject() (
// cache related stuff should remain in the project where the cache is bound
userCache.get[User](sessionID) match {
case Some(user) => fuccess(user)
case None => // session not known yet in cache
case None => // session not known yet in cache
val newSessionData = SessionData(
ip = MurmurHash3.stringHash(request.remoteAddress).toString,
userAgent = request.headers.get(Http.HeaderNames.USER_AGENT).getOrElse("Not specified"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ final class BackendController @Inject() (
def setMaintenanceState(): Action[Json] = userAction(circe.json) { implicit request =>
if (request.user.isSuperuser) {
request.body.asObject match {
case None => BadRequest
case None => BadRequest
case Some(value) =>
maintenanceMessage = value("message").get.asString.orElse(Some("")).get
maintenanceSubmitBlocked = value("submitBlocked").get.asBoolean.orElse(Some(false)).get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ class ConstantsV2 @Inject() (config: Configuration) {

// Job deletion settings
/** Sweeps at this time after server start */
final val jobDeletionDelay: FiniteDuration = 10 minutes
final val jobDeletionDelay: FiniteDuration = 10.minutes

/** Sweeps in this interval */
final val jobDeletionInterval: FiniteDuration = 3 hours
final val jobDeletionInterval: FiniteDuration = 3.hours

/** all jobs of registered users that are older than the given number are permanently deleted everywhere */
final val jobDeletionRegistered: Int = 90
Expand All @@ -73,10 +73,10 @@ class ConstantsV2 @Inject() (config: Configuration) {

// User Deletion settings
/** Sweeps at this time after server start */
final val userDeletionDelay: FiniteDuration = 70 minutes
final val userDeletionDelay: FiniteDuration = 70.minutes

/** Sweeps in this interval */
final val userDeletionInterval: FiniteDuration = 3 hours
final val userDeletionInterval: FiniteDuration = 3.hours

/** Sending an eMail to the user this many days before the deletion */
final val userDeletionWarning: Int = 14 // days
Expand All @@ -89,7 +89,7 @@ class ConstantsV2 @Inject() (config: Configuration) {

// qstat long polling in order to detect zombie jobs, not used for cluster load calc anymore
/** Interval of the qstat requests */
final val pollingInterval: FiniteDuration = 5 minutes
final val pollingInterval: FiniteDuration = 5.minutes

/** The marker for 100% load capacity */
final val loadPercentageMarker: Int = 32 // Jobs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import reactivemongo.api.bson.BSONDateTime

object ZonedDateTimeHelper {

final val dateTimeFormatter: DateTimeFormatter = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm:ss O")
final val defaultZoneID: ZoneId = ZoneId.systemDefault()
final val dateTimeFormatter: DateTimeFormatter = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm:ss O")
final val defaultZoneID: ZoneId = ZoneId.systemDefault()
def getZDT(bsonDateTime: BSONDateTime): ZonedDateTime = {
Instant.ofEpochMilli(bsonDateTime.value).atZone(defaultZoneID)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ object FASTA {
private[FASTA] def parse(input: String): Option[FASTA] = {
parseAll(sequence, input) match {
case Success(es, _) => Some(FASTA(List(Entry("empty header", es))))
case _ =>
case _ =>
parseAll(entries, input) match {
case Success(es, _) => Some(FASTA(es))
case _ => None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class JobActor @Inject() (
@volatile private var currentJobLogs: Map[String, JobEventLog] = Map.empty[String, JobEventLog]
@volatile private var currentExecutionContexts: Map[String, ExecutionContext] = Map.empty[String, ExecutionContext]

private val fetchLatestInterval = 500 millis
private val Tick: Cancellable = {
private val fetchLatestInterval = 500.millis
private val Tick: Cancellable = {
// scheduler should use the system dispatcher
context.system.scheduler.scheduleWithFixedDelay(Duration.Zero, fetchLatestInterval, self, UpdateLog)(
context.system.dispatcher
Expand Down Expand Up @@ -109,7 +109,7 @@ class JobActor @Inject() (
private def getCurrentExecutionContext(jobID: String): Option[ExecutionContext] = {
currentExecutionContexts.get(jobID) match {
case Some(executionContext) => Some(executionContext)
case None =>
case None =>
if ((constants.jobPath / jobID).exists) {
val executionContext = ExecutionContext(constants.jobPath / jobID, reOpen = true)
currentExecutionContexts = currentExecutionContexts.updated(jobID, executionContext)
Expand Down Expand Up @@ -196,7 +196,7 @@ class JobActor @Inject() (
jobDao.updateJobStatus(job.jobID, job.status).map { _ =>
val jobLog = currentJobLogs.get(job.jobID) match {
case Some(jobEventLog) => jobEventLog.addJobStateEvent(job.status)
case None =>
case None =>
JobEventLog(
jobID = job.jobID,
toolName = job.tool,
Expand Down Expand Up @@ -355,7 +355,7 @@ class JobActor @Inject() (
.getCurrentJob(jobID)
.flatMap {
case Some(job) => fuccess(Some(job))
case None =>
case None =>
if (verbose)
log.info(
s"[JobActor[$jobActorNumber].Delete] jobID $jobID not found in current jobs. Loading job from DB."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class FileController @Inject() (
with ContentTypes {

def getStructureFile(accession: String): Action[AnyContent] = Action { implicit request =>
val db = LinkUtil.identifyDatabase(accession)
val db = LinkUtil.identifyDatabase(accession)
val ending = db match {
case "scop" => "pdb"
case "ecod" => "pdb"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class JobGetController @Inject() (

def suggestJobsForQuery(queryString: String): Action[AnyContent] =
userAction.async { implicit request =>
val user = request.user
val user = request.user
val tools: List[Tool] = toolConfig.values
.unsafeRunSync()
.values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ final class ResultsController @Inject() (
// access allowed to job
(for {
json <- EitherT.liftF(resultFiles.getResults(jobID))
r <- EitherT
.fromEither[Future](json.hcursor.downField(resultField.getOrElse("alignment")).as[AlignmentResult])
r <- EitherT.fromEither[Future](
json.hcursor.downField(resultField.getOrElse("alignment")).as[AlignmentResult]
)
} yield r).value.map {
case Right(r) =>
val l = r.alignment.length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ class SubmissionController @Inject() (
Unauthorized
} else {
request.body.asObject match {
case None => BadRequest
case None => BadRequest
case Some(obj) =>
if (obj.contains("isPublic")) {
jobActorAccess
.sendToJobActor(jobID, SetJobPublic(jobID, obj("isPublic").get.asBoolean.getOrElse(false)))
jobActorAccess.sendToJobActor(
jobID,
SetJobPublic(jobID, obj("isPublic").get.asBoolean.getOrElse(false))
)
}
Ok
}
Expand All @@ -91,7 +93,7 @@ class SubmissionController @Inject() (

def submitJob(toolName: String): Action[Json] = userAction(circe.json).async { implicit request =>
request.body.asObject match {
case None => fuccess(BadRequest)
case None => fuccess(BadRequest)
case Some(obj) =>
val parts: Iterable[(String, String)] = for {
(key, json) <- obj.toIterable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ case class HmmerHSP(
"hitLen" -> hit_len.asJson,
"observedDomains" -> domain_obs_num.asJson,
"agree" -> midline.asJson,
"query" -> Map(
"query" -> Map(
"start" -> query_start.asJson,
"end" -> query_end.asJson,
"seq" -> query_seq.asJson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ object LinkUtil {
case "ecod" => val idEcod = id.slice(5, 14); generateLink(ecodBaseLink, idEcod, id)
case "cath" => val idCath = id.slice(5, 12); generateLink(cathBaseLink, idCath, id)
case "phrog" => val idPhrog = id.replaceAll("phrog_", ""); generateLink(phrogBaseLink, idPhrog, id)
case "keggoc" =>
case "keggoc" =>
val idKeggoc = id.split("OC.").last; generateLink(keggocBaseLink, idKeggoc, id)

case _ => id
Expand Down Expand Up @@ -116,7 +116,7 @@ object LinkUtil {
case prokaryoticProteasomeNameReg(_) => links += generateLink(ncbiProteinBaseLink, idNcbi, "NCBI Fasta")
case pdbNameReg(_) => links += generateLink(pdbeBaseLink, idPdb, "PDBe")
case pfamNameReg(_) => links += generateLink(cddBaseLink, idCDD, "CDD")
case alphafolddbNameReg(_) =>
case alphafolddbNameReg(_) =>
links += generateLink(uniprotBaseLink, idAlphaFold, "UniProt")
links += generateLink(uniprotBaseLink, idAlphaFold + ".fasta", "UniProt FASTA")
case uniprotNameReg(_) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ case class PLMBlastHSP(
"eval" -> eValue.asJson,
"bitScore" -> (identScore * 100).round.asJson,
"hitLen" -> hit_len.asJson,
"query" -> Map(
"query" -> Map(
"start" -> query_start.asJson,
"end" -> query_end.asJson
).asJson,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ case class PSIBlastHSP(
"refLen" -> ref_len.asJson,
"hitLen" -> hit_len.asJson,
"agree" -> midLine.asJson,
"query" -> Map(
"query" -> Map(
"start" -> query_start.asJson,
"end" -> query_end.asJson,
"seq" -> query_seq.asJson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class HHService @Inject() (
tool <- toolFinder.getTool(jobID)
} yield (json, tool)).map {
case (json, tool) => resultFiles.parseResult(tool, json)
case _ =>
case _ =>
val error = "parsing result json failed."
logger.error(error)
Left(DecodingFailure(error, Nil))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ final class JobDispatcher @Inject() (
EitherT.leftT(JobSubmitError.ModellerKeyInvalid)
} else {
for {
generatedId <- generateJobId(parts)
_ <- validateJobId(generatedId)
_ <- checkNotAlreadyTaken(generatedId)
job <- EitherT.pure[Future, JobSubmitError](generateJob(toolName, generatedId, parts, user))
generatedId <- generateJobId(parts)
_ <- validateJobId(generatedId)
_ <- checkNotAlreadyTaken(generatedId)
job <- EitherT.pure[Future, JobSubmitError](generateJob(toolName, generatedId, parts, user))
isFromInstitute <- EitherT.pure[Future, JobSubmitError](
user.userData.map(_.eMail).getOrElse("").matches("[email protected]")
)
Expand Down Expand Up @@ -114,7 +114,7 @@ final class JobDispatcher @Inject() (
form: Map[String, String],
user: User
): Job = {
val now = ZonedDateTime.now
val now = ZonedDateTime.now
val dateDeletionOn = now.plusDays(
if (user.isRegistered) constants.jobDeletionRegistered.toLong
else constants.jobDeletion.toLong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ final class ProcessService @Inject() (
val generateAlignmentScript = (scriptPath + "/generateAlignment.sh").toFile // HHPRED, HHBLITS alnEval
val retrieveFullSeq = (scriptPath + "/retrieveFullSeq.sh").toFile
val retrieveAlnEval = (scriptPath + "/retrieveAlnEval.sh").toFile // Hmmer & PSIBLAST alnEval
val retrieveFullSeqHHblits =
val retrieveFullSeqHHblits =
(scriptPath + "/retrieveFullSeqHHblits.sh").toFile // why so little abstractions ???

val fullEvalAccs: () => String =
Expand All @@ -94,15 +94,15 @@ final class ProcessService @Inject() (
"%s ".format(result.HSPS(num - 1).accession)
}.mkString

val tempFileName = UUID.randomUUID().toString
val tempFileName = UUID.randomUUID().toString
val (script, params) = (tool, form.forwardHitsMode, form.sequenceLengthMode) match {
case (HHBLITS, "eval", "aln") | (HHPRED, "eval", "aln") =>
(
generateAlignmentScript,
List(
"jobID" -> jobId,
"filename" -> tempFileName,
"numList" ->
"numList" ->
result.HSPS.filter(_.eValue <= form.eval).map { _.num }.mkString(" ")
)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Runscript(files: Seq[File]) extends TELRegex with Logging {
// Special fields to put the runscript into a larger context

private case class Replacer(arguments: Seq[(String, ValidArgument)]) {
private var counter = -1
private var counter = -1
def apply(m: Regex.Match): String = {
m.groupNames.foreach(s =>
logger.debug(s)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class ToolConfig @Inject() (
validationParams
)
val inputGroup: Seq[String] = paramAccess.paramGroups("Input")
val toolParameterForm = ToolParameters(
val toolParameterForm = ToolParameters(
Seq(
ParameterSection(
"Input",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class ParamAccess @Inject() (tel: TEL) {
case "DIAMOND_MIN_ALN_COV" => select("diamond_min_aln_cov", default = Some("80"))

// HHblits
case "HHBLITSDB" => select("hhblitsdb", default = Some("UniRef30"))
case "HHBLITSDB" => select("hhblitsdb", default = Some("UniRef30"))
case "HHBLITS_INCL_EVAL" =>
select("hhblits_incl_eval", default = Some("1e-3"))

Expand All @@ -93,14 +93,12 @@ class ParamAccess @Inject() (tel: TEL) {
case "COSINE_PERCENTILE_CUTOFF" => select("cosine_percentile_cutoff", default = Some("70"))
case "ALIGNMENT_CUTOFF" => select("alignment_cutoff", default = Some("0.30"))
case "WIN_LEN" => select("win_len", default = Some("15"))
case "MERGE_HITS" => select("merge_hits", default = Some("1"))
case "PLM_ALN_MODE" => select("plm_aln_mode", default = Some("loc"))
case "SPAN" => select("span", default = Some("25"))
case "SIGMA_FACTOR" => select("sigma_factor", default = Some("2"))
case "BFACTOR" => select("bfactor", default = Some("2"))
case "PLM_GAP_EXT" => select("plm_gap_ext", default = Some("0.5"))


case "MERGE_HITS" => select("merge_hits", default = Some("1"))
case "PLM_ALN_MODE" => select("plm_aln_mode", default = Some("loc"))
case "SPAN" => select("span", default = Some("25"))
case "SIGMA_FACTOR" => select("sigma_factor", default = Some("2"))
case "BFACTOR" => select("bfactor", default = Some("2"))
case "PLM_GAP_EXT" => select("plm_gap_ext", default = Some("0.5"))

// HHpred
case "TWOTEXTALIGNMENT" =>
Expand All @@ -125,7 +123,7 @@ class ParamAccess @Inject() (tel: TEL) {
case "MACTHRESHOLD" => select("macthreshold", default = Some("0.3"))

// HMMER
case "HMMER_DB" => select("hmmerdb", default = Some("alphafold_uniprot50"))
case "HMMER_DB" => select("hmmerdb", default = Some("alphafold_uniprot50"))
case "MAX_HHBLITS_ITER" =>
select("max_hhblits_iter", default = Some("1"), onDetectedMSA = Some("0"))

Expand All @@ -139,7 +137,7 @@ class ParamAccess @Inject() (tel: TEL) {
select("blast_incl_eval", default = Some("1e-3"))

// Kalign
case "GAP_OPEN" => NumberParameter("gap_open", default = Some(11))
case "GAP_OPEN" => NumberParameter("gap_open", default = Some(11))
case "GAP_EXT_KALN" =>
NumberParameter(
"gap_ext_kaln",
Expand Down Expand Up @@ -174,8 +172,8 @@ class ParamAccess @Inject() (tel: TEL) {
// HHrepID
case "MSA_GEN_MAX_ITER_HHREPID" =>
select("msa_gen_max_iter_hhrepid", default = Some("3"), onDetectedMSA = Some("0"))
case "SCORE_SS" => select("score_ss", default = Some("2"))
case "REP_PVAL_THRESHOLD" => select("rep_pval_threshold", default = Some("1e-2"))
case "SCORE_SS" => select("score_ss", default = Some("2"))
case "REP_PVAL_THRESHOLD" => select("rep_pval_threshold", default = Some("1e-2"))
case "SELF_ALN_PVAL_THRESHOLD" =>
select("self_aln_pval_threshold", default = Some("1e-1"))
case "MERGE_ITERS" => select("merge_iters", default = Some("3"))
Expand Down Expand Up @@ -283,7 +281,7 @@ class ParamAccess @Inject() (tel: TEL) {
case "OUT_FORMAT" => select("out_format", default = Some("fas"))

// HHfilter
case "MAX_SEQID" => NumberParameter("max_seqid", default = Some(90))
case "MAX_SEQID" => NumberParameter("max_seqid", default = Some(90))
case "MIN_QUERY_COV" =>
NumberParameter(
"min_query_cov",
Expand Down
Loading