Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Some more categories written out to CIF #1063

Merged
josemduarte merged 7 commits intobiojava:masterbiojava/biojava:masterfrom
josemduarte:more-cif-outputjosemduarte/biojava:more-cif-outputCopy head branch name to clipboard
Jun 1, 2023
Merged

Some more categories written out to CIF #1063
josemduarte merged 7 commits intobiojava:masterbiojava/biojava:masterfrom
josemduarte:more-cif-outputjosemduarte/biojava:more-cif-outputCopy head branch name to clipboard

Conversation

@josemduarte
Copy link
Contributor

Adding _entity and _entity_poly to CIF output, so that some more metadata is available for consumers.

Also:

  • now adding seqres groups to Chains when no entity info is present in input file
  • upgrading to latest ciftools-java

@josemduarte josemduarte requested a review from sbittrich May 24, 2023 21:03
entityDescriptions[i] = e.getDescription() == null? "?" : e.getDescription();
}

String[] polyEntityIds = entityInfos.stream().filter(e -> e.getType() == EntityType.POLYMER).map(e -> Integer.toString(e.getMolId())).collect(Collectors.toList()).toArray(new String[]{});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Streams have a toArray method as well. .collect(Collectors.toList()).toArray(new String[]{}) can be simplified to .toArray(String[]::new), effectively skipping the creation of a List.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one, thanks. Added a commit.

And shame to IntelliJ for not suggesting this!

Copy link
Member

@sbittrich sbittrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, code looks good and should solve our problem.
There are 2 stream expressions that can be simplified.

}

String[] polyEntityIds = entityInfos.stream().filter(e -> e.getType() == EntityType.POLYMER).map(e -> Integer.toString(e.getMolId())).collect(Collectors.toList()).toArray(new String[]{});
String[] polyEntitySeqs = entityInfos.stream().filter(e -> e.getType() == EntityType.POLYMER).map(e -> e.getChains().get(0).getSeqResSequence()).collect(Collectors.toList()).toArray(new String[]{});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Member

@sbittrich sbittrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@josemduarte josemduarte merged commit d09477e into biojava:master Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.