Skip to content

Commit

Permalink
check if output file has the right columns
Browse files Browse the repository at this point in the history
  • Loading branch information
sainirmayi committed Mar 21, 2024
1 parent f02d38c commit 491d48e
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions src/salmon/quant/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,46 @@ echo "> Run salmon quant for single-end reads"
--lib_type "A" \
--index "$dir_in/salmon/transcriptome_index" \
--unmated_reads "$dir_in/reads/a_se.fq.gz" \
--output "quant_se_results"
--output "quant_se_results" \
--quant_results "quant_se.sf"

cat quant_se.sf
echo ">> Checking output"
[ ! -d "quant_se_results" ] && echo "Output directory quant_se_results does not exist" && exit
[ ! -s "quant_se_results/quant.sf" ] && echo "Output file quant_se_results/quant.sf is empty" && exit 1
[ ! -d "quant_se_results" ] && echo "Output directory quant_se_results does not exist" && exit 1
[ ! -f "quant_se.sf" ] && echo "Output file quant_se.sf does not exist!" && exit 1
[ ! -s "quant_se.sf" ] && echo "Output file quant_se.sf is empty!" && exit 1
grep -q "Name Length EffectiveLength TPM NumReads" "quant_se.sf" || (echo "Output file quant_se.sf does not have the right format!" && exit 1)

echo "> Run salmon quant for paired-end reads"
"$meta_executable" \
--lib_type "A" \
--index "$dir_in/salmon/transcriptome_index" \
--mates1 "$dir_in/reads/a_1.fq.gz" \
--mates2 "$dir_in/reads/a_2.fq.gz" \
--output "quant_pe_results"
--output "quant_pe_results" \
--quant_results "quant_pe.sf"

cat quant_pe.sf
echo ">> Checking output"
[ ! -d "quant_pe_results" ] && echo "Output directory quant_pe_results does not exist" && exit
[ ! -s "quant_pe_results/quant.sf" ] && echo "Output file quant_pe_results/quant.sf is empty" && exit 1
[ ! -f "quant_pe.sf" ] && echo "Output file quant_pe.sf does not exist!" && exit 1
[ ! -s "quant_pe.sf" ] && echo "Output file quant_pe.sf is empty!" && exit 1
grep -q "Name Length EffectiveLength TPM NumReads" "quant_pe.sf" || (echo "Output file quant_pe.sf does not have the right format!" && exit 1)

echo "> Run salmon quant for paired-end reads with technical replicates"
"$meta_executable" \
--lib_type "A" \
--index "$dir_in/salmon/transcriptome_index" \
--mates1 $dir_in/reads/a_1.fq.gz $dir_in/reads/b_1.fq.gz \
--mates2 $dir_in/reads/a_2.fq.gz $dir_in/reads/b_2.fq.gz \
--output "quant_pe_rep_results"
--output "quant_pe_rep_results" \
--quant_results "quant_pe_rep.sf"

cat quant_pe_rep.sf
echo ">> Checking output"
[ ! -d "quant_pe_rep_results" ] && echo "Output directory quant_pe_rep_results does not exist" && exit
[ ! -s "quant_pe_rep_results/quant.sf" ] && echo "Output file quant_pe_rep_results/quant.sf is empty" && exit 1
[ ! -f "quant_pe_rep.sf" ] && echo "Output file quant_pe_rep.sf does not exist!" && exit 1
[ ! -s "quant_pe_rep.sf" ] && echo "Output file quant_pe_rep.sf is empty!" && exit 1
grep -q "Name Length EffectiveLength TPM NumReads" "quant_pe_rep.sf" || (echo "Output file quant_pe_rep.sf does not have the right format!" && exit 1)

echo "> Test successful"

0 comments on commit 491d48e

Please sign in to comment.