Re-naming and using user input files in bash script
I am trying to use a user provided input file, run it through a program, and rename the output file. I then want to be able to reference the renamed output later on in the program. I am sure it is an easy fix, but I am brand new to writing scripts and internet searches haven't given me anything. Any help would be greatly appreciated. Here is a sample of the code:
#run user input file through program and rename input_trimmed
/usr/local/bin/prinseq-lite.pl -fasta $1 -min_len 150 -out_good $1_trimmed
#run the input_trimmed file through program and rename input_blast.tab
blastx -query $1_trimmed.fasta -db xtrop.protein.faa -out $1_blast.tab -evalue .000001 -outfmt 6 -num_descriptions 1 -num_alignments 1 -num_threads 8
A=$(grep -c ">" $1)
B=$(grep -c ">" $1_trimmed)
C=$($B/$A)
D=$(wc -l $1_blast.tab)
E=$($D/$B)
F=$(sed 's:.*\tgi|\([0-9]*\).*:\1:'$1 _blast.tab | sort | uniq | wc -l)
echo "# and % of sequences in $1: $A"
echo "# and % of $1 sequences in $1_trimmed: $B , $C"
echo "Sensitivity: $E"
echo "# of unique hits: $F"
|