-
Notifications
You must be signed in to change notification settings - Fork 5
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
EVA-3501 - adding new endpoint for parsing fasta file data #80
Conversation
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.
Looks good.
I tested it locally and it works.
@@ -86,4 +87,27 @@ public Optional<Map<String, Object>> getAllPossibleSeqColExtendedData(String acc | |||
|
|||
return Optional.of(seqColResultData); | |||
} | |||
|
|||
public Optional<Map<String, Object>> getAllPossibleSeqColExtendedData(String insdcAccession, String fastFileContent) throws IOException { |
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.
This being a generic function for any fasta file, I'm not sure it makes sense to put it in NCBISeqColDataSource.java
public Optional<AssemblySequenceEntity> getAssemblySequencesByAccession(String insdcAccession, String fastFileContent) throws IOException { | ||
AssemblySequenceEntity assemblySequenceEntity; | ||
try (InputStream stream = new ByteArrayInputStream(fastFileContent.getBytes())) { | ||
NCBIAssemblySequenceReader reader = readerFactory.build(stream, insdcAccession); |
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.
We'll probably have to refactor this since NCBIAssemblySequenceReader
is actually pretty generic and does not need to be attached to 'NCBI' prefix
@ApiResponse(responseCode = "500", description = "Server Error") | ||
}) | ||
@PutMapping(value = "/seqcols/fasta/{insdcAccession}") | ||
public ResponseEntity<?> fetchAndInsertSeqColByParsingFastFile(@PathVariable(value = "insdcAccession") String insdcAccession, @RequestBody String fastFileContent) { |
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 don't think the string parameter is being used anywhere. It is here to comply with the current object structure.
I guess we should at least change the variant name (and the doc) to make clear it does not have to be an INSDC assembly accession.
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.
Positive
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 agree, it's not being used in the calculations but since we are using a lot of existing code that requires this value, I left it as it is. Was named insdcAccession, since it ultimately sets the insdcAccession value of AssemblySequenceEntity.
I have updated the parameter name to just accession.
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 meant to set it as "Comment"
Sorry, I didn't mean to commit the change, just to suggest |
src/main/java/uk/ac/ebi/eva/evaseqcol/controller/admin/AdminController.java
Outdated
Show resolved
Hide resolved
src/main/java/uk/ac/ebi/eva/evaseqcol/service/SeqColService.java
Outdated
Show resolved
Hide resolved
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.
Looks good.
Have nothing to add on Tim's comments.
fcc5307
to
91cc475
Compare
To be discussed in stand-upThe idea for this PR was to get the functionality working without modifying too much of the existing code (easier to remove the new changes if needed). |
src/main/java/uk/ac/ebi/eva/evaseqcol/entities/SeqColExtendedDataEntity.java
Outdated
Show resolved
Hide resolved
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.
We decided that we will have a refactor of the code at a later date that could bring in some of the changes made in contig alias.
No description provided.