annotate msp_out.sh @ 2:b566b27247f7 draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 4018b84dd3c735d16f488094f001a19e634fe1a2
author recetox
date Fri, 08 Mar 2024 10:55:31 +0000
parents bf836aaeca19
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
bf836aaeca19 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
1 #!/bin/sh
bf836aaeca19 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
2
2
b566b27247f7 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 4018b84dd3c735d16f488094f001a19e634fe1a2
recetox
parents: 0
diff changeset
3 molname=`sed -n '1{p;q}' molname.txt`
0
bf836aaeca19 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
4 kword=$(grep 'NPOINTS' result.jdx)
bf836aaeca19 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
5 num_peaks=$(echo "$kword" | sed 's/^[^=]*=//')
bf836aaeca19 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
6 echo `pwd`
bf836aaeca19 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
7 sed -n '/PEAK/,/END/{/PEAK/!{/END/!p}}' result.jdx > temp.dat
bf836aaeca19 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
8 awk '{print $1, $2}' temp.dat > tempa.dat
bf836aaeca19 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
9 sed "1s/^/NAME: $molname\nNum Peaks: $num_peaks\n/" tempa.dat >> simulated_spectra.msp
bf836aaeca19 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
10 sed -i '$a\ ' simulated_spectra.msp
bf836aaeca19 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
11 rm temp.dat tempa.dat