Skip to content

Commit

Permalink
repair gzcat vs gzcat in after_download script, give sed vs gsed the …
Browse files Browse the repository at this point in the history
…same treatment
  • Loading branch information
kevinschaper committed Sep 11, 2024
1 parent 24f9de3 commit 72a0ed2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scripts/after_download.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
#!/bin/sh

# set zcat to gzcat if gzcat is available
if command -v gzcat &> /dev/null
if command -v gzcat
then
ZCAT=gzcat
else
ZCAT=zcat
fi

# set sed command to gsed if gsed is available (a crutch for OSX)
if command -v gsed
then
SED=gsed
else
SED=sed
fi

# Make a simple text file of all the gene IDs in Alliance
${ZCAT} data/alliance/BGI_*.gz | jq '.data[].basicGeneticEntity.primaryId' | pigz > data/alliance/alliance_gene_ids.txt.gz

Expand All @@ -26,7 +34,7 @@ awk '{ if ($2 == "rdfs:subClassOf" || $2 == "BFO:0000050" || $2 == "UPHENO:00000
tar xfO data/monarch/kg-phenio.tar.gz merged-kg_nodes.tsv | grep ^NCBITaxon | cut -f 1,3 > data/monarch/taxon_labels.tsv

# Repair Orphanet prefixes in MONDO sssom rows as necessary
sed -i 's/\torphanet.ordo\:/\tOrphanet\:/g' data/monarch/mondo.sssom.tsv
$SED -i 's/\torphanet.ordo\:/\tOrphanet\:/g' data/monarch/mondo.sssom.tsv

# Repair mesh: prefixes in MONDO sssom rows as necessary
sed -i 's@mesh:@MESH:@g' data/monarch/mondo.sssom.tsv
$SED -i 's@mesh:@MESH:@g' data/monarch/mondo.sssom.tsv

0 comments on commit 72a0ed2

Please sign in to comment.