Created
May 31, 2018 04:58
-
-
Save mbk0asis/214560e6d5f679e13d8ec70ac696e6f0 to your computer and use it in GitHub Desktop.
To profile the INDEL patterns in amplicon sequncing reads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
printf "\nINDEL.profiler\n\n usage: ./INDEL.profiler.sh READs.fasta Amplicon.seq.fasta\n\n" | |
cat $1 | \ | |
while read l; do | |
printf " \n" | |
read L | |
echo $l $L | sed 's/ /\n/g' | cat - $2 | muscle -quiet | fasta_formatter | \ | |
while read c; do | |
printf "\n"$c"\nDEL:\n" | |
read d; | |
echo $d | grep -bo "-" | cut -d: -f1 | \ | |
awk 'NR==1 {a=$1;b=$1;next} ($1 != b+1){print a+1"-"b+1; a=$1} {b=$1} END{print a+1"-"b+1}' | |
read e | |
printf $e"\nINS:\n" | |
read f | |
echo $f | grep -bo "-" | cut -d: -f1 | \ | |
awk 'NR==1 {a=$1;b=$1;next} ($1 != b+1){print a+1"+"b+1; a=$1} {b=$1} END{print a+1"+"b+1}' | |
done | grep -v ">" | paste -s -d" " | |
done | sort | uniq -c | sort -rh > $1.INDEL.profile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment