Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
2eee9b94
Commit
2eee9b94
authored
6 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
function returns list instead of modifying parameter
parent
c2e88a2f
No related branches found
No related tags found
1 merge request
!695
Resolve "Harmonize column names in the overlay datasets"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaReader.java
+9
-8
9 additions, 8 deletions
...java/lcsb/mapviewer/services/utils/ColorSchemaReader.java
with
9 additions
and
8 deletions
service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaReader.java
+
9
−
8
View file @
2eee9b94
...
...
@@ -152,8 +152,8 @@ public class ColorSchemaReader {
String
[]
columns
=
line
.
split
(
"\t"
);
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
=
new
HashMap
<>();
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
=
new
ArrayList
<>();
parseColumns
(
columns
,
schemaColumns
,
customIdentifiers
,
ColorSchemaType
.
GENETIC_VARIANT
);
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
=
parseColumns
(
columns
,
schemaColumns
,
ColorSchemaType
.
GENETIC_VARIANT
);
Integer
colorColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
COLOR
);
Integer
contigColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
CONTIG
);
if
(
contigColumn
==
null
)
{
...
...
@@ -481,8 +481,7 @@ public class ColorSchemaReader {
String
[]
columns
=
line
.
split
(
"\t"
);
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
=
new
HashMap
<>();
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
=
new
ArrayList
<>();
parseColumns
(
columns
,
schemaColumns
,
customIdentifiers
,
ColorSchemaType
.
GENERIC
);
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
=
parseColumns
(
columns
,
schemaColumns
,
ColorSchemaType
.
GENERIC
);
Integer
valueColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
VALUE
);
Integer
colorColumn
=
schemaColumns
.
get
(
ColorSchemaColumn
.
COLOR
);
...
...
@@ -680,8 +679,9 @@ public class ColorSchemaReader {
* @throws InvalidColorSchemaException
* thrown when the list of column headers contain invalid value
*/
public
void
parseColumns
(
String
[]
columns
,
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
,
List
<
Pair
<
MiriamType
,
Integer
>>
customIdentifiers
,
ColorSchemaType
type
)
throws
InvalidColorSchemaException
{
public
List
<
Pair
<
MiriamType
,
Integer
>>
parseColumns
(
String
[]
columns
,
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
,
ColorSchemaType
type
)
throws
InvalidColorSchemaException
{
List
<
Pair
<
MiriamType
,
Integer
>>
result
=
new
ArrayList
<>();
Map
<
String
,
MiriamType
>
acceptableIdentifiers
=
new
HashMap
<>();
Map
<
String
,
MiriamType
>
deprecatedIdentifiers
=
new
HashMap
<>();
for
(
MiriamType
miriamType
:
MiriamType
.
values
())
{
...
...
@@ -701,9 +701,9 @@ public class ColorSchemaReader {
}
if
(!
found
)
{
if
(
acceptableIdentifiers
.
keySet
().
contains
(
columns
[
i
].
toLowerCase
()))
{
customIdentifiers
.
add
(
new
Pair
<>(
acceptableIdentifiers
.
get
(
columns
[
i
].
toLowerCase
()),
i
));
result
.
add
(
new
Pair
<>(
acceptableIdentifiers
.
get
(
columns
[
i
].
toLowerCase
()),
i
));
}
else
if
(
deprecatedIdentifiers
.
keySet
().
contains
(
columns
[
i
].
toLowerCase
()))
{
customIdentifiers
.
add
(
new
Pair
<>(
deprecatedIdentifiers
.
get
(
columns
[
i
].
toLowerCase
()),
i
));
result
.
add
(
new
Pair
<>(
deprecatedIdentifiers
.
get
(
columns
[
i
].
toLowerCase
()),
i
));
}
else
{
String
columnNames
=
""
;
for
(
ColorSchemaColumn
schemaColumn
:
ColorSchemaColumn
.
values
())
{
...
...
@@ -719,6 +719,7 @@ public class ColorSchemaReader {
}
}
}
return
result
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment