-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix parsing of experiment IDs and names #38
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.
Confirm that this does not work on Mac. I would suggest a much simpler solution- switch the jq filter to use TSV and use Awk with tabs separating fields. Could you confirm that the suggestion works, and do similarly with the other?
@@ -91,7 +91,7 @@ echo -e "\n#### Selected differential experiments\n" >> $releaseNotesFile | |||
## parse list of new differential studies to get write experiment titles | |||
curl 'https://wwwdev.ebi.ac.uk/gxa/json/experiments' | \ | |||
jq -r '.experiments | .[] | select(.loadDate | strptime("%d-%m-%Y") | mktime > '$last_release_epoch_time') | select(.rawExperimentType | test("DIFFERENTIAL"; "i")) | [.experimentAccession, .experimentDescription] | @csv' | \ | |||
awk -v FS="," '{ printf "- [%s](https://www.ebi.ac.uk/gxa/experiments/%s)\n", $2, $1}' | sed s/\"//g >> $releaseNotesFile | |||
awk -v FPAT="^([^,]+)|(\"[^\"]+\")$" '{ printf "- [%s](https://www.ebi.ac.uk/gxa/experiments/%s)\n", $2, $1}' | sed s/\"//g >> $releaseNotesFile |
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.
awk -v FPAT="^([^,]+)|(\"[^\"]+\")$" '{ printf "- [%s](https://www.ebi.ac.uk/gxa/experiments/%s)\n", $2, $1}' | sed s/\"//g >> $releaseNotesFile |
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.
Done in edd0bde, thanks!
Co-authored-by: Jonathan Manning <[email protected]>
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!
The previous parser uses
,
as a field separator, which does not behave as planned when an experiment name string uses a comma, as reported here. This fix replaces the field separator with a regular expresion for the desired field patterns. It also only accepts,
when inside the second/last element (the experiment name) of the parsed string.This, as far as tested, works using
gawk
(the default awk in codon as fg_atlas or fg_atlas_sc), but not in other awk versions, likemawk
or the originalawk
.