Skip to content

Commit

Permalink
Check tsv file exist
Browse files Browse the repository at this point in the history
  • Loading branch information
leexgh committed Aug 22, 2024
1 parent 5fd2b8b commit 4577692
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/import_mongo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ do

echo "Transforming $mutation_assessor_tsv_file"
# Rename the columns
if [ -f "${DIR}/../data/common_input/${mutation_assessor_tsv_file}" ]; then
echo "File exists: ${DIR}/../data/common_input/${mutation_assessor_tsv_file}"
else
echo "File not found: ${DIR}/../data/common_input/${mutation_assessor_tsv_file}"
exit 1
fi
sed -i '' 's/uniprotId\tSV\thgvspShort\tF_score\tF_impact\tMSA\tMAV/uniprotId\tsv\thgvspShort\tf_score\tf_impact\tmsa\tmav/' ${DIR}/../data/common_input/$mutation_assessor_tsv_file
# Add a new column "_id" (uniprotId,hgvspShort)
awk -F'\t' 'BEGIN{OFS="\t"} NR==1{print "_id",$0; next} {print $1","$3,$0}' ${DIR}/$mutation_assessor_tsv_file > ${DIR}/../data/common_input/processed_$mutation_assessor_tsv_file
Expand Down

0 comments on commit 4577692

Please sign in to comment.