Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Check if the format is correct
- if [[ $1 != *.fasta ]]; then
- echo "The input file $1 it's not in fasta format!"
- echo ""
- echo "Usage: ./nomescript.sh NO_HIT.fasta"
- exit 1
- fi
- read -p "Enter k-mer last value: " KMER
- read -p "Enter read lenght: " READLENGHT
- # calculate the coefficient used to convert coverage. Final is Y
- K=$(($READLENGHT - $KMER + 1))
- Y=$(echo "scale=4; $K / $READLENGHT" | bc)
- while read odd; do
- echo -n"cov_" ; echo "scale=2;$Y / ${odd##*_}" | bc -q
- read even
- eval ACOUNT=$( echo $even | grep -c "A");
- eval GCOUNT=$( echo $even | grep -c "G");
- eval CCOUNT=$( echo $even | grep -c "C");
- eval TCOUNT=$( echo $even | grep -c "T")
- eval TOTALBASES=$(($ACOUNT+$CCOUNT+$GCOUNT+$TCOUNT))
- eval GC_CONTENT=$(($GCOUNT+$CCOUNT))
- echo "DNA seq:"
- echo "scale=2;$GC_CONTENT / $TOTALBASES*100" | bc
- done < "$1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement