Commit 96bcf788 authored by Brandi Cantarel's avatar Brandi Cantarel
Browse files

se/pe fix

parent 68aac6f3
......@@ -45,35 +45,43 @@ if [[ -z $NPROC ]]
then
NPROC=`nproc`
fi
fqs=''
i=0
numfq=${#fqs[@]}
while [[ $i -le $numfq ]]
do
fqs="$fqs $1"
i=$((i + 1))
shift 1
done
hisat_opt=''
diff $fq1 $fq2 > difffile
if [[ -f $fq1 ]]
then
fqs="$fq1"
if [[ -f $fq2 ]]
then
diff $fq1 $fq2 > difffile
if [[ -s difffile ]]
then
fqs+=" $fq2"
fi
fi
else
fqs=''
i=0
numfq=${#fqs[@]}
while [[ $i -le $numfq ]]
do
fqs="$fqs $1"
i=$((i + 1))
shift 1
done
fi
if [[ -f $fq2 ]] && [[ -s difffile ]]
then
fqs+=" $fq2"
fi
numfq=${#fqs[@]}
numfq=0
for k in $fqs
do
numfq=$((numfq + 1))
done
hisat_opt=''
star_opt=$fqs
fqarray=($fqs)
if [[ $numfq == 1 ]]
if [[ $numfq == 2 ]]
then
hisat_opt="-1 ${fqarray[0]} -2 ${fqarray[1]}"
else
hisat_opt="-U $fqarray[0]"
hisat_opt="-U ${fqarray[0]}"
fi
if [ $algo == 'star' ]
......
......@@ -29,29 +29,32 @@ if [[ -z $pair_id ]]; then
usage
fi
fqs=''
i=0
numfq=${#fqs[@]}
while [[ $i -le $numfq ]]
do
fqs="$fqs $1"
i=$((i + 1))
shift 1
done
if [[ -f $fq1 ]]
if [[ -z $fq1 ]]
then
i=0
numfq=${#fqs[@]}
while [[ $i -le $numfq ]]
do
fqs="$fqs $1"
i=$((i + 1))
shift 1
done
else
fqs="$fq1"
r1base="${fq1%.fastq*}"
if [[ -f $fq2 ]]
then
fqs+=" $fq2"
r2base="${fq2%.fastq*}"
fi
fi
if [[ -f $fq2 ]]
then
fqs+=" $fq2"
r2base="${fq2%.fastq*}"
fi
numfq=${#fqs[@]}
numfq=0
for k in $fqs
do
numfq=$((numfq + 1))
done
copts='-q 25 --illumina --gzip --length 35'
if [[ $numfq == 1 ]]
if [[ $numfq == 2 ]]
then
copts="$copts --paired"
fi
......@@ -70,7 +73,7 @@ then
mv *_val_2.fq.gz ${pair_id}.trim.R2.fastq.gz
else
mv *_trimmed.fq.gz ${pair_id}.trim.R1.fastq.gz
cp ${pair_id}.trim.R1.fastq.gz ${pair_id}.trim.R2.fastq.gz
#cp ${pair_id}.trim.R1.fastq.gz ${pair_id}.trim.R2.fastq.gz
fi
if [[ $filter == 1 ]]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment