Skip to content

Conversation

@wow-such-code
Copy link
Member

  • allows users to provide a sample identifier to upload datasets (previously only experiments were possible)
  • improves error handling when PETab directory is not specified for upload
  • removes unnecessary classes
  • provides some SEEK classes and methods, that are not yet used

@wow-such-code wow-such-code requested a review from a team as a code owner September 2, 2024 12:07
Steffengreiner
Steffengreiner previously approved these changes Sep 2, 2024
Copy link

@Steffengreiner Steffengreiner left a comment

Choose a reason for hiding this comment

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

Heya @wow-such-code I have some questions and minor nitpicks, but overall it looks good! Well done 👍

return;
}
DatasetWithProperties result = new DatasetWithProperties(datasets.get(0));
Optional<String> patientID = openbis.findPropertyInSampleHierarchy("PATIENT_DKFZ_ID",

Choose a reason for hiding this comment

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

Could there be other PatientIds classifiers? If so i'd recommend to move this into a global identifier.

System.out.println("Found dataset, downloading.");
System.out.println();

final String tmpPath = "tmp/";

Choose a reason for hiding this comment

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

I'm confused of the purpose of this command? It downloads the data into a temp folder and afterwards deletes it again?

Comment on lines 68 to 69
System.out.printf("Dataset %s was successfully created%n", result.getPermId());
} else {

Choose a reason for hiding this comment

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

NIT: I think it would help to have 2 different output messages here, since one result attaches the dataset to an experiment while the other registers it to a sample

Comment on lines +67 to 68
DataSetPermId result = openbis.registerDatasetForExperiment(Path.of(dataPath), experimentID, parents);
System.out.printf("Dataset %s was successfully created%n", result.getPermId());

Choose a reason for hiding this comment

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

Do you need to differentiate between registration to an experiment and to a sample here as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

the use case here was specified as always using an experiment

} catch (final Exception e) {
LOG.error(e.getMessage());
}
return null;

Choose a reason for hiding this comment

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

Why does this method specify a return value if it always returns a null value?

Copy link
Member Author

Choose a reason for hiding this comment

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

it returns a permID if the try case succeeds

Choose a reason for hiding this comment

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

I'm blind thanks :D

creation.setUploadId(uploadId);
creation.setParentIds(parentCodes.stream().map(DataSetPermId::new).collect(
Collectors.toList()));
creation.setTypeId(new EntityTypePermId("UNKNOWN", EntityKind.DATA_SET));

Choose a reason for hiding this comment

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

This also looks hardcoded? Maybe having some JD or doing this case in a seperate method would help distinguish on how this can happen?
(Can there be multiple Unknown PermIds?)

Copy link
Member Author

Choose a reason for hiding this comment

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

this is the openbis dataset type, it is not clear yet which types should be used and how they will be specified

Copy link

@Steffengreiner Steffengreiner left a comment

Choose a reason for hiding this comment

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

Well done!

} catch (final Exception e) {
LOG.error(e.getMessage());
}
return null;

Choose a reason for hiding this comment

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

I'm blind thanks :D

@wow-such-code wow-such-code merged commit 7b20a9c into development Sep 2, 2024
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.

3 participants