Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

setup_katuali.sh 1.9 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
  1. #!/bin/bash
  2. # Set up katuali workspace for multiple runfolders:
  3. # 1. create top-level folder
  4. # 2. copy sequencing_summary.txt
  5. # 3. concatenate all fastqs to guppy_<suffix>/basecalls.fastq
  6. #
  7. # Finally
  8. # 4. symlink the ref directory alongside data directories
  9. # Usage:
  10. # run from location where data should be placed
  11. # setup_katuali.sh <guppy_suffix> ../../runfolder1 ../runfolder2 ...
  12. guppy_suffix=$1
  13. shift
  14. # directory of this script, used to locate other resources
  15. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
  16. for folder in $@; do
  17. echo "Creating workspace for: $folder"
  18. name=$(basename $folder)
  19. abspath=$(realpath $folder)
  20. echo "name: $name"
  21. echo "source: $abspath"
  22. echo $name
  23. mkdir -p $name
  24. # symlink fast5
  25. fast5_src=$abspath/fast5_pass
  26. if [[ -d "$fast5_src" ]]; then
  27. echo "Symlinking fast5_pass to $name/reads"
  28. ln -s ${fast5_src} $name/reads
  29. else
  30. echo "Expected fast5 location does not exist: ${fast5_src}"
  31. exit 1
  32. fi
  33. # concatenate fastq
  34. fastq_src=$abspath/fastq_pass
  35. guppy_out=${name}/guppy_${guppy_suffix}
  36. if [[ -d "$fastq_src" ]]; then
  37. echo "Collating fastq_pass to ${guppy_out}"
  38. mkdir -p "${guppy_out}"
  39. ${DIR}/rationalize_fastq -i ${fastq_src} -o ${guppy_out}/basecalls.fastq.gz
  40. else
  41. echo "Expected fast5 location does not exist: ${fastq_src}"
  42. exit 1
  43. fi
  44. # copy summary
  45. summary=$(ls ${abspath}/sequencing_summary_????????_????????.txt 2>/dev/null)
  46. summary_out=${guppy_out}/sequencing_summary.txt
  47. echo $summary
  48. if [[ -n "${summary}" ]]; then
  49. echo "Copying ${summary} to ${summary_out}"
  50. cp ${summary} ${summary_out}
  51. else
  52. echo "Could not find sequencing summary in ${abspath}"
  53. exit 1
  54. fi
  55. done
  56. # symlink ref directory
  57. ref_dir=$(realpath ${DIR}/ref)
  58. ln -s ${ref_dir} ref
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...