Skip to content

Commit

Permalink
Merge pull request #99 from sanger-bentley-group/dev
Browse files Browse the repository at this point in the history
Release Version 1.0.0-rc7
  • Loading branch information
HarryHung authored Apr 17, 2024
2 parents 7c8ad0f + b853d51 commit fcbcece
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions bin/get_lineage.sh
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
2 changes: 1 addition & 1 deletion main.nf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env nextflow

// Version of this release
pipelineVersion = '1.0.0-rc6'
pipelineVersion = '1.0.0-rc7'

// Import workflow modules
include { PIPELINE } from "$projectDir/workflows/pipeline"
Expand Down

0 comments on commit fcbcece

Please sign in to comment.