18
|
1 #!/bin/bash
|
|
2
|
|
3 OUTFile=${1}
|
|
4 shift
|
|
5 groupCount=1
|
|
6 replicateNumber=1
|
|
7
|
|
8 arrayZ=( $@ )
|
|
9 #remove the last symble '@' given by commande line
|
|
10 unset arrayZ[${#arrayZ[@]}-1]
|
|
11
|
|
12 for FILE in ${arrayZ[@]}
|
|
13 do
|
|
14 #if a new group of fastq, re-count the replicateNumber
|
|
15 if echo $FILE | grep -q "@"
|
|
16 then
|
|
17 groupCount=$(($groupCount + 1))
|
|
18 replicateNumber=1
|
|
19 else
|
|
20 echo -e "Group${groupCount}_${replicateNumber}\t${FILE}" >>${OUTFile}
|
|
21 replicateNumber=$(($replicateNumber + 1))
|
|
22 fi
|
|
23 done
|
|
24
|