-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ena 5863 updating validation scope #148
Open
Rajkumar-D
wants to merge
6
commits into
master
Choose a base branch
from
ENA-5863-updating-validation-scope
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e6b05e3
Updating the validationScope to support different layer of processing
Rajkumar-D 6a4becd
Updating the validationScope to support different layer of processing
Rajkumar-D 17b6b7b
Removing ValidationScopes that is not currently used
Rajkumar-D f80e8e9
Removing ValidationScopes that is not currently used
Rajkumar-D b2b1c90
ENA-5863: Changes for validation scope
Rajkumar-D f96a364
changes for adding ValidationScope
Rajkumar-D File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,48 +10,45 @@ | |
*/ | ||
package uk.ac.ebi.embl.api.validation; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public enum ValidationScope { | ||
/** Putff (ENA) */ | ||
EMBL(Group.SEQUENCE), | ||
EMBL(Group.PUTFF), | ||
/** Putff (NCBI) */ | ||
NCBI(Group.SEQUENCE), | ||
NCBI(Group.PUTFF, Group.NCBI), | ||
/** Putff (NCBI master) */ | ||
NCBI_MASTER(Group.SEQUENCE), | ||
NCBI_MASTER(Group.PUTFF, Group.NCBI), | ||
/** Pipeline (Webin-CLI sequence scope) */ | ||
EMBL_TEMPLATE(Group.SEQUENCE), | ||
EMBL_TEMPLATE(Group.PIPELINE), | ||
/** Putff (patent protein) */ | ||
EPO_PEPTIDE(Group.SEQUENCE), | ||
EPO_PEPTIDE(Group.EPO), | ||
/** Putff (patent) */ | ||
EPO(Group.SEQUENCE), | ||
/** TODO: remove if not used */ | ||
INSDC(Group.SEQUENCE), | ||
/** TODO: remove if not used */ | ||
EGA(Group.SEQUENCE), | ||
/** TODO: remove if not used */ | ||
ARRAYEXPRESS(Group.SEQUENCE), | ||
EPO(Group.EPO), | ||
/** Pipeline (Webin-CLI genome scope) */ | ||
ASSEMBLY_MASTER(Group.ASSEMBLY), | ||
ASSEMBLY_MASTER(Group.ASSEMBLY, Group.PIPELINE), | ||
/** Pipeline (Webin-CLI genome scope) */ | ||
ASSEMBLY_CONTIG(Group.ASSEMBLY), | ||
ASSEMBLY_CONTIG(Group.ASSEMBLY, Group.PIPELINE), | ||
/** Pipeline (Webin-CLI genome scope) */ | ||
ASSEMBLY_SCAFFOLD(Group.ASSEMBLY), | ||
ASSEMBLY_SCAFFOLD(Group.ASSEMBLY, Group.PIPELINE), | ||
/** Pipeline (Webin-CLI genome scope) */ | ||
ASSEMBLY_CHROMOSOME(Group.ASSEMBLY), | ||
ASSEMBLY_CHROMOSOME(Group.ASSEMBLY, Group.PIPELINE), | ||
/** Pipeline (Webin-CLI transcriptome scope) */ | ||
ASSEMBLY_TRANSCRIPTOME(Group.ASSEMBLY); | ||
ASSEMBLY_TRANSCRIPTOME(Group.PIPELINE); | ||
|
||
private final Group group; | ||
private final List<Group> groups; | ||
|
||
ValidationScope(Group group) { | ||
this.group = group; | ||
ValidationScope(Group... groups) { | ||
this.groups = Arrays.asList(groups); | ||
} | ||
|
||
public boolean isInGroup(Group group) { | ||
return this.group == group; | ||
return this.groups.contains(group); | ||
} | ||
|
||
public Group group() { | ||
return this.group; | ||
public List<Group> groups() { | ||
return this.groups; | ||
} | ||
|
||
public static ValidationScope get(String scope) { | ||
|
@@ -77,8 +74,11 @@ public int getAssemblyLevel() { | |
} | ||
|
||
public enum Group { | ||
PIPELINE, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest to add a few comments -> /** Webin submissions processed by pipelines. */ /** Non-Webin submissions processed by putff. */ |
||
PUTFF, | ||
ASSEMBLY, | ||
SEQUENCE | ||
NCBI, | ||
EPO | ||
} | ||
|
||
public static ValidationScope getScope(FileType fileType) { | ||
|
@@ -87,4 +87,24 @@ public static ValidationScope getScope(FileType fileType) { | |
} | ||
return ValidationScope.EMBL; | ||
} | ||
|
||
public static boolean isPipelineGroup(ValidationScope scope){ | ||
return scope.isInGroup(Group.PIPELINE); | ||
} | ||
|
||
public static boolean isPutffGroup(ValidationScope scope){ | ||
return scope.isInGroup(Group.PUTFF); | ||
} | ||
|
||
public static boolean isAssemblyGroup(ValidationScope scope){ | ||
return scope.isInGroup(Group.ASSEMBLY); | ||
} | ||
|
||
public static boolean isNcbiGroup(ValidationScope scope){ | ||
return scope.isInGroup(Group.NCBI); | ||
} | ||
|
||
public static boolean isEpoGroup(ValidationScope scope){ | ||
return scope.isInGroup(Group.EPO); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have only four groups (not sure what to call them):
We might wish to rename: