-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from sanger-bentley-group/dev
Release Version 1.0.0-rc7
- Loading branch information
Showing
2 changed files
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
# Run PopPUNK to assign GPSCs to samples | ||
|
||
# Add "prefix_" to all sample names in qfile to avoid poppunk_assign crashing due to sample name already exists in database | ||
# Remove "prefix_" from all sample names in the result | ||
# Assign sequential names (gps_pipeline_poppunk_query_<number>) to all sample names in qfile to avoid poppunk_assign crashing due to sample name already exists in database | ||
# Reassign original names back to all sample in the result | ||
|
||
# Save results of individual sample into .csv with its name as filename | ||
|
||
sed 's/^/prefix_/' "$QFILE" > safe_qfile.txt | ||
awk -F '\t' '{ print "gps_pipeline_poppunk_query_" FNR "\t" $2 }' "$QFILE" > safe_qfile.txt | ||
|
||
poppunk_assign --db "${POPPUNK_DIR}/${DB_NAME}" --external-clustering "${EXT_CLUSTERS_DIR}/${EXT_CLUSTERS_FILE}" --query safe_qfile.txt --output output --threads "$(nproc)" | ||
sed 's/^prefix_//' output/output_external_clusters.csv > result.txt | ||
|
||
tail -n +2 output/output_external_clusters.csv | sort -V > result.txt | ||
|
||
paste <(cut -f 1 "$QFILE") <(cut -f 2 -d ',' result.txt) > renamed_result.txt | ||
|
||
awk -F , 'NR!=1 { print "\"GPSC\"\n" "\"" $2 "\"" > $1 ".csv" }' result.txt | ||
awk -F '\t' '{ print "\"GPSC\"\n" "\"" $2 "\"" > $1 ".csv" }' renamed_result.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters