Skip to content

Commit bfb6755

Browse files
committed
adding script to produce summary table after preproc
1 parent 30c6e81 commit bfb6755

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

preprocessing/make_sample_list.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#! /bin/bash
2+
3+
4+
if [ $# -ne 2 ]; then
5+
echo "No arguments";
6+
echo "Usage:";
7+
echo "./make_sample_list.sh <output_file> <input_folder>";
8+
exit 1;
9+
fi;
10+
11+
if [ "$1" == "" ]; then
12+
echo "Output file parameter is empty";
13+
exit 1;
14+
fi;
15+
16+
if [ "$2" == "" ]; then
17+
echo "Input folder parameter is empty";
18+
exit 1;
19+
fi;
20+
21+
if [ -f $1 ]; then
22+
echo "Output file already exists";
23+
exit 1;
24+
fi;
25+
26+
if [ ! -d $2 ]; then
27+
echo "Input folder does not exists";
28+
exit 1;
29+
fi;
30+
31+
echo -n "Writing output file: $1 ... ";
32+
33+
echo -e "#sample\tn_cleaned_reads" > $1;
34+
tail -n1 $2/*/*_summary.stats | grep -v "^$" | grep -v "^==>" | cut -f1,3 >> $1;
35+
36+
echo "Done!";

0 commit comments

Comments
 (0)