annotate msp_out.sh @ 0:1d3fd08e50ff draft

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
author recetox
date Thu, 22 Feb 2024 08:41:17 +0000
parents
children 0d9d72ef658f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
1d3fd08e50ff planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
1 #!/bin/sh
1d3fd08e50ff planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
2
1d3fd08e50ff planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
3 molname=`sed -n '2{p;q}' TMPQCXMS/TMP.1/start.xyz`
1d3fd08e50ff 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)
1d3fd08e50ff 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/^[^=]*=//')
1d3fd08e50ff planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/qcxms commit 45ad41f2368834ab06929496fb17fc9a85b8e3c5
recetox
parents:
diff changeset
6 echo `pwd`
1d3fd08e50ff 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
1d3fd08e50ff 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
1d3fd08e50ff 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
1d3fd08e50ff 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
1d3fd08e50ff 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