Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -143,26 +143,18 @@ public static DiseasePanel parseCensus(Path censusTsvFile) throws IOException {
case "Role in Cancer":
if (StringUtils.isNotEmpty(value)) {
String[] roles = value.split(", ");
ClinicalProperty.RoleInCancer roleInCancer = null;
Set<ClinicalProperty.RoleInCancer> rolesInCancer = new HashSet<>();
for (String role : roles) {
ClinicalProperty.RoleInCancer tmpRole = null;
if ("TSG".equals(role)) {
tmpRole = ClinicalProperty.RoleInCancer.TUMOR_SUPPRESSOR_GENE;
rolesInCancer.add(ClinicalProperty.RoleInCancer.TUMOR_SUPPRESSOR_GENE);
} else if ("oncogene".equals(role)) {
tmpRole = ClinicalProperty.RoleInCancer.ONCOGENE;
}
if (tmpRole != null && roleInCancer == null) {
roleInCancer = tmpRole;
} else if (tmpRole != null) {
if (tmpRole != roleInCancer) {
roleInCancer = ClinicalProperty.RoleInCancer.BOTH;
} else {
System.out.println("Found repeated roles?");
}
rolesInCancer.add(ClinicalProperty.RoleInCancer.ONCOGENE);
} else if ("fusion".equals(role)) {
rolesInCancer.add(ClinicalProperty.RoleInCancer.FUSION);
}
}
if (roleInCancer != null) {
genePanel.getCancer().setRoles(Collections.singletonList(roleInCancer));
if (!rolesInCancer.isEmpty()) {
genePanel.getCancer().setRoles(new ArrayList<>(rolesInCancer));
}
}
break;
Expand Down